/* Conjoint Studio — styles. Reuses the Research Edge design system
   (terracotta accent, Inter/Montserrat, warm neutrals). */

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

:root {
  --color-bg: #ffffff;
  --color-bg-warm: #f9f7f4;
  --color-text: #191919;
  --color-text-secondary: #555555;
  --color-text-tertiary: #888888;
  --color-accent: #c4703f;
  --color-accent-soft: rgba(196, 112, 63, 0.12);
  --color-border: #e5e5e5;
  --color-border-light: #efefef;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-title: 'Helvetica Neue', 'Montserrat', 'Inter', Helvetica, Arial, sans-serif;
  --warm-sand: #f0e6d3;
  --muted-sage: #d4ddd2;
  --pale-sky: #d0dde8;
  --light-lavender: #ddd5e8;
  /* status */
  --ok: #4a7c59; --ok-soft: #e6efe8;
  --warn: #b07a2e; --warn-soft: #f6ecda;
  --bad: #b0453f; --bad-soft: #f6e2e0;
  --radius: 10px;
  --shadow: 0 8px 30px rgba(0,0,0,0.08);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.05);
  --maxw: 1180px;
}

html { font-size: 16px; -webkit-font-smoothing: antialiased; scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--color-bg); color: var(--color-text); line-height: 1.6; }
::selection { background: rgba(196,112,63,0.15); }
h1,h2,h3,h4 { font-family: var(--font-title); font-weight: 700; line-height: 1.2; }
a { color: var(--color-accent); }
code, .mono { font-family: 'SF Mono', ui-monospace, Menlo, Consolas, monospace; font-size: 0.86em; }

/* ── Nav — mirrors the main site's header ── */
.nav { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,0.88); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid var(--color-border-light); }
.nav-inner { max-width: var(--maxw); margin: 0 auto; padding: 0 2rem; height: 56px; display: flex; align-items: center; justify-content: space-between; }
.nav-logo { display: inline-flex; align-items: center; text-decoration: none; }
.nav-logo img { height: 24px; width: auto; display: block; }
.nav-logo-text { font-family: var(--font-title); font-weight: 900; font-size: 0.9rem; color: var(--color-text); text-transform: lowercase; }
.nav-logo-text .sep { color: var(--color-accent); margin: 0 0.05em; }
.nav-links { display: flex; gap: 2.25rem; list-style: none; margin: 0; padding: 0; }
.nav-links a { font-size: 0.825rem; font-weight: 400; color: var(--color-text-secondary); text-decoration: none; transition: color 0.2s; }
.nav-links a:hover { color: var(--color-text); }

