/* ============================================================
   CareerDoc — Design System (v2 + live compat)
   ============================================================ */

/* Visually hidden but present for screen readers / SEO (e.g. a page's
   semantic H1 on layouts where a visible heading doesn't fit the design). */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---------- CSS Variables — CareerDoc app, brain design ---------- */
:root {
  --bg: #05070c;
  --surface: #0b111b;
  --surface-glass: rgba(9, 14, 22, 0.72);
  --surface2: #0f1622;
  --border: rgba(159, 196, 232, 0.14);
  --border2: rgba(159, 196, 232, 0.22);
  --text: #e8eef6;
  --text2: #c2cede;
  --muted: #9fb0c4;
  --muted2: #6b7f96;
  --accent: #2f63c4;
  --accent2: #33bcf8;
  --accent2-bright: #57c9fb;
  --accentg: linear-gradient(135deg, #2f63c4, #33bcf8);
  --sidebar-bg: rgba(6, 9, 15, 0.72);

  --success: #4fbb86;
  --warn: #d69c50;
  --warning: #d69c50;
  --danger: #e3776f;
  --info: #33bcf8;

  --shadow-sm: 0 1px 3px rgba(0,0,0,.4);
  --shadow: 0 8px 26px -10px rgba(0,0,0,.6);
  --shadow-md: 0 8px 26px -10px rgba(0,0,0,.6);
  --shadow-lg: 0 26px 60px -22px rgba(0,0,0,.7);
  --shadow-xl: 0 40px 110px -28px rgba(0,0,0,.8);
  --glow: inset 0 1px 0 rgba(255,255,255,.05);

  --nav-active-bg: rgba(51,188,248,.14);
  --nav-active-border: #33bcf8;
  --nav-hover-bg: rgba(159,196,232,.06);

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 18px;
  --sidebar-w: 248px;
  --header-h: 60px;
  --transition: 0.18s ease;
  --bg2: var(--surface2);
}

/* Instrument Sans for headings — the landing's display face */
h1, h2, h3, .page-title, .card-title, .modal-title, .stat-value, .brand-name, .cd-hero-title {
  font-family: 'Instrument Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  letter-spacing: -0.015em;
}

/* ---------- Ambient 3D background (bg.js) ---------- */
#bg-3d {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  animation: bgfade 1.4s ease .25s both;
}
#bg-3d canvas { display: block; }
#bg-scrim {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(120% 85% at 84% 10%, transparent 0%, rgba(5,7,12,.16) 42%, rgba(5,7,12,.6) 100%),
    linear-gradient(180deg, rgba(5,7,12,.26) 0%, rgba(5,7,12,.45) 55%, rgba(5,7,12,.9) 100%);
}
/* keep the sidebar and the main reading column legible over the shape */
#bg-scrim::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: calc(var(--sidebar-w) + 470px);
  background: linear-gradient(to right, #05070c 34%, rgba(5,7,12,.72) 60%, transparent);
}
@keyframes bgfade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { #bg-3d { animation: none; opacity: 1; } }
body[data-bg] .app-layout { position: relative; z-index: 1; }
/* the old flat SVG decoration is replaced by bg.js on these pages */
.bg-canvas { display: none !important; }

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent2); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea, button { font-size: inherit; }
img { max-width: 100%; }
ul, ol { list-style: none; }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

/* ---------- App Layout ---------- */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  backdrop-filter: blur(20px) saturate(1.3);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 200;
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform var(--transition);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  text-decoration: none;
  cursor: pointer;
  transition: opacity var(--transition);
}
.sidebar-brand:hover { opacity: 0.75; }

.cd-logo { width: 24px; height: 20px; flex-shrink: 0; }

.brand-name {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text);
}
.brand-name span { color: var(--accent2); }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 10px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border2) transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--muted2);
  padding: 14px 18px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  height: 44px;
  padding: 0 16px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  white-space: nowrap;
}

.nav-item:hover {
  background: var(--nav-hover-bg);
  color: var(--text2);
  text-decoration: none;
}

.nav-item.active {
  background: var(--nav-active-bg);
  color: var(--accent);
  border-left-color: var(--nav-active-border);
  font-weight: 600;
}

.nav-item.active { color: var(--accent2); }

.nav-icon { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.7; }
.nav-item.active .nav-icon { opacity: 1; }

/* ---------- User Area ---------- */
.sidebar-user {
  border-top: 1px solid var(--border);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  flex-shrink: 0;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  letter-spacing: 0.3px;
}

.user-info { flex: 1; min-width: 0; }

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-plan { font-size: 11px; color: var(--muted2); }

.settings-gear {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.settings-gear:hover {
  background: var(--surface2);
  border-color: var(--border);
  color: var(--text2);
}

.settings-gear svg { width: 15px; height: 15px; }

/* ---------- Settings Popover ---------- */
.settings-popover {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 10px;
  width: 210px;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 500;
  overflow: hidden;
  opacity: 0;
  transform: translateY(6px) scale(.97);
  pointer-events: none;
  transition: opacity .15s ease, transform .15s ease;
}

.settings-popover.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.settings-popover-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 15px;
  font-size: 13px;
  color: var(--text2);
  font-weight: 500;
  text-decoration: none;
  transition: background var(--transition);
}

.settings-popover-item:hover { background: var(--surface2); text-decoration: none; }

.settings-signout {
  color: var(--danger) !important;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---------- Toggle Switch ---------- */
.toggle-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 38px;
  height: 22px;
  cursor: pointer;
  flex-shrink: 0;
}

.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border2);
  border-radius: 22px;
  transition: background .2s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}

.toggle-switch input:checked + .toggle-slider { background: var(--accent2); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(16px); }

/* ---------- Main Content ---------- */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.main-inner {
  flex: 1;
  padding: 28px 30px;
  max-width: 1300px;
  width: 100%;
}

/* ---------- Page Header ---------- */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.4px;
}

.page-subtitle {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 18px;
  height: 38px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  border: 1px solid transparent;
  text-decoration: none;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition), color var(--transition), opacity var(--transition), transform .12s ease;
  white-space: nowrap;
  letter-spacing: 0.1px;
  cursor: pointer;
  font-family: inherit;
}

.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn svg { width: 15px; height: 15px; flex-shrink: 0; }

.btn-primary {
  background: var(--accent2);
  color: #04121e;
  border-color: var(--accent2);
}
.btn-primary:hover:not(:disabled) {
  background: var(--accent2-bright);
  border-color: var(--accent2-bright);
  color: #04121e;
  text-decoration: none;
}

