:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-muted: #64748b;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --strong: #059669;
  --strong-bg: #ecfdf5;
  --moderate: #d97706;
  --moderate-bg: #fffbeb;
  --error: #dc2626;
  --error-bg: #fef2f2;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 25px rgba(0,0,0,.06);
  --radius: 12px;
  --radius-sm: 8px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* --- Header --- */
.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px clamp(20px, 5vw, 48px);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.masthead > div:last-child {
  flex-wrap: wrap;
  justify-content: flex-end;
  row-gap: 8px;
}
.site-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 24px;
  flex-wrap: wrap;
}
.wordmark {
  font-weight: 700; font-size: 20px; letter-spacing: 0;
  display: flex; align-items: center; gap: 6px;
}
.wordmark-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex: 0 0 auto;
}
.wordmark-icon {
  width: 28px; height: 28px;
  background: var(--primary);
  color: #fff;
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700;
}
.ghost-link {
  font-size: 13px; color: var(--text-muted);
  text-decoration: none; font-weight: 500;
  transition: color .15s;
}
.ghost-link:hover { color: var(--text); }

/* --- Hero --- */
.hero {
  text-align: center;
  padding: 64px clamp(20px,5vw,48px) 48px;
  background: linear-gradient(135deg, #eff6ff 0%, #f0f9ff 40%, #f8fafc 100%);
  border-bottom: 1px solid var(--border);
}
.hero h1 {
  font-size: clamp(32px, 4.5vw, 48px);
  font-weight: 800; letter-spacing: -.02em;
  margin: 0 0 12px; color: var(--text);
  line-height: 1.15;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero p {
  font-size: 17px; color: var(--text-muted);
  max-width: 580px; margin: 0 auto;
}

.search-header {
  max-width: 1120px;
  margin: 0 auto;
  padding: 32px clamp(20px, 5vw, 48px) 8px;
}
.search-header .eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--primary);
  margin: 0 0 8px;
}
.search-header h1 {
  font-size: clamp(26px, 3.2vw, 38px);
  line-height: 1.15;
  letter-spacing: -.01em;
  margin: 0 0 8px;
}
.search-header p {
  color: var(--text-muted);
  font-size: 14.5px;
  max-width: 760px;
  margin: 0;
}

/* Hook cards (in left panel) */
.hook-cards {
  display: flex; flex-direction: column; gap: 12px;
  margin-bottom: 28px;
}
.hook-card {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 13px; line-height: 1.5;
}
.hook-card strong { display: block; font-size: 13.5px; margin-bottom: 2px; }
.hook-card span { color: var(--text-muted); }
.hook-icon {
  font-size: 20px; width: 36px; height: 36px; flex-shrink: 0;
  background: var(--primary-light); color: var(--primary);
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
}

/* --- Layout --- */
.layout {
  max-width: 1120px; margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
  gap: clamp(32px, 5vw, 56px);
  padding: 40px clamp(20px, 5vw, 48px) 64px;
  align-items: start;
}

/* --- Left: form --- */
.brief { position: sticky; top: 80px; }
.brief .eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--primary); margin: 0 0 8px;
}
.brief h2 {
  font-size: 26px; font-weight: 700; letter-spacing: -.01em;
  margin: 0 0 8px; line-height: 1.2;
}
.brief .lede {
  font-size: 14.5px; color: var(--text-muted);
  margin: 0 0 28px; line-height: 1.6;
}

.research-source-field {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px; align-items: end;
}
.research-source-field .field { margin-bottom: 0; }
.research-import-btn { min-height: 44px; }
.field-status {
  min-height: 18px; margin: 6px 0 10px;
  color: var(--text-muted); font-size: 12px; line-height: 1.45;
}

.field {
  display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px;
}
.field-label {
  font-size: 12px; font-weight: 600; color: var(--text);
  letter-spacing: .02em;
}
.field-label .opt { font-weight: 400; color: var(--text-muted); }
textarea, input[type="text"], input[type="password"], input[type="email"], input[type="search"], input[type="number"], input[type="date"], select {
  font-family: var(--font); font-size: 14.5px; color: var(--text);
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); padding: 11px 13px; width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; line-height: 1.5; }
textarea:focus, input:focus, select:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.row { display: flex; gap: 10px; }
.row .field { flex: 0 0 auto; width: 46%; }
.row .field.grow { flex: 1 1 auto; width: auto; }

.hint {
  font-size: 12.5px; color: var(--text-muted); line-height: 1.5;
}
.hint a { color: var(--primary); font-weight: 500; }

.settings {
  margin: 4px 0 20px; border-top: 1px solid var(--border); padding-top: 14px;
}
.settings summary {
  font-size: 12px; font-weight: 600; color: var(--text-muted);
  cursor: pointer; list-style: none; letter-spacing: .03em;
  user-select: none;
}
.settings summary::-webkit-details-marker { display: none; }
.settings summary::before { content: "+ "; color: var(--primary); font-weight: 700; }
.settings[open] summary::before { content: "\2013 "; }
.settings-body { padding-top: 14px; }
.search-options {
  margin: 2px 0 16px; border-top: 1px solid var(--border); padding-top: 12px;
}
.search-options summary {
  color: var(--text-muted); cursor: pointer; font-size: 12px;
  font-weight: 600; list-style: none;
}
.search-options summary::-webkit-details-marker { display: none; }
.search-options summary::before { content: "+ "; color: var(--primary); font-weight: 700; }
.search-options[open] summary::before { content: "\2013 "; }
.search-options .field { margin-bottom: 0; }

.run {
  font-family: var(--font); font-weight: 600; font-size: 15px;
  background: var(--primary); color: #fff; border: none;
  border-radius: var(--radius-sm); padding: 13px 20px; width: 100%;
  cursor: pointer; letter-spacing: .01em;
  transition: background .15s, transform .1s, box-shadow .15s;
  box-shadow: 0 1px 2px rgba(37,99,235,.3);
}
.run:hover { background: var(--primary-hover); box-shadow: 0 2px 8px rgba(37,99,235,.35); }
.run:active { transform: translateY(1px); }
.run:disabled { opacity: .55; cursor: progress; }
.microcopy { font-size: 12px; color: var(--text-muted); text-align: center; margin: 10px 0 0; }

/* --- Right: results --- */
.ledger { min-width: 0; }
.result-tabs {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px; width: 100%; min-height: 44px; margin-bottom: 18px;
  padding: 4px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: #eef2f7;
}
.result-tab {
  min-width: 0; border: 0; border-radius: 6px; padding: 8px 12px;
  background: transparent; color: var(--text-muted); cursor: pointer;
  font: 600 13px/1.2 var(--font);
}
.result-tab:hover { color: var(--text); }
.result-tab.is-active {
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm);
}
.tab-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; margin-left: 5px; padding: 0 6px;
  border-radius: 10px; background: var(--primary-light); color: var(--primary);
  font-size: 11px;
}
.result-panel[hidden] { display: none; }
.placeholder {
  text-align: center; padding: 72px 32px;
  color: var(--text-muted); pointer-events: none;
}
.placeholder-icon {
  width: 56px; height: 56px; margin: 0 auto 16px;
  background: var(--primary-light); color: var(--primary);
  border-radius: 14px; display: flex; align-items: center; justify-content: center;
  font-size: 24px;
}
.placeholder strong { display: block; margin-bottom: 5px; color: var(--text); font-size: 14px; }
.placeholder p { max-width: 340px; margin: 0 auto; font-size: 13.5px; line-height: 1.5; }

