/* ═══════════════════════════════════════════════════════════════
   foresight.css — Foresight Financial Forecast App
   Single stylesheet for all pages.
═══════════════════════════════════════════════════════════════ */

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

/* ── DESIGN TOKENS ─────────────────────────────────────────────── */
:root {
  --bg:        #0f1117;
  --surface:   #171b26;
  --surface2:  #1e2334;
  --border:    rgba(255, 255, 255, 0.07);
  --accent:    #c9a84c;
  --accent2:   #e2c97e;
  --text:      #e8e6df;
  --muted:     #7a7d8a;
  --ok:        #81c784;
  --error:     #e57373;
  --sidebar-w: 240px;
  --topbar-h:  64px;
}

/* ── BASE ──────────────────────────────────────────────────────── */
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── SESSION BAR ───────────────────────────────────────────────── */
#fs-session-bar {
  position: fixed; top: 0; left: 0; right: 0; height: 36px;
  background: #0a0c12; color: var(--text);
  font: 12px 'DM Sans', sans-serif;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex; align-items: center; padding: 0 18px; gap: 14px;
  z-index: 9999;
}
#fs-session-bar .fs-label {
  color: var(--muted); letter-spacing: 0.06em;
  text-transform: uppercase; font-size: 10px;
}
#fs-session-bar .fs-name   { color: var(--accent2); font-weight: 500; }
#fs-session-bar .fs-spacer { flex: 1; }
#fs-session-bar .fs-status {
  font-size: 11px; padding: 3px 8px; border-radius: 4px;
  background: rgba(129, 199, 132, 0.12); color: var(--ok);
  border: 1px solid rgba(129, 199, 132, 0.25);
}
#fs-session-bar .fs-status.dirty {
  background: rgba(229, 115, 115, 0.12); color: var(--error);
  border-color: rgba(229, 115, 115, 0.3);
}
#fs-session-bar a.fs-btn,
#fs-session-bar button.fs-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #0f1117; text-decoration: none;
  padding: 5px 12px; border-radius: 5px;
  font-weight: 500; font-size: 12px; border: none;
  cursor: pointer; font-family: inherit;
}
#fs-session-bar a.fs-btn:hover { filter: brightness(1.05); }
#fs-session-bar form.fs-end-form { display: inline; }
#fs-session-bar button.fs-end {
  background: transparent; color: var(--muted);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 4px 10px; border-radius: 4px;
  font-size: 11px; cursor: pointer; font-family: inherit;
}
#fs-session-bar button.fs-end:hover {
  color: var(--error); border-color: rgba(229, 115, 115, 0.4);
}
body.fs-has-session-bar                   { padding-top: 36px; }
body.fs-has-session-bar .topbar           { top: 36px; }
body.fs-has-session-bar .sidebar          { top: calc(var(--topbar-h) + 36px); }
body.fs-has-session-bar .layout           { margin-top: calc(var(--topbar-h) + 36px); }

/* ── TOPBAR ────────────────────────────────────────────────────── */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--topbar-h);
  background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; z-index: 100;
}
.topbar::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent) 40%, var(--accent2) 60%, transparent);
  opacity: 0.25;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-monogram {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  font-family: 'Playfair Display', serif; font-size: 16px; font-weight: 600;
  color: #0f1117; flex-shrink: 0;
}
.brand-name { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name span:first-child {
  font-family: 'Playfair Display', serif; font-size: 15px; font-weight: 600;
  color: var(--accent2); letter-spacing: 0.01em;
}
.brand-name span:last-child {
  font-size: 11px; font-weight: 300; color: var(--muted);
  letter-spacing: 0.06em; text-transform: uppercase;
}
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface2);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--muted);
  transition: background 0.2s, border-color 0.2s;
}
.icon-btn:hover {
  background: rgba(201, 168, 76, 0.12); border-color: rgba(201, 168, 76, 0.35);
  color: var(--accent2);
}
.icon-btn svg { width: 17px; height: 17px; }

/* ── APP LAYOUT ────────────────────────────────────────────────── */
.layout {
  display: flex; margin-top: var(--topbar-h);
  min-height: calc(100vh - var(--topbar-h));
}