.btn-cyan, .btn-save {
  background: var(--accent2);
  color: #04121e;
  border-color: var(--accent2);
}
.btn-cyan:hover:not(:disabled), .btn-save:hover:not(:disabled) {
  background: var(--accent2-bright);
  border-color: var(--accent2-bright);
  color: #04121e;
  text-decoration: none;
}

.btn-ghost {
  background: transparent;
  color: #cdd9e8;
  border-color: rgba(159,196,232,.28);
}
.btn-ghost:hover:not(:disabled) {
  background: rgba(159,196,232,.07);
  border-color: rgba(159,196,232,.5);
  color: var(--text);
  text-decoration: none;
}

.btn-danger {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger);
}
.btn-danger:hover:not(:disabled) {
  background: rgba(220,38,38,.07);
  text-decoration: none;
}

.btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; }
.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Hero panel (page header + optional stats) — all pages ---------- */
.dash-hero-panel {
  position: relative;
  background: var(--surface-glass);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  backdrop-filter: blur(16px) saturate(1.2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 24px 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow), var(--glow);
  z-index: 0;
  overflow: hidden;
}
.dash-hero-panel::before {
  content: '';
  position: absolute;
  right: -80px; top: -120px;
  width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(51,188,248,.12), transparent 65%);
  pointer-events: none;
}

.dash-hero-panel .page-title {
  color: #f4f8fd;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,.4));
}
.dash-hero-panel .page-subtitle {
  color: var(--muted);
  text-shadow: none;
}

/* stat cards inside panel: no extra bottom margin */
.dash-hero-panel .stats-row,
.dash-hero-panel .stats {
  margin-bottom: 0;
}

/* Separator between header and stats when both present */
.dash-hero-panel .page-header {
  margin-bottom: 18px;
}

.stats-row, .stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface-glass);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm), var(--glow);
  display: flex;
  align-items: flex-start;
  gap: 14px;
  transition: box-shadow var(--transition), border-color var(--transition);
}

.stat-card:hover { box-shadow: var(--shadow), var(--glow); border-color: var(--border2); }

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon svg { width: 18px; height: 18px; }
.stat-icon.navy  { background: rgba(12,36,97,.1);   color: var(--accent); }
.stat-icon.cyan  { background: rgba(25,200,226,.12); color: var(--accent2); }
.stat-icon.green { background: rgba(22,163,74,.1);   color: #16A34A; }
.stat-icon.amber { background: rgba(217,119,6,.1);   color: #D97706; }

.stat-icon.navy  { background: rgba(40,85,184,.18); }
.stat-icon.cyan  { background: rgba(25,200,226,.14); }
.stat-icon.green { background: rgba(22,163,74,.14); }
.stat-icon.amber { background: rgba(217,119,6,.14); }

.stat-body { flex: 1; min-width: 0; }

.stat-value, .stat-val {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
  line-height: 1;
}

.stat-label {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
  font-weight: 500;
}

/* ---------- Card ---------- */
.card {
  background: var(--surface-glass);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  backdrop-filter: blur(16px) saturate(1.2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm), var(--glow);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.card-body { padding: 20px; }

/* ---------- Pipeline Tabs ---------- */
.pipeline-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.pipeline-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  background: var(--surface);
  border: 1.5px solid var(--border2);
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  white-space: nowrap;
  font-family: inherit;
}

.pipeline-tab:hover {
  background: var(--surface2);
  color: var(--text2);
}

.pipeline-tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  font-weight: 600;
}

.pipeline-tab.active {
  background: var(--accent2);
  color: #0A1628;
  border-color: var(--accent2);
}

.pipeline-tab .tab-count {
  background: rgba(255,255,255,.22);
  color: inherit;
  border-radius: 999px;
  font-size: 11px;
  padding: 1px 7px;
  font-weight: 700;
}

.pipeline-tab:not(.active) .tab-count {
  background: var(--bg);
  color: var(--muted2);
}

/* ---------- Filter Bar ---------- */
.filter-bar, .filter-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.filter-input {
  height: 38px;
  padding: 0 12px;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color var(--transition);
  font-family: inherit;
  width: 240px;
}

.filter-select {
  height: 38px;
  padding: 0 12px;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  outline: none;
  cursor: pointer;
  font-family: inherit;
}

.filter-input:focus, .filter-select:focus { border-color: var(--accent2); }

/* ---------- Form Controls ---------- */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 16px;
}

.form-group:last-child { margin-bottom: 0; }

label, .label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: 7px;
}

.input,
input[type=text],
input[type=email],
input[type=password],
input[type=tel],
input[type=url],
input[type=number],
select,
textarea {
  width: 100%;
  padding: 10px 13px;
  background: var(--surface2);
  border: 1.5px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  appearance: none;
  -webkit-appearance: none;
}

.input:focus,
input[type=text]:focus,
input[type=email]:focus,
input[type=password]:focus,
input[type=tel]:focus,
input[type=url]:focus,
select:focus,
textarea:focus {
  border-color: var(--accent2);
  box-shadow: 0 0 0 3px rgba(25,200,226,.14);
}

.input::placeholder,
input::placeholder,
textarea::placeholder { color: var(--muted2); }

textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.6;
  padding: 10px 13px;
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2366708A'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}

.input-sm { height: 34px; font-size: 13px; padding: 0 10px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* ---------- Table ---------- */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
  font-size: 13px;
}

thead tr {
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
}

th {
  text-align: left;
  padding: 11px 16px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  white-space: nowrap;
}

td {
  padding: 13px 16px;
  font-size: 13.5px;
  color: var(--text2);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }

tbody tr {
  cursor: pointer;
  transition: background var(--transition);
}

tbody tr:hover { background: var(--surface2); }

.td-company { font-weight: 600; color: var(--text); }
.td-role    { color: var(--text2); }
.td-location { color: var(--muted); font-size: 13px; }
.td-date    { color: var(--muted); font-size: 13px; white-space: nowrap; }
.td-actions { white-space: nowrap; }

/* Row tints */
tr.row-saved       { background: rgba(37,99,235,.04); }
tr.row-applied     { background: rgba(16,185,129,.04); }
tr.row-interviewing{ background: rgba(245,158,11,.05); }
tr.row-offered     { background: rgba(20,184,166,.05); }
tr.row-rejected    { background: rgba(239,68,68,.04); }
tr.row-withdrawn   { background: rgba(100,116,139,.04); }

