:root {
  --bg: #f5f7f3;
  --bg-soft: #ecf2eb;
  --surface: #ffffff;
  --surface-strong: #fdfdf9;
  --nav: #10231f;
  --nav-soft: #19332e;
  --ink: #111827;
  --muted: #667085;
  --subtle: #98a2b3;
  --line: #d9e2dc;
  --line-strong: #c3d0c8;
  --primary: #0f766e;
  --primary-dark: #115e59;
  --primary-soft: #d8f2ee;
  --accent: #b45309;
  --danger: #b42318;
  --warning: #b54708;
  --success: #047857;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow-md: 0 18px 50px rgba(16, 24, 40, 0.10);
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 26px;
}

[data-theme="dark"] {
  --bg: #0c1412;
  --bg-soft: #111d1a;
  --surface: #13201d;
  --surface-strong: #172622;
  --nav: #08110f;
  --nav-soft: #10201c;
  --ink: #eef7f4;
  --muted: #a8bbb5;
  --subtle: #7f948d;
  --line: #263a34;
  --line-strong: #34534b;
  --primary: #2dd4bf;
  --primary-dark: #5eead4;
  --primary-soft: #123a35;
  --accent: #f59e0b;
  --danger: #f97066;
  --warning: #fdb022;
  --success: #32d583;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.32);
  --shadow-md: 0 20px 50px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(16, 35, 31, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 35, 31, 0.035) 1px, transparent 1px),
    radial-gradient(circle at 18% 0%, rgba(15, 118, 110, 0.16), transparent 28rem),
    radial-gradient(circle at 100% 16%, rgba(180, 83, 9, 0.12), transparent 28rem),
    var(--bg);
  background-size: 28px 28px, 28px 28px, auto, auto, auto;
  font-family: "Pretendard", "Noto Sans KR", "Malgun Gothic", "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.55;
}

a {
  color: var(--primary-dark);
  text-decoration: none;
}

a:hover {
  color: var(--primary);
}

button,
input,
textarea,
select {
  font: inherit;
}

.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 280px minmax(0, 1fr);
}