/* ── SIDEBAR ───────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w); background: var(--surface);
  border-right: 1px solid var(--border);
  position: fixed; top: var(--topbar-h); bottom: 0; left: 0;
  display: flex; flex-direction: column; padding: 24px 0; overflow-y: auto;
}
.sidebar-section-label {
  font-size: 10px; font-weight: 500; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted);
  padding: 0 20px; margin-bottom: 8px;
}
.nav-list { list-style: none; padding: 0; }
.nav-item a {
  display: flex; align-items: center; gap: 12px; padding: 11px 20px;
  text-decoration: none; color: var(--muted); font-size: 13.5px; font-weight: 400;
  border-left: 2px solid transparent;
  transition: color 0.18s, background 0.18s, border-color 0.18s;
}
.nav-item a:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.nav-item a.active {
  color: var(--accent2); background: rgba(201, 168, 76, 0.08);
  border-left-color: var(--accent); font-weight: 500;
}
.nav-item a .nav-icon { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.7; }
.nav-item a.active .nav-icon,
.nav-item a:hover  .nav-icon { opacity: 1; }

/* ── MAIN CONTENT ──────────────────────────────────────────────── */
.main { margin-left: var(--sidebar-w); flex: 1; padding: 40px 44px; min-width: 0; }

/* ── PAGE HEADER ───────────────────────────────────────────────── */
.page-header { margin-bottom: 28px; }
.page-header h1 {
  font-family: 'Playfair Display', serif; font-size: 26px; font-weight: 500;
  color: var(--text); margin-bottom: 6px;
}
.page-header p { font-size: 13.5px; color: var(--muted); font-weight: 300; }
.page-header--row {
  display: flex; align-items: flex-start; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
}

/* ── FLASH MESSAGES ────────────────────────────────────────────── */
.flash-list { margin-bottom: 20px; display: flex; flex-direction: column; gap: 8px; }
.flash-msg  {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px; border-radius: 8px; font-size: 13.5px;
}
.flash-msg.ok    { background: rgba(129, 199, 132, 0.1); border: 1px solid rgba(129, 199, 132, 0.3); color: var(--ok); }
.flash-msg.error { background: rgba(229, 115, 115, 0.1); border: 1px solid rgba(229, 115, 115, 0.3); color: var(--error); }

/* ── BUTTONS ───────────────────────────────────────────────────── */
.btn-primary {
  padding: 10px 24px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: none; border-radius: 8px; color: #0f1117;
  font-family: 'DM Sans', sans-serif; font-size: 13.5px; font-weight: 500;
  cursor: pointer; transition: opacity 0.2s;
  text-decoration: none; display: inline-block;
}
.btn-primary:hover   { opacity: 0.88; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-secondary {
  padding: 10px 20px; background: transparent;
  border: 1px solid var(--border); border-radius: 8px;
  color: var(--muted); font-family: 'DM Sans', sans-serif; font-size: 13px;
  cursor: pointer; text-decoration: none; display: inline-block;
  transition: border-color 0.2s, color 0.2s;
}
.btn-secondary:hover { border-color: rgba(201, 168, 76, 0.35); color: var(--text); }
.btn-bar   { display: flex; align-items: center; gap: 12px; margin-top: 20px; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── INLINE RENAME FORM ─────────────────────────────────────────── */
.inline-rename-form { display: flex; align-items: center; gap: 6px; }
.rename-input {
  padding: 5px 10px; background: var(--bg); border: 1px solid var(--border);
  border-radius: 6px; color: var(--text); font-family: 'DM Sans', sans-serif;
  font-size: 13px; width: 180px;
}
.rename-input:focus { outline: none; border-color: var(--accent); }
.rename-btn { padding: 5px 10px; font-size: 13px; }

/* ── CARDS ─────────────────────────────────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 24px;
}
.table-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden;
}
.table-card-header {
  padding: 18px 24px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.table-card-header h2 {
  font-family: 'Playfair Display', serif; font-size: 16px;
  font-weight: 500; color: var(--text);
}
.badge {
  font-size: 11px; color: var(--muted); background: var(--surface2);
  border: 1px solid var(--border); border-radius: 20px; padding: 2px 10px;
}

/* ── TABLE ─────────────────────────────────────────────────────── */
.table-scroll { overflow-x: auto; max-height: calc(100vh - 280px); overflow-y: auto; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data-table thead th {
  background: var(--surface2); color: var(--accent);
  font-size: 11px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border);
  white-space: nowrap; position: sticky; top: 0; z-index: 1;
}
table.data-table tbody td   { padding: 10px 16px; color: var(--text); border-bottom: 1px solid var(--border); }
table.data-table tbody tr:last-child td { border-bottom: none; }
table.data-table tbody tr:hover td     { background: rgba(255, 255, 255, 0.02); }
td.num       { text-align: right; font-family: 'Courier New', monospace; font-size: 12.5px; white-space: nowrap; }
td.muted     { color: var(--muted); font-size: 12px; }
td.accent    { color: var(--accent2); font-weight: 500; }
th.col-right,
td.col-right { text-align: right; }
.fc-col      { text-align: right; min-width: 110px; white-space: nowrap; }

/* Sticky first column in wide/scrollable tables */
.sticky-col {
  position: sticky; left: 0; background: var(--surface);
  z-index: 1; box-shadow: 3px 0 8px rgba(0, 0, 0, 0.3);
}
.sticky-col-header {
  position: sticky; left: 0; z-index: 2; background: var(--surface2);
}
.sticky-col.indented { padding-left: 24px; }
.acct-name { font-size: 13px; color: var(--text); }
.acct-code { font-size: 11px; color: var(--muted); font-family: monospace; }

/* Line-item breakdown rows nested under an account (multiple line items sharing one account code) */
.line-item-row td          { border-top: none; }
.line-item-row .sticky-col { padding-left: 40px; }
.line-item-row .acct-name  { font-size: 12px; color: var(--muted); }

/* Balance sheet section rows */
.section-header-row { background: rgba(255, 255, 255, 0.025); }
.section-label {
  font-size: 10px; font-weight: 500; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted);
  padding: 10px 14px 6px;
}

/* Statement-level title rows: INCOME STATEMENT, BALANCE SHEET */
.stmt-title-row { background: rgba(255, 255, 255, 0.04); }
.stmt-title {
  font-size: 11px; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--text);
  padding: 14px 14px 8px;
  border-bottom: 1px solid var(--border);
}