/* Table → Cards on mobile */
@media (max-width: 640px) {
  .table-wrap table { display: block; }
  .table-wrap thead { display: none; }
  .table-wrap tbody { display: flex; flex-direction: column; gap: 10px; padding: 12px; }
  .table-wrap tr { display: block; border-radius: 14px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
  .table-wrap tr:hover { background: var(--surface); }
  .table-wrap td { display: block; border-bottom: none; padding: 3px 0; white-space: normal; max-width: none; overflow: visible; }
}

/* ---------- Status Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
  white-space: nowrap;
  text-transform: capitalize;
}

.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.badge-saved       { background: rgba(37,99,235,.12);   color: #2563EB; border: 1px solid rgba(37,99,235,.2); }
.badge-applied     { background: rgba(16,185,129,.12);  color: #059669; border: 1px solid rgba(16,185,129,.2); }
.badge-interviewing{ background: rgba(245,158,11,.12);  color: #D97706; border: 1px solid rgba(245,158,11,.2); }
.badge-offered     { background: rgba(22,163,74,.12);   color: #16A34A; border: 1px solid rgba(22,163,74,.2); }
.badge-rejected    { background: rgba(220,38,38,.1);    color: #DC2626; border: 1px solid rgba(220,38,38,.2); }
.badge-withdrawn   { background: rgba(100,116,139,.1);  color: #64748B; border: 1px solid rgba(100,116,139,.2); }

.badge-saved        { background: rgba(37,99,235,.18);  color: #93C5FD; }
.badge-applied      { background: rgba(16,185,129,.18); color: #6EE7B7; }
.badge-interviewing { background: rgba(245,158,11,.18); color: #FDE68A; }
.badge-offered      { background: rgba(22,163,74,.18);  color: #4ADE80; }
.badge-rejected     { background: rgba(220,38,38,.18);  color: #FCA5A5; }
.badge-withdrawn    { background: rgba(100,116,139,.18);color: #94A3B8; }

.badge-cv { background: rgba(2,132,199,.1); color: #0284C7; border: 1px solid rgba(2,132,199,.2); }
.badge-cl { background: rgba(22,163,74,.12); color: #16A34A; border: 1px solid rgba(22,163,74,.2); }
.badge-cv { background: rgba(2,132,199,.18); color: #38BDF8; }
.badge-cl { background: rgba(22,163,74,.18); color: #4ADE80; }

.badge-free    { background: rgba(100,116,139,.1); color: #475569; }
.badge-starter { background: rgba(2,132,199,.1);   color: #0284C7; }
.badge-base    { background: rgba(124,58,237,.1);  color: #7C3AED; }
.badge-pro     { background: rgba(217,119,6,.1);   color: #D97706; }

/* ---------- Alerts ---------- */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  border: 1px solid;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
  line-height: 1.5;
}

.alert-info    { background: rgba(2,132,199,.07);  border-color: rgba(2,132,199,.25);  color: #0284C7; }
.alert-success { background: rgba(22,163,74,.07);  border-color: rgba(22,163,74,.25);  color: #16A34A; }
.alert-warning { background: rgba(217,119,6,.07);  border-color: rgba(217,119,6,.25);  color: #D97706; }
.alert-error   { background: rgba(220,38,38,.07);  border-color: rgba(220,38,38,.25);  color: #DC2626; }

/* ---------- Spinner ---------- */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2.5px solid var(--border2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Modal ---------- */
.modal-overlay,
#modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3,5,9,.66);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  z-index: 900;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.open,
#modal-overlay.open { display: flex; }

.modal {
  background: rgba(9,13,20,.9);
  -webkit-backdrop-filter: blur(24px) saturate(1.3);
  backdrop-filter: blur(24px) saturate(1.3);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}

.modal-close {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), color var(--transition);
  cursor: pointer;
}

.modal-close:hover { background: var(--surface2); color: var(--text2); }
.modal-close svg { width: 16px; height: 16px; }

.modal-body { padding: 20px 24px; }

.modal-footer {
  padding: 14px 24px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* Modal tabs (dashboard generate flow) */
.modal-tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 20px; gap: 0; }
.modal-tab {
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all .15s;
  white-space: nowrap;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: inherit;
}
.modal-tab:hover:not(.active) { background: rgba(12,36,97,.04); color: var(--text); }
.modal-tab.active { color: var(--accent2); border-bottom-color: var(--accent2); }
.modal-pane { display: none; }
.modal-pane.active { display: block; }

/* ---------- Add Application modal (large, sticky header + tabs) ---------- */
.modal-lg {
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  overflow: hidden;
  padding: 0;
}
.modal-lg .modal-header,
.modal-lg .modal-tabs { flex-shrink: 0; }
.modal-lg .modal-header { padding: 18px 22px 14px; }
.modal-lg .modal-tabs { margin-bottom: 0; padding: 0 22px; }
.modal-lg .modal-body { flex: 1 1 auto; overflow-y: auto; padding: 20px 22px 22px; }

/* JD paste / drop zone */
textarea.jd-drop { min-height: 128px; transition: border-color .15s, box-shadow .15s, background .15s; }
textarea.jd-drop.drag-over {
  border-color: var(--accent2);
  background: rgba(25,200,226,.05);
  box-shadow: 0 0 0 3px rgba(25,200,226,.14);
}
.jd-hint { margin-top: 6px; font-size: 11.5px; color: var(--muted2); }

.gen-action-row { display: flex; align-items: center; gap: 12px 14px; flex-wrap: wrap; margin-top: 14px; }
.gen-status-text { font-size: 12.5px; color: var(--muted); }

/* Primary "Generate my CV" action in the modal — the loudest control there */
.btn-generate {
  flex: 1 1 auto; min-width: 210px; justify-content: center;
  height: 44px; padding: 0 22px; font-size: 14px; font-weight: 700;
  background: var(--accent2); color: #08131f; border-color: var(--accent2);
}
.btn-generate:hover:not(:disabled) { opacity: .9; box-shadow: var(--shadow); color: #08131f; text-decoration: none; }
.btn-generate:disabled { opacity: .5; }
.btn-generate svg { width: 16px; height: 16px; }

.gen-parse-info {
  margin-top: 10px; padding: 8px 12px; border-radius: var(--radius-sm);
  background: var(--surface2); border: 1px solid var(--border);
  font-size: 12px; color: var(--text2);
}

.alert-stack { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 0; }
.alert-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.alert-link { font-weight: 700; margin-left: 6px; }

/* Fit score panel */
#fit-rings.fit-panel {
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  margin: 16px 0 0;
  padding: 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.fit-panel-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--muted);
}
.fit-rings-row { display: flex; gap: 20px; flex-wrap: wrap; }
.fit-rings-row .fit-ring-wrap { flex: 1; min-width: 150px; }

/* Generated-documents tray */
#gen-links.doc-tray {
  margin: 16px 0 0; padding: 12px 14px; gap: 10px; flex-wrap: wrap;
  background: rgba(25,200,226,.05);
  border: 1px solid rgba(25,200,226,.22);
  border-radius: var(--radius);
}
.doc-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 0 14px; height: 34px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border2);
  color: var(--text2); font-size: 12.5px; font-weight: 600;
  cursor: pointer; font-family: inherit;
  transition: border-color .15s, color .15s, background .15s;
}
.doc-chip:hover { border-color: var(--accent2); color: var(--text); }
.doc-chip svg { width: 15px; height: 15px; flex-shrink: 0; }
.doc-chip-accent { background: var(--accent2); color: #0A1628; border-color: var(--accent2); font-weight: 700; }
.doc-chip-accent:hover { opacity: .88; color: #0A1628; }

/* ── CV template picker ── */
.tpl-picker { display: flex; gap: 8px; flex-wrap: wrap; }
.tpl-swatch {
  padding: 7px 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border2);
  color: var(--text2); font-size: 12.5px; font-weight: 600;
  cursor: pointer; font-family: inherit;
  transition: border-color .15s, color .15s, background .15s;
}
.tpl-swatch:hover { border-color: var(--accent2); color: var(--text); }
.tpl-swatch.active { background: var(--accent2); color: #0A1628; border-color: var(--accent2); }
.tpl-hint { font-size: 11.5px; color: var(--text2); margin-top: 6px; }

/* Shared bottom action bar for each modal pane */
.modal-pane-footer {
  margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border);
  display: flex; gap: 10px; justify-content: flex-end;
}

/* Bordered sub-section inside a pane (correspondence, etc.) */
.pane-section {
  margin-top: 4px; padding: 16px; background: var(--surface2);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.pane-section .card-title { margin-bottom: 12px; }

/* ---------- Tabs ---------- */
.tabs-row {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.tab-btn {
  padding: 9px 18px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
  white-space: nowrap;
  font-family: inherit;
}

.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-btn.active { color: var(--accent2); border-bottom-color: var(--accent2); }

/* ---------- Documents Grid ---------- */
.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 190px);
  gap: 16px;
  justify-content: start;
}

.doc-card--featured {
  border-top: 3px solid var(--accent2);
  background: linear-gradient(160deg, rgba(25,200,226,.07) 0%, var(--surface) 55%);
}
.doc-card--featured .doc-score-big {
  font-size: 28px;
  font-weight: 800;
  color: var(--accent2);
  line-height: 1;
}
.doc-card--featured .doc-top-match {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--accent2);
  margin-bottom: 10px;
}

