/* work-fast — glass theme (loaded after style.css / auth.css)
   Dark is the default; html[data-theme="light"] switches to the light glass
   variant. Everything is token-driven so both themes stay in sync. */

/* ============================================================ */
/* 1. Tokens                                                     */
/* ============================================================ */
:root {
  color-scheme: dark;

  --bg: #070a12;
  --bg-2: #0d1322;
  --blob-1: rgba(79, 141, 247, .55);
  --blob-2: rgba(139, 92, 246, .42);
  --blob-3: rgba(34, 211, 238, .30);

  --panel: rgba(255, 255, 255, .040);
  --panel-2: rgba(255, 255, 255, .085);
  --panel-solid: #10141f;
  --border: rgba(255, 255, 255, .12);
  --stroke: rgba(255, 255, 255, .10);
  --line: rgba(255, 255, 255, .18);
  --stroke-strong: rgba(255, 255, 255, .18);
  --highlight: rgba(255, 255, 255, .10);

  --text: #e9eefb;
  --muted: #a7b3ca;
  --accent: #5b9dff;
  --accent-2: #3b7de0;
  --accent-soft: rgba(91, 157, 255, .14);
  --ok: #43cf8b;
  --warn: #f2bb3d;
  --err: #f4707c;

  --glass-top: rgba(255, 255, 255, .085);
  --glass-bottom: rgba(255, 255, 255, .015);
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23g)' opacity='0.055'/%3E%3C/svg%3E");
  --radius: 14px;
  --radius-sm: 10px;
  --blur: 20px;
  --sat: 150%;
  --shadow: 0 18px 45px rgba(0, 0, 0, .45);
  --shadow-sm: 0 8px 22px rgba(0, 0, 0, .32);
  --ring: 0 0 0 3px rgba(91, 157, 255, .22);

  /* code / editor surfaces (overridden in light) */
  --code-bg: rgba(6, 9, 16, .55);
  --code-text: #d9e4f7;
  --row-hover: rgba(255, 255, 255, .05);
  --active-row: rgba(91, 157, 255, .16);
}

html[data-theme="light"] {
  color-scheme: light;

  --bg: #e8eefb;
  --bg-2: #f4f7ff;
  --blob-1: rgba(37, 99, 235, .60);
  --blob-2: rgba(124, 58, 237, .48);
  --blob-3: rgba(14, 165, 233, .48);

  --panel: rgba(255, 255, 255, .44);
  --panel-2: rgba(255, 255, 255, .78);
  --panel-solid: #ffffff;
  --border: rgba(17, 34, 68, .12);
  --stroke: rgba(255, 255, 255, .85);
  --line: rgba(17, 34, 68, .18);
  --stroke-strong: rgba(17, 34, 68, .14);
  --highlight: rgba(255, 255, 255, .9);

  --text: #101a2e;
  --muted: #55617c;
  --accent: #2f6fd0;
  --accent-2: #245bb0;
  --accent-soft: rgba(47, 111, 208, .12);
  --ok: #16a165;
  --warn: #b7761a;
  --err: #d8455a;

  --shadow: 0 18px 40px rgba(23, 42, 84, .14);
  --shadow-sm: 0 8px 20px rgba(23, 42, 84, .10);
  --ring: 0 0 0 3px rgba(47, 111, 208, .20);

  --glass-top: rgba(255, 255, 255, .78);
  --glass-bottom: rgba(255, 255, 255, .20);
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23g)' opacity='0.035'/%3E%3C/svg%3E");
  --code-bg: rgba(255, 255, 255, .75);
  --code-text: #17325c;
  --row-hover: rgba(47, 111, 208, .06);
  --active-row: rgba(47, 111, 208, .12);
}

/* ============================================================ */
/* 2. Ambient background                                         */
/* ============================================================ */
html { background: var(--bg); }

/* the body itself stays transparent - every layer of the backdrop lives on the
   fixed pseudo-element below, so translucent panels really do refract it.
   (A body background paints over a negative z-index pseudo and kills the effect.) */