/* Category group sub-headers: Income, COGS, Current Assets, etc. */
.group-label {
  font-size: 12.5px; font-weight: 600; color: var(--text);
  padding: 12px 14px 4px;
}

/* Subtotal row (Total Income, Total COGS, etc.) */
.subtotal-row td           { border-top: 1px solid var(--border); font-weight: 500; }
.subtotal-row .sticky-col  { background: var(--surface); }

/* Primary subtotals: Gross Profit, EBIT, Total Assets, Total Liabilities */
.primary-subtotal-row td          { border-top: 2px solid var(--border); font-weight: 600; }
.primary-subtotal-row .sticky-col { background: var(--surface); }

/* Margin / metric rows: GP Margin %, EBIT Margin %, Net Profit Margin % */
.metric-row td         { font-style: italic; border-top: none; }
.metric-row .sticky-col { background: var(--surface); }
.metric-name { font-size: 11.5px; color: var(--muted); font-style: italic; padding-left: 8px; }
.metric-row .num { color: var(--muted); font-size: 12px; }

/* CF sub-label (e.g. "Adjustments" indented under a group-label) */
.sub-label {
  font-size: 11px; font-weight: 500; color: var(--muted);
  padding: 6px 14px 2px 28px;
}

/* Total / Net Profit row */
.total-row                { background: rgba(201, 168, 76, 0.08); }
.total-row td             { border-top: 2px solid rgba(201, 168, 76, 0.3); font-weight: 600; color: var(--accent2); }
.total-row .sticky-col    { background: rgba(201, 168, 76, 0.08); }
.total-label              { font-size: 13.5px; font-weight: 600; color: var(--accent2); }

/* ── EMPTY STATE ───────────────────────────────────────────────── */
.empty-state {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 56px 32px;
  text-align: center; color: var(--muted); font-size: 14px;
}
.empty-state-action { margin-top: 16px; }

/* ── FORM ──────────────────────────────────────────────────────── */
.form-section {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 28px 32px; margin-bottom: 24px;
}
.form-section h2 {
  font-family: 'Playfair Display', serif; font-size: 16px;
  font-weight: 500; color: var(--text); margin-bottom: 16px;
}
.form-grid  { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field label {
  font-size: 11px; font-weight: 500; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted);
}
.form-hint { font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.form-input {
  background: var(--surface2); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); padding: 10px 14px; font-family: 'DM Sans', sans-serif;
  font-size: 14px; width: 100%; transition: border-color 0.2s;
}
.form-input:focus { outline: none; border-color: rgba(201, 168, 76, 0.5); }
.form-input-suffix                   { position: relative; display: flex; align-items: center; }
.form-input-suffix .form-input       { padding-right: 36px; }
.form-input-suffix .suffix           { position: absolute; right: 12px; font-size: 12px; color: var(--muted); pointer-events: none; }
.form-select {
  background: var(--surface2); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); padding: 10px 14px; font-family: 'DM Sans', sans-serif;
  font-size: 14px; width: 100%; cursor: pointer; transition: border-color 0.2s;
}
.form-select:focus { outline: none; border-color: rgba(201, 168, 76, 0.5); }

