/* ═══════════════════════════════════════════════════════════════
   GORA AI — themes + Settings UI (Oct 2026)
   data-theme="dark" on <html> is set by the inline head script and
   settings.js (light / dark / system). Loaded after responsive.css.
═══════════════════════════════════════════════════════════════ */

:root { color-scheme: light; }
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg:         #0d1519;
  --panel:      #152127;
  --surface:    #1a2930;
  --ink:        #e4ecef;
  --muted:      #9aacb4;
  --line:       #2a3a42;
  --teal:       #3dbcaf;
  --teal-soft:  #12383a;
  --blue:       #84b6ec;
  --blue-soft:  #182f47;
  --amber:      #e7a95c;
  --amber-soft: #3a2b16;
  --red:        #f08a8a;
  --red-soft:   #3c1f22;
  --green:      #63d293;
  --green-soft: #14331f;
  --shadow:     0 18px 45px rgba(0, 0, 0, 0.45);
}
:root[data-theme="dark"] body {
  background: linear-gradient(180deg, rgba(61, 188, 175, 0.07), transparent 280px), var(--bg);
}
/* Filled buttons keep a deep teal so white text stays readable */
:root[data-theme="dark"] .step-btn-next,
:root[data-theme="dark"] .login-button,
:root[data-theme="dark"] .plan-banner-cta,
:root[data-theme="dark"] .assistant-launcher,
:root[data-theme="dark"] .sbx-gate-cta { background: #0f766e; border-color: #0f766e; color: #fff; }
:root[data-theme="dark"] .step-btn-next:hover,
:root[data-theme="dark"] .login-button:hover { background: #0b5f58; border-color: #0b5f58; }
/* Form controls */
:root[data-theme="dark"] input,
:root[data-theme="dark"] select,
:root[data-theme="dark"] textarea { background-color: var(--surface); color: var(--ink); border-color: var(--line); }
:root[data-theme="dark"] input::placeholder,
:root[data-theme="dark"] textarea::placeholder { color: #6f838c; }
/* Map: dark ocean + legend */
:root[data-theme="dark"] .map-canvas,
:root[data-theme="dark"] .map-canvas svg { background: #10202a; }
:root[data-theme="dark"] .map-legend { background: rgba(21, 33, 39, 0.92); }
/* Cookie banner and dark overlays are already dark — keep them distinct */
:root[data-theme="dark"] .cookie-banner { background: #0a1114; border: 1px solid var(--line); }
/* Cost boxes, notes and status colours tuned for dark */
:root[data-theme="dark"] .cost-estimate.cost-paid { border-color: #6b5326; color: #f1c27d; }
:root[data-theme="dark"] .cost-estimate.cost-free { border-color: #275c3a; color: #7fdba4; }
:root[data-theme="dark"] .cost-estimate.cost-aging { border-color: #6b5326; }
:root[data-theme="dark"] .cost-estimate.cost-stale { border-color: #6b2c2c; }
:root[data-theme="dark"] .cost-freshness-fresh { color: #9aacb4; }
:root[data-theme="dark"] .cost-freshness-aging { color: #f0b664; }
:root[data-theme="dark"] .cost-freshness-stale { color: #f39a9a; }
:root[data-theme="dark"] .cost-note { opacity: .9; }
:root[data-theme="dark"] .demo-note { background: rgba(21, 33, 39, 0.85); }
/* Templates are documents: keep them on white "paper" so they match the PDF */
:root[data-theme="dark"] .tmpl-doc {
  --panel: #ffffff; --surface: #f7fafb; --ink: #162025; --muted: #61717a; --line: #d9e0e3;
  --teal: #0f766e; --teal-soft: #d9f0ed; --amber-soft: #f7ead8; --red-soft: #f6dddd; --green-soft: #dcfce7;
  background: #fff; color: #162025; color-scheme: light; border-radius: 8px; padding: 18px;
}
:root[data-theme="dark"] .tmpl-doc input,
:root[data-theme="dark"] .tmpl-doc select,
:root[data-theme="dark"] .tmpl-doc textarea { background-color: #fffbeb; color: #162025; border-color: #e6d9a8; }
/* Images/logos that were drawn for light backgrounds */
:root[data-theme="dark"] .gs-brand-logo { background: var(--surface); }

/* ═════════════ Avatar menu ═════════════ */
.gs-menu { position: fixed; z-index: 330; min-width: 240px; padding: 6px; background: var(--panel); color: var(--ink);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 40px rgba(0,0,0,.18); }
.gs-menu[hidden] { display: none; }
.gs-menu-head { display: grid; gap: 2px; padding: 10px 12px 8px; }
.gs-menu-head strong { font-size: 14px; }
.gs-menu-head span { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.gs-menu button, .gs-menu a { display: flex; align-items: center; width: 100%; min-height: 40px; padding: 0 12px; border: 0; border-radius: 8px;
  background: transparent; color: var(--ink); font: inherit; font-size: 14px; text-align: left; text-decoration: none; cursor: pointer; }
.gs-menu button:hover, .gs-menu a:hover, .gs-menu button:focus-visible, .gs-menu a:focus-visible { background: var(--surface); outline: none; }
.gs-menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }
.gs-menu-out { color: var(--red) !important; }

/* ═════════════ Settings view ═════════════ */
.gs-view { position: fixed; inset: 0; z-index: 310; display: grid; place-items: center; padding: 24px; background: rgba(8, 18, 22, 0.45); }
.gs-view[hidden] { display: none; }
body.gs-open { overflow: hidden; }
.gs-shell { display: grid; grid-template-columns: 220px 1fr; grid-template-rows: auto 1fr; width: min(1040px, 100%); height: min(760px, calc(100dvh - 48px));
  background: var(--bg); color: var(--ink); border-radius: 16px; overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,.3); }
.gs-head { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; background: var(--panel); border-bottom: 1px solid var(--line); }
.gs-head h2 { margin: 0; font-size: 20px; }
.gs-close { width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--surface); color: var(--ink); cursor: pointer; font-size: 15px; }
.gs-nav { display: flex; flex-direction: column; gap: 2px; padding: 12px; background: var(--panel); border-right: 1px solid var(--line); overflow-y: auto; }
.gs-nav button { min-height: 42px; padding: 0 14px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font: inherit; font-size: 14px; font-weight: 600; text-align: left; cursor: pointer; }
.gs-nav button:hover { background: var(--surface); color: var(--ink); }
.gs-nav button.active { background: var(--teal-soft); color: var(--teal); font-weight: 800; }
.gs-body { padding: 20px; overflow-y: auto; display: grid; align-content: start; gap: 14px; }
.gs-note { margin: 0; padding: 10px 14px; border-radius: 10px; background: var(--amber-soft); color: var(--ink); font-size: 13.5px; }
.gs-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.gs-card h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 16px; }
.gs-hint { margin: 6px 0; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.gs-hint code { font-size: 12.5px; word-break: break-all; }
.gs-form { display: grid; gap: 10px; }
.gs-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.gs-grid.one { grid-template-columns: minmax(0, 420px); }
.gs-form label, .gs-modal label, .gs-reauth label { display: grid; gap: 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
.gs-form input, .gs-form select, .gs-modal input, .gs-mfa-box input { min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); font: inherit; font-weight: 400; }
.gs-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 4px; }
.gs-actions .ghost-button, .gs-actions .step-btn-next, .gs-danger { min-height: 42px; text-decoration: none; display: inline-flex; align-items: center; }
.gs-msg { font-size: 13px; font-weight: 600; color: var(--teal); }
.gs-msg.bad { color: var(--red); }
.gs-on { color: var(--green); }
.gs-pill { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; background: var(--teal-soft); color: var(--teal); font-size: 11.5px; font-weight: 800; letter-spacing: .02em; }
.gs-pill.bad { background: var(--red-soft); color: var(--red); }
.gs-plan { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.gs-plan-name { font-size: 22px; font-weight: 800; }
.gs-team { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 6px; }
.gs-team li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.gs-team em { color: var(--muted); font-style: normal; font-size: 12.5px; margin-left: 6px; }
.gs-mfa-box { margin-top: 12px; padding: 14px; border: 1px dashed var(--line); border-radius: 10px; }
.gs-mfa-box img { background: #fff; padding: 6px; border-radius: 8px; }
.gs-themes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.gs-theme { position: relative; display: grid; gap: 4px; padding: 12px; border: 2px solid var(--line); border-radius: 12px; cursor: pointer; background: var(--surface); }
.gs-theme.on { border-color: var(--teal); }
.gs-theme input { position: absolute; opacity: 0; pointer-events: none; }
.gs-theme:focus-within { outline: 2px solid var(--teal); outline-offset: 2px; }
.gs-theme strong { font-size: 14px; }
.gs-theme > span:last-child { font-size: 12.5px; color: var(--muted); }
.gs-theme-swatch { display: grid; grid-template-columns: 1fr 2fr; grid-template-rows: 14px 1fr; gap: 4px; height: 72px; padding: 6px; border-radius: 8px; margin-bottom: 6px; }
.gs-theme-swatch i { border-radius: 4px; }
.gs-theme-swatch i:first-child { grid-column: 1 / -1; }
.gs-sw-light { background: #f5f7f8; } .gs-sw-light i { background: #fff; } .gs-sw-light i:first-child { background: #0d3349; }
.gs-sw-dark { background: #0d1519; } .gs-sw-dark i { background: #1a2930; } .gs-sw-dark i:first-child { background: #0b1418; }
.gs-sw-system { background: linear-gradient(135deg, #f5f7f8 50%, #0d1519 50%); } .gs-sw-system i { background: rgba(127,127,127,.35); } .gs-sw-system i:first-child { background: #0d3349; }
.gs-muted-card { opacity: .92; }
.gs-brand-preview { display: flex; align-items: center; gap: 16px; padding: 14px; border: 1px dashed var(--line); border-radius: 10px; margin: 8px 0; }
.gs-brand-logo { display: grid; place-items: center; width: 120px; height: 48px; border-radius: 8px; background: var(--surface); color: var(--muted); font-size: 12px; font-weight: 700; }
.gs-brand-colours { display: flex; gap: 8px; }
.gs-brand-colours i { width: 28px; height: 28px; border-radius: 50%; background: var(--line); }
.gs-switch { display: flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; }
.gs-switch input { width: 20px; height: 20px; accent-color: var(--teal); }
.gs-danger-card { border-color: color-mix(in srgb, var(--red) 40%, var(--line)); }
.gs-danger { padding: 0 16px; border: 1px solid var(--red); border-radius: 8px; background: transparent; color: var(--red); font: inherit; font-weight: 700; cursor: pointer; }
.gs-danger:disabled { opacity: .45; cursor: not-allowed; }
.gs-danger:not(:disabled):hover { background: var(--red-soft); }
.gs-modal { position: fixed; inset: 0; z-index: 420; display: grid; place-items: center; padding: 16px; background: rgba(8, 18, 22, .55); }
.gs-modal-card { width: min(460px, 100%); padding: 22px; border-radius: 14px; background: var(--panel); color: var(--ink); display: grid; gap: 10px; }
.gs-modal-card h3 { margin: 0; }

/* Tablet portrait: sections become a tab strip */
@media (max-width: 900px) {
  .gs-view { padding: 12px; }
  .gs-shell { grid-template-columns: 1fr; grid-template-rows: auto auto 1fr; height: calc(100dvh - 24px); }
  .gs-nav { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 8px; scrollbar-width: none; }
  .gs-nav::-webkit-scrollbar { display: none; }
  .gs-nav button { flex: 0 0 auto; border-radius: 999px; }
}
/* Phone: full-screen, single column */
@media (max-width: 600px) {
  .gs-view { padding: 0; }
  .gs-shell { width: 100%; height: 100dvh; border-radius: 0; }
  .gs-body { padding: 12px 12px calc(16px + env(safe-area-inset-bottom)); }
  .gs-grid, .gs-themes { grid-template-columns: 1fr; }
  .gs-themes .gs-theme { grid-template-columns: 72px 1fr; align-items: center; column-gap: 12px; }
  .gs-themes .gs-theme-swatch { grid-row: span 2; height: 48px; margin: 0; }
}
/* Hide the retired "Your workspace" side panel */
#profilePanel { display: none !important; }

/* ── Team workspaces (Oct 2026) ── */
.gs-row-actions { display: inline-flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.step-btn-next.small { padding: 6px 12px; font-size: 13px; min-height: 32px; }
.gs-ws-bar { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 900; display: flex; align-items: center; gap: 12px; padding: 8px 10px 8px 16px; border-radius: 999px; background: var(--panel, #fff); border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(15, 32, 40, .14); font-size: 13.5px; color: var(--ink); max-width: calc(100vw - 32px); }
.gs-invite-toast { position: fixed; right: 16px; bottom: 16px; z-index: 950; width: min(360px, calc(100vw - 32px)); padding: 16px; border-radius: 12px; background: var(--panel, #fff); border: 1px solid var(--line); box-shadow: 0 12px 32px rgba(15, 32, 40, .18); color: var(--ink); }
.gs-invite-toast p { margin: 0 0 10px; }
@media (max-width: 600px) { .gs-ws-bar { border-radius: 12px; bottom: 10px; font-size: 12.5px; } }
/* Accessibility: AA contrast for small badges in dark mode */
:root[data-theme="dark"] .sidenav-badge { color: #04302b; }
:root[data-theme="dark"] .login-pricing-badge { color: #2a1a05; }
