/* ── Reset & Base ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Neutral, warm-gray palette. One muted slate accent; status colors are
   desaturated and used sparingly (badges, alerts). */
:root {
  color-scheme: light;
  --bg:          #f5f4f1;
  --surface:     #ffffff;
  --surface-2:   #f0eeea;
  --border:      #e1ded8;
  --border-soft: #ebe9e4;
  --text:        #23221f;
  --muted:       #6f6b64;
  --accent:      #3e4b59;   /* slate */
  --accent-hover:#2f3a46;
  --accent-soft: #e7eaee;
  --on-accent:   #ffffff;
  --focus:       rgba(62,75,89,0.18);

  --success:     #2f6f4e;
  --success-bg:  #e6f0ea;
  --warning:     #8a5a12;
  --warning-bg:  #f6eddc;
  --danger:      #a63d2f;
  --danger-bg:   #f6e5e2;
  --info:        #3e4b59;
  --info-bg:     #eceef1;

  /* Column-mapper highlights */
  --col-name:    #dce6f2;
  --col-unit:    #e3ecd6;
  --col-price:   #f4e5c8;
  --col-code:    #ece3f2;
  --col-category:#e9e7e2;

  --radius:      10px;
  --radius-sm:   7px;
  --shadow:      0 1px 2px rgba(35,34,31,0.05), 0 2px 8px rgba(35,34,31,0.04);
  --shadow-lg:   0 6px 24px rgba(35,34,31,0.08);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg:          #1a1a19;
    --surface:     #232321;
    --surface-2:   #2c2c29;
    --border:      #393935;
    --border-soft: #31312e;
    --text:        #ecebe7;
    --muted:       #a19d95;
    --accent:      #c9d1da;
    --accent-hover:#e1e6ec;
    --accent-soft: #33383e;
    --on-accent:   #1a1a19;
    --focus:       rgba(201,209,218,0.22);

    --success:     #8cc4a3;
    --success-bg:  #26332b;
    --warning:     #dcb478;
    --warning-bg:  #3a3122;
    --danger:      #e3998e;
    --danger-bg:   #3b2826;
    --info:        #c9d1da;
    --info-bg:     #2d3136;

    --col-name:    #2f3b4d;
    --col-unit:    #323d2b;
    --col-price:   #453a25;
    --col-code:    #3b3045;
    --col-category:#34332f;

    --shadow:      0 1px 2px rgba(0,0,0,0.3);
    --shadow-lg:   0 6px 24px rgba(0,0,0,0.35);
  }
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
code {
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font-size: 0.9em;
  background: var(--surface-2);
  padding: 1px 5px;
  border-radius: 4px;
}

/* ── Navbar ─────────────────────────────────────────────────────────────────── */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 24px;
  height: 60px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 650;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.nav-brand:hover { text-decoration: none; }
.nav-logo { font-size: 20px; }

.nav-links { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }

.nav-link {
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
}
.nav-link:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav-link.active { color: var(--text); background: var(--surface-2); font-weight: 600; }
.nav-link-logout { margin-left: 8px; }

@media (max-width: 640px) {
  .navbar { height: auto; padding: 10px 16px; flex-wrap: wrap; }
  .nav-link { padding: 6px 10px; }
}

/* ── Main Content ───────────────────────────────────────────────────────────── */
.main-content {
  max-width: 1160px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}
@media (max-width: 640px) { .main-content { padding: 20px 16px 48px; } }