.doc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: box-shadow var(--transition), border-color var(--transition);
}

.doc-card:hover { box-shadow: var(--shadow); border-color: var(--border2); }

.doc-icon-wrap {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.doc-icon-wrap.cv { background: rgba(2,132,199,.1); color: #0284C7; }
.doc-icon-wrap.cl { background: rgba(22,163,74,.1); color: #16A34A; }
.doc-icon-wrap.cv { background: rgba(2,132,199,.18); color: #38BDF8; }
.doc-icon-wrap.cl { background: rgba(22,163,74,.18); color: #4ADE80; }
.doc-icon-wrap svg { width: 22px; height: 22px; }

.doc-company { font-size: 15px; font-weight: 700; color: var(--text); }
.doc-role    { font-size: 13px; color: var(--muted); margin-top: 1px; }
.doc-meta    { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--muted2); }

/* ---------- Mail Layout ---------- */
.mail-layout {
  display: flex;
  gap: 0;
  height: calc(100vh - var(--header-h) - 56px);
  min-height: 500px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.mail-list {
  width: 320px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  overflow-y: auto;
}

.mail-item {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
  position: relative;
}

.mail-item:hover { background: var(--surface2); }
.mail-item.active { background: rgba(25,200,226,.06); border-left: 3px solid var(--accent2); }

.mail-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 4px;
}

.mail-sender  { font-size: 13.5px; font-weight: 600; color: var(--text); }
.mail-date    { font-size: 11px; color: var(--muted2); white-space: nowrap; }
.mail-subject { font-size: 13px; color: var(--text2); margin-bottom: 3px; font-weight: 500; }
.mail-preview { font-size: 12px; color: var(--muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

.unread-dot {
  position: absolute;
  top: 16px;
  right: 14px;
  width: 8px;
  height: 8px;
  background: var(--accent2);
  border-radius: 50%;
}

.mail-detail {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.mail-detail-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  gap: 12px;
}

.mail-detail-empty svg { width: 48px; height: 48px; opacity: 0.3; }

.mail-detail-header { border-bottom: 1px solid var(--border); padding-bottom: 18px; }
.mail-detail-subject { font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 10px; }
.mail-detail-meta { display: flex; gap: 20px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.mail-detail-meta span strong { color: var(--text2); font-weight: 600; }
.mail-detail-body { font-size: 14.5px; color: var(--text2); line-height: 1.75; white-space: pre-wrap; }

/* Legacy mail classes */
.msg-list { list-style: none; margin: 0; padding: 0; }
.msg-row { display: flex; align-items: flex-start; gap: 14px; padding: 13px 18px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .1s; }
.msg-row:hover { background: var(--surface2); }
.msg-row.unread .msg-subject { font-weight: 700; color: var(--text); }
.msg-row.unread .msg-from { font-weight: 600; }
.msg-from { font-size: 13px; color: var(--text); min-width: 160px; max-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex-shrink: 0; }
.msg-middle { flex: 1; min-width: 0; }
.msg-subject { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-snippet { font-size: 12px; color: var(--muted); opacity: .6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.msg-date { font-size: 11px; color: var(--muted); white-space: nowrap; flex-shrink: 0; }
#detail-pane { display: none; }
.detail-header { padding: 16px 20px; border-bottom: 1px solid var(--border); }
.detail-subject { font-size: 16px; font-weight: 700; margin-bottom: 8px; color: var(--text); }
.detail-meta { font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 3px; }
.detail-body { padding: 20px; font-size: 13px; line-height: 1.7; white-space: pre-wrap; color: var(--text); max-height: 55vh; overflow-y: auto; }
.detail-actions { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; gap: 10px; }

/* ---------- Plan Cards ---------- */
.plans-grid, .plan-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.plan-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: box-shadow var(--transition), border-color var(--transition);
}

.plan-card:hover { box-shadow: var(--shadow); border-color: var(--border2); }

.plan-card.featured {
  border: 2px solid var(--accent2);
  box-shadow: 0 0 0 1px rgba(25,200,226,.15), var(--shadow);
}

.plan-featured-tag, .plan-badge {
  position: absolute;
  top: -1px;
  right: 18px;
  background: var(--accent2);
  color: #0A1628;
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 0 0 8px 8px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.plan-name     { font-size: 16px; font-weight: 700; color: var(--text); }
.plan-tagline  { font-size: 12px; color: var(--muted); }
.plan-price    { font-size: 28px; font-weight: 800; color: var(--text); letter-spacing: -0.8px; }
.plan-price span { font-size: 14px; font-weight: 500; color: var(--muted); }
.plan-features { flex: 1; list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.plan-feature, .plan-features li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text2);
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
}
.plan-feature:last-child, .plan-features li:last-child { border-bottom: none; }
.plan-feature svg { width: 14px; height: 14px; color: var(--success); flex-shrink: 0; }
.plan-features li::before { content: "✓"; color: var(--success); font-weight: 700; flex-shrink: 0; }
.plan-features li.locked { color: var(--muted); }
.plan-features li.locked::before { content: "✗"; color: var(--border2); }
.plan-btn-wrap { margin-top: 4px; }
.plan-btn-wrap button { width: 100%; }

/* ---------- Usage Cards ---------- */
.usage-row, .usage-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.usage-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}

.usage-label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.usage-value { font-size: 22px; font-weight: 700; color: var(--text); margin-bottom: 8px; }

.usage-bar, .progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 6px;
}

.usage-bar-fill, .progress-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
}

/* Legacy usage stat */
.usage-stat .value { font-size: 22px; font-weight: 700; color: var(--text); }
.usage-stat .label { font-size: 12px; color: var(--muted); margin-top: 2px; }
.usage-stat .sub   { font-size: 11px; color: var(--muted); }

/* ---------- Integration Cards ---------- */
.integration-section { margin-bottom: 28px; }

.integration-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 12px;
}

.integration-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.integration-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: flex-start;
  gap: 14px;
  transition: border-color .2s, box-shadow .2s;
}

.integration-card:hover { border-color: var(--border2); box-shadow: var(--shadow); }

.integration-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.integration-info { flex: 1; min-width: 0; }
.integration-info h3 { font-size: 14px; font-weight: 700; margin-bottom: 4px; color: var(--text); }
.integration-info p  { font-size: 13px; color: var(--muted); line-height: 1.5; margin: 0 0 12px; }

.integration-name   { font-size: 14px; font-weight: 600; color: var(--text); }
.integration-status { font-size: 12px; color: var(--muted); margin-top: 2px; }
.integration-status.connected { color: var(--success); font-weight: 600; }

.connect-panel { display: none; margin-top: 12px; background: var(--bg); border: 1.5px solid var(--border); border-radius: 9px; padding: 14px 16px; }
.connect-panel.open { display: block; }
.code-box { font-size: 22px; font-weight: 800; letter-spacing: 3px; color: var(--accent2); background: rgba(25,200,226,.1); border: 1px dashed rgba(25,200,226,.35); border-radius: 8px; padding: 10px 18px; display: inline-block; margin: 10px 0; }
.connect-step { font-size: 13px; color: var(--muted); margin-bottom: 6px; line-height: 1.5; }
.connect-step strong { color: var(--text); }

.status-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 11px; font-weight: 700; }
.status-connected    { background: rgba(16,185,129,.12); border: 1px solid rgba(16,185,129,.25); color: #16A34A; }
.status-disconnected { background: var(--bg2); border: 1.5px solid var(--border); color: var(--muted); }
.status-pending      { background: rgba(245,158,11,.1);  border: 1px solid rgba(245,158,11,.25); color: #D97706; }
.status-approved     { background: rgba(25,200,226,.12); border: 1px solid rgba(25,200,226,.3);  color: var(--accent2); }

.coming-soon-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface2);
  color: var(--muted2);
  border: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.section-heading {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  margin: 28px 0 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-heading::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ---------- Profile Page ---------- */
.profile-layout { display: grid; grid-template-columns: 280px 1fr; gap: 22px; align-items: start; }

.profile-sidebar-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 6px;
}

.profile-name     { font-size: 18px; font-weight: 700; color: var(--text); }
.profile-headline { font-size: 13px; color: var(--muted); margin-top: 2px; line-height: 1.4; }

.profile-stat-row { display: flex; gap: 20px; margin: 10px 0 4px; }
.profile-stat     { text-align: center; }
.profile-stat-val { font-size: 18px; font-weight: 700; color: var(--text); }
.profile-stat-lbl { font-size: 11px; color: var(--muted2); }

.skill-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.skill-tag {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  color: var(--text2);
}

.profile-detail-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
}

.profile-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.exp-item { padding: 14px 0; border-bottom: 1px solid var(--border); }
.exp-item:last-child { border-bottom: none; padding-bottom: 0; }
.exp-title   { font-size: 14.5px; font-weight: 700; color: var(--text); }
.exp-company { font-size: 13px; color: var(--accent2); font-weight: 600; }
.exp-dates   { font-size: 12px; color: var(--muted); margin-top: 2px; }
.exp-bullets { margin-top: 8px; padding-left: 16px; }
.exp-bullets li { font-size: 13.5px; color: var(--text2); line-height: 1.6; list-style: disc; padding-left: 2px; }

/* ---------- Fit Rings ---------- */
.fit-rings { display: flex; gap: 24px; padding: 16px 0; flex-wrap: wrap; }
.fit-ring-wrap { display: flex; flex-direction: column; align-items: center; flex: 1; min-width: 160px; }
.fit-ring-svg { width: 72px; height: 72px; }
.fit-ring-track { fill: none; stroke: var(--border); stroke-width: 8; }
.fit-ring-fill { fill: none; stroke: #22c55e; stroke-width: 8; stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; transition: stroke-dashoffset .6s ease; }
.fit-ring-pct { font-size: 13px; font-weight: 800; fill: var(--text); }
.fit-ring-label { font-size: 12px; font-weight: 700; color: var(--muted); margin-top: 6px; }
.fit-ring-match { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--accent2); margin-top: 2px; }
.fit-detail { font-size: 11px; line-height: 1.5; text-align: center; margin-top: 4px; color: var(--muted); }
.str { color: var(--success); }
.gap { color: var(--danger); }
.fit-divider { width: 1px; background: var(--border); align-self: stretch; margin: 0 4px; }

/* ---------- Drop Zone ---------- */
.drop-zone {
  border: 2px dashed var(--border2);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s;
  font-size: 13px;
  color: var(--muted);
  background: var(--surface2);
}
.drop-zone:hover, .drop-zone.drag-over { border-color: var(--accent2); background: rgba(25,200,226,.04); }

/* ---------- Avatar ---------- */
.avatar-wrap { display: flex; align-items: center; gap: 16px; }
.avatar-placeholder { width: 64px; height: 64px; border-radius: 50%; background: var(--surface2); border: 2px dashed var(--border2); display: flex; align-items: center; justify-content: center; font-size: 24px; cursor: pointer; }
.avatar-img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; border: 2px solid var(--border); }

/* ---------- FAB (mobile only) ---------- */
.fab {
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 24px;
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  transition: all .2s;
  font-family: inherit;
}
.fab:hover { transform: scale(1.08); box-shadow: var(--shadow-xl); }
@media (min-width: 769px) { .fab { display: none; } }

/* ---------- Chat FAB + Panel ---------- */
.chat-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 400;
  transition: transform .15s, box-shadow .15s;
  cursor: pointer;
}
.chat-fab:hover { transform: scale(1.06); box-shadow: var(--shadow-xl); }
.chat-fab svg { width: 22px; height: 22px; }