/* ── App header + tabs ── */
.app-head { border-bottom: 1px solid var(--color-border); background: var(--color-bg); }
.app-head-inner { max-width: var(--maxw); margin: 0 auto; padding: 1.5rem 2rem 0; }
.app-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
.app-title { font-family: var(--font-title); font-weight: 900; font-size: 1.5rem; letter-spacing: -0.01em; }
.privacy-note { max-width: 460px; font-size: 0.74rem; line-height: 1.55; color: var(--color-text-tertiary); text-align: right; }
.privacy-note strong { color: var(--color-text-secondary); font-weight: 600; }
.privacy-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); margin-right: 0.4rem; vertical-align: middle; }
.app-actions { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.expert-toggle { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.8rem; color: var(--color-text-secondary); cursor: pointer; padding-left: 0.5rem; }
.expert-toggle input { accent-color: var(--color-accent); }

/* Tabs: light stage tints with a subtle raised-3D face */
.tabs { display: flex; gap: 0.45rem; margin-top: 1.4rem; }
.tab { font-family: var(--font); font-size: 0.9rem; font-weight: 500; color: var(--color-text-secondary); border: 1px solid rgba(25,25,25,0.1); border-bottom: none; border-radius: 10px 10px 0 0; padding: 0.65rem 1.1rem 0.72rem; cursor: pointer; display: flex; align-items: center; gap: 0.5rem; background: linear-gradient(180deg, #fff 0%, var(--tabbg, #f2f2f2) 100%); box-shadow: inset 0 1px 0 rgba(255,255,255,0.9), 0 1px 2px rgba(25,25,25,0.06); transition: color 0.15s, box-shadow 0.15s, transform 0.15s; }
.tab:hover:not(:disabled) { color: var(--color-text); box-shadow: inset 0 1px 0 rgba(255,255,255,0.9), 0 2px 5px rgba(25,25,25,0.1); }
.tab[aria-selected="true"] { color: var(--color-text); font-weight: 600; transform: translateY(-2px); background: linear-gradient(180deg, #fff 40%, var(--tabbg, #f2f2f2) 160%); box-shadow: inset 0 2px 0 var(--tabc, var(--color-accent)), inset 0 3px 0 rgba(255,255,255,0.5), 0 3px 8px rgba(25,25,25,0.1); }
.tab-num { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; background: rgba(25,25,25,0.07); color: var(--color-text-tertiary); font-size: 0.72rem; font-weight: 600; }
.tab[aria-selected="true"] .tab-num { background: var(--tabc, var(--color-accent)); color: #fff; }
.tab:disabled { opacity: 0.45; cursor: not-allowed; }

/* ── Main / panels ── */
.app-main { max-width: var(--maxw); margin: 0 auto; padding: 2rem; }
.panel { animation: fade 0.2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ── Layout helpers ── */
.row { display: flex; gap: 1rem; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.grid-side { display: grid; grid-template-columns: 1.6fr 1fr; gap: 1.5rem; align-items: start; }
.section-lead { color: var(--color-text-secondary); font-size: 0.95rem; max-width: 62ch; margin-bottom: 1.25rem; }
.stack > * + * { margin-top: 1rem; }
.muted { color: var(--color-text-tertiary); }
.small { font-size: 0.82rem; }

/* ── Cards ── */
.card { background: var(--color-bg); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 1.25rem 1.4rem; box-shadow: var(--shadow-sm); }
.card + .card { margin-top: 1.25rem; }
.card-warm { background: var(--color-bg-warm); border-color: var(--color-border-light); }
.card-title { font-size: 1rem; font-weight: 700; margin-bottom: 0.25rem; }
.card-sub { font-size: 0.85rem; color: var(--color-text-tertiary); margin-bottom: 1rem; }

/* ── Buttons ── */
.btn { font-family: var(--font); font-size: 0.85rem; font-weight: 500; padding: 0.5rem 1rem; border-radius: 8px; border: 1px solid var(--color-border); background: var(--color-bg); color: var(--color-text); cursor: pointer; transition: all 0.15s; white-space: nowrap; }
.btn:hover { border-color: var(--color-text-tertiary); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--color-accent); border-color: var(--color-accent); color: #fff; }
.btn-primary:hover { background: #a95d31; border-color: #a95d31; }
.btn-ghost { background: none; }
.btn-sm { padding: 0.3rem 0.6rem; font-size: 0.78rem; }
.btn-danger { color: var(--bad); border-color: var(--bad-soft); }

/* ── Forms ── */
label.field { display: block; font-size: 0.82rem; font-weight: 500; color: var(--color-text-secondary); margin-bottom: 0.3rem; }
input[type="text"], input[type="number"], select, textarea { font-family: var(--font); font-size: 0.88rem; padding: 0.45rem 0.6rem; border: 1px solid var(--color-border); border-radius: 7px; background: var(--color-bg); color: var(--color-text); width: 100%; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--color-accent); box-shadow: 0 0 0 3px var(--color-accent-soft); }
.inline-input { width: auto; }
.help { font-size: 0.78rem; color: var(--color-text-tertiary); margin-top: 0.25rem; }

/* ── Tables ── */
table.data { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
table.data th { text-align: left; font-weight: 600; color: var(--color-text-secondary); border-bottom: 2px solid var(--color-border); padding: 0.5rem 0.6rem; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.03em; }
table.data td { padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--color-border-light); }
table.data tr:hover td { background: var(--color-bg-warm); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-scroll { overflow-x: auto; }

/* ── Attribute editor ── */
.attr-block { border: 1px solid var(--color-border); border-radius: var(--radius); padding: 1rem; margin-bottom: 0.9rem; background: var(--color-bg); }
.attr-head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.7rem; }
.attr-head input.attr-name { font-weight: 600; max-width: 260px; }
.attr-grip { color: var(--color-text-tertiary); cursor: grab; font-size: 1rem; }
.levels { display: flex; flex-direction: column; gap: 0.4rem; }
.level-row { display: flex; align-items: center; gap: 0.5rem; }
.level-row .level-label { flex: 1; max-width: 320px; }
.level-row .level-value { width: 110px; }
.chip { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.72rem; padding: 0.15rem 0.5rem; border-radius: 999px; background: var(--color-border-light); color: var(--color-text-secondary); }
.chip-accent { background: var(--color-accent-soft); color: var(--color-accent); }

/* ── Status pills / QC ── */
.pill { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.75rem; font-weight: 600; padding: 0.2rem 0.6rem; border-radius: 999px; }
.pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill-ok { color: var(--ok); background: var(--ok-soft); }
.pill-warn { color: var(--warn); background: var(--warn-soft); }
.pill-bad { color: var(--bad); background: var(--bad-soft); }
.qc-banner { display: flex; align-items: center; gap: 0.75rem; padding: 0.85rem 1.1rem; border-radius: var(--radius); font-size: 0.9rem; }
.qc-banner.ok { background: var(--ok-soft); color: #2f5a3c; }
.qc-banner.warn { background: var(--warn-soft); color: #7a531c; }
.qc-banner.bad { background: var(--bad-soft); color: #7d2f2b; }

/* ── Diagnostics meter ── */
.meter { height: 8px; background: var(--color-border-light); border-radius: 999px; overflow: hidden; }
.meter-fill { height: 100%; background: var(--color-accent); border-radius: 999px; }
.meter-fill.good { background: var(--ok); }
.meter-fill.mid { background: var(--warn); }
.meter-fill.poor { background: var(--bad); }

/* ── Stat tiles ── */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.9rem; }
.tile { border: 1px solid var(--color-border); border-radius: var(--radius); padding: 0.9rem 1rem; background: var(--color-bg-warm); }
.tile-val { font-family: var(--font-title); font-weight: 900; font-size: 1.5rem; line-height: 1; }
.tile-label { font-size: 0.76rem; color: var(--color-text-tertiary); margin-top: 0.35rem; }
.tile-note { font-size: 0.72rem; color: var(--color-text-secondary); margin-top: 0.2rem; }

/* ── Expert-only detail ── */
.expert-only { display: none; }
body.expert .expert-only { display: revert; }
.expert-note { font-size: 0.8rem; color: var(--color-text-tertiary); border-left: 2px solid var(--color-border); padding-left: 0.7rem; margin-top: 0.5rem; }

/* ── Charts ── */
.chart svg { max-width: 100%; height: auto; display: block; }
.chart-title { font-size: 0.92rem; font-weight: 600; margin-bottom: 0.6rem; }
.legend { display: flex; flex-wrap: wrap; gap: 0.75rem; font-size: 0.78rem; color: var(--color-text-secondary); margin-top: 0.5rem; }
.legend span { display: inline-flex; align-items: center; gap: 0.35rem; }
.legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }

/* ── Simulator (condensed: many concepts must scan easily) ── */
.concepts { display: grid; grid-template-columns: repeat(auto-fit, minmax(172px, 1fr)); gap: 0.7rem; }
.concept { border: 1px solid var(--color-border); border-radius: var(--radius); padding: 0.7rem 0.8rem; position: relative; }
.concept-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.5rem; }
.concept-name { font-weight: 600; font-size: 0.85rem; border: none; padding: 0; min-width: 0; }
.concept-share { font-family: var(--font-title); font-weight: 900; font-size: 1.15rem; }
.concept-field { margin-bottom: 0.35rem; }
.concept-field label { font-size: 0.66rem; color: var(--color-text-tertiary); display: block; margin-bottom: 0.1rem; }
.concept-field select { font-size: 0.78rem; padding: 0.26rem 0.4rem; }
.sweep-box { max-width: 440px; }
.delta-up { color: var(--ok); } .delta-down { color: var(--bad); }
.moves-list { list-style: none; }
.moves-list li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.4rem 0; border-bottom: 1px solid var(--color-border-light); font-size: 0.85rem; }

/* ── Dropzone ── */
.dropzone { border: 2px dashed var(--color-border); border-radius: var(--radius); padding: 2rem; text-align: center; color: var(--color-text-tertiary); cursor: pointer; transition: all 0.15s; }
.dropzone:hover, .dropzone.drag { border-color: var(--color-accent); background: var(--color-accent-soft); color: var(--color-accent); }
.file-ok { color: var(--ok); font-weight: 500; }

/* ── Modal ── */
.modal-backdrop { position: fixed; inset: 0; background: rgba(25,25,25,0.4); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal-backdrop[hidden] { display: none; }  /* explicit: beats .modal-backdrop's display:flex so [hidden] actually hides */
.modal { background: #fff; border-radius: var(--radius); padding: 1.75rem; width: min(440px, 90vw); box-shadow: var(--shadow); text-align: center; }
.modal h3 { margin-bottom: 1rem; }
.progress-track { height: 8px; background: var(--color-border-light); border-radius: 999px; overflow: hidden; margin: 0.75rem 0; }
.progress-fill { height: 100%; width: 0; background: var(--color-accent); border-radius: 999px; transition: width 0.2s; }
.progress-line { font-size: 0.82rem; color: var(--color-text-secondary); font-variant-numeric: tabular-nums; margin-bottom: 1rem; min-height: 1.2em; }

/* ── Toasts ── */
.toasts { position: fixed; bottom: 1.25rem; right: 1.25rem; display: flex; flex-direction: column; gap: 0.5rem; z-index: 200; }
.toast { background: var(--color-text); color: #fff; padding: 0.6rem 0.95rem; border-radius: 8px; font-size: 0.83rem; box-shadow: var(--shadow); animation: fade 0.2s ease; max-width: 340px; }
.toast.ok { background: var(--ok); } .toast.bad { background: var(--bad); }

/* ── Shell: left sidebar + main column ── */
.shell { max-width: 1380px; margin: 0 auto; display: grid; grid-template-columns: 236px minmax(0, 1fr); align-items: start; }
.side { position: sticky; top: 54px; padding: 1.5rem 1.15rem; border-right: 1px solid var(--color-border-light); min-height: calc(100vh - 54px); }
.side h3 { font-family: var(--font); font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--color-text-tertiary); margin-bottom: 0.6rem; }
.side .btn { width: 100%; text-align: left; margin-bottom: 0.3rem; }
.side-desc { font-size: 0.72rem; color: var(--color-text-tertiary); line-height: 1.45; margin: 0 0 0.85rem 0.15rem; }
.side-note { font-size: 0.74rem; color: var(--color-text-secondary); background: var(--color-bg-warm); border-radius: 8px; padding: 0.6rem 0.7rem; margin-bottom: 0.9rem; line-height: 1.5; }
.main-col { min-width: 0; }
@media (max-width: 920px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; min-height: 0; border-right: none; border-bottom: 1px solid var(--color-border-light); display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; padding: 0.8rem 1.1rem; }
  .side h3, .side-note, .side-desc { display: none; }
  .side .btn { width: auto; margin: 0; }
}
.app-logo { vertical-align: -5px; margin-right: 0.55rem; }

/* path chooser */
.paths { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 1rem; }
.path-card { flex: 1; min-width: 250px; display: flex; gap: 0.75rem; align-items: flex-start; text-align: left; font-family: var(--font); border: 1px solid var(--color-border); border-radius: 10px; background: var(--color-bg); padding: 0.8rem 1rem; cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s; }
.path-card:hover { border-color: var(--stagec, var(--color-accent)); box-shadow: var(--shadow-sm); }
.path-ico { flex: none; width: 34px; height: 34px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; color: var(--stagec, var(--color-accent)); background: var(--color-bg-warm); background: color-mix(in srgb, var(--stagec, var(--color-accent)) 11%, #fff); }
.path-ico svg { width: 19px; height: 19px; display: block; }
.path-body { display: block; min-width: 0; }
.path-body strong { display: block; font-size: 0.9rem; margin-bottom: 0.15rem; }
.path-body span { font-size: 0.78rem; color: var(--color-text-secondary); line-height: 1.45; display: block; }

/* flat icons inside sidebar buttons */
.btn-ico { width: 15px; height: 15px; vertical-align: -2px; margin-right: 0.45rem; }

/* stage colors + light tab tints: each workflow tab/panel owns a hue */
.tab[data-tab="design"] { --tabc: #2a78d6; --tabbg: #e4edf8; }
.tab[data-tab="analyze"] { --tabc: #17936a; --tabbg: #e0f1e9; }
.tab[data-tab="results"] { --tabc: #4a3aa7; --tabbg: #e9e6f4; }
.tab[data-tab="simulator"] { --tabc: #b96a00; --tabbg: #f7ead8; }
#panel-design { --stage: #2a78d6; }
#panel-analyze { --stage: #17936a; }
#panel-results { --stage: #4a3aa7; }
#panel-simulator { --stage: #b96a00; }

/* per-segment small multiples (results + simulator) */
.seg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 1rem; margin-top: 0.75rem; }

/* ── Workflow sections: connected tree of collapsible steps ── */
.wsec { margin: 2.6rem 0; scroll-margin-top: 70px; position: relative; padding-left: 2.15rem; }
.panel > .wsec:first-of-type { margin-top: 0.75rem; }
.wsec + .wsec { margin-top: 2.4rem; }
/* rail connecting the step dots */
.wsec::before { content: ''; position: absolute; left: 8px; top: 20px; bottom: -2.6rem; width: 2px; background: var(--color-border); }
.wsec:last-of-type::before { display: none; }
/* the step dot */
.wsec::after { content: ''; position: absolute; left: 3px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--stage, var(--color-accent)); box-shadow: 0 0 0 3px var(--color-bg); }
.wsec-eyebrow { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--stage, var(--color-accent)); }
.wsec-title { font-family: var(--font-title); font-weight: 900; font-size: 1.35rem; letter-spacing: -0.01em; margin: 0.3rem 0 0.45rem; cursor: pointer; user-select: none; }
.wsec-title::after { content: '▾'; font-size: 0.7em; color: var(--color-text-tertiary); margin-left: 0.5rem; display: inline-block; transition: transform 0.15s; }
.wsec.collapsed .wsec-title::after { transform: rotate(-90deg); }
.wsec.collapsed .wsec-body, .wsec.collapsed .wsec-lead { display: none; }
.wsec-lead { color: var(--color-text-secondary); font-size: 0.95rem; max-width: 70ch; margin-bottom: 1.15rem; }

/* data-format prompt box */
.prompt-wrap { position: relative; margin-top: 0.6rem; }
.prompt-box { background: #f6f4f0; border: 1px solid var(--color-border); border-radius: 8px; padding: 0.8rem 0.9rem; font-family: 'SF Mono', ui-monospace, Menlo, monospace; font-size: 0.72rem; line-height: 1.55; white-space: pre-wrap; max-height: 230px; overflow: auto; color: var(--color-text-secondary); }
.copy-btn { position: absolute; top: 0.5rem; right: 0.5rem; }
table.schema { width: 100%; border-collapse: collapse; font-size: 0.8rem; margin: 0.5rem 0; }
table.schema th { text-align: left; border-bottom: 2px solid var(--color-border); padding: 0.35rem 0.5rem; font-size: 0.72rem; text-transform: uppercase; color: var(--color-text-secondary); }
table.schema td { padding: 0.35rem 0.5rem; border-bottom: 1px solid var(--color-border-light); vertical-align: top; }

/* results anchor nav */
.subnav { display: flex; gap: 0.45rem; flex-wrap: wrap; margin-top: 1rem; }
.subnav a { font-size: 0.78rem; padding: 0.32rem 0.75rem; border: 1px solid var(--color-border); border-radius: 999px; text-decoration: none; color: var(--color-text-secondary); background: var(--color-bg); transition: all 0.15s; }
.subnav a:hover { border-color: var(--color-accent); color: var(--color-accent); }

/* pastel rotation for stat tiles (site palette: sand/sage/sky/lavender) */
.tiles .tile:nth-child(4n+1) { background: var(--warm-sand); border-color: transparent; }
.tiles .tile:nth-child(4n+2) { background: var(--muted-sage); border-color: transparent; }
.tiles .tile:nth-child(4n+3) { background: var(--pale-sky); border-color: transparent; }
.tiles .tile:nth-child(4n+4) { background: var(--light-lavender); border-color: transparent; }

/* part-worth small multiples */
.pw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(480px, 1fr)); gap: 1.1rem; }
@media (max-width: 560px) { .pw-grid { grid-template-columns: 1fr; } }
figure.pw-cell { margin: 0; border: 1px solid var(--color-border); border-radius: var(--radius); padding: 0.9rem 1rem 0.7rem; background: var(--color-bg); }
.pw-head { font-weight: 700; font-size: 0.95rem; margin-bottom: 0.5rem; display: flex; align-items: center; gap: 0.5rem; }
.pw-cap { font-size: 0.78rem; color: var(--color-text-tertiary); margin-top: 0.4rem; border-top: 1px solid var(--color-border-light); padding-top: 0.45rem; }
.pw-cell svg { max-width: 100%; height: auto; display: block; }
.swatch { display: inline-block; width: 11px; height: 11px; border-radius: 3px; flex: none; }

/* designer settings + export grids */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0.9rem 1.1rem; }
.settings-grid .setting input { margin-bottom: 0; }
.export-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; }
.exp-card { border: 1px solid var(--color-border); border-radius: var(--radius); padding: 1rem 1.1rem; background: var(--color-bg); display: flex; flex-direction: column; gap: 0.45rem; border-top: 3px solid var(--color-border); }
.export-grid .exp-card:nth-child(4n+1) { border-top-color: #2a78d6; }
.export-grid .exp-card:nth-child(4n+2) { border-top-color: #1baf7a; }
.export-grid .exp-card:nth-child(4n+3) { border-top-color: #eda100; }
.export-grid .exp-card:nth-child(4n+4) { border-top-color: #4a3aa7; }
.exp-card h4 { font-family: var(--font); font-weight: 600; font-size: 0.92rem; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.exp-card p { font-size: 0.8rem; color: var(--color-text-secondary); line-height: 1.5; flex: 1; }
.exp-card .btn { align-self: flex-start; }

/* ── Guidance layer ── */
.help-details { border: 1px solid var(--color-border-light); border-radius: 8px; background: var(--color-bg-warm); margin-top: 0.75rem; font-size: 0.85rem; }
.help-details > summary { cursor: pointer; padding: 0.55rem 0.85rem; font-weight: 500; color: var(--color-accent); list-style: none; user-select: none; }
.help-details > summary::-webkit-details-marker { display: none; }
.help-details > summary::before { content: '❔ '; }
.help-details[open] > summary { border-bottom: 1px solid var(--color-border-light); }
.help-body { padding: 0.75rem 0.95rem; color: var(--color-text-secondary); line-height: 1.55; }
.help-body p + p, .help-body ul { margin-top: 0.6rem; }
.help-body ul, .help-body ol { margin-left: 1.1rem; }
.help-body li + li { margin-top: 0.35rem; }
.tip { background: var(--warm-sand); color: #6b4e2e; border-radius: 8px; padding: 0.6rem 0.85rem; font-size: 0.82rem; line-height: 1.5; margin-top: 0.75rem; }
.tip ul { margin: 0.3rem 0 0 1.1rem; }
.narrative { background: var(--color-accent-soft); border-left: 3px solid var(--color-accent); border-radius: 8px; padding: 1rem 1.25rem; font-size: 0.95rem; line-height: 1.6; }
.narrative p + p { margin-top: 0.5rem; }
.narrative strong { color: var(--color-text); }
.narrative-list { margin: 0.6rem 0 0 1.2rem; }
.narrative-list li { margin-bottom: 0.55rem; line-height: 1.55; }
.glossary { display: grid; grid-template-columns: minmax(160px, 1fr) 2fr; gap: 0.35rem 1rem; font-size: 0.85rem; }
.glossary dt { font-weight: 600; color: var(--color-text); }
.glossary dd { color: var(--color-text-secondary); }
@media (max-width: 560px) { .glossary { grid-template-columns: 1fr; } .glossary dd { margin-bottom: 0.4rem; } }

/* ── Empty state ── */
.empty { text-align: center; padding: 3rem 1rem; color: var(--color-text-tertiary); }
.empty h3 { color: var(--color-text-secondary); margin-bottom: 0.5rem; }

/* ── Footer ── */
.footer { background: var(--color-bg-warm); border-top: 1px solid var(--color-border-light); margin-top: 3rem; }
.footer-inner { max-width: var(--maxw); margin: 0 auto; padding: 2rem; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.footer-left { font-size: 0.8rem; color: var(--color-text-tertiary); }
.footer-left .sep { color: var(--color-accent); }
.footer-right { display: flex; gap: 1.5rem; }
.footer-right a { font-size: 0.8rem; color: var(--color-text-tertiary); text-decoration: none; }
.footer-right a:hover { color: var(--color-text); }

/* ── Responsive ── */
@media (max-width: 860px) {
  .grid-2, .grid-side { grid-template-columns: 1fr; }
  .app-actions { width: 100%; }
  .nav-inner, .app-head-inner, .app-main, .footer-inner { padding-left: 1.1rem; padding-right: 1.1rem; }
  .tabs { overflow-x: auto; }
  .nav-links { gap: 1.1rem; }
  .privacy-note { text-align: left; max-width: none; }
}