/* ── Alerts ─────────────────────────────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 14px;
  border: 1px solid transparent;
  border-left-width: 4px;
}
.alert-success  { background: var(--success-bg); border-color: var(--success); color: var(--text); }
.alert-error    { background: var(--danger-bg);  border-color: var(--danger);  color: var(--text); }
.alert-warning  { background: var(--warning-bg); border-color: var(--warning); color: var(--text); }
.alert-info     { background: var(--info-bg);    border-color: var(--info);    color: var(--text); }
.alert-close { background: none; border: none; cursor: pointer; color: var(--muted); font-size: 15px; padding: 2px 4px; }
.alert-close:hover { color: var(--text); }

/* ── Page Header ────────────────────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.page-title {
  font-size: 26px;
  font-weight: 650;
  letter-spacing: -0.4px;
  line-height: 1.25;
  color: var(--text);
}
.page-sub {
  color: var(--muted);
  font-size: 14px;
  margin-top: 4px;
}
.breadcrumb {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}
.breadcrumb a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.breadcrumb a:hover { color: var(--text); }

/* ── Buttons ────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 550;
  line-height: 1.2;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  font-family: inherit;
}
.btn:hover { text-decoration: none; }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* Primary = the one main action on a screen */
.btn-primary  { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
/* Success (export) stays quiet: outlined with a green tint */
.btn-success  { background: var(--success-bg); color: var(--success); border-color: transparent; }
.btn-success:hover { border-color: var(--success); }
.btn-danger   { background: var(--surface); color: var(--danger); border-color: var(--border); }
.btn-danger:hover { background: var(--danger-bg); border-color: var(--danger); }
.btn-warning  { background: var(--warning-bg); color: var(--warning); border-color: transparent; }
.btn-warning:hover { border-color: var(--warning); }
.btn-outline  { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-outline:hover { background: var(--surface-2); }
.btn-sm       { padding: 6px 12px; font-size: 13px; }
.btn-full     { width: 100%; justify-content: center; }
.btn-danger-ghost { background: none; border: none; color: var(--muted); padding: 4px 8px; font-size: 14px; border-radius: 6px; }
.btn-danger-ghost:hover { background: var(--danger-bg); color: var(--danger); }

.link-btn { background: none; border: none; color: var(--text); font-weight: 550; cursor: pointer; font-size: inherit; text-align: left; padding: 0; font-family: inherit; }
.link-btn:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

/* ── Cards ──────────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}
.card-title {
  font-size: 15px;
  font-weight: 650;
  color: var(--text);
  margin-bottom: 16px;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 768px) { .two-col { grid-template-columns: 1fr; } }
.two-col > * { min-width: 0; }

/* List + side form (Contacts) and side form + list (Manual Entry) */
.layout-main-side, .layout-side-main { display: grid; gap: 20px; align-items: start; }
.layout-main-side { grid-template-columns: minmax(0, 1fr) 360px; }
.layout-side-main { grid-template-columns: 320px minmax(0, 1fr); }
.layout-main-side > *, .layout-side-main > * { min-width: 0; }
@media (max-width: 880px) {
  .layout-main-side, .layout-side-main { grid-template-columns: minmax(0, 1fr); }
}

/* ── Forms ──────────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 14px; font-weight: 550; color: var(--text); margin-bottom: 6px; }
.form-hint  { font-size: 13px; color: var(--muted); margin-top: 5px; line-height: 1.45; }
.required   { color: var(--danger); }
.muted      { color: var(--muted); }

.form-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
select.form-input { cursor: pointer; }
.form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus);
}
.form-input::placeholder { color: var(--muted); opacity: 0.75; }

.file-input {
  font-size: 14px;
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 8px;
  cursor: pointer;
  max-width: 100%;
}
.file-input::file-selector-button {
  font-family: inherit;
  font-size: 13px;
  margin-right: 10px;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
}

.divider { border: none; border-top: 1px solid var(--border); margin: 24px 0; }

/* ── Radio Groups ───────────────────────────────────────────────────────────── */
.radio-group { display: flex; flex-direction: column; gap: 10px; }
.radio-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.radio-option:hover { border-color: var(--muted); }
.radio-option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.radio-option input[type=radio] { margin-top: 4px; accent-color: var(--accent); }
.radio-title { font-size: 14px; font-weight: 600; }
.radio-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* ── Badges ─────────────────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
  text-transform: capitalize;
  white-space: nowrap;
}
.badge-draft    { background: var(--surface-2);  color: var(--muted); }
.badge-active   { background: var(--success-bg); color: var(--success); }
.badge-closed   { background: var(--surface-2);  color: var(--text); }
.badge-inactive { background: var(--surface-2);  color: var(--muted); }
button.badge { border: 1px solid transparent; font-family: inherit; cursor: pointer; }
button.badge:hover { border-color: var(--border); }
.badge-email    { background: var(--info-bg);    color: var(--info); }
.badge-manual   { background: var(--warning-bg); color: var(--warning); }

/* ── Active Banner ──────────────────────────────────────────────────────────── */
.active-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--success);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}
.active-banner-left { display: flex; align-items: center; gap: 14px; }
.active-banner-title { font-weight: 650; font-size: 15px; }
.active-banner-sub   { font-size: 13px; color: var(--muted); }