.chat-panel {
  position: fixed;
  bottom: 86px;
  right: 24px;
  width: 340px;
  max-width: calc(100vw - 32px);
  max-height: 480px;
  background: var(--surface);
  border: 1.5px solid var(--border2);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  z-index: 400;
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.chat-panel.open { display: flex; }

.chat-panel-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--accent);
  color: #fff;
}

.chat-panel-title { font-size: 14px; font-weight: 700; }
.chat-close-btn {
  width: 26px;
  height: 26px;
  background: rgba(255,255,255,.15);
  border: none;
  border-radius: 6px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s;
}
.chat-close-btn:hover { background: rgba(255,255,255,.25); }
.chat-close-btn svg { width: 14px; height: 14px; }

.chat-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }

.chat-msg {
  max-width: 82%;
  padding: 9px 13px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
  word-wrap: break-word;
}

.chat-msg.bot, .chat-msg.ai {
  background: var(--surface2);
  color: var(--text2);
  border-radius: 4px 12px 12px 12px;
  align-self: flex-start;
  border: 1px solid var(--border);
}

.chat-msg.user {
  background: var(--accent2);
  color: #0A1628;
  border-radius: 12px 4px 12px 12px;
  align-self: flex-end;
}

.chat-msg.thinking {
  background: var(--surface2);
  color: var(--muted);
  border: 1px solid var(--border);
  font-style: italic;
  align-self: flex-start;
  border-radius: 4px 12px 12px 12px;
}