.shell-nav {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px;
  background:
    radial-gradient(circle at top left, rgba(20, 184, 166, 0.20), transparent 20rem),
    linear-gradient(180deg, var(--nav) 0%, #0b1715 100%);
  color: #edf7f4;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.brand {
  display: flex;
  gap: 13px;
  align-items: center;
  min-height: 72px;
  padding: 14px;
  margin-bottom: 24px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 15px;
  background: linear-gradient(135deg, #14b8a6 0%, #0f766e 100%);
  color: #ffffff;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: -0.08em;
  box-shadow: 0 12px 24px rgba(20, 184, 166, 0.28);
}

.brand strong,
.brand small,
.side-note strong,
.side-note small {
  display: block;
}

.brand strong {
  font-size: 15px;
  letter-spacing: -0.02em;
}

.brand small,
.side-note small {
  color: #9fb9b3;
  font-size: 12px;
}

.nav-section {
  display: grid;
  gap: 8px;
}

.nav-section a {
  position: relative;
  display: grid;
  gap: 2px;
  padding: 13px 15px 13px 18px;
  border: 1px solid transparent;
  border-radius: 16px;
  color: #cfe1dc;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.nav-section a:hover,
.nav-section a.active {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  transform: translateX(2px);
}

.nav-section a.active::before {
  position: absolute;
  top: 14px;
  bottom: 14px;
  left: 7px;
  width: 3px;
  border-radius: 999px;
  background: #2dd4bf;
  content: "";
}

.nav-section span {
  color: #8fb0a8;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-section strong {
  font-size: 14px;
  font-weight: 800;
}

.side-note {
  position: absolute;
  right: 22px;
  bottom: 22px;
  left: 22px;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #34d399;
  box-shadow: 0 0 0 6px rgba(52, 211, 153, 0.12);
}

.shell-main {
  min-width: 0;
  padding: 26px 30px 44px;
}

.topbar {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 14px 18px;
  margin-bottom: 22px;
  border: 1px solid rgba(217, 226, 220, 0.80);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(14px);
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.topbar strong {
  display: block;
  font-size: 17px;
  letter-spacing: -0.03em;
}

.topbar-kicker,
.topbar-badge,
.eyebrow,
.card-label,
th,
.pill,
.token {
  font-family: "Pretendard", "IBM Plex Sans KR", "Noto Sans KR", "Segoe UI", sans-serif;
}

.topbar-kicker,
.eyebrow,
.card-label {
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.topbar-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.theme-toggle {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 13px;
}

.hero,
.panel,
.card {
  border: 1px solid rgba(217, 226, 220, 0.92);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 38px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.hero::after {
  position: absolute;
  z-index: 0;
  right: -80px;
  bottom: -120px;
  width: 340px;
  height: 340px;
  border: 54px solid rgba(15, 118, 110, 0.08);
  border-radius: 999px;
  content: "";
}

.hero > * {
  position: relative;
  z-index: 1;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 860px;
  margin-bottom: 14px;
  font-size: clamp(28px, 3vw, 38px);
  line-height: 1.14;
  letter-spacing: -0.045em;
}

.mobile-title {
  display: none;
}

.page-header h1 {
  font-size: clamp(26px, 2.5vw, 34px);
}

h2 {
  margin-bottom: 14px;
  font-size: 19px;
  line-height: 1.25;
  letter-spacing: -0.04em;
}

.hero p,
.page-header p,
.card p,
.empty {
  color: var(--muted);
}

.hero p {
  max-width: 720px;
  margin-bottom: 26px;
  font-size: 15px;
}

.hero-actions,
.actions,
.run-box,
.filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.button,
button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font-weight: 850;
  box-shadow: var(--shadow-sm);
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.button:hover,
button:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
  transform: translateY(-1px);
}

.button.primary,
button.primary {
  border-color: var(--primary);
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #ffffff;
  box-shadow: 0 14px 26px rgba(15, 118, 110, 0.22);
}

.button.primary:hover,
button.primary:hover {
  color: #ffffff;
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 18px 0;
}

.card {
  position: relative;
  overflow: hidden;
  min-height: 150px;
  padding: 22px;
  border-radius: var(--radius-md);
}

.card::after {
  position: absolute;
  right: 18px;
  bottom: 18px;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.14), rgba(180, 83, 9, 0.12));
  content: "";
}

.card strong {
  display: block;
  margin: 9px 0 8px;
  font-size: 30px;
  line-height: 1;
  letter-spacing: -0.04em;
}

.panel-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}

.panel {
  min-width: 0;
  margin-bottom: 18px;
  padding: 22px;
  overflow-x: auto;
  border-radius: var(--radius-md);
}

.panel-title,
.page-header {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  justify-content: space-between;
}

.page-header {
  margin-bottom: 18px;
  padding: 2px 0;
}

.page-header p {
  max-width: 780px;
}

.panel-title small,
label small,
.recipients {
  color: var(--muted);
}

table {
  width: 100%;
  min-width: 920px;
  border-collapse: separate;
  border-spacing: 0;
}

th,
td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

td:not(.archive-summary):not(.ai-summary) {
  white-space: nowrap;
}

tbody tr {
  transition: background 140ms ease;
}

tbody tr:hover {
  background: rgba(15, 118, 110, 0.045);
}

input,
textarea,
select {
  width: 100%;
  margin-top: 8px;
  padding: 12px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  outline: none;
  background: var(--surface-strong);
  color: var(--ink);
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

label {
  color: #344054;
  font-size: 14px;
  font-weight: 800;
}

fieldset {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-strong);
}

legend {
  padding: 0 7px;
  color: #344054;
  font-size: 13px;
  font-weight: 900;
}

.customer-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.customer-form.compact {
  margin-top: 12px;
}

.customer-edit-row td {
  padding: 0 0 18px;
  background: transparent;
}

.inline-edit-panel {
  margin: 8px 0 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.08), rgba(180, 83, 9, 0.05)), var(--surface-strong);
}

.inline-edit-panel h3 {
  margin: 0;
  font-size: 18px;
}