body { background: transparent; min-height: 100vh; }

/* the coloured blobs the glass panels refract */
body::before {
  content: "";
  position: fixed;
  inset: -140px;              /* overscan so the blur never fades at the edges */
  z-index: -1;
  pointer-events: none;
  /* blobs first (painted on top), base wash last (painted underneath) */
  background:
    radial-gradient(46rem 38rem at 14% 6%, var(--blob-1), transparent 60%),
    radial-gradient(40rem 34rem at 90% 10%, var(--blob-2), transparent 62%),
    radial-gradient(52rem 40rem at 78% 92%, var(--blob-3), transparent 60%),
    radial-gradient(34rem 30rem at 2% 86%, var(--blob-2), transparent 64%),
    radial-gradient(20rem 34rem at 3% 42%, var(--blob-1), transparent 68%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 55%, var(--bg) 100%);
  filter: blur(60px) saturate(135%);
}

/* ============================================================ */
/* 3. Shared glass surface                                       */
/* ============================================================ */
.panel,
.sidebar,
.stat,
.auth-card,
.modal,
.dropdown,
.toast,
.trial-banner,
.subscribe-banner,
.plan-option,
.backup-panel,
.email-meta,
.warnings,
.callout,
.notice,
.alert,
.history-items,
.employer-rows,
.profile-grid {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(var(--blur)) saturate(var(--sat));
  -webkit-backdrop-filter: blur(var(--blur)) saturate(var(--sat));
}

/* top highlight line — the "polished glass" cue */
.panel,
.sidebar,
.stat,
.auth-card,
.modal,
.dropdown,
.toast,
.trial-banner,
.subscribe-banner,
.plan-option,
.nav,
.backup-panel {
  background-color: var(--panel);
  background-image: var(--grain), linear-gradient(160deg, var(--glass-top), var(--glass-bottom));
}

.panel::after,
.sidebar::after,
.auth-card::after,
.modal::after,
.toast::after,
.plan-option::after {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--highlight), transparent);
  border-radius: inherit;
  pointer-events: none;
}

.panel,
.auth-card,
.modal { border-radius: var(--radius); }

.panel { padding: 20px; }

.history-items,
.employer-rows,
.profile-grid,
.email-meta,
.warnings,
.callout,
.notice,
.alert { box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }

.warnings,
.callout,
.notice,
.alert,
.email-meta { background: var(--panel-2); }

/* ============================================================ */
/* 4. Sidebar shell (left navigation)                            */
/* ============================================================ */
.app-shell {
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 18px;
  height: calc(100vh - 36px);
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px 14px;
  overflow: hidden auto;
  border-radius: 20px;
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 8px 14px;
  border-bottom: 1px solid var(--line);
}
.side-brand h1 { margin: 0; font-size: 15px; letter-spacing: .2px; }
.side-brand .sub { margin: 3px 0 0; font-size: 11px; line-height: 1.35; }
.side-brand .logo { height: 30px; max-width: 118px; }

.sidenav {
  display: flex;
  flex-direction: column;
  gap: 5px;
  border: none;
  margin: 0;
  padding: 0;
}

.main-tabs.sidenav .tab {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 11px 13px;
  font-size: 13.5px;
  font-weight: 500;
  text-align: left;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
}

.main-tabs.sidenav .tab svg { width: 17px; height: 17px; flex: 0 0 17px; opacity: .9; }

.main-tabs.sidenav .tab:hover {
  color: var(--text);
  background: var(--panel-2);
  border-color: var(--line);
  transform: translateX(2px);
}

.main-tabs.sidenav .tab.active {
  color: var(--text);
  background: linear-gradient(135deg, var(--accent-soft), rgba(255, 255, 255, .04));
  border-color: var(--stroke-strong);
  box-shadow: inset 0 1px 0 var(--highlight), 0 6px 18px rgba(0, 0, 0, .22);
}
.main-tabs.sidenav .tab.active svg { opacity: 1; color: var(--accent); }