.chat-input-row {
  padding: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
}

.chat-input {
  flex: 1;
  height: 36px;
  padding: 0 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  outline: none;
  font-family: inherit;
}
.chat-input:focus { border-color: var(--accent2); }

/* Markdown rendering inside AI chat bubbles */
.chat-msg.ai p, .chat-msg.bot p {
  margin: 0 0 8px;
}
.chat-msg.ai p:last-child, .chat-msg.bot p:last-child { margin-bottom: 0; }

.chat-msg.ai h1, .chat-msg.ai h2, .chat-msg.ai h3,
.chat-msg.bot h1, .chat-msg.bot h2, .chat-msg.bot h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin: 10px 0 4px;
  line-height: 1.3;
}
.chat-msg.ai h1:first-child, .chat-msg.ai h2:first-child, .chat-msg.ai h3:first-child,
.chat-msg.bot h1:first-child, .chat-msg.bot h2:first-child, .chat-msg.bot h3:first-child {
  margin-top: 0;
}

.chat-msg.ai ul, .chat-msg.bot ul,
.chat-msg.ai ol, .chat-msg.bot ol {
  margin: 4px 0 8px;
  padding-left: 18px;
}
.chat-msg.ai li, .chat-msg.bot li {
  margin-bottom: 3px;
  line-height: 1.5;
}

.chat-msg.ai strong, .chat-msg.bot strong { font-weight: 700; color: var(--text); }
.chat-msg.ai em, .chat-msg.bot em { font-style: italic; }

.chat-msg.ai code, .chat-msg.bot code {
  background: var(--border);
  padding: 1px 5px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 12px;
}

.chat-msg.ai pre, .chat-msg.bot pre {
  background: var(--border);
  padding: 8px 10px;
  border-radius: 6px;
  overflow-x: auto;
  margin: 6px 0;
}
.chat-msg.ai pre code, .chat-msg.bot pre code {
  background: none;
  padding: 0;
  font-size: 11px;
}

.chat-msg.ai a, .chat-msg.bot a {
  color: var(--accent2);
  text-decoration: underline;
  word-break: break-all;
}

.chat-msg.ai blockquote, .chat-msg.bot blockquote {
  border-left: 3px solid var(--border2);
  padding-left: 10px;
  margin: 6px 0;
  color: var(--muted);
  font-style: italic;
}

.chat-msg.ai hr, .chat-msg.bot hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 8px 0;
}

.chat-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: opacity .15s;
}
.chat-send-btn:hover { opacity: 0.85; }
.chat-send-btn svg { width: 14px; height: 14px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 10px;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  opacity: 0;
  transition: opacity .25s, transform .25s;
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.toast-success { border-color: var(--success); color: var(--success); }
.toast.toast-error   { border-color: var(--danger);  color: var(--danger); }

/* ---------- Extension install nudge ---------- */
.cd-ext-nudge {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9998;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  max-width: 300px;
  background: var(--surface2, var(--surface));
  border: 1.5px solid var(--border2);
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: var(--shadow-xl, var(--shadow-lg));
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .25s, transform .25s;
}
.cd-ext-nudge.show { opacity: 1; transform: translateY(0); }
.cd-ext-nudge-icon { font-size: 22px; line-height: 1; flex-shrink: 0; margin-top: 1px; }
.cd-ext-nudge-body { min-width: 0; }
.cd-ext-nudge-title { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.cd-ext-nudge-text { font-size: 12px; color: var(--muted); line-height: 1.5; margin-bottom: 12px; }
.cd-ext-nudge-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  background: var(--accentg);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  border-radius: 8px;
  text-decoration: none;
}
.cd-ext-nudge-btn:hover { opacity: .9; }
.cd-ext-nudge-close {
  position: absolute;
  top: 6px;
  right: 8px;
  background: none;
  border: none;
  font-size: 16px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
}
.cd-ext-nudge-close:hover { color: var(--text); }
@media (max-width: 480px) {
  .cd-ext-nudge { left: 12px; right: 12px; max-width: none; bottom: 84px; }
}

/* ---------- Empty State ---------- */
.empty-state, .empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--muted);
  text-align: center;
  gap: 12px;
  font-size: 13px;
}
.empty-state svg { width: 48px; height: 48px; opacity: 0.25; }
.empty-icon { font-size: 36px; opacity: .5; }