.form-error {
  margin: 0 0 14px;
  color: var(--danger);
  font-size: 14px;
  font-weight: 850;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.archive-filter {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.filter-actions {
  align-items: end;
}

.wide {
  grid-column: 1 / -1;
}

.check {
  display: inline-flex;
  gap: 9px;
  align-items: center;
  width: auto;
  margin: 8px 16px 8px 0;
  color: #344054;
}

.check input {
  width: auto;
  margin: 0;
  accent-color: var(--primary);
}

.pill,
.token {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  margin: 2px;
  padding: 5px 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: #eef4f1;
  color: #475467;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.15;
  white-space: nowrap;
}

.pill.ok {
  border-color: #b7e4d8;
  background: #dff8ef;
  color: var(--success);
}

.severity-critical {
  border-color: #ffd1cc;
  background: #fff0ee;
  color: var(--danger);
}

.severity-high {
  border-color: #fedf89;
  background: #fffaeb;
  color: var(--warning);
}

.severity-medium {
  border-color: #fef08a;
  background: #fefce8;
  color: #854d0e;
}

.severity-low {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.token.muted {
  border-color: #e4e7ec;
  background: #f8faf8;
  color: var(--muted);
}

.link-button {
  min-height: auto;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--primary-dark);
  box-shadow: none;
}

.link-button:hover {
  transform: none;
  text-decoration: underline;
}

.link-button.danger,
.error {
  color: var(--danger);
}

.mail-preview {
  margin-top: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-strong);
  box-shadow: var(--shadow-sm);
}

.mail-preview header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.mail-preview header p {
  margin-bottom: 0;
  color: var(--muted);
}

.mail-frame {
  width: 100%;
  min-height: 760px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
}

.archive-summary {
  min-width: 440px;
}

.ai-summary {
  min-width: 170px;
}

.archive-list {
  display: grid;
  gap: 14px;
}

.archive-compact-panel {
  padding: 18px;
}

.archive-compact-filter {
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 220px)) repeat(2, minmax(72px, auto)) repeat(3, minmax(150px, 1fr));
  gap: 10px;
  align-items: end;
}

.archive-compact-filter label {
  display: grid;
  gap: 6px;
}

.archive-compact-filter label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.archive-keyword {
  grid-column: span 2;
}

.archive-compact-filter .button {
  min-width: 72px;
  white-space: nowrap;
}

.archive-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-strong);
}

.archive-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  table-layout: fixed;
}

.archive-table th,
.archive-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line);
  vertical-align: top;
}

.archive-table th:first-child,
.archive-table td:first-child {
  border-left: 0;
}

.archive-table tr:last-child td {
  border-bottom: 0;
}

.archive-table th {
  background: rgba(15, 118, 110, 0.08);
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  text-align: center;
  white-space: nowrap;
}

.archive-table td {
  color: var(--ink);
  font-size: 14px;
}

.sent-cell {
  width: 126px;
  text-align: center;
}

.archive-table th:nth-child(1) {
  width: 126px;
}

.archive-table th:nth-child(2) {
  width: 190px;
}

.archive-table th:nth-child(3) {
  width: 102px;
}

.archive-table th:nth-child(4) {
  width: 112px;
}

.archive-table th:nth-child(6) {
  width: 90px;
}

.sent-cell input {
  width: 15px;
  height: 15px;
  margin: 3px auto 8px;
  accent-color: var(--primary);
}

.sent-cell .pill {
  justify-content: center;
  min-width: 74px;
}

.archive-title-cell {
  min-width: 0;
  overflow: hidden;
}

.archive-title-cell strong {
  display: block;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.archive-title-cell p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.archive-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.archive-row-meta span {
  display: inline-flex;
  min-height: 23px;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  background: #eef4f1;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.link-cell {
  width: 90px;
  text-align: center;
}

.link-cell a {
  color: #001eff;
  font-weight: 900;
  text-decoration: underline;
}

.learning-note {
  display: grid;
  gap: 8px;
}

.learning-note p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.archive-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(90deg, rgba(15, 118, 110, 0.04), transparent 42%),
    var(--surface-strong);
  box-shadow: var(--shadow-sm);
}

.archive-card-head {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
}

.archive-card h3 {
  margin: 6px 0 0;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.32;
  letter-spacing: -0.04em;
}

.archive-card h3 a {
  color: #0f5f59;
}

.archive-card h3 a:hover {
  text-decoration: underline;
}

.archive-meta,
.archive-status,
.archive-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.archive-meta span {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  background: #eef4f1;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.archive-status {
  justify-content: flex-end;
  min-width: 138px;
}

.original-title {
  display: block;
  margin-top: 8px;
  color: var(--subtle);
}

.archive-lead,
.classification-reason,
.archive-card-side p {
  color: var(--muted);
  font-size: 14px;
}