/* Variable % preview table (inside assumptions form) */
.pct-preview {
  margin-top: 12px;
}
.pct-preview-table {
  width: 100%; border-collapse: collapse;
  font-size: 12.5px;
}
.pct-preview-table th {
  text-align: left; font-weight: 600; font-size: 11px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted);
  padding: 4px 10px 4px 0; border-bottom: 1px solid var(--border);
}
.pct-preview-table td {
  padding: 6px 10px 6px 0; border-bottom: 1px solid var(--border);
  color: var(--text);
}
.pct-preview-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.pct-preview-table td.muted { color: var(--muted); }

/* Inline error/warning banners inside forms */
.alert-error {
  padding: 14px 18px;
  background: rgba(229, 115, 115, 0.08); border: 1px solid rgba(229, 115, 115, 0.25);
  border-radius: 8px; font-size: 13px; color: var(--error); margin-bottom: 16px;
}
.alert-error a { color: var(--accent2); }

/* ── UPLOAD PAGE ───────────────────────────────────────────────── */
.upload-meta        { margin-top: 12px; font-size: 12px; color: var(--muted); }
.upload-meta strong { color: var(--text); }
.file-row           { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.file-input-label   {
  display: flex; align-items: center; gap: 10px;
  flex: 1; min-width: 240px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 14px; cursor: pointer;
}
.file-input-label input[type=file] { display: none; }
.file-name   { flex: 1; color: var(--muted); font-size: 13px; }
.file-browse {
  background: rgba(201, 168, 76, 0.08); border: 1px solid rgba(201, 168, 76, 0.3);
  color: var(--accent2); padding: 5px 12px; border-radius: 6px;
  font-size: 12px; white-space: nowrap;
}
.stmt-badge     { font-size: 11px; padding: 2px 7px; border-radius: 4px; display: inline-block; }
.stmt-badge--pl { background: rgba(201, 168, 76, 0.1);    color: var(--accent2); border: 1px solid rgba(201, 168, 76, 0.25); }
.stmt-badge--bs { background: rgba(100, 140, 255, 0.1);   color: #9ab4f5;        border: 1px solid rgba(100, 140, 255, 0.25); }

/* ── HISTORICAL VIEW ───────────────────────────────────────────── */
.type-bar { display: flex; gap: 8px; margin-bottom: 20px; align-items: center; }
.spacer   { flex: 1; }

/* ── FORECAST VIEW — TABS ──────────────────────────────────────── */
.tab-bar {
  display: flex; gap: 4px; background: var(--surface2);
  border: 1px solid var(--border); border-radius: 9px;
  padding: 4px; margin-bottom: 20px; width: fit-content;
}
.tab {
  padding: 7px 20px; border-radius: 6px; font-size: 13px; color: var(--muted);
  text-decoration: none; border: none; background: transparent; cursor: pointer;
  transition: background 0.15s, color 0.15s; font-family: 'DM Sans', sans-serif;
}
.tab:hover  { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.tab.active { background: rgba(201, 168, 76, 0.15); color: var(--accent2); font-weight: 500; }

/* ── FORECAST VIEW — CHARTS ────────────────────────────────────── */
.chart-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 24px; margin-bottom: 24px;
}
.chart-card h2 {
  font-family: 'Playfair Display', serif; font-size: 16px;
  font-weight: 500; color: var(--text); margin-bottom: 20px;
}
.charts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 900px) { .charts-grid { grid-template-columns: 1fr; } }

/* ── DASHBOARD ─────────────────────────────────────────────────── */
.dash-stats {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px; margin-bottom: 36px;
}
.stat-label {
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent); font-weight: 500; margin-bottom: 10px;
}
.stat-value { font-family: 'Playfair Display', serif; font-size: 36px; color: var(--text); margin-bottom: 4px; }
.stat-note  { font-size: 12.5px; color: var(--muted); }