/* ---------- Section Divider ---------- */
.divider { height: 1px; background: var(--border); margin: 16px 0; }

/* ---------- Skeleton Loaders ---------- */
@keyframes shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position:  600px 0; }
}

.skeleton {
  background: linear-gradient(90deg, var(--border) 25%, var(--border2) 50%, var(--border) 75%);
  background-size: 600px 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: 6px;
  display: block;
}

.sk-text   { height: 13px; margin-bottom: 6px; }
.sk-w60    { width: 60%; }
.sk-w40    { width: 40%; }
.sk-w80    { width: 80%; }
.sk-w30    { width: 30%; }
.sk-stat   { height: 36px; width: 72px; margin-bottom: 6px; border-radius: 8px; }
.sk-row    { height: 50px; border-radius: 0; margin: 0; }
.sk-card   { height: 110px; border-radius: var(--radius); }
.sk-circle { border-radius: 50%; }

/* ---------- Utility ---------- */
.flex           { display: flex; }
.flex-col       { display: flex; flex-direction: column; }
.items-center   { align-items: center; }
.justify-between{ justify-content: space-between; }
.justify-end    { justify-content: flex-end; }
.gap-2, .gap-8  { gap: 8px; }
.gap-3          { gap: 12px; }
.gap-4, .gap-16 { gap: 16px; }
.w-full         { width: 100%; }
.text-sm        { font-size: 13px; }
.text-xs        { font-size: 11.5px; }
.text-muted     { color: var(--muted); }
.text-right     { text-align: right; }
.font-bold      { font-weight: 700; }
.font-semibold  { font-weight: 600; }
.mt-1           { margin-top: 4px; }
.mt-2, .mt-8   { margin-top: 8px; }
.mt-3           { margin-top: 12px; }
.mt-4, .mt-16  { margin-top: 16px; }
.mt-24          { margin-top: 24px; }
.mb-1           { margin-bottom: 4px; }
.mb-2           { margin-bottom: 8px; }
.mb-3           { margin-bottom: 12px; }
.mb-4           { margin-bottom: 16px; }

/* ---------- Mobile Header ---------- */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  background: var(--sidebar-bg);
  border-bottom: 1px solid var(--border);
  z-index: 190;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}

.mobile-hamburger {
  width: 36px;
  height: 36px;
  background: transparent;
  border: none;
  color: var(--text2);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.mobile-hamburger svg { width: 22px; height: 22px; }

.mobile-brand, .mobile-logo-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}
.mobile-brand .cd-logo { width: 20px; height: 16px; }
.mobile-brand span { color: var(--accent2); }

.mobile-logo-text { font-size: 15px; font-weight: 800; color: var(--text); }
.mobile-logo-text span { color: var(--accent2); }

/* ---------- Bottom Nav (mobile) ---------- */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 58px;
  background: var(--sidebar-bg);
  border-top: 1px solid var(--border);
  z-index: 190;
  align-items: center;
  justify-content: space-around;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 10px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: color var(--transition);
  cursor: pointer;
  background: none;
  border: none;
  flex: 1;
  font-family: inherit;
}

.bottom-nav-item svg { width: 20px; height: 20px; }
.bottom-nav-item.active { color: var(--accent); }
.bottom-nav-item.active { color: var(--accent2); }
.bottom-nav-item:hover { color: var(--text2); text-decoration: none; }

/* ---------- Nav Overlay (mobile) ---------- */
.nav-overlay, .sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(6,13,28,.5);
  z-index: 195;
}

body.nav-open .nav-overlay,
body.nav-open .sidebar-overlay { display: block; }

/* ---------- More Drawer ---------- */
.more-drawer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border2);
  border-radius: 18px 18px 0 0;
  z-index: 500;
  padding: 0 0 env(safe-area-inset-bottom);
  transform: translateY(100%);
  transition: transform .25s;
  box-shadow: var(--shadow-xl);
}
.more-drawer.open { transform: translateY(0); }
.more-drawer-handle { display: flex; justify-content: center; padding: 12px 0 4px; }
.more-drawer-handle span { width: 36px; height: 4px; background: var(--border2); border-radius: 2px; }
.more-drawer-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text2);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  text-decoration: none;
}
.more-drawer-item:last-child { border-bottom: none; }

/* ---------- Auth Page ---------- */
.auth-page, .auth-wrap {
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 420px;
  padding: 36px 36px 28px;
}

.auth-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  text-decoration: none;
  cursor: pointer;
  transition: opacity var(--transition);
}
.auth-brand:hover { opacity: 0.8; }
.auth-brand .cd-logo { width: 36px; height: 29px; }
.auth-brand-name { font-size: 22px; font-weight: 800; color: var(--text); letter-spacing: -0.5px; }
.auth-brand-name span { color: var(--accent2); }

.auth-tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 24px;
}

.auth-tab {
  flex: 1;
  text-align: center;
  padding: 10px 0 11px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color var(--transition), border-color var(--transition);
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: inherit;
}

.auth-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.auth-tab.active { color: var(--accent2); border-bottom-color: var(--accent2); }

.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form .form-group { margin-bottom: 0; }
.auth-form .btn { width: 100%; height: 44px; font-size: 15px; justify-content: center; }
.auth-footer { text-align: center; margin-top: 20px; color: var(--muted2); font-size: 12px; }

/* Auth two-column landing layout */
.landing { display: grid; grid-template-columns: 1fr 440px; min-height: 100vh; }
@media (max-width: 900px) { .landing { grid-template-columns: 1fr; } .hero-col { display: none; } }