.archive-lead {
  margin: 12px 0 10px;
  line-height: 1.65;
}

.classification-reason {
  margin: 10px 0 0;
  padding: 11px 13px;
  border-left: 3px solid var(--primary);
  border-radius: 0 12px 12px 0;
  background: rgba(15, 118, 110, 0.07);
}

.archive-card-side {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.76);
}

.archive-card-side p {
  margin: 5px 0 10px;
}

.archive-card-side small {
  display: block;
  margin-top: 10px;
  color: var(--subtle);
  font-size: 12px;
}

.archive-summary a,
.archive-summary strong {
  font-weight: 900;
}

.archive-summary p,
.ai-summary p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.archive-summary small,
.mini-heading {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.mini-list {
  margin: 6px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.empty {
  margin-bottom: 0;
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 16px;
  background: var(--surface-strong);
}

.header-actions,
.review-run-box {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

.helper-text {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.review-message {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-strong);
}

.review-message + .review-message {
  margin-top: 16px;
}

.review-message > header,
.review-item-top {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
}

.review-message > header p {
  margin-bottom: 0;
  color: var(--muted);
}

.review-items {
  display: grid;
  gap: 12px;
}

.review-item {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.review-item form:first-child {
  display: grid;
  gap: 12px;
}

.review-edit-grid {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 12px;
}

.notice-list {
  display: grid;
  gap: 8px;
}

.notice-list p {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-strong);
  color: var(--muted);
}

.guide-flow {
  display: grid;
  gap: 12px;
}

.guide-detail {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.guide-detail article {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-strong);
}

.guide-detail h3 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 16px;
  letter-spacing: -0.02em;
}

.guide-detail p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.guide-flow article {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-strong);
}

.guide-flow article > span {
  display: inline-flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #ffffff;
  font-weight: 950;
}

.guide-flow strong,
.guide-link-list strong,
.guide-settings strong {
  color: var(--ink);
}

.guide-flow p {
  margin: 6px 0 0;
  color: var(--muted);
}

.guide-link-list {
  display: grid;
  gap: 10px;
}

.guide-link-list a {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-strong);
  color: var(--ink);
}

.guide-link-list a:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}

.guide-link-list span {
  color: var(--muted);
}

.guide-settings {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.guide-source-table {
  min-width: 720px;
}

.login-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 22px;
  align-items: stretch;
  min-height: 520px;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 10% 20%, rgba(45, 212, 191, 0.18), transparent 22rem),
    radial-gradient(circle at 100% 100%, rgba(245, 158, 11, 0.14), transparent 22rem),
    var(--surface);
  box-shadow: var(--shadow);
}

.login-panel h1 {
  max-width: 680px;
}

.login-panel > div:first-child {
  display: grid;
  align-content: center;
}

.login-card {
  display: grid;
  align-content: center;
  gap: 14px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-strong);
}

.login-card strong {
  color: var(--ink);
  font-size: 22px;
}

.login-card p {
  margin: 0;
  color: var(--muted);
}

.guide-settings div {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-strong);
}

.guide-settings span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

