:root {
    --ink: #171914;
    --ink-soft: #383b34;
    --muted: #70746a;
    --paper: #f5f3ed;
    --surface: #fffefa;
    --surface-2: #eceae3;
    --line: #dcd9cf;
    --line-dark: #c9c5ba;
    --accent: #d85d3f;
    --accent-dark: #ad3f29;
    --accent-pale: #f9e7df;
    --green: #29735b;
    --green-pale: #e1f0e8;
    --blue: #4058a5;
    --danger: #a63b2e;
    --sidebar: #191b17;
    --sidebar-muted: #9b9f94;
    --radius-sm: 9px;
    --radius: 15px;
    --radius-lg: 24px;
    --shadow-sm: 0 1px 2px rgba(23, 25, 20, .05), 0 8px 24px rgba(23, 25, 20, .035);
    --shadow-lg: 0 28px 80px rgba(23, 25, 20, .18);
    --sidebar-width: 252px;
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--paper);
    font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body { min-height: 100vh; margin: 0; background: var(--paper); color: var(--ink); -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 10px; font-size: clamp(2.15rem, 4vw, 3.55rem); line-height: .98; letter-spacing: -.055em; font-weight: 720; }
h2 { margin-bottom: 8px; font-size: 1.42rem; line-height: 1.15; letter-spacing: -.025em; }
h3 { margin-bottom: 6px; font-size: 1rem; }
p { color: var(--muted); line-height: 1.6; }
code { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.eyebrow { display: block; margin-bottom: 10px; color: var(--accent-dark); font-size: .7rem; line-height: 1; font-weight: 780; letter-spacing: .14em; text-transform: uppercase; }
.muted { color: var(--muted); }

/* Authentication */
.auth-page { background: #e8e4db; }
.auth-layout { min-height: 100vh; padding: 34px clamp(24px, 5vw, 76px); display: grid; grid-template-rows: auto 1fr auto; background: radial-gradient(circle at 75% 20%, rgba(216, 93, 63, .12), transparent 25%), radial-gradient(circle at 14% 80%, rgba(64, 88, 165, .1), transparent 28%), #edeae2; }
.auth-brand, .sidebar-brand, .mobile-brand { display: inline-flex; align-items: center; gap: 12px; width: max-content; }
.auth-brand strong, .sidebar-brand strong { display: block; font-size: .92rem; line-height: 1.1; letter-spacing: -.01em; }
.auth-brand small, .sidebar-brand small { display: block; margin-top: 3px; color: var(--muted); font-size: .68rem; }
.brand-mark { width: 39px; height: 39px; border-radius: 12px; display: inline-grid; place-items: center; flex: 0 0 auto; background: var(--accent); color: white; font-size: .82rem; font-weight: 850; letter-spacing: -.07em; box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); }
.login-card { align-self: center; justify-self: center; width: min(980px, 100%); display: grid; grid-template-columns: 1.08fr .92fr; overflow: hidden; background: var(--surface); border: 1px solid rgba(23,25,20,.09); border-radius: 28px; box-shadow: var(--shadow-lg); }
.login-copy { min-height: 570px; padding: clamp(44px, 6vw, 76px); display: flex; flex-direction: column; justify-content: center; position: relative; isolation: isolate; background: var(--sidebar); color: white; overflow: hidden; }
.login-copy::before { content: ""; position: absolute; z-index: -1; width: 380px; height: 380px; border: 1px solid rgba(255,255,255,.1); border-radius: 50%; top: -150px; right: -140px; box-shadow: 0 0 0 50px rgba(255,255,255,.025), 0 0 0 110px rgba(255,255,255,.018); }
.login-copy::after { content: "78"; position: absolute; z-index: -1; bottom: -55px; left: -12px; color: rgba(255,255,255,.035); font-size: 15rem; font-weight: 900; letter-spacing: -.12em; }
.login-copy .eyebrow { color: #f19b80; }
.login-copy h1 { max-width: 480px; margin-bottom: 25px; font-size: clamp(2.4rem, 5vw, 4.4rem); }
.login-copy > p { max-width: 450px; color: #b9bdb2; font-size: 1.02rem; }
.login-proof { margin-top: 48px; display: flex; gap: 13px; align-items: center; }
.proof-icon { width: 31px; height: 31px; display: grid; place-items: center; border: 1px solid #4d5148; border-radius: 50%; color: #f19b80; }
.login-proof strong, .login-proof small { display: block; }
.login-proof strong { font-size: .84rem; }
.login-proof small { max-width: 360px; margin-top: 3px; color: #92978c; font-size: .72rem; line-height: 1.4; }
.login-form-wrap { padding: clamp(42px, 6vw, 72px); align-self: center; }
.login-form-wrap h2 { font-size: 1.85rem; letter-spacing: -.04em; }
.login-form-wrap > p { margin-bottom: 30px; font-size: .88rem; }
.auth-footer { align-self: end; margin: 24px 0 0; text-align: center; font-size: .72rem; }
.setup-note { display: grid; gap: 5px; margin-bottom: 20px; padding: 13px 14px; background: #fff7dd; border: 1px solid #eed88c; border-radius: var(--radius-sm); font-size: .77rem; line-height: 1.45; }
.setup-note span { color: #766627; }
.setup-note code { font-size: .7rem; }

/* Shell */
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; width: var(--sidebar-width); padding: 27px 21px 24px; display: flex; flex-direction: column; background: var(--sidebar); color: white; }
.sidebar-brand { padding: 0 7px 35px; }
.brand-mark--light { background: #f0ede4; color: var(--sidebar); }
.sidebar-brand small { color: var(--sidebar-muted); }
.sidebar-nav { display: grid; gap: 6px; }
.nav-label { padding: 0 13px 9px; color: #72776c; font-size: .61rem; font-weight: 720; letter-spacing: .13em; text-transform: uppercase; }
.sidebar-nav a { position: relative; padding: 11px 13px; display: flex; align-items: center; gap: 11px; border-radius: 10px; color: #aeb2a7; font-size: .84rem; font-weight: 600; transition: background .18s ease, color .18s ease; }
.sidebar-nav a:hover { background: rgba(255,255,255,.055); color: white; }
.sidebar-nav a.is-active { background: #2a2d27; color: white; box-shadow: inset 0 0 0 1px rgba(255,255,255,.04); }
.sidebar-nav a.is-active::before { content: ""; position: absolute; left: -21px; width: 3px; height: 23px; border-radius: 0 3px 3px 0; background: #ed795b; }
.sidebar-nav svg { width: 18px; height: 18px; }
.sidebar-foot { margin-top: auto; padding: 18px 8px 0; border-top: 1px solid #30332d; }
.staff-chip { display: flex; gap: 10px; align-items: center; min-width: 0; }
.avatar { width: 34px; height: 34px; display: inline-grid; place-items: center; flex: 0 0 auto; border-radius: 10px; background: #e7ded0; color: #6d4d37; font-size: .75rem; font-weight: 800; }
.staff-chip > span:last-child { min-width: 0; }
.staff-chip strong, .staff-chip small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.staff-chip strong { font-size: .74rem; }
.staff-chip small { margin-top: 3px; color: #858a7e; font-size: .62rem; }
.sidebar-foot form { margin-top: 12px; }
.main-shell { min-height: 100vh; margin-left: var(--sidebar-width); padding: clamp(35px, 5vw, 68px) clamp(28px, 6vw, 84px) 90px; }
.main-shell > * { width: min(1180px, 100%); margin-left: auto; margin-right: auto; }
.mobile-header { display: none; }

/* Buttons and forms */
.button { min-height: 42px; padding: 10px 16px; border: 1px solid transparent; border-radius: 10px; display: inline-flex; justify-content: center; align-items: center; gap: 9px; cursor: pointer; font-size: .77rem; line-height: 1; font-weight: 720; transition: transform .16s ease, background .16s ease, border-color .16s ease, box-shadow .16s ease; }
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button:focus-visible, .text-button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible, .icon-button:focus-visible { outline: 3px solid rgba(64,88,165,.22); outline-offset: 2px; }
.button--primary { background: var(--ink); color: white; box-shadow: 0 7px 16px rgba(23,25,20,.13); }
.button--primary:hover { background: #2d3029; }
.button--secondary { background: var(--surface); border-color: var(--line-dark); color: var(--ink); box-shadow: var(--shadow-sm); }
.button--secondary:hover { border-color: #a9a59a; background: white; }
.button--danger-ghost { background: transparent; border-color: #dfb4aa; color: var(--danger); }
.button--danger-ghost:hover { background: #fff4f1; }
.button--wide { width: 100%; }
.button svg { width: 16px; height: 16px; }
.text-button { padding: 2px 0; border: 0; background: transparent; color: var(--ink); cursor: pointer; font-size: .74rem; font-weight: 720; text-decoration: underline; text-decoration-color: #b9b6ad; text-underline-offset: 4px; }
.text-button--light { color: #969b90; }
.text-button--danger { color: var(--danger); text-decoration-color: #d9a49b; }
.icon-button { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; }
.stack-form { display: grid; gap: 18px; }
.stack-form label { display: grid; gap: 8px; color: var(--ink-soft); font-size: .72rem; font-weight: 690; }
.stack-form label > span { display: flex; justify-content: space-between; gap: 15px; }
.stack-form label small { color: var(--muted); font-size: .65rem; font-weight: 500; }
input, textarea, select { width: 100%; border: 1px solid var(--line-dark); border-radius: 9px; background: #fffefa; color: var(--ink); transition: border-color .16s ease, box-shadow .16s ease, background .16s ease; }
input, select { min-height: 44px; padding: 10px 12px; }
textarea { padding: 12px; line-height: 1.55; resize: vertical; }
input::placeholder, textarea::placeholder { color: #a3a59d; }
input:focus, textarea:focus, select:focus { border-color: #7b83a4; background: white; box-shadow: 0 0 0 3px rgba(64,88,165,.09); outline: none; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-footer { padding-top: 3px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.form-footer > span { color: var(--muted); font-size: .68rem; font-weight: 500; }

/* Headers and navigation */
.page-header { margin-bottom: 38px; display: flex; justify-content: space-between; align-items: flex-end; gap: 26px; }
.page-header > div:first-child { min-width: 0; }
.page-header h1 { margin-bottom: 9px; }
.page-header p { margin: 0; font-size: .86rem; }
.header-actions { display: flex; gap: 9px; flex: 0 0 auto; }
.breadcrumbs { margin-bottom: 31px; display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: .68rem; white-space: nowrap; overflow: hidden; }
.breadcrumbs a { transition: color .15s; }
.breadcrumbs a:hover { color: var(--ink); }
.breadcrumbs span { overflow: hidden; text-overflow: ellipsis; }
.breadcrumbs > span:not(:last-child) { color: #bbb8ae; }
.title-with-status { margin-bottom: 10px; display: flex; align-items: center; gap: 12px; }
.title-with-status .eyebrow { margin: 0; }
.badge { width: max-content; padding: 5px 8px; display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; font-size: .61rem; font-weight: 750; letter-spacing: .025em; }
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge--live { background: var(--green-pale); color: var(--green); }
.badge--closed { background: #ebe9e3; color: #686b63; }

/* Core cards */
.stat-strip { margin-bottom: 31px; padding: 19px 25px; display: grid; grid-template-columns: repeat(3, auto) 1fr; align-items: center; gap: clamp(24px, 4vw, 56px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.stat-strip > div { display: flex; align-items: baseline; gap: 7px; }
.stat-strip strong { font-size: 1.35rem; letter-spacing: -.04em; }
.stat-strip span { color: var(--muted); font-size: .68rem; }
.stat-strip p { margin: 0 0 0 auto; font-size: .7rem; }
.card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.client-card { min-height: 170px; padding: 24px; position: relative; display: flex; align-items: center; gap: 19px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.client-card:hover { transform: translateY(-2px); border-color: #c6c2b7; box-shadow: 0 13px 34px rgba(23,25,20,.08); }
.card-hit { position: absolute; inset: 0; z-index: 1; }
.client-monogram { width: 64px; height: 64px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 18px; background: hsl(var(--monogram-hue, 22) 35% 88%); color: hsl(var(--monogram-hue, 22) 28% 32%); font-size: 1.3rem; font-weight: 820; }
.client-card:nth-child(6n+1) .client-monogram { --monogram-hue: 22; }
.client-card:nth-child(6n+2) .client-monogram { --monogram-hue: 160; }
.client-card:nth-child(6n+3) .client-monogram { --monogram-hue: 220; }
.client-card:nth-child(6n+4) .client-monogram { --monogram-hue: 52; }
.client-card:nth-child(6n+5) .client-monogram { --monogram-hue: 280; }
.client-card:nth-child(6n) .client-monogram { --monogram-hue: 195; }
.client-card-body { min-width: 0; }
.meta-kicker { display: block; margin-bottom: 5px; color: var(--muted); font-size: .6rem; text-transform: uppercase; letter-spacing: .1em; }
.client-card h2 { margin-bottom: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1.22rem; }
.metric-row { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: .64rem; }
.metric-row strong { color: var(--ink); }
.round-arrow { width: 35px; height: 35px; margin-left: auto; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 50%; color: var(--ink); font-size: .85rem; transition: border-color .16s, background .16s; }
.client-card .round-arrow { position: relative; z-index: 2; pointer-events: none; }
.client-card:hover .round-arrow, .project-row:hover .round-arrow, .page-row:hover .round-arrow { border-color: var(--ink); background: var(--ink); color: white; }
.content-card, .settings-card, .snippet-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.content-card { padding: 27px; }
.settings-card { height: max-content; padding: 25px; }
.settings-card h2 { margin-bottom: 22px; }
.settings-card .danger-zone { margin-top: 28px; }
.split-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
.split-layout--wide { grid-template-columns: minmax(0, 1fr) 285px; }
.section-heading { margin-bottom: 17px; display: flex; justify-content: space-between; align-items: end; gap: 20px; }
.section-heading .eyebrow { margin-bottom: 7px; }
.section-heading h2 { margin: 0; font-size: 1.55rem; }
.section-heading p { margin: 5px 0 0; font-size: .73rem; }
.section-heading--action { align-items: center; }
.count-pill { min-width: 28px; height: 28px; padding: 0 8px; display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); font-size: .67rem; font-weight: 700; }
.danger-zone { padding-top: 21px; border-top: 1px solid var(--line); }
.danger-zone > strong, .danger-footer strong { font-size: .75rem; }
.danger-zone p, .danger-footer p { margin: 6px 0 10px; font-size: .67rem; line-height: 1.5; }
.danger-footer { margin-top: 50px; padding: 23px 25px; display: flex; justify-content: space-between; align-items: center; gap: 20px; border: 1px solid #e3cdc7; border-radius: var(--radius); background: rgba(255,254,250,.55); }
.danger-footer p { margin-bottom: 0; }

/* Lists */
.project-list, .page-list, .question-list, .response-list { display: grid; gap: 9px; }
.project-row { padding: 18px 19px; display: grid; grid-template-columns: 38px minmax(0, 1fr) auto 35px; gap: 15px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-sm); transition: border-color .16s, transform .16s; }
.project-row:hover { border-color: #bcb8ad; transform: translateX(2px); }
.project-glyph { width: 38px; height: 38px; padding: 10px; display: grid; gap: 3px; border-radius: 10px; background: var(--surface-2); }
.project-glyph span { display: block; border-radius: 2px; background: #888b82; }
.project-glyph span:nth-child(2) { width: 70%; }
.project-main strong, .project-main small { display: block; }
.project-main strong { margin-bottom: 4px; font-size: .86rem; }
.project-main small { color: var(--muted); font-size: .64rem; }
.project-metrics { display: flex; gap: 20px; color: var(--muted); font-size: .66rem; }
.project-toolbar { margin-bottom: 31px; padding: 14px 17px; display: flex; justify-content: space-between; align-items: center; gap: 20px; background: #e9ede5; border: 1px solid #d5dccf; border-radius: 11px; }
.project-toolbar > div { display: flex; align-items: center; gap: 11px; }
.project-toolbar strong, .project-toolbar small { display: block; }
.project-toolbar strong { font-size: .72rem; }
.project-toolbar small { margin-top: 2px; color: var(--muted); font-size: .62rem; }
.status-orb { width: 23px; height: 23px; display: block; position: relative; border-radius: 50%; background: var(--green-pale); }
.status-orb::after { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: var(--green); }
.page-row { padding: 17px 18px 17px 11px; display: grid; grid-template-columns: 40px minmax(0, 1fr) 35px; gap: 15px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-sm); transition: border-color .16s, transform .16s; }
.page-row:hover { border-color: #bcb8ad; }
.reorder-controls { align-self: stretch; display: grid; place-items: center; grid-template-rows: 1fr auto 1fr; border-right: 1px solid var(--line); }
.reorder-controls form { line-height: 0; }
.reorder-controls button, .question-actions button { padding: 3px 8px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.reorder-controls button:disabled, .question-actions button:disabled { opacity: .25; cursor: default; }
.reorder-controls > span { color: var(--ink); font-size: .66rem; font-weight: 760; }
.row-title { margin-bottom: 5px; display: flex; align-items: center; gap: 9px; }
.row-title a { font-size: .9rem; font-weight: 760; }
.documentary-url { max-width: 100%; display: inline-block; overflow: hidden; color: var(--muted); font-size: .67rem; white-space: nowrap; text-overflow: ellipsis; vertical-align: bottom; }
.documentary-url:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.page-row-meta { margin-top: 12px; display: flex; gap: 18px; flex-wrap: wrap; color: var(--muted); font-size: .62rem; }
.frozen-label { color: var(--blue); font-weight: 680; }

/* Page detail */
.page-header--page { align-items: center; }
.page-detail-grid { margin-bottom: 53px; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(260px, .7fr); gap: 18px; align-items: start; }
.card-heading { margin-bottom: 22px; display: flex; justify-content: space-between; gap: 15px; align-items: start; }
.card-heading h2 { margin: 0; }
.live-label { display: inline-flex; gap: 6px; align-items: center; color: var(--green); font-size: .63rem; font-weight: 750; }
.live-label i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px var(--green-pale); }
.snippet-card { padding: 25px; background: var(--sidebar); border-color: var(--sidebar); color: white; }
.snippet-card .eyebrow { color: #ef9276; }
.snippet-card > p { color: #a6aa9f; font-size: .71rem; line-height: 1.55; }
.snippet-card code { font-size: .68rem; }
.code-block { margin: 18px 0; overflow: hidden; background: #0f100e; border: 1px solid #353831; border-radius: 10px; }
.code-block code { min-height: 104px; padding: 13px; display: block; color: #d7d9d2; line-height: 1.55; word-break: break-all; }
.code-block button { width: 100%; padding: 9px; border: 0; border-top: 1px solid #353831; background: #262922; color: #d9dcd3; cursor: pointer; font-size: .67rem; font-weight: 720; }
.code-block button:hover { background: #30342c; }
.snippet-meta { padding: 12px 0; display: grid; gap: 5px; border-top: 1px solid #363932; border-bottom: 1px solid #363932; }
.snippet-meta span { color: #777c71; font-size: .59rem; text-transform: uppercase; letter-spacing: .09em; }
.snippet-meta code { overflow-wrap: anywhere; color: #c0c4b9; }
.privacy-note { margin: 15px 0 0 !important; display: flex; gap: 8px; }
.section-block { margin-top: 48px; }
.frozen-banner { margin-bottom: 17px; padding: 15px 17px; display: flex; gap: 12px; align-items: center; background: #edf0fa; border: 1px solid #d3d9ec; border-radius: 11px; color: #394f94; }
.frozen-banner strong, .frozen-banner small { display: block; }
.frozen-banner strong { font-size: .74rem; }
.frozen-banner small { margin-top: 3px; color: #66729b; font-size: .65rem; line-height: 1.4; }
.lock-glyph { width: 29px; height: 29px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: #d9def0; font-size: 1rem; }
.question-card { display: grid; grid-template-columns: 47px minmax(0, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: 13px; box-shadow: var(--shadow-sm); }
.question-number { padding-top: 20px; border-right: 1px solid var(--line); text-align: center; color: var(--muted); font-size: .68rem; font-weight: 770; }
.question-body { padding: 20px 21px; }
.question-topline { margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.type-pill { padding: 4px 7px; border-radius: 5px; background: var(--surface-2); color: var(--muted); font-size: .58rem; font-weight: 720; text-transform: uppercase; letter-spacing: .06em; }
.question-actions { display: flex; gap: 2px; }
.question-actions form { display: inline; }
.question-body > h3 { margin-bottom: 14px; font-size: .93rem; line-height: 1.45; }
.choice-preview { margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 7px; counter-reset: none; list-style: none; }
.choice-preview li { padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: #faf9f5; color: var(--ink-soft); font-size: .68rem; }
.free-text-preview { height: 37px; padding: 0 11px; display: flex; align-items: center; border: 1px dashed var(--line-dark); border-radius: 8px; color: #999b93; font-size: .66rem; }
.edit-drawer { margin: 18px -21px -20px; border-top: 1px solid var(--line); }
.edit-drawer > summary { padding: 12px 21px; cursor: pointer; color: var(--muted); font-size: .66rem; font-weight: 720; list-style: none; }
.edit-drawer > summary::after { content: "＋"; float: right; }
.edit-drawer[open] > summary::after { content: "−"; }
.edit-drawer .stack-form { padding: 10px 21px 20px; }
.drawer-delete { padding: 12px 21px; border-top: 1px solid var(--line); }
.responses-section { padding-top: 3px; }
.response-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-sm); overflow: hidden; }
.response-card summary { padding: 17px 18px; display: grid; grid-template-columns: 36px minmax(0, 1fr) auto 20px; align-items: center; gap: 13px; cursor: pointer; list-style: none; }
.response-card summary::-webkit-details-marker { display: none; }
.avatar--response { width: 36px; height: 36px; }
.response-identity strong, .response-identity small, .response-date strong, .response-date small { display: block; }
.response-identity strong { font-size: .76rem; }
.response-identity small { margin-top: 3px; color: var(--muted); font-size: .64rem; }
.response-date { text-align: right; }
.response-date small { margin-bottom: 3px; color: var(--muted); font-size: .56rem; text-transform: uppercase; letter-spacing: .06em; }
.response-date strong { font-size: .65rem; }
.chevron { color: var(--muted); transition: transform .18s; }
.response-card[open] .chevron { transform: rotate(180deg); }
.response-answers { padding: 4px 20px 21px 66px; border-top: 1px solid var(--line); }
.response-answers > div { padding: 16px 0; display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 8px; border-bottom: 1px solid #eceae4; }
.response-answers > div:last-child { border-bottom: 0; }
.response-answers > div > span { color: var(--muted); font-size: .66rem; }
.response-answers p { margin: 0; }
.response-answers p strong { display: block; margin-bottom: 7px; color: var(--muted); font-size: .65rem; font-weight: 650; }
.answer-text { display: block; color: var(--ink); font-size: .76rem; line-height: 1.55; }

/* Tables and utility panels */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: .72rem; }
.data-table th { padding: 0 13px 12px; color: var(--muted); font-size: .59rem; font-weight: 720; letter-spacing: .08em; text-align: left; text-transform: uppercase; }
.data-table td { padding: 16px 13px; border-top: 1px solid var(--line); color: var(--muted); }
.table-person { display: flex; gap: 11px; align-items: center; min-width: 220px; }
.table-person strong, .table-person small { display: block; }
.table-person strong { color: var(--ink); font-size: .74rem; }
.table-person small { margin-top: 3px; color: var(--muted); font-size: .63rem; }
.table-action { text-align: right; }
.info-panel { margin-top: 18px; padding: 17px 19px; display: flex; gap: 13px; align-items: start; border: 1px solid #d8d8e5; border-radius: 12px; background: #f1f1f8; }
.info-glyph { width: 24px; height: 24px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: #dedfed; color: #505989; font-family: Georgia, serif; font-weight: 800; }
.info-panel strong { font-size: .73rem; }
.info-panel p { margin: 4px 0 0; font-size: .67rem; line-height: 1.5; }

/* Empty states, flash, dialogs */
.empty-state { min-height: 310px; padding: 45px 25px; display: flex; flex-direction: column; justify-content: center; align-items: center; border: 1px dashed var(--line-dark); border-radius: var(--radius); background: rgba(255,254,250,.5); text-align: center; }
.empty-state--compact { min-height: 205px; }
.empty-state--large { min-height: 70vh; }
.empty-state h2, .empty-state h3 { margin-bottom: 8px; }
.empty-state p { max-width: 440px; margin-bottom: 20px; font-size: .77rem; }
.empty-icon { width: 48px; height: 48px; margin-bottom: 18px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); color: var(--accent); font-size: .8rem; font-weight: 820; box-shadow: var(--shadow-sm); }
.flash-stack { position: fixed; z-index: 80; top: 24px; right: 28px; width: min(390px, calc(100vw - 40px)); display: grid; gap: 8px; }
.flash { padding: 13px 14px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: 0 15px 40px rgba(23,25,20,.13); color: var(--ink-soft); font-size: .72rem; line-height: 1.4; }
.flash-dot { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: var(--green); }
.flash--error .flash-dot { background: var(--danger); }
.flash button { margin-left: auto; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 1.05rem; }
.flash.is-leaving { opacity: 0; transform: translateY(-5px); transition: .2s; }
.app-dialog { width: min(480px, calc(100vw - 32px)); padding: 32px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); }
.app-dialog--wide { width: min(680px, calc(100vw - 32px)); }
.app-dialog::backdrop { background: rgba(20,22,18,.57); backdrop-filter: blur(4px); }
.dialog-close { position: absolute; top: 14px; right: 15px; }
.dialog-close button { width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; font-size: 1.2rem; }
.dialog-heading { margin-bottom: 25px; padding-right: 25px; }
.dialog-heading h2 { font-size: 1.65rem; }
.dialog-heading p { margin: 0; font-size: .76rem; }

@media (max-width: 1020px) {
    :root { --sidebar-width: 222px; }
    .main-shell { padding-left: 35px; padding-right: 35px; }
    .card-grid { grid-template-columns: 1fr; }
    .split-layout--wide { grid-template-columns: minmax(0, 1fr) 255px; }
    .page-detail-grid { grid-template-columns: 1fr; }
    .snippet-card { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
    .snippet-card .eyebrow, .snippet-card h2, .snippet-card > p { grid-column: 1; }
    .snippet-card .code-block { grid-column: 2; grid-row: 1 / span 4; margin: 0; }
    .snippet-meta, .privacy-note { grid-column: 1; }
    .project-metrics { display: none; }
}

@media (max-width: 760px) {
    .sidebar { width: min(290px, 84vw); transform: translateX(-102%); box-shadow: 20px 0 60px rgba(0,0,0,.25); transition: transform .22s ease; }
    .sidebar.is-open { transform: translateX(0); }
    .mobile-header { height: 68px; padding: 0 18px; display: flex; position: sticky; z-index: 25; top: 0; justify-content: space-between; align-items: center; background: rgba(245,243,237,.92); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
    .mobile-brand { gap: 9px; }
    .mobile-brand .brand-mark { width: 34px; height: 34px; border-radius: 10px; }
    .mobile-brand strong { font-size: .82rem; }
    .main-shell { margin-left: 0; padding: 34px 18px 65px; }
    .page-header { margin-bottom: 28px; align-items: flex-start; }
    .page-header:not(.page-header--page) { flex-direction: column; }
    .page-header .header-actions { width: 100%; flex-wrap: wrap; }
    .page-header .header-actions .button { flex: 1; }
    .stat-strip { grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 17px 12px; text-align: center; }
    .stat-strip > div { display: grid; gap: 2px; }
    .stat-strip p { display: none; }
    .split-layout, .split-layout--wide { grid-template-columns: 1fr; }
    .project-row { grid-template-columns: 38px minmax(0, 1fr) 35px; }
    .project-toolbar { align-items: flex-start; }
    .project-toolbar small { display: none; }
    .snippet-card { display: block; }
    .snippet-card .code-block { margin: 18px 0; }
    .form-grid { grid-template-columns: 1fr; }
    .login-card { margin: 35px auto; grid-template-columns: 1fr; }
    .login-copy { min-height: auto; padding: 45px 34px; }
    .login-copy h1 { font-size: 2.6rem; }
    .login-proof { margin-top: 28px; }
    .login-form-wrap { padding: 42px 34px; }
    .auth-layout { display: block; padding: 24px 16px; }
    .auth-brand { margin-left: 8px; }
    .auth-footer { margin-bottom: 10px; }
}

@media (max-width: 520px) {
    h1 { font-size: 2.35rem; }
    .page-header--page { display: grid; }
    .card-grid { gap: 10px; }
    .client-card { min-height: 145px; padding: 19px; }
    .client-monogram { width: 52px; height: 52px; border-radius: 14px; }
    .metric-row { gap: 8px 12px; }
    .project-row { padding: 15px; grid-template-columns: minmax(0, 1fr) 34px; }
    .project-glyph { display: none; }
    .page-row { grid-template-columns: 30px minmax(0, 1fr); padding-right: 15px; }
    .page-row > .round-arrow { display: none; }
    .reorder-controls { margin-left: -4px; }
    .page-row-meta { gap: 10px; }
    .question-card { grid-template-columns: 37px minmax(0, 1fr); }
    .question-body { padding: 17px 16px; }
    .edit-drawer { margin-left: -16px; margin-right: -16px; }
    .response-card summary { grid-template-columns: 36px minmax(0, 1fr) 18px; }
    .response-date { display: none; }
    .response-answers { padding-left: 18px; }
    .danger-footer { align-items: flex-start; flex-direction: column; }
    .app-dialog { padding: 28px 21px; }
    .section-heading--action { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