.loading { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 72px 0; }
.spinner {
  width: 32px; height: 32px; border: 3px solid var(--border);
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading p { font-size: 13.5px; color: var(--text-muted); font-weight: 500; }

.error {
  border: 1px solid var(--error); border-radius: var(--radius);
  background: var(--error-bg); color: var(--error);
  padding: 16px 18px; font-size: 14px;
}

.summary {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px; margin-bottom: 20px;
}
.summary .summary-row { font-size: 13.5px; color: var(--text-muted); margin: 3px 0; }
.chips { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-block; font-size: 12px; font-weight: 500;
  background: var(--primary-light); color: var(--primary);
  border-radius: 999px; padding: 4px 11px;
}

/* --- Toolbar --- */
.toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 16px;
  padding: 10px 14px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.toolbar-actions {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.saved-toolbar {
  align-items: flex-start;
}
.saved-toolbar strong {
  display: block; font-size: 13px; line-height: 1.35;
}
.saved-count {
  display: block; font-size: 12px; color: var(--text-muted); line-height: 1.45;
}
.saved-list {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; gap: 10px; margin: 0 0 16px;
}
.manual-advisor-panel {
  margin: 0 0 16px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.manual-advisor-panel[hidden] { display: none; }
.manual-advisor-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.manual-advisor-heading .eyebrow { margin: 0 0 4px; color: var(--primary); font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.manual-advisor-heading h3 { margin: 0; font-size: 16px; line-height: 1.3; letter-spacing: 0; }
.manual-advisor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 10px;
}
.manual-advisor-panel .run { width: auto; min-width: 150px; }
.saved-empty {
  padding: 54px 24px; text-align: center; color: var(--text-muted);
  border: 1px dashed var(--border); border-radius: var(--radius-sm);
}
.saved-empty strong { display: block; color: var(--text); font-size: 14px; margin-bottom: 5px; }
.saved-empty p { margin: 0; font-size: 13px; }
.saved-more { position: relative; }
.saved-more summary {
  min-height: 34px; display: flex; align-items: center; padding: 0 10px;
  border: 1px solid var(--border); border-radius: 7px; background: var(--surface);
  color: var(--text-muted); cursor: pointer; font-size: 12px; font-weight: 600;
  list-style: none;
}
.saved-more summary::-webkit-details-marker { display: none; }
.saved-more-menu {
  position: absolute; z-index: 5; top: calc(100% + 5px); right: 0;
  min-width: 150px; padding: 5px; border: 1px solid var(--border);
  border-radius: 7px; background: var(--surface); box-shadow: var(--shadow-lg);
}
.saved-more-menu button {
  width: 100%; padding: 8px 10px; border: 0; border-radius: 5px;
  background: transparent; color: var(--error); cursor: pointer;
  font: 600 12px/1.3 var(--font); text-align: left;
}
.saved-more-menu button:hover { background: var(--error-bg); }
.saved-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 14px;
}
.saved-item-head {
  display: flex; justify-content: space-between; gap: 12px; align-items: flex-start;
  margin-bottom: 10px;
}
.saved-item-name { font-size: 13.5px; font-weight: 700; line-height: 1.35; }
.saved-item-meta { font-size: 12px; color: var(--text-muted); line-height: 1.45; }
.saved-edit-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}
.saved-edit-grid label {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 11px; font-weight: 600; color: var(--text-muted);
}
.saved-edit-grid input {
  font-size: 12.5px; padding: 8px 9px; border: 1px solid var(--border);
  border-radius: 7px; color: var(--text); background: var(--surface);
}
.saved-remove-btn {
  border: 1px solid var(--border); background: var(--surface); color: var(--text-muted);
  border-radius: 7px; padding: 6px 9px; cursor: pointer; font-size: 12px; font-weight: 600;
}
.saved-remove-btn:hover { border-color: var(--error); color: var(--error); }
.select-all-label {
  font-size: 13px; font-weight: 500; cursor: pointer;
  display: flex; align-items: center; gap: 6px; user-select: none;
}
.export-btn {
  font-weight: 600; font-size: 13px;
  background: var(--strong); color: #fff; border: none;
  border-radius: 7px; padding: 8px 16px; cursor: pointer;
  transition: background .15s, box-shadow .15s;
  box-shadow: 0 1px 2px rgba(5,150,105,.25);
}
.export-btn:hover { background: #047857; box-shadow: 0 2px 8px rgba(5,150,105,.35); }
.export-btn:disabled {
  opacity: .5; cursor: not-allowed; box-shadow: none;
}
.export-btn.is-saved:disabled {
  opacity: 1; color: #047857; background: #ecfdf5;
  border: 1px solid #a7f3d0;
}
.mini-export-btn {
  font-weight: 600; font-size: 13px;
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: 7px; padding: 8px 12px; cursor: pointer;
  transition: border-color .15s, color .15s, box-shadow .15s;
}
.mini-export-btn:hover { border-color: var(--primary); color: var(--primary); box-shadow: var(--shadow-sm); }
.mini-export-btn:disabled {
  opacity: .5; cursor: not-allowed; box-shadow: none;
}

/* Checkbox on cards */
.card-check {
  position: absolute; left: 17px; top: 28px; z-index: 2;
  display: flex; align-items: center;
}
.card-check input[type="checkbox"] {
  width: 17px; height: 17px; cursor: pointer; accent-color: var(--primary);
}

.cards { list-style: none; margin: 0; padding: 0; }
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px 22px 88px;
  margin: 14px 0;
  box-shadow: var(--shadow);
  transition: box-shadow .2s;
}
.card:hover { box-shadow: var(--shadow-lg); }
.card .rank {
  position: absolute; left: 46px; top: 22px;
  font-size: 15px; font-weight: 700; color: var(--primary);
  background: var(--primary-light);
  width: 30px; height: 30px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}
.card .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.card .name { font-weight: 700; font-size: 18px; letter-spacing: -.01em; }
.card .title { font-size: 13px; color: var(--text-muted); margin: 2px 0 0; }

.tier {
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 6px; white-space: nowrap;
}
.tier.Strong { color: var(--strong); background: var(--strong-bg); }
.tier.Moderate { color: var(--moderate); background: var(--moderate-bg); }

.meter { display: flex; align-items: center; gap: 10px; margin: 14px 0 10px; }
.meter .track { flex: 1; height: 6px; background: #f1f5f9; border-radius: 999px; overflow: hidden; }
.meter .fill { height: 100%; width: 0; border-radius: 999px; transition: width .8s cubic-bezier(.2,.8,.2,1); }
.meter .fill.Strong { background: var(--strong); }
.meter .fill.Moderate { background: var(--moderate); }
.meter .score { font-weight: 700; font-size: 14px; color: var(--text); min-width: 32px; text-align: right; }

.labels { margin: 2px 0 10px; display: flex; flex-wrap: wrap; gap: 5px; }
.label-chip {
  display: inline-block; font-size: 11.5px; font-weight: 500;
  color: var(--primary); background: var(--primary-light);
  border-radius: 999px; padding: 3px 10px;
}
.rationale { font-size: 14px; margin: 0 0 6px; color: var(--text); }
.rank-reason {
  font-size: 13px; color: var(--text-muted); margin: 0 0 10px;
  padding-left: 12px; border-left: 2px solid var(--moderate);
}

.meta {
  display: flex; flex-wrap: wrap; gap: 8px 18px;
  border-top: 1px solid var(--border); padding-top: 12px; font-size: 13px;
}
.meta .k { font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-right: 5px; }
.meta a { color: var(--primary); font-weight: 500; word-break: break-word; }
.verification-row {
  display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0;
}
.verification-badge {
  display: inline-flex; align-items: center; min-height: 25px; padding: 4px 8px;
  border: 1px solid var(--border); border-radius: 6px; background: var(--bg);
  color: var(--text-muted); font-size: 11.5px; font-weight: 600;
}
.verification-badge.is-verified { border-color: #a7f3d0; background: var(--strong-bg); color: var(--strong); }
.source-list {
  margin: 10px 0 0; padding: 10px 0 0; border-top: 1px solid var(--border);
  font-size: 12.5px; color: var(--text-muted);
}
.source-list strong { color: var(--text); }
.source-list a { color: var(--primary); font-weight: 500; word-break: break-word; }

.lowerfit {
  margin-top: 22px; padding: 16px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.lowerfit:empty { display: none; }
.lowerfit h3 { font-weight: 600; font-size: 13px; color: var(--text-muted); margin: 0 0 8px; text-transform: uppercase; letter-spacing: .05em; }
.lowerfit ul { margin: 0; padding-left: 18px; color: var(--text-muted); font-size: 13.5px; }
.lowerfit li { margin: 4px 0; }

.notes {
  margin-top: 16px; padding: 14px 16px;
  background: var(--primary-light); border-radius: var(--radius-sm);
  font-size: 13.5px; color: var(--text); line-height: 1.5;
}

/* --- Chat --- */
.chat-panel {
  margin-top: 24px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden;
}
.chat-heading {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.chat-heading > strong { font-size: 13px; }
.chat-mode-control {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 3px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg);
}
.chat-mode-control button {
  display: block; min-width: 138px; padding: 7px 10px; border-radius: 6px;
  border: 0; background: transparent; cursor: pointer; font-family: var(--font);
  color: var(--text-muted); font-size: 11px; font-weight: 600; text-align: center;
}
.chat-mode-control button.is-active { background: var(--surface); color: var(--primary); box-shadow: 0 1px 2px rgba(15, 23, 42, .08); }
.chat-mode-control button:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.chat-messages {
  max-height: 300px; overflow-y: auto;
  padding: 16px; display: flex; flex-direction: column; gap: 10px;
}
.chat-messages:empty { display: none; }
.chat-bubble {
  max-width: 80%; padding: 10px 14px; border-radius: 12px;
  font-size: 13.5px; line-height: 1.5; word-break: break-word;
}
.chat-user {
  align-self: flex-end;
  background: var(--primary); color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-assistant {
  align-self: flex-start;
  background: #f1f5f9; color: var(--text);
  border-bottom-left-radius: 4px;
}
.chat-error { color: var(--error); font-style: italic; background: var(--error-bg); }
.chat-form {
  display: flex; gap: 8px; padding: 12px 16px;
  border-top: 1px solid var(--border);
}
.chat-form input {
  flex: 1; font-family: var(--font); font-size: 14px; color: var(--text);
  background: var(--bg); border: 1.5px solid var(--border);
  border-radius: 8px; padding: 10px 12px; transition: border-color .15s;
}
.chat-form input:focus { outline: none; border-color: var(--primary); }
.chat-send-btn {
  font-weight: 600; font-size: 13px;
  background: var(--primary); color: #fff; border: none;
  border-radius: 8px; padding: 0 18px; cursor: pointer;
  transition: background .15s;
}
.chat-send-btn:hover { background: var(--primary-hover); }
.chat-send-btn:disabled { opacity: .5; cursor: progress; }

@media (max-width: 700px) {
  .chat-heading { align-items: stretch; flex-direction: column; }
  .chat-mode-control button { min-width: 0; }
}

/* --- Footer --- */
.foot {
  text-align: center; color: var(--text-muted);
  font-size: 13px; padding: 32px; border-top: 1px solid var(--border);
}
.footer-support-nav {
  display: flex;
  justify-content: center;
  margin-top: 10px;
}
.global-support-link {
  color: inherit;
  font-weight: 600;
  text-decoration: none;
}
.global-support-link:hover { color: var(--text); text-decoration: underline; }

/* --- Demo Page --- */
.demo-page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 40px clamp(20px, 5vw, 48px) 72px;
}
.demo-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, .82fr);
  gap: clamp(32px, 6vw, 72px);
  align-items: center;
  padding: 48px 0 56px;
}
.demo-hero .eyebrow,
.demo-section .eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--primary);
  margin: 0 0 8px;
}
.demo-hero h1 {
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.08;
  letter-spacing: -.02em;
  margin: 0 0 16px;
  max-width: 760px;
}
.demo-hero p {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 660px;
  margin: 0;
}
.demo-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 26px;
}
.demo-primary,
.demo-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}
.demo-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 1px 2px rgba(37,99,235,.28);
}
.demo-primary:hover { background: var(--primary-hover); }
.demo-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
.demo-secondary:hover { border-color: var(--primary); color: var(--primary); }
.demo-preview {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.demo-window-bar {
  display: flex;
  gap: 7px;
  align-items: center;
  height: 34px;
  padding: 0 14px;
  background: #f1f5f9;
  border-bottom: 1px solid var(--border);
}
.demo-window-bar span {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #cbd5e1;
}
.demo-preview-body { padding: 18px; }
.demo-preview-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 14px;
}
.demo-preview-row.strong {
  background: var(--strong-bg);
  border-color: #bbf7d0;
}
.demo-preview-row b { color: var(--strong); }
.demo-preview-line {
  height: 10px;
  width: 72%;
  background: #e2e8f0;
  border-radius: 999px;
  margin: 9px 0;
}
.demo-preview-line.wide { width: 92%; }
.demo-preview-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 16px 0;
}
.demo-preview-tags span {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-light);
  border-radius: 999px;
  padding: 4px 9px;
}
.demo-email-block {
  border-top: 1px solid var(--border);
  margin-top: 14px;
  padding-top: 14px;
}
.demo-email-block strong {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.demo-email-block p {
  margin: 0;
  color: var(--text);
  font-size: 13px;
}
.demo-section {
  padding: 38px 0;
  border-top: 1px solid var(--border);
}
.demo-section-head {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  margin-bottom: 22px;
}
.demo-section h2 {
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.15;
  letter-spacing: -.01em;
  margin: 0;
  max-width: 680px;
}
.demo-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.demo-step,
.demo-value-grid > div {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px;
}
.demo-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  margin-bottom: 14px;
}
.demo-step h3,
.demo-value-grid strong {
  display: block;
  font-size: 16px;
  line-height: 1.25;
  margin: 0 0 8px;
}
.demo-step p,
.demo-value-grid p {
  color: var(--text-muted);
  font-size: 13.5px;
  margin: 0 0 14px;
}
.demo-step a {
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}
.demo-band {
  background: #f8fafc;
  margin-left: calc(clamp(20px, 5vw, 48px) * -1);
  margin-right: calc(clamp(20px, 5vw, 48px) * -1);
  padding-left: clamp(20px, 5vw, 48px);
  padding-right: clamp(20px, 5vw, 48px);
}
.demo-value-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.demo-launch {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
}
.demo-launch h2 { max-width: 720px; }