.pulse-dot {
  width: 9px;
  height: 9px;
  background: var(--success);
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Rounds Grid ────────────────────────────────────────────────────────────── */
.rounds-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.round-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  color: var(--text);
  text-decoration: none;
  display: block;
  box-shadow: var(--shadow);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.round-card:hover {
  border-color: var(--muted);
  box-shadow: var(--shadow-lg);
  text-decoration: none;
}
.round-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.round-card-name { font-size: 17px; font-weight: 650; margin-bottom: 6px; }
.round-card-meta { font-size: 13px; color: var(--muted); margin-top: 3px; }
.round-token { font-size: 12px; color: var(--muted); font-family: ui-monospace, Consolas, monospace; }

.round-active  { border-left: 4px solid var(--success); }
.round-closed .round-card-name { color: var(--muted); }

/* ── Steps ──────────────────────────────────────────────────────────────────── */
.steps-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}
@media (max-width: 960px) { .steps-row { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .steps-row { grid-template-columns: 1fr; } }

.step-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  box-shadow: var(--shadow);
}
.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 650;
  flex-shrink: 0;
  color: var(--muted);
}
.step-done .step-num   { background: var(--success-bg); color: var(--success); }
.step-active .step-num { background: var(--accent); color: var(--on-accent); }
.step-title { font-weight: 650; font-size: 15px; margin-bottom: 4px; }
.step-sub   { font-size: 13px; color: var(--muted); line-height: 1.45; }
.step-body  { flex: 1; min-width: 0; }
.step-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; align-items: center; }
.step-result  { margin-top: 10px; font-size: 13px; line-height: 1.45; }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }

/* ── Stats Row ──────────────────────────────────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}
@media (max-width: 700px) { .stats-row { grid-template-columns: repeat(2, 1fr); } }

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.stat-num   { font-size: 26px; font-weight: 650; color: var(--text); letter-spacing: -0.5px; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* ── Section Cards ──────────────────────────────────────────────────────────── */
.section-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.section-title { font-size: 16px; font-weight: 650; margin-bottom: 14px; }
.section-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.section-title-row .section-title { margin-bottom: 0; }

.danger-zone { margin-top: 32px; border-color: var(--border); box-shadow: none; background: transparent; }
.danger-zone .section-title { color: var(--danger); font-size: 15px; margin-bottom: 6px; }

/* ── Tables ─────────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.data-table th {
  padding: 10px 12px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
  position: sticky;
  top: 0;
}
.data-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: var(--bg); }
.data-table-sm td, .data-table-sm th { padding: 8px 10px; font-size: 13px; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-inactive td { color: var(--muted); }

.item-list-scroll { max-height: 360px; overflow: auto; border-radius: 8px; border: 1px solid var(--border); }

/* ── Tags ───────────────────────────────────────────────────────────────────── */
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 500; }
.tag-pending { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }

/* ── Manual Order Items ─────────────────────────────────────────────────────── */
.item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border-soft);
}
.item-row:last-child { border-bottom: none; }
.item-row:hover { background: var(--bg); }
.item-row-info { flex: 1; min-width: 0; }
.item-row-name { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-row-meta { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.qty-input {
  width: 76px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  text-align: center;
  flex-shrink: 0;
}
.qty-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus); }
.qty-input.has-value { border-color: var(--success); background: var(--success-bg); }

/* ── Info Box ───────────────────────────────────────────────────────────────── */
.info-box {
  background: var(--info-bg);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 20px;
  line-height: 1.5;
}