.side-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.side-foot .status { display: flex; flex-direction: column; gap: 8px; }

.side-foot .user-btn {
  width: 100%;
  justify-content: space-between;
  text-align: left;
  padding: 9px 12px;
  cursor: pointer;
}

.side-foot .badge { width: 100%; text-align: center; padding: 6px 10px; }

.side-actions { display: flex; gap: 8px; }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--muted);
  font-size: 12.5px;
  cursor: pointer;
  flex: 1;
  transition: color .18s ease, border-color .18s ease, background .18s ease;
}
.theme-toggle:hover { color: var(--text); border-color: var(--stroke-strong); }
.theme-toggle svg { width: 16px; height: 16px; }
.theme-toggle .ico { display: inline-flex; }
/* show the mode you would switch to */
html:not([data-theme="light"]) .theme-toggle .moon,
html:not([data-theme="light"]) .theme-toggle .t-dark,
html[data-theme="light"] .theme-toggle .sun,
html[data-theme="light"] .theme-toggle .t-light { display: none; }

.user-menu { position: relative; }
.side-foot .user-menu { display: block; }
.side-foot .dropdown { bottom: calc(100% + 8px); top: auto; right: 0; left: 0; }

/* collapse control (top of the sidebar) */
.nav-collapse {
  margin-left: auto;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--muted);
  cursor: pointer;
  transition: color .18s ease, border-color .18s ease, background .18s ease;
}
.nav-collapse:hover { color: var(--text); border-color: var(--stroke-strong); background: var(--panel); }
.nav-collapse svg { width: 15px; height: 15px; min-width: 15px; flex: 0 0 15px; transition: transform .24s ease; }

/* account chip */
.user-avatar {
  display: none;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .02em;
}

.nav-scrim {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(3, 5, 10, .55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

/* ============================================================ */
/* 4b. Icon rail — the sidebar tucked down to icons              */
/* ============================================================ */
html.nav-collapsed .app-shell { grid-template-columns: 78px minmax(0, 1fr); }
html.nav-collapsed .sidebar { padding: 16px 10px; overflow: visible; }
html.nav-collapsed .side-brand { flex-direction: column; gap: 9px; padding: 4px 0 12px; }
html.nav-collapsed .side-brand .logo { height: 24px; max-width: 44px; object-fit: contain; }
html.nav-collapsed .brand-text { display: none; }
html.nav-collapsed .nav-collapse svg { transform: rotate(180deg); }
html.nav-collapsed .nav-collapse { margin-left: 0; }

html.nav-collapsed .main-tabs.sidenav .tab {
  position: relative;
  justify-content: center;
  gap: 0;
  padding: 11px 0;
  transform: none;
}
html.nav-collapsed .main-tabs.sidenav .tab > span { display: none; }
html.nav-collapsed .main-tabs.sidenav .tab svg { width: 18px; height: 18px; flex: 0 0 18px; }

/* the label rides out on hover / keyboard focus */
html.nav-collapsed .main-tabs.sidenav .tab::after,
html.nav-collapsed .side-foot .user-btn::after,
html.nav-collapsed .theme-toggle::after,
html.nav-collapsed #gmail-badge::after {
  content: attr(data-label);
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%) translateX(-4px);
  padding: 6px 10px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--panel-solid);
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  box-shadow: var(--shadow-sm);
  transition: opacity .16s ease, transform .16s ease;
  z-index: 60;
}
html.nav-collapsed .main-tabs.sidenav .tab:hover::after,
html.nav-collapsed .main-tabs.sidenav .tab:focus-visible::after,
html.nav-collapsed .side-foot .user-btn:hover::after,
html.nav-collapsed .theme-toggle:hover::after,
html.nav-collapsed #gmail-badge:hover::after { opacity: 1; transform: translateY(-50%) translateX(0); }