.qs-list  { display: flex; flex-direction: column; gap: 0; }
.qs-step  { display: flex; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.qs-step:last-child { border-bottom: none; }
.qs-num   {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  background: rgba(201, 168, 76, 0.15); border: 1px solid rgba(201, 168, 76, 0.3);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Playfair Display', serif; color: var(--accent); font-size: 13px; font-weight: 600;
}
.qs-body  { flex: 1; }
.qs-title { font-size: 13.5px; font-weight: 500; color: var(--text); margin-bottom: 2px; }
.qs-desc  { font-size: 12px; color: var(--muted); }

/* ── SESSION START PAGE (standalone, no sidebar) ───────────────── */
body.session-start {
  align-items: center; padding: 60px 24px;
}
body.session-start .brand              { gap: 14px; margin-bottom: 48px; }
body.session-start .brand-monogram     { width: 44px; height: 44px; border-radius: 10px; font-size: 20px; }
body.session-start .brand-name span:first-child { font-size: 20px; }

.ss-title    { font-family: 'Playfair Display', serif; font-size: 32px; font-weight: 500; margin-bottom: 12px; text-align: center; }
.ss-subtitle { font-size: 14px; color: var(--muted); text-align: center; max-width: 580px; line-height: 1.6; margin-bottom: 40px; }

.ss-flashes  { width: 100%; max-width: 720px; margin-bottom: 20px; }
.ss-flash    { padding: 12px 16px; border-radius: 8px; font-size: 13px; margin-bottom: 8px; border: 1px solid var(--border); }
.ss-flash.error { background: rgba(229, 115, 115, 0.1); border-color: rgba(229, 115, 115, 0.3); color: var(--error); }
.ss-flash.ok    { background: rgba(129, 199, 132, 0.1); border-color: rgba(129, 199, 132, 0.3); color: var(--ok); }

.ss-active-banner {
  background: rgba(129, 199, 132, 0.08); border: 1px solid rgba(129, 199, 132, 0.25);
  color: var(--text); padding: 14px 18px; border-radius: 10px;
  margin-bottom: 24px; max-width: 720px; width: 100%;
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; flex-wrap: wrap;
}
.ss-active-banner .label   { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.ss-active-banner .name    { color: var(--accent2); font-weight: 500; }
.ss-active-banner .actions { display: flex; gap: 8px; }
.ss-active-banner a,
.ss-active-banner button {
  background: transparent; border: 1px solid var(--border); color: var(--text);
  padding: 8px 14px; border-radius: 6px; font-size: 12px;
  text-decoration: none; cursor: pointer; font-family: inherit;
}
.ss-active-banner a:hover { border-color: rgba(201, 168, 76, 0.5); color: var(--accent2); }

#fsReconnect {
  max-width: 720px; width: 100%; margin-bottom: 20px;
  padding: 14px 18px;
  background: rgba(201, 168, 76, 0.08); border: 1px solid rgba(201, 168, 76, 0.3);
  border-radius: 10px; font-size: 13px; display: none;
  align-items: center; gap: 14px; flex-wrap: wrap;
}
#fsReconnect span { flex: 1; }

.ss-cards {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 24px; width: 100%; max-width: 720px;
}
@media (max-width: 700px) { .ss-cards { grid-template-columns: 1fr; } }

.ss-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 28px;
  display: flex; flex-direction: column;
}
.ss-card h2 { font-family: 'Playfair Display', serif; font-size: 20px; font-weight: 500; margin-bottom: 6px; color: var(--accent2); }
.ss-card p  { font-size: 13px; color: var(--muted); line-height: 1.6; margin-bottom: 20px; }
.ss-card form { display: flex; flex-direction: column; gap: 12px; flex: 1; justify-content: flex-end; }

.field-label { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; display: block; }

.ss-input {
  width: 100%; background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; padding: 11px 14px; color: var(--text);
  font-family: inherit; font-size: 14px;
}
.ss-input:focus { outline: none; border-color: rgba(201, 168, 76, 0.5); }

.ss-file-wrap {
  width: 100%; background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; padding: 11px 14px;
  display: flex; align-items: center; gap: 10px; cursor: pointer;
}
.ss-file-wrap input[type=file] { display: none; }
.ss-file-label { color: var(--muted); font-size: 13px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-file-pick  { background: rgba(201, 168, 76, 0.08); border: 1px solid rgba(201, 168, 76, 0.3); color: var(--accent2); padding: 5px 12px; border-radius: 6px; font-size: 12px; }

.ss-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #0f1117; border: none; padding: 12px 18px;
  border-radius: 8px; font-weight: 500; font-size: 14px;
  cursor: pointer; font-family: inherit;
}
.ss-btn:hover { filter: brightness(1.05); }
.ss-btn--secondary { background: transparent; color: var(--accent2); border: 1px solid rgba(201, 168, 76, 0.3); }

.ss-last-used {
  margin-top: 12px; padding: 10px 12px;
  background: var(--surface2); border: 1px dashed var(--border);
  border-radius: 8px; font-size: 12px; color: var(--muted); display: none;
}
.ss-last-used.shown { display: block; }
.ss-last-used b { color: var(--accent2); }

.ss-warn {
  margin-top: 32px; padding: 14px 18px; max-width: 720px; width: 100%;
  background: rgba(229, 115, 115, 0.06); border: 1px solid rgba(229, 115, 115, 0.25);
  border-radius: 8px; font-size: 12px; color: var(--muted); line-height: 1.6;
}
.ss-warn b { color: var(--error); }