[data-theme="dark"] body {
  background:
    linear-gradient(rgba(94, 234, 212, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(94, 234, 212, 0.035) 1px, transparent 1px),
    radial-gradient(circle at 18% 0%, rgba(45, 212, 191, 0.12), transparent 28rem),
    radial-gradient(circle at 100% 16%, rgba(245, 158, 11, 0.10), transparent 28rem),
    var(--bg);
}

[data-theme="dark"] .hero,
[data-theme="dark"] .panel,
[data-theme="dark"] .card,
[data-theme="dark"] .topbar {
  border-color: var(--line);
}

[data-theme="dark"] .button,
[data-theme="dark"] button,
[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select {
  background: var(--surface-strong);
  color: var(--ink);
}

[data-theme="dark"] .button.primary,
[data-theme="dark"] button.primary {
  background: linear-gradient(135deg, #0f766e 0%, #0d9488 100%);
  color: #ffffff;
}

[data-theme="dark"] .token,
[data-theme="dark"] .pill,
[data-theme="dark"] .archive-meta span {
  background: #1e302b;
  color: #c8d9d3;
}

[data-theme="dark"] .token.muted {
  border-color: var(--line);
  background: #192824;
  color: var(--muted);
}

[data-theme="dark"] .archive-table th {
  background: rgba(45, 212, 191, 0.09);
  color: #d8ebe5;
}

[data-theme="dark"] .archive-table-wrap {
  background: #12231f;
}

[data-theme="dark"] .archive-row-meta span {
  background: #1e302b;
  color: #c8d9d3;
}

[data-theme="dark"] .archive-title-cell p,
[data-theme="dark"] .learning-note p {
  color: #c8d9d3;
}

[data-theme="dark"] .link-cell a {
  color: #7dd3fc;
}

[data-theme="dark"] .pill.ok {
  border-color: rgba(50, 213, 131, 0.28);
  background: rgba(50, 213, 131, 0.12);
  color: #86efac;
}

[data-theme="dark"] .severity-critical {
  border-color: rgba(249, 112, 102, 0.35);
  background: rgba(249, 112, 102, 0.12);
  color: #fda29b;
}

[data-theme="dark"] .severity-high,
[data-theme="dark"] .severity-medium {
  border-color: rgba(253, 176, 34, 0.35);
  background: rgba(253, 176, 34, 0.12);
  color: #fcd34d;
}

[data-theme="dark"] .severity-low {
  border-color: rgba(50, 213, 131, 0.28);
  background: rgba(50, 213, 131, 0.12);
  color: #86efac;
}

[data-theme="dark"] .classification-reason {
  background: rgba(45, 212, 191, 0.09);
}

[data-theme="dark"] .archive-card {
  background:
    linear-gradient(90deg, rgba(45, 212, 191, 0.06), transparent 45%),
    #12231f;
}

[data-theme="dark"] .archive-card h3 a {
  color: #5eead4;
}

[data-theme="dark"] .archive-card h3 a:hover {
  color: #99f6e4;
}

[data-theme="dark"] .archive-card-side {
  border-color: #34534b;
  background: #0f1d1a;
  color: var(--ink);
}

[data-theme="dark"] .archive-card-side p,
[data-theme="dark"] .archive-card-side .mini-list,
[data-theme="dark"] .archive-card-side small {
  color: #c8d9d3;
}

[data-theme="dark"] .archive-card-side .mini-heading {
  color: #e6f3ef;
}

[data-theme="dark"] .archive-lead,
[data-theme="dark"] .classification-reason {
  color: #d5e7e2;
}

[data-theme="dark"] .mail-frame {
  background: #ffffff;
}

.hero,
.cards,
.panel,
.page-header {
  animation: enter 420ms ease both;
}

@keyframes enter {
  from {
    transform: translateY(8px);
  }
  to {
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .shell-nav {
    padding: 16px;
  }

  .side-note {
    right: 16px;
    left: 16px;
  }

  .archive-filter {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .archive-compact-filter {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .archive-keyword {
    grid-column: auto;
  }
}

@media (max-width: 860px) {
  .app-shell {
    display: block;
  }

  .shell-nav {
    position: relative;
    height: auto;
    padding: 14px;
  }

  .brand {
    margin-bottom: 12px;
  }

  .nav-section {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .side-note {
    position: static;
    margin-top: 12px;
  }

  .shell-main {
    padding: 16px;
  }

  .topbar,
  .panel-title,
  .page-header,
  .mail-preview header,
  .review-message > header,
  .review-item-top {
    display: grid;
  }

  .cards,
  .panel-grid,
  .guide-detail,
  .guide-settings,
  .login-panel,
  .customer-form,
  .archive-filter,
  .archive-compact-filter,
  .archive-card,
  .review-edit-grid {
    grid-template-columns: 1fr;
  }

  .archive-card-head {
    display: grid;
  }

  .archive-status {
    justify-content: flex-start;
  }

  .hero {
    padding: 26px;
  }

  h1,
  .page-header h1 {
    font-size: 32px;
    overflow-wrap: anywhere;
    word-break: normal;
  }
}

@media (max-width: 520px) {
  .hero-actions,
  .run-box,
  .filter-actions {
    display: grid;
  }

  .hero {
    padding: 22px;
  }

  h1,
  .page-header h1 {
    font-size: 26px;
    line-height: 1.16;
    letter-spacing: -0.055em;
    word-break: break-all;
  }

  .desktop-title {
    display: none;
  }

  .mobile-title {
    display: inline;
  }

  .button,
  button {
    width: 100%;
  }
}