html.nav-collapsed .side-foot .user-btn,
html.nav-collapsed .theme-toggle { position: relative; justify-content: center; padding: 9px 0; }
html.nav-collapsed .side-foot .user-btn #user-name,
html.nav-collapsed .side-foot .user-btn .caret,
html.nav-collapsed .theme-toggle .t-light,
html.nav-collapsed .theme-toggle .t-dark { display: none; }
html.nav-collapsed .user-avatar { display: inline-flex; }
html.nav-collapsed #gmail-badge {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0;
  font-size: 0;
}
html.nav-collapsed #gmail-badge::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
}
html.nav-collapsed .side-foot .dropdown { left: 0; right: auto; width: 236px; }

/* ============================================================ */
/* 5. Content area                                               */
/* ============================================================ */
main { padding: 0; }

.app-main { grid-column: 2; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.app-main .view { max-width: none; }

.view > .panel + .panel,
.view > .panel + .settings-layout,
.view > .settings-layout + .panel,
.view > .credentials-panel + .credentials-panel { margin-top: 16px; }

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

/* ============================================================ */
/* 6. Component skins                                            */
/* ============================================================ */
.panel h2 { color: var(--muted); letter-spacing: .08em; }

input, textarea, select {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: var(--ring);
  background: var(--panel);
}
select option { background: var(--panel-solid); color: var(--text); }

button.primary, .btn.primary, .primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: 1px solid rgba(255, 255, 255, .18);
  color: #fff;
  box-shadow: 0 10px 26px rgba(47, 111, 208, .30);
}
button.primary:hover, .btn.primary:hover, .primary:hover { filter: brightness(1.07); }

button.ghost, .btn, .ghost {
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--text);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
button.ghost:hover, .btn:hover, .ghost:hover { border-color: var(--stroke-strong); }

.badge {
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--muted);
}
.badge.ok { color: var(--ok); border-color: rgba(67, 207, 139, .40); }
.badge.bad { color: var(--err); border-color: rgba(244, 112, 124, .40); }
.badge.warn { color: var(--warn); border-color: rgba(242, 187, 61, .40); }

.tabs { border-bottom: 1px solid var(--line); }
.tabs .tab {
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  color: var(--muted);
}
.tabs .tab.active { color: var(--text); border-color: var(--line); border-bottom-color: transparent; background: var(--panel-2); }

.stat {
  padding: 15px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-radius: var(--radius-sm);
}
.stat-label { color: var(--muted); font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; }
.stat-value { font-size: 22px; font-weight: 600; }