/* --- Admissions Page --- */
.admissions-output {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.admission-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 18px;
}
.admission-block h3 {
  margin: 0 0 8px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
}
.admission-block p,
.admission-block li {
  font-size: 13.5px;
  line-height: 1.55;
}
.admission-block p {
  margin: 0 0 8px;
}
.admission-block ul {
  margin: 0;
  padding-left: 18px;
}
.admission-block li {
  margin: 8px 0;
}
.admission-block a {
  color: var(--primary);
  font-weight: 600;
  word-break: break-word;
}
.admission-block.caution {
  border-color: #facc15;
  background: #fffbeb;
}
.source-line {
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 2px;
}
.status-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  margin-left: 5px;
  vertical-align: baseline;
}

/* --- Commercial account and admin --- */
.compact-page-header { padding-bottom: 24px; }
.compact-page-header h1,
.admin-title-row h1,
.legal-page h1 { letter-spacing: 0; }
.service-notice {
  max-width: 1024px;
  margin: 16px auto;
  padding: 12px 16px;
  border: 1px solid #f59e0b;
  border-radius: 8px;
  background: #fffbeb;
  color: #92400e;
  font-size: 13px;
  display: flex;
  gap: 8px;
  align-items: baseline;
}
.service-notice[data-tone="success"] {
  border-color: #86efac;
  background: #f0fdf4;
  color: #166534;
}
.service-notice[data-tone="error"] {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}
.account-shell {
  width: min(1024px, calc(100% - 40px));
  margin: 0 auto;
  padding: 16px 0 64px;
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}
.account-auth-panel,
.account-section,
.admin-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.account-auth-panel {
  position: sticky;
  top: 82px;
  padding: 24px;
}
.account-auth-panel h2,
.account-section h2,
.admin-section h2 {
  font-size: 18px;
  line-height: 1.3;
  letter-spacing: 0;
  margin: 0 0 8px;
}
.account-auth-panel .eyebrow,
.account-section .eyebrow,
.admin-section .eyebrow,
.admin-title-row .eyebrow,
.legal-page .eyebrow {
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin: 0 0 6px;
}
.account-auth-panel .lede {
  color: var(--text-muted);
  font-size: 13.5px;
  margin: 0 0 20px;
}
.consent-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  margin: 4px 0 18px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
}
.consent-row input { margin: 3px 0 0; }
.consent-row a,
.legal-footer a,
.legal-page a { color: var(--primary); }
.google-login {
  width: 100%;
  min-height: 42px;
  margin-top: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.google-login:hover:not(:disabled) { border-color: var(--primary); background: var(--bg); }
.google-login:disabled { cursor: wait; opacity: 0.65; }
.google-login-mark { color: #4285f4; font-size: 17px; font-weight: 800; line-height: 1; }
.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0;
  color: var(--text-muted);
  font-size: 12px;
}
.auth-divider::before,
.auth-divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.auth-switch {
  margin: 16px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}
.auth-switch a { color: var(--primary); font-weight: 600; }
.account-terms-gate {
  margin: 16px 0;
  padding: 14px;
  border: 1px solid var(--moderate);
  border-radius: 6px;
  background: var(--moderate-bg);
}
.account-terms-gate p { margin: 0 0 10px; font-size: 13px; }
.account-terms-gate .run { width: 100%; margin-top: 12px; }
.register-shell {
  width: min(100% - 32px, 480px);
  margin: 32px auto 64px;
}
.register-shell .account-auth-panel { position: static; }
.register-shell .google-login { margin: 0 0 16px; }
.register-shell .auth-divider { margin-top: 0; }
.register-submit { width: 100%; margin-top: 4px; }
.registration-pending { padding-top: 6px; }
.registration-pending h3 { margin: 0 0 10px; font-size: 17px; letter-spacing: 0; }
.registration-pending > p:not(.eyebrow) { margin: 0 0 10px; color: var(--text-muted); font-size: 13px; line-height: 1.55; }
.registration-pending strong { color: var(--text); overflow-wrap: anywhere; }
.registration-code-entry { margin-top: 10px; }
.verification-form { margin-top: 18px; }
.verification-code-input {
  min-height: 52px;
  text-align: center;
  font: 600 24px/1 var(--font-mono);
  letter-spacing: 0;
}

/* --- Application Tracker --- */
.application-header { padding-bottom: 24px; }
.application-shell {
  width: min(1220px, calc(100% - 40px));
  margin: 0 auto;
  padding: 0 0 72px;
}
.application-view-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--border);
}
.application-view-tabs button {
  min-width: 0;
  padding: 15px 18px;
  border: 0;
  background: var(--surface);
  color: var(--text-muted);
  text-align: left;
  cursor: pointer;
}
.application-view-tabs button:hover { background: #f8fafc; }
.application-view-tabs button.is-active {
  box-shadow: inset 0 -3px 0 var(--primary);
  background: var(--primary-light);
  color: var(--text);
}
.application-view-tabs strong,
.application-view-tabs span { display: block; }
.application-view-tabs strong { margin-bottom: 3px; font-size: 14px; }
.application-view-tabs span { font-size: 11px; line-height: 1.4; }
.application-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--border);
}
.application-summary > div {
  min-height: 86px;
  padding: 15px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--surface);
}
.application-summary span { color: var(--text-muted); font-size: 12px; font-weight: 600; }
.application-summary strong { font-size: 27px; line-height: 1; }
.application-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 18px 0 28px;
}
.application-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 180px;
  gap: 8px;
  width: min(500px, 100%);
}
.application-filters input,
.application-filters select { min-height: 40px; padding-top: 8px; padding-bottom: 8px; }
.application-import-label { display: inline-flex; align-items: center; min-height: 38px; }
.application-layout {
  display: grid;
  grid-template-columns: minmax(320px, 390px) minmax(0, 1fr);
  gap: 44px;
  align-items: start;
}
.application-editor {
  position: sticky;
  top: 82px;
  max-height: calc(100vh - 102px);
  overflow-y: auto;
  padding-right: 8px;
  scrollbar-width: thin;
}
.application-section-heading,
.application-list-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}
.application-section-heading .eyebrow,
.application-list-heading .eyebrow { margin: 0 0 5px; color: var(--primary); font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.application-section-heading h2,
.application-list-heading h2 { margin: 0; font-size: 22px; line-height: 1.25; letter-spacing: 0; }
.application-fieldset {
  min-width: 0;
  margin: 22px 0;
  padding: 18px 0 2px;
  border: 0;
  border-top: 1px solid var(--border);
}
.application-fieldset legend {
  padding: 0 10px 0 0;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}
.application-date-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.application-advisor-picker {
  max-height: 168px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}
.application-advisor-picker label {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 9px 11px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  font-size: 12px;
  line-height: 1.4;
}
.application-advisor-picker label:last-child { border-bottom: 0; }
.application-advisor-picker input { margin: 2px 0 0; accent-color: var(--primary); }
.application-advisor-picker p { margin: 0; padding: 12px; color: var(--text-muted); font-size: 12px; }
.package-source-preview {
  display: grid;
  gap: 3px;
  margin: -5px 0 16px;
  padding: 10px 12px;
  border-left: 3px solid var(--primary);
  background: #f8fafc;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.45;
}
.package-source-preview strong { color: var(--text); font-size: 12px; }
.package-source-preview a { color: var(--primary); font-weight: 600; text-decoration: none; }
.application-documents { display: flex; flex-direction: column; gap: 6px; }
.application-document-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px 30px;
  gap: 6px;
  align-items: center;
}
.application-document-row > span { min-width: 0; font-size: 12px; line-height: 1.35; }
.application-document-row select { padding: 7px 8px; font-size: 11px; }
.application-document-row button {
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 17px;
  line-height: 1;
}
.application-document-row button:hover { border-color: var(--error); color: var(--error); }
.application-add-document { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; margin-top: 10px; }
.application-add-document input { padding: 8px 10px; font-size: 12px; }
.application-list-panel { min-width: 0; }
.application-list-heading { align-items: end; padding-bottom: 13px; border-bottom: 1px solid var(--border); }
.application-list { display: flex; flex-direction: column; gap: 12px; }
.application-record {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}
.application-record > header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.application-record h3 { margin: 7px 0 2px; font-size: 17px; line-height: 1.25; letter-spacing: 0; }
.application-record header p { margin: 0; color: var(--text-muted); font-size: 12px; }
.application-stage-chip {
  display: inline-flex;
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}
.application-stage-chip[data-stage="submitted"],
.application-stage-chip[data-stage="interview"],
.application-stage-chip[data-stage="offer"] { background: var(--strong-bg); color: var(--strong); }
.application-stage-chip[data-stage="rejected"],
.application-stage-chip[data-stage="withdrawn"] { background: #f1f5f9; color: var(--text-muted); }
.application-record-actions { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.application-record-actions button {
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  font: 600 11px var(--font);
}
.application-record-actions button:hover { border-color: var(--primary); color: var(--primary); }
.application-record-actions button.danger:hover { border-color: var(--error); color: var(--error); }
.application-record-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: 7px;
  overflow: hidden;
  background: var(--border);
}
.application-record-grid > div { min-width: 0; padding: 10px 12px; display: flex; flex-direction: column; background: #f8fafc; }
.application-record-grid span,
.application-progress-row span,
.application-linked-work > span { color: var(--text-muted); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.application-record-grid strong { overflow-wrap: anywhere; font-size: 12px; line-height: 1.4; }
.application-record-grid strong a { color: var(--primary); text-decoration: none; }
.application-record-grid small { color: var(--text-muted); font-size: 10px; }
.application-progress-row { margin-top: 14px; }
.application-progress-row > div:first-child { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 5px; }
.application-progress-row strong { font-size: 11px; }
.application-progress { height: 6px; overflow: hidden; border-radius: 3px; background: #e2e8f0; }
.application-progress > span { display: block; height: 100%; background: var(--strong); }
.application-linked-work { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 14px; }
.application-linked-work > span { margin-right: 3px; }
.application-linked-work a { padding: 3px 6px; border-radius: 4px; background: var(--primary-light); color: var(--primary); text-decoration: none; font-size: 10px; font-weight: 600; }
.application-notes { margin: 13px 0 0; padding-top: 12px; border-top: 1px solid var(--border); white-space: pre-wrap; color: var(--text-muted); font-size: 12px; }
.package-timeline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 11px;
}
.application-stage-chip[data-stage="ready"] { background: #ecfdf5; color: #047857; }
.application-stage-chip[data-stage="sent"],
.application-stage-chip[data-stage="follow_up"],
.application-stage-chip[data-stage="replied"] { background: #eff6ff; color: #1d4ed8; }

@media (max-width: 900px) {
  .application-toolbar { align-items: flex-start; flex-direction: column; }
  .application-layout { grid-template-columns: 1fr; gap: 42px; }
  .application-editor { position: static; max-height: none; overflow: visible; padding-right: 0; }
}

@media (max-width: 620px) {
  .application-shell { width: min(100% - 28px, 1220px); }
  .application-view-tabs { grid-template-columns: 1fr; }
  .application-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .application-filters { grid-template-columns: 1fr; }
  .application-toolbar .toolbar-actions { width: 100%; }
  .application-toolbar .toolbar-actions > * { flex: 1 1 auto; justify-content: center; text-align: center; }
  .application-date-grid { grid-template-columns: 1fr; }
  .application-record > header { flex-direction: column; }
  .application-record-actions { justify-content: flex-start; }
  .application-record-grid { grid-template-columns: 1fr; }
  .application-document-row { grid-template-columns: minmax(0, 1fr) 104px 30px; }
  .manual-advisor-grid { grid-template-columns: 1fr; }
  .manual-advisor-panel .run { width: 100%; }
}
.verification-form .register-submit { margin-top: 10px; }
.registration-resend { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.registration-resend-note { min-height: 38px; margin: 0 0 8px; color: var(--text-muted); font-size: 12.5px; line-height: 1.5; }
.registration-pending > .text-action { margin-top: 14px; }
.captcha-slot {
  min-height: 65px;
  margin: 12px 0;
  overflow: hidden;
}
.captcha-slot[hidden] { display: none; }
.account-actions { margin-top: 4px; }
.account-actions .run { width: auto; min-width: 112px; padding: 10px 16px; }
.admin-link { text-decoration: none; }
.text-action {
  appearance: none;
  border: 0;
  padding: 6px 0;
  background: transparent;
  color: var(--primary);
  font: 600 12px var(--font);
  cursor: pointer;
}
.form-status {
  min-height: 20px;
  margin: 14px 0 0;
  color: var(--text-muted);
  font-size: 12.5px;
}
.form-status[data-tone="error"] { color: var(--error); }
.form-status[data-tone="success"] { color: var(--strong); }
.account-details { min-width: 0; }
.account-stats,
.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.account-stat,
.metric {
  min-height: 82px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.account-stat span,
.metric span { color: var(--text-muted); font-size: 11.5px; font-weight: 600; }
.account-stat strong,
.metric strong { font-size: 22px; line-height: 1.1; }
.account-stat strong[data-status="active"] { color: var(--strong); }
.account-stat strong[data-status="suspended"],
.account-stat strong[data-status="closed"] { color: var(--error); }
.account-section { padding: 20px; margin-bottom: 16px; }
.account-section-copy { margin: 0 0 14px; color: var(--text-muted); font-size: 13px; line-height: 1.55; }
.identity-list { display: grid; border-top: 1px solid var(--line); }
.identity-row {
  min-height: 48px;
  display: grid;
  grid-template-columns: minmax(130px, .7fr) minmax(180px, 1fr) auto;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
}
.identity-row > span:not(.identity-provider) { min-width: 0; overflow-wrap: anywhere; color: var(--text-muted); }
.identity-row strong { color: var(--strong); font-size: 11.5px; }
.identity-provider { font-weight: 700; }
.identity-actions { margin-top: 14px; }
.identity-password-form { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.section-heading-row,
.admin-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}
.activity-list { margin-top: 14px; border-top: 1px solid var(--border); }
.activity-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
}
.activity-row > div { min-width: 0; }
.activity-row strong,
.activity-row span { display: block; }
.activity-row span { color: var(--text-muted); font-size: 11px; overflow-wrap: anywhere; }
.activity-value { text-align: right; flex: 0 0 auto; }
.activity-value span[data-status="success"] { color: var(--strong); }
.activity-value span[data-status="refunded"] { color: var(--moderate); }
.credit-positive { color: var(--strong); }
.credit-negative { color: var(--text); }
.purchase-heading { align-items: center; }
.payment-mode { flex: 0 0 auto; padding: 5px 8px; border-radius: 5px; background: #eef7f4; color: #08775a; font-size: 10.5px; font-weight: 700; text-transform: uppercase; }
.payment-products { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 16px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.payment-product { min-width: 0; padding: 18px; display: flex; flex-direction: column; align-items: stretch; }
.payment-product + .payment-product { border-left: 1px solid var(--border); }
.payment-product-amount { display: flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.payment-product-amount strong { font-size: 27px; line-height: 1; }
.payment-product-amount span { color: var(--text); font-size: 12px; font-weight: 600; }
.payment-product-type { margin: 9px 0 16px; color: var(--text-muted); font-size: 11px; }
.payment-product .payment-buy { width: 100%; margin-top: auto; padding: 10px 12px; font-size: 12.5px; box-shadow: none; }
.purchase-section > .form-status:empty { display: none; }
.empty-state { color: var(--text-muted); font-size: 12.5px; margin: 14px 0 0; }
.cost-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px 18px; margin-top: 12px; }
.cost-grid > div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 12.5px; }
.legal-footer { display: flex; justify-content: space-between; gap: 24px; }
.legal-footer span:last-child { display: flex; gap: 16px; }

.admin-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 36px 0 72px;
}
.admin-title-row { margin-bottom: 20px; }
.admin-title-row h1 { font-size: 30px; line-height: 1.2; margin: 0 0 6px; }
.admin-title-row p:last-child { color: var(--text-muted); font-size: 13.5px; margin: 0; }
.admin-shell > .service-notice { max-width: none; margin: 0 0 20px; }
.metric-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.metric { min-height: 88px; }
.metric strong { font-size: 20px; }
.admin-section { padding: 20px; margin-top: 16px; }
.compact-search { width: min(260px, 100%); }
.compact-search input { padding: 8px 10px; font-size: 12.5px; }
.admin-table-wrap { margin-top: 16px; overflow-x: auto; border: 1px solid var(--border); border-radius: 7px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 12.5px; background: var(--surface); }
.admin-table th,
.admin-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
.admin-table th { background: #f8fafc; color: var(--text-muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; }
.admin-table tbody tr:last-child td { border-bottom: 0; }
.admin-table td:first-child { min-width: 210px; white-space: normal; }
.admin-table td:first-child strong,
.admin-table td:first-child span { display: block; overflow-wrap: anywhere; }
.admin-table td:first-child span { color: var(--text-muted); font-size: 10.5px; }
.admin-table .status-chip { margin-left: 0; }
.status-chip[data-status="active"] { background: var(--strong-bg); color: var(--strong); }
.status-chip[data-status="suspended"],
.status-chip[data-status="closed"] { background: var(--error-bg); color: var(--error); }
.table-action {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--primary);
  padding: 5px 9px;
  font: 600 11px var(--font);
  cursor: pointer;
}
.empty-cell { color: var(--text-muted); text-align: center !important; padding: 24px !important; }
.user-editor { scroll-margin-top: 84px; }
.mono-detail { color: var(--text-muted); font: 11px var(--font-mono); margin: 0; overflow-wrap: anywhere; }
.admin-edit-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: 18px; }
.admin-edit-block h3 { font-size: 13px; margin: 0 0 12px; }
.compact-run { width: auto; padding: 9px 14px; font-size: 12.5px; }
.admin-danger-zone {
  display: grid;
  grid-template-columns: minmax(240px, .8fr) minmax(320px, 1.2fr);
  gap: 16px 28px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.admin-danger-copy h3 { margin: 0 0 7px; color: var(--error); font-size: 13px; }
.admin-danger-copy p,
.admin-danger-note { margin: 0; color: var(--text-muted); font-size: 12px; line-height: 1.55; }
.admin-danger-form { min-width: 0; }
.danger-button {
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid var(--error);
  border-radius: 6px;
  background: var(--error);
  color: #fff;
  font: 600 12.5px var(--font);
  cursor: pointer;
}
.danger-button:hover:not(:disabled) { filter: brightness(.94); }
.danger-button:disabled { cursor: not-allowed; opacity: .45; }
.admin-danger-note { grid-column: 2; }
.admin-two-column { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.ai-operations-section .admin-section-copy { margin: 5px 0 0; }
.runtime-control { flex: 0 0 230px; }
.runtime-control > label { display: block; margin-bottom: 6px; color: var(--text-muted); font-size: 11px; font-weight: 700; }
.runtime-control > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.runtime-control input { min-width: 0; padding: 8px 10px; }
.operations-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 18px; border: 1px solid var(--border); border-radius: 7px; overflow: hidden; }
.operation-metric { min-height: 82px; padding: 14px 16px; background: var(--surface); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); display: flex; flex-direction: column; justify-content: space-between; }
.operation-metric:nth-child(3n) { border-right: 0; }
.operation-metric:nth-last-child(-n + 3) { border-bottom: 0; }
.operation-metric span,
.rate-limit-strip span { color: var(--text-muted); font-size: 11px; font-weight: 600; }
.operation-metric strong { font-size: 19px; line-height: 1.2; }
.rate-limit-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; padding: 13px 2px 0; }
.rate-limit-strip > div { min-width: 0; }
.rate-limit-strip span,
.rate-limit-strip strong { display: block; overflow-wrap: anywhere; }
.rate-limit-strip strong { margin-top: 3px; font-size: 12px; }

.legal-page {
  width: min(840px, calc(100% - 40px));
  margin: 0 auto;
  padding: 48px 0 72px;
}
.legal-page h1 { font-size: 34px; line-height: 1.2; margin: 0 0 12px; }
.legal-page article > p { color: var(--text-muted); font-size: 14px; }
.legal-page h2 { font-size: 19px; letter-spacing: 0; margin: 34px 0 10px; }
.legal-page h3 { font-size: 14px; letter-spacing: 0; margin: 18px 0 6px; }
.legal-page p,
.legal-page li,
.legal-contact { font-size: 14px; line-height: 1.72; }
.legal-page ul { margin: 8px 0 12px; padding-left: 22px; }
.legal-page li + li { margin-top: 5px; }
.legal-page .legal-lede { max-width: 720px; font-size: 16px; line-height: 1.65; }
.legal-summary { margin: 24px 0 8px; padding: 16px 18px; border: 1px solid var(--border); border-left: 3px solid var(--primary); border-radius: 6px; background: var(--surface); }
.legal-summary strong { display: block; margin-bottom: 5px; font-size: 13px; }
.legal-summary p { margin: 0; color: var(--text-muted); font-size: 13.5px; line-height: 1.6; }
.legal-contact { padding: 14px 16px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text-muted); font-style: normal; overflow-wrap: anywhere; }
.legal-contact strong { color: var(--text); }
.legal-table-wrap { width: 100%; overflow-x: auto; margin: 12px 0; border: 1px solid var(--border); border-radius: 6px; }
.legal-table { width: 100%; min-width: 580px; border-collapse: collapse; background: var(--surface); font-size: 13px; }
.legal-table th,
.legal-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; line-height: 1.5; }
.legal-table th { background: var(--bg); color: var(--text-muted); font-size: 11px; text-transform: uppercase; }
.legal-table tr:last-child td { border-bottom: 0; }
.legal-table th:first-child,
.legal-table td:first-child { width: 48%; }
.legal-page .legal-note { border-left: 3px solid #f59e0b; padding: 10px 14px; background: #fffbeb; color: #92400e; }
.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; }

/* --- Responsive --- */
@media (max-width: 800px) {
  .masthead { align-items: flex-start; flex-direction: column; gap: 12px; }
  .layout { grid-template-columns: 1fr; }
  .layout > * { min-width: 0; }
  .brief { position: static; }
  .hero { padding: 40px 20px 32px; }
  .saved-edit-grid { grid-template-columns: 1fr; }
  .result-tabs { position: sticky; top: 0; z-index: 4; }
  .demo-hero,
  .demo-steps,
  .demo-value-grid {
    grid-template-columns: 1fr;
  }
  .demo-hero { padding-top: 24px; }
  .demo-section-head,
  .demo-launch {
    align-items: flex-start;
    flex-direction: column;
  }
  .site-nav { gap: 12px; }
  .account-shell { grid-template-columns: 1fr; }
  .account-auth-panel { position: static; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-two-column,
  .admin-edit-grid,
  .admin-danger-zone { grid-template-columns: 1fr; }
  .ai-operations-section .section-heading-row { flex-direction: column; }
  .runtime-control { width: 100%; flex-basis: auto; }
  .operations-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .operation-metric,
  .operation-metric:nth-child(3n) { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
  .operation-metric:nth-child(2n) { border-right: 0; }
  .operation-metric:last-child { border-bottom: 0; }
  .rate-limit-strip { grid-template-columns: 1fr; gap: 10px; }
  .admin-danger-note { grid-column: 1; }
  .identity-row { grid-template-columns: minmax(120px, .8fr) minmax(0, 1fr); }
  .identity-row strong { grid-column: 1 / -1; padding-bottom: 10px; }
}
@media (max-width: 440px) {
  .row { flex-direction: column; gap: 0; }
  .row .field, .row .field.grow { width: 100%; }
  .research-source-field { grid-template-columns: 1fr; }
  .research-import-btn { width: 100%; }
  .saved-toolbar { align-items: stretch; flex-direction: column; }
  .saved-toolbar .toolbar-actions { justify-content: space-between; }
  .saved-item-head { flex-direction: column; }
  .saved-item-head .toolbar-actions { width: 100%; align-items: stretch; }
  .saved-item-head .toolbar-actions > button { flex: 1 1 auto; }
  .masthead { align-items: flex-start; flex-direction: column; gap: 12px; }
  .site-nav { justify-content: flex-start; }
  .account-stats,
  .metric-grid,
  .cost-grid { grid-template-columns: 1fr; }
  .section-heading-row,
  .admin-title-row,
  .legal-footer { flex-direction: column; }
  .service-notice { margin-left: 20px; margin-right: 20px; flex-direction: column; }
  .captcha-slot { min-height: 140px; }
  .payment-products { grid-template-columns: 1fr; }
  .payment-product { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 14px; padding: 14px 0; }
  .payment-product + .payment-product { border-left: 0; border-top: 1px solid var(--border); }
  .payment-product-type { margin: 0; }
  .payment-product .payment-buy { grid-column: 2; grid-row: 1 / 3; width: 78px; }
}

@media (prefers-reduced-motion: reduce) {
  .spinner { animation: none; opacity: .8; }
  .meter .fill { transition: none; }
}

/* --- Public site and authenticated workspace --- */
.wordmark { color: var(--text); text-decoration: none; }
.ghost-link[aria-current="page"] { color: var(--primary); font-weight: 700; }
.public-masthead { min-height: 64px; padding-top: 12px; padding-bottom: 12px; }
.public-try { color: var(--primary); font-weight: 700; }
.public-signup,
.home-primary-action,
.home-secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 6px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}
.public-signup,
.home-primary-action { background: var(--primary); color: #fff; }
.public-signup:hover,
.home-primary-action:hover { background: var(--primary-hover); }
.home-secondary-action { color: var(--text); border: 1px solid var(--border); background: #fff; }
.home-secondary-action:hover { border-color: #94a3b8; }

.home-hero {
  min-height: 0;
  padding: clamp(52px, 7vh, 78px) clamp(20px, 5vw, 72px) 0;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
}
.home-hero-copy { max-width: 900px; margin: 0 auto 36px; text-align: center; }
.home-hero .eyebrow,
.home-section .eyebrow,
.home-cta .eyebrow,
.public-title .eyebrow,
.dashboard-shell .eyebrow,
.auth-card .eyebrow {
  margin: 0 0 8px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.home-hero h1 { margin: 0; font-size: clamp(44px, 6vw, 74px); line-height: 1.02; letter-spacing: 0; }
.home-headline { margin: 14px auto 0; max-width: 760px; font-size: clamp(22px, 3vw, 36px); font-weight: 700; line-height: 1.18; color: #334155; }
.home-subcopy { margin: 16px auto 0; max-width: 720px; color: var(--text-muted); font-size: 16px; line-height: 1.65; }
.home-benefit-note { margin: 10px auto 0; max-width: 720px; color: #42566f; font-size: 13px; font-weight: 600; line-height: 1.55; }
.home-actions { display: flex; justify-content: center; gap: 10px; margin-top: 24px; flex-wrap: wrap; }
.home-trust { margin: 13px 0 0; color: var(--text-muted); font-size: 12px; }
.home-product-stage {
  width: min(1180px, 94vw);
  height: clamp(250px, 35vh, 340px);
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  box-shadow: 0 20px 55px rgba(15, 23, 42, .12);
  background: #fff;
}
.home-preview-ui { min-width: 880px; height: 100%; padding: 24px 42px 36px; background: #f8fafc; color: var(--text); overflow: hidden; }
.home-preview-heading { max-width: 700px; margin: 0 auto 24px; }
.home-preview-heading .eyebrow,
.home-preview-form .eyebrow { margin: 0 0 5px; color: var(--primary); font-size: 8px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.home-preview-heading h2 { margin: 0 0 5px; font-size: 25px; line-height: 1.18; letter-spacing: 0; }
.home-preview-heading > p:last-child,
.home-preview-form > p { margin: 0; color: var(--text-muted); font-size: 10px; line-height: 1.5; }
.home-preview-grid { display: grid; grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr); gap: 44px; max-width: 880px; margin: 0 auto; }
.home-preview-form h3 { margin: 0 0 2px; font-size: 17px; line-height: 1.25; }
.home-preview-form label { display: flex; flex-direction: column; gap: 4px; margin-top: 11px; }
.home-preview-form label > span { font-size: 8px; font-weight: 700; }
.home-preview-form textarea,
.home-preview-form input { width: 100%; border: 1px solid #d7e0eb; border-radius: 5px; background: #fff; color: var(--text-muted); font: 10px/1.45 var(--font); padding: 8px 9px; resize: none; }
.home-preview-form textarea { height: 60px; }
.home-preview-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.home-preview-form > button { width: 100%; margin-top: 12px; padding: 8px 10px; border: 0; border-radius: 5px; background: var(--primary); color: #fff; font: 700 10px var(--font); }
.home-preview-results { padding-top: 55px; }
.home-preview-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--text-muted); font-size: 10px; }
.home-preview-empty strong { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 8px; background: var(--primary-light); color: var(--primary); font-size: 17px; }
.home-preview-empty p { margin: 0; }
.home-preview-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 42px; padding: 9px 11px; border: 1px solid #d7e0eb; border-radius: 6px; background: #fff; }
.home-preview-toolbar > div { display: flex; flex-direction: column; }
.home-preview-toolbar strong { font-size: 9px; }
.home-preview-toolbar span { color: var(--text-muted); font-size: 8px; }
.home-preview-toolbar button { flex: 0 0 auto; padding: 7px 10px; border: 0; border-radius: 5px; background: #6fc7ae; color: #fff; font: 700 8px var(--font); }

.home-section { padding: 88px clamp(20px, 6vw, 80px); }
.home-section-heading { max-width: 700px; margin-bottom: 42px; }
.home-section h2,
.home-cta h2,
.public-title h1 { margin: 0; font-size: clamp(30px, 4vw, 46px); line-height: 1.15; letter-spacing: 0; }
.home-section-heading > p:last-child,
.public-title > p:last-child { margin: 14px 0 0; color: var(--text-muted); max-width: 680px; }
.home-workflow { background: #fff; }
.workflow-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border); }
.workflow-list li { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 24px; padding: 24px 0; border-bottom: 1px solid var(--border); }
.workflow-list li > span { color: var(--primary); font: 600 12px var(--font-mono); padding-top: 3px; }
.workflow-list h3 { margin: 0 0 5px; font-size: 20px; }
.workflow-list p { margin: 0; color: var(--text-muted); max-width: 740px; }

.home-proof { display: grid; grid-template-columns: minmax(260px, .8fr) minmax(0, 1.2fr); gap: clamp(48px, 8vw, 110px); align-items: start; background: #eef7f4; }
.home-proof-copy h2 { margin-bottom: 14px; }
.home-proof-copy > p:last-child { color: #52666a; }
.proof-points { border-top: 1px solid #b8d7cf; }
.proof-points > div { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 24px; padding: 20px 0; border-bottom: 1px solid #b8d7cf; }
.proof-points strong { font-size: 14px; }
.proof-points span { color: #52666a; font-size: 13.5px; }
.home-cta { display: flex; justify-content: space-between; align-items: center; gap: 32px; padding: 72px clamp(20px, 6vw, 80px); background: #162338; color: #fff; }
.home-cta .eyebrow { color: #70d6b5; }
.home-cta h2 { max-width: 740px; font-size: clamp(28px, 4vw, 44px); }
.home-cta .home-primary-action { flex: 0 0 auto; background: #fff; color: #162338; }
.public-footer { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 24px clamp(20px, 5vw, 72px); border-top: 1px solid var(--border); background: #fff; color: var(--text-muted); font-size: 12px; }
.public-footer nav { display: flex; gap: 18px; }
.public-footer a { color: inherit; text-decoration: none; }
.public-footer a:hover { color: var(--text); }
.global-site-footer { margin-top: auto; }

.public-content { width: min(1040px, calc(100% - 40px)); margin: 0 auto; padding: 72px 0 88px; }
.public-title { max-width: 760px; margin-bottom: 48px; }
.pricing-band { display: grid; grid-template-columns: minmax(240px, .75fr) minmax(0, 1.25fr); gap: 56px; padding: 36px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.pricing-intro { display: flex; flex-direction: column; align-items: flex-start; }
.pricing-intro > span { color: var(--text-muted); font-size: 12px; font-weight: 700; text-transform: uppercase; }
.pricing-intro > strong { margin-top: 4px; font-size: 38px; line-height: 1.15; }
.pricing-intro p { color: var(--text-muted); font-size: 13px; }
.pricing-intro .home-primary-action { margin-top: 10px; }
.pricing-table > div { display: flex; justify-content: space-between; gap: 24px; padding: 13px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.pricing-table > div:last-child { border-bottom: 0; }
.pricing-note { color: var(--text-muted); font-size: 12.5px; max-width: 760px; margin-top: 20px; }
.faq-page { width: min(820px, calc(100% - 40px)); }
.faq-list { border-top: 1px solid var(--border); }
.faq-list details { padding: 19px 0; border-bottom: 1px solid var(--border); }
.faq-list summary { cursor: pointer; font-weight: 700; font-size: 15px; }
.faq-list p { color: var(--text-muted); margin: 12px 0 0; max-width: 720px; font-size: 13.5px; }

.auth-page { min-height: 100vh; display: flex; flex-direction: column; background: #f5f8fc; }
.auth-shell { flex: 1; display: grid; place-items: center; width: 100%; padding: 52px 20px; }
.auth-card { width: min(440px, 100%); padding: 32px; border: 1px solid var(--border); border-radius: 8px; background: #fff; box-shadow: var(--shadow); }
.auth-card h1 { margin: 0 0 8px; font-size: 27px; line-height: 1.2; letter-spacing: 0; }
.auth-card .lede { margin: 0 0 20px; color: var(--text-muted); font-size: 13.5px; }
.inline-notice { margin: 0 0 16px; }
.auth-footer { margin-top: auto; }

.auth-pending > main,
.auth-pending > .search-header,
.auth-pending > .foot { visibility: hidden; }
.app-masthead { min-height: 64px; }
.app-nav { gap: 18px; }
.credit-nav,
.account-nav { color: var(--text-muted); text-decoration: none; font-size: 12px; font-weight: 600; }
.credit-nav { display: inline-flex; align-items: center; gap: 5px; padding: 6px 9px; border: 1px solid #b8d7cf; border-radius: 6px; background: #eef7f4; color: #08775a; }
.account-nav { padding-left: 4px; }
.language-switcher {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}
.language-switcher select {
  width: 68px;
  height: 34px;
  padding: 0 7px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font: 600 12px var(--font);
  cursor: pointer;
}
.language-switcher select:hover { border-color: #94a3b8; }
.language-switcher select:focus { outline: 2px solid rgba(37, 99, 235, .2); outline-offset: 1px; border-color: var(--primary); }
.app-service-notice { margin: 16px auto; }
.dashboard-shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 52px 0 80px; }
.dashboard-welcome { max-width: 760px; margin-bottom: 32px; }
.dashboard-welcome h1 { margin: 0 0 10px; font-size: clamp(30px, 4vw, 44px); line-height: 1.15; letter-spacing: 0; }
.dashboard-welcome > p:last-child { margin: 0; color: var(--text-muted); }
.dashboard-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1px; overflow: hidden; border: 1px solid var(--border); border-radius: 8px; background: var(--border); }
.dashboard-summary > div { min-height: 132px; padding: 18px; display: flex; flex-direction: column; background: #fff; }
.dashboard-summary span { color: var(--text-muted); font-size: 12px; font-weight: 600; }
.dashboard-summary strong { margin: 5px 0 14px; font-size: 30px; line-height: 1; }
.dashboard-summary a { margin-top: auto; color: var(--primary); font-size: 12px; text-decoration: none; font-weight: 600; }
.dashboard-flow { margin-top: 56px; }
.dashboard-section-heading { display: flex; justify-content: space-between; align-items: end; gap: 32px; margin-bottom: 24px; }
.dashboard-section-heading h2 { margin: 0; font-size: 27px; }
.dashboard-section-heading > p { max-width: 430px; margin: 0; color: var(--text-muted); font-size: 13px; }
.dashboard-tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.dashboard-tools > a { min-height: 220px; padding: 20px; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--text); text-decoration: none; display: flex; flex-direction: column; transition: border-color .15s, transform .15s; }
.dashboard-tools > a:hover { border-color: #94a3b8; transform: translateY(-2px); }
.dashboard-tools span { color: var(--primary); font: 600 11px var(--font-mono); }
.dashboard-tools h3 { margin: 20px 0 8px; font-size: 18px; }
.dashboard-tools p { margin: 0; color: var(--text-muted); font-size: 13px; }
.dashboard-tools strong { margin-top: auto; color: var(--primary); font-size: 12px; }

@media (max-width: 900px) {
  .public-nav .public-try { display: none; }
  .home-proof,
  .pricing-band { grid-template-columns: 1fr; gap: 34px; }
  .dashboard-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 800px) {
  .public-masthead { align-items: center; flex-direction: row; }
  .public-nav { width: auto; overflow: visible; flex-wrap: nowrap; justify-content: flex-end; padding-bottom: 0; }
  .public-nav > a:nth-child(-n+3) { display: none; }
  .home-hero { padding-top: 48px; }
  .home-product-stage { height: 220px; width: 100%; }
  .home-preview-ui { width: 820px; min-width: 820px; padding-left: 34px; padding-right: 34px; }
  .home-section { padding-top: 64px; padding-bottom: 64px; }
  .home-cta { align-items: flex-start; flex-direction: column; }
  .proof-points > div { grid-template-columns: 1fr; gap: 6px; }
  .app-masthead { position: static; }
  .app-nav { width: 100%; overflow-x: auto; flex-wrap: nowrap; justify-content: flex-start; padding-bottom: 3px; }
  .dashboard-section-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
}

@media (max-width: 520px) {
  .public-masthead { align-items: center; }
  .public-masthead .wordmark { font-size: 18px; }
  .public-nav { gap: 8px; }
  .public-nav .public-signup { min-height: 34px; padding: 6px 11px; }
  .language-switcher select { width: 58px; padding: 0 4px; }
  .home-hero { padding-left: 18px; padding-right: 18px; }
  .home-hero h1 { font-size: 43px; }
  .home-headline { font-size: 24px; }
  .home-subcopy { font-size: 14px; }
  .home-actions { align-items: stretch; flex-direction: column; }
  .workflow-list li { grid-template-columns: 42px minmax(0, 1fr); gap: 10px; }
  .public-footer { align-items: flex-start; flex-direction: column; }
  .auth-card { padding: 24px 20px; }
  .dashboard-summary,
  .dashboard-tools { grid-template-columns: 1fr; }
}