/* ---------- Public site nav ---------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 48px;
  height: 64px;
  background: rgba(238,242,249,.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: background .2s;
}
.site-nav { background: rgba(6,13,28,.88); }

/* ---------- Responsive ≤768px ---------- */
@media (max-width: 768px) {
  .mobile-header { display: flex; }
  .bottom-nav    { display: flex; }

  .sidebar { transform: translateX(-100%); }
  body.nav-open .sidebar { transform: translateX(0); }

  .main {
    margin-left: 0;
    padding-top: var(--header-h);
    padding-bottom: 68px;
  }

  .main-inner { padding: 18px 16px; }

  .stats-row, .stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }

  .doc-grid { grid-template-columns: repeat(2, 1fr); }

  .plans-grid, .plan-grid { grid-template-columns: 1fr 1fr; gap: 12px; }

  .usage-row, .usage-grid { grid-template-columns: 1fr; gap: 10px; }

  .profile-layout { grid-template-columns: 1fr; }

  .mail-list { width: 100%; border-right: none; }
  .mail-detail { display: none; padding: 18px 16px; }
  .mail-detail.mobile-open { display: flex; position: fixed; inset: 0; background: var(--surface); z-index: 600; padding-top: calc(var(--header-h) + 10px); }

  .chat-panel { width: calc(100vw - 32px); right: 16px; }
  .chat-fab   { bottom: 74px; right: 16px; }
  .toast      { bottom: 70px; }

  table { min-width: 580px; }
  .table-wrap { margin: 0 -2px; }

  .page-header { margin-bottom: 16px; }
  .page-title  { font-size: 19px; }

  @media (max-width: 640px) {
    .filter-row { display: none; }
    .integration-grid { grid-template-columns: 1fr; }
  }
}

/* ---------- Responsive 769–1100px ---------- */
@media (min-width: 769px) and (max-width: 1100px) {
  .plans-grid, .plan-grid { grid-template-columns: 1fr 1fr; }
  .doc-grid { grid-template-columns: repeat(auto-fill, 170px); justify-content: start; }
  .stats-row, .stats { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Sidebar compat ---------- */
.sidebar-footer { padding: 12px 14px; border-top: 1px solid var(--border); }

/* ═══════════════════════════════════════════════════════════
   PUBLIC / MARKETING SITE COMPONENTS
   ═══════════════════════════════════════════════════════════ */

/* ── Nav logo ───────────────────────────────────────────── */
.site-nav-logo {
  font-size: 16px; font-weight: 800; letter-spacing: -.4px;
  color: var(--text); text-decoration: none; flex-shrink: 0;
  display: flex; align-items: center; gap: 8px;
}
.site-nav-logo:hover { color: var(--accent); text-decoration: none; }
.site-nav-logo svg { flex-shrink: 0; }

/* ── Nav links ──────────────────────────────────────────── */
.nav-link {
  font-size: 14px; font-weight: 500; color: var(--muted);
  text-decoration: none; white-space: nowrap; transition: color .15s;
}
.nav-link:hover { color: var(--text); text-decoration: none; }
.nav-link.active { color: var(--text); font-weight: 600; }

/* ── Nav CTA area ─────────────────────────────────────── */
.nav-cta { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.site-nav > .nav-cta { margin-left: auto; }

.btn-nav-ghost {
  padding: 7px 16px; border-radius: 8px;
  border: 1.5px solid var(--border2); background: transparent;
  color: var(--muted); font-size: 13px; font-weight: 600;
  text-decoration: none; white-space: nowrap; transition: all .15s;
}
.btn-nav-ghost:hover {
  border-color: var(--accent); color: var(--accent); text-decoration: none;
}

.btn-nav-primary {
  padding: 7px 18px; border-radius: 8px;
  background: var(--accent); color: #fff;
  font-size: 13px; font-weight: 700;
  text-decoration: none; white-space: nowrap; transition: all .15s;
}
.btn-nav-primary:hover {
  opacity: .88; transform: translateY(-1px);
  text-decoration: none; color: #fff;
}

/* ── Theme toggle button ──────────────────────────────── */
.theme-btn {
  width: 34px; height: 34px; border-radius: 8px;
  border: 1.5px solid var(--border); background: transparent;
  cursor: pointer; font-size: 16px; display: flex;
  align-items: center; justify-content: center; flex-shrink: 0;
  transition: border-color .15s, background .15s; padding: 0;
}
.theme-btn:hover { border-color: var(--border2); background: var(--surface2); }

/* ── Mobile nav (hamburger) ────────────────────────────── */
.nav-mobile-btn {
  display: none; width: 36px; height: 36px; border-radius: 8px;
  border: 1.5px solid var(--border); background: transparent;
  cursor: pointer; align-items: center; justify-content: center;
  color: var(--muted); flex-shrink: 0; transition: border-color .15s;
}
.nav-mobile-btn:hover { border-color: var(--border2); color: var(--text); }
.nav-mobile-btn svg { display: block; }

.nav-mobile-menu {
  display: none; position: fixed; inset: 0; z-index: 200;
  background: var(--bg); padding: 0;
  flex-direction: column; overflow-y: auto;
}
.nav-mobile-menu.open { display: flex; }
.nav-mobile-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.nav-mobile-links {
  display: flex; flex-direction: column; padding: 16px 20px; gap: 4px;
}
.nav-mobile-links a {
  font-size: 16px; font-weight: 500; color: var(--text); text-decoration: none;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.nav-mobile-links a:last-child { border-bottom: none; }
.nav-mobile-cta {
  padding: 20px; display: flex; flex-direction: column; gap: 10px;
}

/* ── Site footer ──────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 36px 48px;
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  background: var(--surface);
}
.site-footer { background: var(--bg2); }

.footer-logo {
  font-size: 15px; font-weight: 800; letter-spacing: -.3px;
  color: var(--text); text-decoration: none;
}
a.footer-logo:hover { color: var(--accent); text-decoration: none; }

.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-links a {
  font-size: 13px; color: var(--muted);
  text-decoration: none; transition: color .15s;
}
.footer-links a:hover { color: var(--text); text-decoration: none; }

.footer-copy { margin-left: auto; font-size: 12px; color: var(--muted); opacity: .6; }

/* ── Public page mobile ────────────────────────────────── */
@media (max-width: 680px) {
  .site-nav { padding: 0 20px; gap: 12px; }
  .site-nav .nav-link { display: none; }
  .site-nav .btn-nav-ghost { display: none; }
  .nav-mobile-btn { display: flex; }
  .site-footer { padding: 24px 20px; gap: 16px; }
  .footer-copy { margin-left: 0; width: 100%; }
}