.table-wrap { border-radius: var(--radius-sm); }
table.jobs thead th {
  background: var(--panel-2);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
table.jobs td { border-bottom: 1px solid var(--line); }
table.jobs tr:hover td { background: var(--row-hover); }

.history-item, .settings-item { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.history-item.active, .settings-item.active { border-color: var(--accent); background: var(--active-row); }

.pill.queued     { background: rgba(154, 164, 178, .16); color: var(--muted); border-color: var(--stroke-strong); }
.pill.processing { background: rgba(242, 187, 61, .14); color: var(--warn); border-color: rgba(242, 187, 61, .35); }
.pill.sent       { background: rgba(67, 207, 139, .14); color: var(--ok); border-color: rgba(67, 207, 139, .35); }
.pill.failed     { background: rgba(244, 112, 124, .14); color: var(--err); border-color: rgba(244, 112, 124, .35); }

.plan-option { padding: 18px; }
.plan-option.featured { border-color: rgba(91, 157, 255, .55); background: linear-gradient(160deg, var(--accent-soft), var(--panel)); }
.save-tag { background: rgba(67, 207, 139, .16); color: var(--ok); }

.doc-view, .editor, pre {
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--code-text);
}
.doc-view.code, code { color: var(--code-text); }

.modal-backdrop { background: rgba(4, 7, 14, .60); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
html[data-theme="light"] .modal-backdrop { background: rgba(20, 32, 58, .32); }

.dropdown {
  background: var(--panel);
  border: 1px solid var(--stroke-strong);
  box-shadow: var(--shadow);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.dropdown-item { color: var(--text); background: transparent; }
.dropdown-item:hover { background: var(--panel-2); }
.dropdown-item.danger { color: var(--err); }
.dropdown-head { border-bottom: 1px solid var(--line); }

.toast {
  background: var(--panel);
  border: 1px solid var(--stroke-strong);
  color: var(--text);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}
.toast.ok { border-color: rgba(67, 207, 139, .45); }
.toast.err { border-color: rgba(244, 112, 124, .45); }

.trial-banner {
  background: linear-gradient(135deg, var(--accent-soft), var(--panel));
  border-color: rgba(91, 157, 255, .40);
}
.trial-banner .trial-badge, .trial-pill { color: var(--text); }

.warnings {
  background: rgba(242, 187, 61, .14);
  border-color: rgba(242, 187, 61, .45);
  color: #f6d68f;
}
.warnings.error {
  border-color: rgba(244, 112, 124, .45);
  background: rgba(244, 112, 124, .12);
  color: var(--err);
}
/* the amber strip was unreadable on the light glass panel */
html[data-theme="light"] .warnings {
  background: rgba(178, 116, 0, .12);
  border-color: rgba(178, 116, 0, .40);
  color: #7a4d00;
}
html[data-theme="light"] .warnings.error {
  background: rgba(190, 40, 55, .09);
  border-color: rgba(190, 40, 55, .36);
  color: #a3182a;
}

/* secondary / ghost controls get a light glass fill — NEVER the primary CTA,
   whose white label would then sit on a white fill (invisible button). */
html[data-theme="light"] button.ghost,
html[data-theme="light"] .btn:not(.primary),
html[data-theme="light"] .ghost:not(.primary),
html[data-theme="light"] .theme-toggle,
html[data-theme="light"] .side-foot .user-btn {
  background: linear-gradient(180deg, #ffffff, #edf2fc);
  box-shadow: 0 2px 7px rgba(23, 42, 84, .12);
}

/* primary CTAs keep the accent gradient + white label in both themes */
.btn.primary,
html[data-theme="light"] .btn.primary,
html[data-theme="light"] a.btn.primary,
html[data-theme="light"] button.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  background-image: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  border-color: rgba(255, 255, 255, .18);
}

/* the one intentionally white button (Google brand) */
.google-btn { box-shadow: var(--shadow-sm); border-radius: var(--radius-sm); }

/* ============================================================ */
/* 7. Marketing + auth pages                                     */
/* ============================================================ */
.nav {
  position: sticky;
  top: 12px;
  z-index: 20;
  margin: 12px auto 0;
  padding: 10px 18px;
  max-width: 1180px;
  border-radius: 18px;
  background-color: var(--panel);
  background-image: var(--grain), linear-gradient(160deg, var(--glass-top), var(--glass-bottom));
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(var(--blur)) saturate(var(--sat));
  -webkit-backdrop-filter: blur(var(--blur)) saturate(var(--sat));
}
.nav-links { gap: 8px; }

.auth-card {
  border-radius: 22px;
  padding: 34px;
}
.auth-wrap { position: relative; }
.auth-top-right {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 30;
  display: flex;
  gap: 8px;
}
.auth-top-right .theme-toggle { flex: 0 0 auto; }

.legal p, .legal li { color: var(--muted); }
.legal {
  background-color: var(--panel);
  background-image: var(--grain), linear-gradient(160deg, var(--glass-top), var(--glass-bottom));
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(var(--blur)) saturate(var(--sat));
  -webkit-backdrop-filter: blur(var(--blur)) saturate(var(--sat));
}

.footer { border-top: 1px solid var(--line); color: var(--muted); }

/* ============================================================ */
/* 8. Responsive                                                 */
/* ============================================================ */
@media (max-width: 1180px) {
  .app-shell { grid-template-columns: 236px minmax(0, 1fr); gap: 14px; padding: 14px; }
  .sidebar { top: 14px; height: calc(100vh - 28px); }
}

@media (max-width: 900px) {
  /* the rail keeps its column; expanding it floats a labelled panel on top */
  .app-shell { grid-template-columns: 78px minmax(0, 1fr); padding: 14px; }
  .nav-scrim { display: none; }
  html:not(.nav-collapsed) .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 268px;
    max-width: 84vw;
    border-radius: 0 20px 20px 0;
    z-index: 35;
    background: var(--panel-solid);
    box-shadow: var(--shadow);
  }
  html:not(.nav-collapsed) .nav-scrim { display: block; }
  .nav { top: 10px; margin: 10px 12px 0; padding: 10px 14px; }
  .auth-top-right { position: static; justify-content: flex-end; margin: 12px 12px 0; }
}

@media (max-width: 620px) {
  .app-shell, html.nav-collapsed .app-shell { grid-template-columns: 62px minmax(0, 1fr); }
  html.nav-collapsed .sidebar { padding: 14px 7px; }
  html:not(.nav-collapsed) .sidebar { width: 84vw; }
  .brand .sub { display: none; }
}

/* ============================================================ */
/* 9. Fallbacks                                                  */
/* ============================================================ */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .panel, .sidebar, .stat, .auth-card, .modal, .dropdown, .toast, .nav { background: var(--panel-solid); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

@media print {
  body::before, .sidebar, .nav-collapse, .nav-scrim { display: none !important; }
}

/* ==========================================================================
   8. landing — the playbook ("more calls, not more applications")
   ========================================================================== */
.playbook { max-width: 1180px; margin: 0 auto; padding: 6px 32px 70px; }
.playbook-inner {
  text-align: center;
  padding: 42px 42px 38px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background-color: var(--panel);
  background-image: var(--grain), linear-gradient(160deg, var(--glass-top), var(--glass-bottom));
  box-shadow: var(--shadow);
  backdrop-filter: blur(var(--blur)) saturate(var(--sat));
  -webkit-backdrop-filter: blur(var(--blur)) saturate(var(--sat));
}
.playbook .eyebrow {
  margin: 0 0 10px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
}
.playbook h2 {
  margin: 0 0 12px;
  font-size: clamp(24px, 3.3vw, 34px);
  letter-spacing: -.4px;
  color: var(--text);
}
.playbook .lede {
  max-width: 730px;
  margin: 0 auto;
  font-size: 16px;
  line-height: 1.62;
  color: var(--muted);
}
.playbook-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(238px, 1fr));
  gap: 16px;
  margin: 30px 0 26px;
  text-align: left;
}
.play-card {
  padding: 20px 22px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background-color: var(--panel-2);
  background-image: linear-gradient(160deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, 0));
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
}
html[data-theme="light"] .play-card {
  background-image: linear-gradient(160deg, rgba(255, 255, 255, .55), rgba(255, 255, 255, 0));
}
.play-card h3 { margin: 0 0 8px; font-size: 16px; color: var(--text); }
.play-card p { margin: 0; font-size: 14.5px; line-height: 1.62; color: var(--muted); }
.play-callout {
  max-width: 760px;
  margin: 0 auto 22px;
  font-size: 17px;
  line-height: 1.55;
  color: var(--text);
}
.play-callout strong { color: var(--accent); }
.play-cta { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
@media (max-width: 760px) {
  .playbook { padding: 4px 18px 50px; }
  .playbook-inner { padding: 26px 20px 24px; border-radius: 18px; }
}

/* Profile list fields: keep the row controls readable in the light theme */
html[data-theme="light"] .row-remove { border-color: #e3bcc4; color: var(--err); }

html[data-theme="light"] .row-remove:hover:not(:disabled) { border-color: var(--err); }

html[data-theme="light"] .field-count { color: var(--muted); }