/* ── Empty State ────────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 56px 20px;
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}
.empty-icon  { font-size: 36px; margin-bottom: 12px; }
.empty-title { font-size: 17px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.empty-sub   { font-size: 14px; }

/* ── Layout helpers ─────────────────────────────────────────────────────────── */
.narrow   { max-width: 520px; }
.medium   { max-width: 640px; }
.mt-2     { margin-top: 12px; }
.mt-3     { margin-top: 20px; }
.row      { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row > .grow { flex: 1; }

/* ── Column mapper ──────────────────────────────────────────────────────────── */
.mapper-controls { margin-bottom: 20px; }
.mapper-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 16px;
}
@media (max-width: 900px) { .mapper-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .mapper-grid { grid-template-columns: minmax(0, 1fr); } }
.check-option { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; margin: 2px 0 4px; }
.check-option input { margin-top: 4px; accent-color: var(--accent); }
.mapper-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border);
}
.import-summary { font-size: 14px; color: var(--muted); }
.import-summary strong { color: var(--text); }

.sheet-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.sheet-legend span { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; border: 1px solid var(--border); }
.swatch-name  { background: var(--col-name); }
.swatch-unit  { background: var(--col-unit); }
.swatch-price { background: var(--col-price); }
.swatch-code  { background: var(--col-code); }
.swatch-category { background: var(--col-category); }
.swatch-skip  { background: var(--surface-2); }

.sheet-scroll { max-height: 70vh; overflow: auto; border: 1px solid var(--border); border-radius: 8px; }
.sheet-table td { white-space: nowrap; }
.sheet-table th.rownum, .sheet-table td.rownum {
  position: sticky; left: 0; z-index: 1; background: var(--surface-2);
  color: var(--muted); text-align: right; font-variant-numeric: tabular-nums;
}
.sheet-table thead th.rownum { z-index: 2; }
.sheet-table .col-name  { background: var(--col-name); }
.sheet-table .col-unit  { background: var(--col-unit); }
.sheet-table .col-price { background: var(--col-price); }
.sheet-table .col-code  { background: var(--col-code); }
.sheet-table .col-category { background: var(--col-category); }
.sheet-table th.col-name, .sheet-table th.col-unit, .sheet-table th.col-price,
.sheet-table th.col-code, .sheet-table th.col-category { color: var(--text); }
.sheet-table .result { color: var(--success); font-size: 12px; }
.sheet-table tr.row-skipped td { color: var(--muted); background: var(--surface-2); }
.sheet-table tr.row-skipped td:not(.rownum) { text-decoration: line-through; text-decoration-color: var(--border); }
.sheet-table tr.row-skipped td.result { color: var(--muted); text-decoration: none; font-style: italic; }
.sheet-table tbody tr:hover td { filter: brightness(0.97); }

/* ── Email preview ──────────────────────────────────────────────────────────── */
.part-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.part-tab {
  display: flex; flex-direction: column; gap: 2px; min-width: 150px; max-width: 260px;
  padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); background: var(--surface); text-decoration: none;
}
.part-tab:hover { border-color: var(--muted); text-decoration: none; }
.part-tab.active { border-color: var(--accent); background: var(--accent-soft); }
.part-tab-num { font-weight: 650; font-size: 14px; }
.part-tab-title { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.part-tab-size { font-size: 12px; color: var(--muted); }
.preview-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.email-frame { width: 100%; height: 70vh; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.email-text {
  max-height: 70vh; overflow: auto; padding: 16px; margin: 0;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px;
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 13px; line-height: 1.45;
  white-space: pre-wrap; overflow-wrap: anywhere;
}

/* ── Login ──────────────────────────────────────────────────────────────────── */
.login-wrap {
  min-height: calc(100vh - 120px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 0;
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 40px 36px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-lg);
}
.login-icon  { font-size: 40px; margin-bottom: 14px; }
.login-title { font-size: 22px; font-weight: 650; letter-spacing: -0.3px; margin-bottom: 6px; }
.login-sub   { font-size: 14px; color: var(--muted); margin-bottom: 26px; }

/* ── Scrollbar ──────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }
