/* Self-hosted brand faces: the privacy-focused app makes no third-party font request. */
@font-face { font-family: "Marcellus"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/marcellus-400.woff2") format("woff2"); }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/manrope-400.woff2") format("woff2"); }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 500; font-display: swap; src: url("/fonts/manrope-500.woff2") format("woff2"); }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/manrope-700.woff2") format("woff2"); }
@font-face { font-family: "Space Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/space-mono-400.woff2") format("woff2"); }

:root {
  --canvas: #f2f0e8;
  --canvas-deep: #eae7dc;
  --surface: #fffdf8;
  --surface-soft: #f8f6ef;
  --ink: #102d29;
  --muted: #5a6965;
  --subtle: #78837f;
  --line: #e2ded2;
  --line-strong: #d3cdbd;
  --pine: #092722;
  --pine-soft: #113a34;
  --accent: #176c63;
  --accent-hover: #11574f;
  --accent-soft: #e4f1ed;
  --accent-pale: #eff7f4;
  --gold: #d7b875;
  --gold-soft: #f5eedc;
  --danger: #a64334;
  --danger-soft: #f8ebe8;
  --white: #fff;
  --shadow-sm: 0 1px 2px rgb(19 42 37 / 4%), 0 4px 18px rgb(19 42 37 / 4%);
  --shadow-md: 0 18px 45px rgb(19 42 37 / 10%);
  --radius-sm: 9px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --sidebar-width: 258px;
  --topbar-height: 68px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--canvas); font: 15px/1.58 "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; }
button, summary, input[type="submit"] { -webkit-tap-highlight-color: transparent; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1, h2 { font-family: "Marcellus", Georgia, serif; font-weight: 400; color: var(--ink); }
h1 { margin: 0; font-size: clamp(2rem, 3vw, 2.85rem); line-height: 1.13; letter-spacing: -.028em; }
h2 { margin: 0; font-size: 1.34rem; line-height: 1.25; }
h3 { margin: 0; font-size: 1rem; line-height: 1.4; }
p { margin: 0; color: var(--muted); }
strong { font-weight: 700; }
summary { list-style: none; cursor: pointer; }
summary::-webkit-details-marker { display: none; }
:focus-visible { outline: 3px solid rgb(23 108 99 / 30%); outline-offset: 3px; border-radius: 4px; }
.ui-icon { display: inline-block; flex: none; vertical-align: middle; }
.skip-link { position: fixed; z-index: 1000; left: 16px; top: -60px; padding: 10px 16px; border-radius: 8px; background: var(--white); color: var(--ink); box-shadow: var(--shadow-md); }
.skip-link:focus { top: 12px; }
.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; }

/* Read-only Alpha setup and bounded source diagnostics. */
.analysis-readiness > p { margin-block: 12px; }
.readiness-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 48px; }
.app-main .wrap .readiness-heading h2 { margin: 0; }
.analysis-readiness[open] > summary .ui-icon { transform: rotate(90deg); }
.readiness-steps { display: grid; gap: 16px; padding-left: 23px; margin-block: 20px; }
.readiness-steps strong { color: var(--ink); }
.analysis-readiness h3 { margin-top: 24px; }
.readiness-sources { display: grid; gap: 10px; margin-block: 14px; }
.readiness-source { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-soft); }
.readiness-source summary { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; min-height: 48px; padding: 12px 14px; }
.readiness-source summary::after { content: "+"; color: var(--accent); font-size: 1.2rem; }
.readiness-source[open] summary::after { content: "-"; }
.readiness-source-title { flex: 1 1 180px; min-width: 0; overflow-wrap: anywhere; color: var(--ink); font-weight: 700; }
.readiness-state { color: var(--accent); font-size: .78rem; font-weight: 700; }
.readiness-source-body { padding: 0 14px 14px; }
.readiness-source-body ul { padding-left: 20px; }
.readiness-source-body li + li { margin-top: 8px; }
.readiness-source-body > a { display: inline-flex; align-items: center; min-height: 44px; }
.analysis-readiness .readiness-limit { padding-top: 14px; border-top: 1px solid var(--line); font-size: .82rem; }

/* Application shell */
.button:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.app-main .wrap h2 { margin: 25px 0 12px; }
.entry .t { width: auto; }
.entry .txt { min-width: 0; overflow-wrap: anywhere; }
.portrait-section .chip:not(.self):not(.unknown), .insight-meta .chip { color: var(--ink); background: var(--accent-soft); }
.insight-meta .chip-gold { background: var(--gold-soft); }
.app-footer nav { flex-wrap: wrap; }
.mobile-account-card strong, .mobile-account-card div span { overflow-wrap: anywhere; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 25px 18px 20px; color: #dce8e5; background: radial-gradient(circle at 0 0, #16423b 0, var(--pine) 45%, #071f1c 100%); overflow-y: auto; }
.sidebar-brand { display: flex; align-items: center; gap: 11px; min-height: 40px; padding: 0 10px; color: var(--white); }
.sidebar-brand:hover { color: var(--white); }
.sidebar-mark { width: 30px; height: 30px; object-fit: contain; filter: brightness(0) invert(1); opacity: .96; }
.sidebar-word { font: 400 20px/1 "Marcellus", Georgia, serif; letter-spacing: .12em; text-transform: uppercase; }
.primary-navigation { margin-top: 42px; display: grid; gap: 5px; }
.nav-section-label { margin: 0 12px 7px; color: #829e98; font-size: .68rem; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.nav-section-spaced { margin-top: 23px; }
.nav-item { position: relative; display: flex; align-items: center; gap: 12px; min-height: 45px; padding: 10px 12px; border-radius: 10px; color: #b9ceca; font-size: .91rem; font-weight: 500; transition: background .18s ease, color .18s ease, transform .18s ease; }
.nav-item:hover { color: var(--white); background: rgb(255 255 255 / 7%); transform: translateX(2px); }
.nav-item.active { color: var(--white); background: linear-gradient(90deg, rgb(255 255 255 / 14%), rgb(255 255 255 / 7%)); box-shadow: inset 0 0 0 1px rgb(255 255 255 / 7%); }
.nav-item.active::before { content: ""; position: absolute; left: -18px; width: 3px; height: 25px; border-radius: 0 3px 3px 0; background: var(--gold); }
.nav-item .ui-icon { opacity: .9; }
.sidebar-trust { margin-top: auto; display: flex; gap: 11px; align-items: flex-start; padding: 15px 13px; border: 1px solid rgb(255 255 255 / 9%); border-radius: 12px; background: rgb(255 255 255 / 5%); }
.sidebar-trust .ui-icon { margin-top: 2px; color: var(--gold); }
.sidebar-trust div { display: grid; gap: 2px; }
.sidebar-trust strong { color: #f5faf8; font-size: .78rem; }
.sidebar-trust span { color: #91aaa5; font-size: .69rem; }
.app-stage { min-width: 0; min-height: 100vh; display: flex; flex-direction: column; }
.topbar { position: sticky; z-index: 50; top: 0; height: var(--topbar-height); display: flex; align-items: center; gap: 18px; padding: 0 clamp(22px, 4vw, 50px); border-bottom: 1px solid rgb(218 213 201 / 82%); background: rgb(248 247 241 / 90%); backdrop-filter: blur(18px); }
.topbar-context { display: grid; line-height: 1.15; }
.topbar-kicker { color: var(--subtle); font-size: .66rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.topbar-context strong { margin-top: 4px; font-size: .91rem; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-button { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: var(--surface); }
.icon-button:hover { border-color: var(--line-strong); color: var(--ink); box-shadow: var(--shadow-sm); }
.account-menu { position: relative; }
.account-menu > summary { min-height: 42px; display: flex; align-items: center; gap: 9px; padding: 4px 9px 4px 5px; border: 1px solid transparent; border-radius: 12px; color: var(--ink); }
.account-menu[open] > summary, .account-menu > summary:hover { border-color: var(--line); background: var(--surface); }
.account-menu[open] > summary .ui-icon:last-child { transform: rotate(180deg); }
.account-summary-name { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .82rem; font-weight: 700; }
.avatar { width: 32px; height: 32px; display: inline-grid; place-items: center; flex: none; border-radius: 10px; color: #eaf6f2; background: linear-gradient(135deg, var(--accent), #2b8d80); font-size: .69rem; font-weight: 700; letter-spacing: .04em; }
.avatar-large { width: 42px; height: 42px; border-radius: 12px; font-size: .8rem; }
.avatar-xl { width: 58px; height: 58px; border-radius: 16px; font-size: 1rem; }
.account-popover { position: absolute; right: 0; top: calc(100% + 8px); width: 270px; padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-md); }
.account-popover::before { content: ""; position: fixed; inset: 0; z-index: -1; }
.account-popover-head { display: flex; align-items: center; gap: 11px; padding: 10px 9px 13px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.account-popover-head div, .mobile-account-card div { min-width: 0; display: grid; }
.account-popover-head strong, .mobile-account-card strong { font-size: .83rem; overflow: hidden; text-overflow: ellipsis; }
.account-popover-head span:not(.avatar), .mobile-account-card div span { color: var(--subtle); font-size: .7rem; overflow: hidden; text-overflow: ellipsis; }
.account-popover > a, .account-popover form button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; text-align: left; cursor: pointer; }
.account-popover > a:hover, .account-popover form button:hover { color: var(--ink); background: var(--surface-soft); }
.account-popover form { margin: 3px 0 0; padding-top: 3px; border-top: 1px solid var(--line); }
.mobile-menu { display: none; }
.flash-stack { position: fixed; z-index: 60; right: 24px; top: calc(var(--topbar-height) + 15px); width: min(390px, calc(100vw - 48px)); }
.flash { margin-bottom: 8px; padding: 12px 15px; border: 1px solid; border-radius: 11px; background: var(--surface); box-shadow: var(--shadow-md); font-size: .84rem; }
.flash.alert { border-color: #ecc7c0; color: var(--danger); background: #fff8f6; }
.flash.notice { border-color: #b9dacf; color: var(--accent-hover); background: #f3fbf8; }
.app-main { flex: 1; min-width: 0; }
.page { width: min(1200px, 100%); margin: 0 auto; padding: clamp(28px, 4.3vw, 55px) clamp(22px, 4vw, 50px) 70px; }
.app-footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 20px clamp(22px, 4vw, 50px) 30px; color: var(--subtle); font-size: .73rem; }
.app-footer nav { display: flex; gap: 18px; }
.app-footer a { color: var(--subtle); }

/* Shared content */
.eyebrow, .section-kicker { display: inline-flex; align-items: center; gap: 7px; color: var(--accent); font-size: .69rem; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; }
.button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border: 1px solid transparent; border-radius: 10px; cursor: pointer; font-size: .82rem; font-weight: 700; line-height: 1.2; transition: transform .15s ease, box-shadow .15s ease, background .15s ease; }
.button:hover { text-decoration: none; transform: translateY(-1px); }
.button-primary { color: var(--white); background: var(--accent); box-shadow: 0 8px 18px rgb(23 108 99 / 18%); }
.button-primary:hover { color: var(--white); background: var(--accent-hover); box-shadow: 0 10px 22px rgb(23 108 99 / 24%); }
.button-secondary { color: var(--ink); border-color: var(--line-strong); background: var(--surface); }
.button-secondary:hover { color: var(--ink); border-color: #bcb4a3; background: var(--white); box-shadow: var(--shadow-sm); }
.button-danger-outline { color: var(--danger); border-color: #dfb4ac; background: var(--surface); }
.button-danger-outline:hover { color: #87352a; background: var(--danger-soft); }
.button-full { width: 100%; }
.text-link { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 700; }
.count-badge { min-width: 32px; height: 28px; display: inline-grid; place-items: center; padding: 0 9px; border-radius: 999px; color: var(--accent); background: var(--accent-soft); font: 700 .72rem/1 "Space Mono", monospace; }
.status-label { display: inline-flex; align-items: center; justify-content: center; min-height: 23px; padding: 3px 9px; border-radius: 999px; font-size: .66rem; font-style: normal; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.status-label.enabled { color: var(--accent-hover); background: var(--accent-soft); }
.status-label.disabled { color: var(--subtle); background: #eceae4; }
.badge { display: inline-flex; align-items: center; width: fit-content; padding: 4px 8px; border-radius: 999px; color: var(--accent); background: var(--accent-soft); font-size: .61rem; font-weight: 700; letter-spacing: .08em; line-height: 1.25; text-transform: uppercase; }
.badge.growth_edge { color: #80601d; background: var(--gold-soft); }
.badge.trigger { color: var(--danger); background: var(--danger-soft); }
.badge.value { color: var(--accent-hover); background: #e3f1e9; }
.panel, .settings-card, .aside-card { border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-sm); }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 17px; }
.section-heading h2 { margin-top: 4px; }
.section-heading p { margin-top: 5px; font-size: .83rem; }
.content-section { margin-top: 48px; scroll-margin-top: 90px; }
.empty-state { min-height: 130px; display: flex; align-items: center; justify-content: center; gap: 16px; padding: 28px; border: 1px dashed var(--line-strong); border-radius: var(--radius-md); background: rgb(255 253 248 / 48%); }
.empty-state.compact { min-height: 105px; justify-content: flex-start; padding: 20px; }
.empty-state.large { min-height: 300px; text-align: center; flex-direction: column; }
.empty-state.large div { max-width: 560px; }
.empty-icon { width: 48px; height: 48px; display: grid; place-items: center; flex: none; border-radius: 14px; color: var(--accent); background: var(--accent-soft); }
.empty-state h2, .empty-state h3 { margin-bottom: 4px; }
.empty-state p { max-width: 600px; font-size: .82rem; }
.empty-state .button, .empty-state .text-link { margin-top: 15px; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding-bottom: 27px; border-bottom: 1px solid var(--line); }
.page-header h1 { margin-top: 7px; }
.page-header p { max-width: 680px; margin-top: 8px; }

/* Dashboard */
.dashboard-hero { position: relative; min-height: 265px; display: flex; align-items: center; overflow: hidden; padding: clamp(30px, 5vw, 55px); border-radius: var(--radius-lg); color: #f0f7f4; background: radial-gradient(circle at 85% 20%, #1d574e 0, transparent 35%), linear-gradient(135deg, #0a2924, #103b34 65%, #0c302a); box-shadow: 0 24px 60px rgb(11 48 42 / 16%); }
.dashboard-hero::after { content: ""; position: absolute; right: -80px; bottom: -110px; width: 360px; height: 360px; border: 1px solid rgb(255 255 255 / 7%); border-radius: 50%; }
.hero-copy { position: relative; z-index: 2; max-width: 670px; }
.dashboard-hero .eyebrow { color: #9ecac2; }
.dashboard-hero h1 { margin-top: 10px; color: var(--white); }
.dashboard-hero p { max-width: 610px; margin-top: 12px; color: #bed2ce; font-size: .96rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 25px; }
.dashboard-hero .button-primary { color: var(--pine); background: #f3eee1; box-shadow: none; }
.dashboard-hero .button-primary:hover { color: var(--pine); background: var(--white); }
.dashboard-hero .button-secondary { color: #e5f1ee; border-color: rgb(255 255 255 / 22%); background: rgb(255 255 255 / 6%); }
.dashboard-hero .button-secondary:hover { color: var(--white); border-color: rgb(255 255 255 / 38%); background: rgb(255 255 255 / 11%); }
.hero-orbit { position: absolute; right: clamp(30px, 8vw, 100px); top: 50%; width: 155px; height: 155px; transform: translateY(-50%); }
.orbit { position: absolute; inset: 0; border: 1px solid rgb(215 184 117 / 28%); border-radius: 50%; }
.orbit-one::after, .orbit-two::after { content: ""; position: absolute; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 18px rgb(215 184 117 / 70%); }
.orbit-one::after { top: 17px; left: 22px; }
.orbit-two { inset: 22px; }
.orbit-two::after { right: -4px; bottom: 33px; }
.orbit-core { position: absolute; inset: 52px; display: grid; place-items: center; border-radius: 50%; color: #e8d4a2; background: rgb(255 255 255 / 8%); box-shadow: 0 0 0 9px rgb(255 255 255 / 3%); }
.metric-grid { position: relative; z-index: 3; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: -20px 22px 0; }
.metric-card { min-height: 92px; display: flex; align-items: center; gap: 13px; padding: 17px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); box-shadow: var(--shadow-sm); }
.metric-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; color: var(--accent); background: var(--accent-pale); }
.metric-card div { display: grid; }
.metric-card strong { font: 400 1.55rem/1.1 "Marcellus", Georgia, serif; }
.metric-card span:last-child { color: var(--subtle); font-size: .69rem; }
.dashboard-split { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(270px, .85fr); gap: 15px; margin-top: 38px; }
.featured-panel, .trust-panel { padding: 23px; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.panel-heading h2 { margin-top: 4px; }
.status-pill { display: flex; align-items: center; gap: 6px; white-space: nowrap; color: var(--accent); font-size: .65rem; font-weight: 700; }
.status-pill > span { width: 7px; height: 7px; border-radius: 50%; background: #36a58d; box-shadow: 0 0 0 4px #e4f4ef; }
.featured-insight { padding-top: 19px; }
.featured-insight h3 { margin-top: 12px; font: 400 1.25rem/1.35 "Marcellus", Georgia, serif; }
.featured-insight > p { margin-top: 8px; }
.insight-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 16px; color: var(--subtle); font-size: .7rem; }
.trust-panel { position: relative; overflow: hidden; background: linear-gradient(145deg, #f8f4e9, #fffdf8); }
.trust-panel::after { content: ""; position: absolute; right: -45px; top: -45px; width: 130px; height: 130px; border-radius: 50%; background: rgb(215 184 117 / 11%); }
.trust-symbol { width: 46px; height: 46px; display: grid; place-items: center; margin-bottom: 18px; border-radius: 13px; color: var(--accent); background: var(--accent-soft); }
.trust-panel h2 { margin-top: 7px; }
.trust-panel p { margin-top: 10px; font-size: .8rem; }
.trust-panel a { display: inline-flex; align-items: center; gap: 6px; margin-top: 18px; font-size: .75rem; font-weight: 700; }
.insight-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.insight-card { padding: 19px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); box-shadow: var(--shadow-sm); }
.insight-card h3 { margin-top: 12px; }
.insight-card > p { margin-top: 8px; font-size: .82rem; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 18px; }
.pagination-status { font-size: .8rem; color: var(--ink-soft, inherit); }
.cardline { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.confidence { color: var(--subtle); font-size: .66rem; }
.evidence-note { display: flex; align-items: center; gap: 5px; margin-top: 13px; color: var(--subtle); font-size: .68rem; }
.evidence-note .ui-icon { color: var(--accent); }
.traits { display: grid; grid-template-columns: repeat(auto-fit, minmax(185px, 1fr)); gap: 11px; }
.trait { padding: 17px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); box-shadow: var(--shadow-sm); }
.trait-label { color: var(--subtle); font-size: .64rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.trait-value { margin-top: 7px; font: 400 1.45rem/1.15 "Marcellus", Georgia, serif; }
.trait-value small { margin-left: 3px; color: var(--subtle); font: 400 .63rem/1 "Manrope", sans-serif; }
.trait-value-text { font: 700 .9rem/1.3 "Manrope", sans-serif; }
.meter { height: 5px; margin-top: 12px; overflow: hidden; border-radius: 999px; background: #e6e3da; }
.meter i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), #49a391); }
.memory-list, .conversation-list { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-sm); }
.memory-row { display: flex; gap: 13px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.memory-row:last-child, .conversation-row:last-child { border-bottom: 0; }
.memory-mark { width: 28px; height: 28px; display: grid; place-items: center; flex: none; border-radius: 9px; color: var(--accent); background: var(--accent-soft); }
.memory-row p { margin-top: 7px; font-size: .8rem; }
.conversation-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 13px; min-height: 68px; padding: 11px 17px; border-bottom: 1px solid var(--line); color: var(--ink); transition: background .15s ease; }
.conversation-row:hover { color: var(--ink); background: var(--surface-soft); }
.conversation-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; color: var(--accent); background: var(--accent-pale); }
.conversation-copy { min-width: 0; display: grid; }
.conversation-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .82rem; }
.conversation-copy span, .line-count { color: var(--subtle); font-size: .67rem; }
.line-count { white-space: nowrap; }

/* Profile and settings */
.settings-page .page-header { align-items: center; }
.profile-identity { display: flex; align-items: center; gap: 12px; padding: 11px 15px 11px 11px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); box-shadow: var(--shadow-sm); }
.profile-identity div { display: grid; }
.profile-identity strong { font-size: .83rem; }
.profile-identity span:not(.avatar) { color: var(--subtle); font-size: .68rem; }
.settings-layout { display: grid; grid-template-columns: minmax(0, 1fr) 285px; gap: 18px; margin-top: 24px; align-items: start; }
.settings-main { display: grid; gap: 16px; }
.settings-card { padding: 24px; }
.settings-card-head { display: flex; align-items: flex-start; gap: 13px; padding-bottom: 19px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.settings-card-head p { margin-top: 3px; font-size: .76rem; }
.settings-icon { width: 38px; height: 38px; display: grid; place-items: center; flex: none; border-radius: 11px; color: var(--accent); background: var(--accent-soft); }
.settings-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.settings-form .field:last-of-type { grid-column: 1 / -1; }
.password-grid .field:last-of-type { grid-column: auto; }
.password-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; padding-top: 2px; }
.field { display: grid; gap: 6px; text-align: left; }
.field label, .verification-form label { color: var(--ink); font-size: .73rem; font-weight: 700; }
.field input, .inline-security-form input, .verification-form input, .help-search input { width: 100%; min-height: 43px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 9px; color: var(--ink); background: var(--surface-soft); outline: none; }
.field input:hover, .inline-security-form input:hover, .verification-form input:hover, .help-search input:hover { border-color: #bcb6a9; }
.field input:focus, .inline-security-form input:focus, .verification-form input:focus, .help-search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgb(23 108 99 / 12%); background: var(--white); }
.field-hint { color: var(--subtle); font-size: .65rem; }
.security-setting { display: flex; align-items: flex-end; justify-content: space-between; gap: 25px; }
.security-setting-copy { max-width: 620px; }
.security-title { display: flex; align-items: center; gap: 9px; }
.security-setting-copy > p { margin-top: 7px; font-size: .8rem; }
.security-note { display: flex; align-items: flex-start; gap: 7px; margin-top: 13px; padding: 10px 12px; border-radius: 9px; color: var(--muted); background: var(--surface-soft); font-size: .68rem; }
.security-note .ui-icon { margin-top: 1px; color: var(--accent); }
.inline-security-form { width: 220px; display: grid; flex: none; gap: 8px; }
.inline-security-form input { min-height: 40px; font-size: .74rem; }
.session-list { display: grid; }
.session-row { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.session-row:first-child { padding-top: 0; }
.session-row:last-child { padding-bottom: 0; border-bottom: 0; }
.session-device { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; color: var(--muted); background: var(--surface-soft); }
.session-row div { min-width: 0; display: grid; }
.session-row div strong { font-size: .77rem; }
.session-row div span { color: var(--subtle); font-size: .65rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.session-row .status-label { margin-left: auto; }
.settings-aside { position: sticky; top: calc(var(--topbar-height) + 20px); display: grid; gap: 13px; }
.aside-card { padding: 21px; }
.aside-icon { width: 42px; height: 42px; display: grid; place-items: center; margin-bottom: 15px; border-radius: 12px; color: var(--accent); background: var(--accent-soft); }
.aside-card h2 { font-size: 1.15rem; }
.aside-card p { margin-top: 8px; font-size: .76rem; }
.aside-card .text-link, .aside-card .button { margin-top: 16px; }
.help-aside { background: linear-gradient(145deg, #f8f4e9, #fffdf8); }

/* Verification flows */
.verification-page { min-height: calc(100vh - var(--topbar-height) - 100px); display: grid; place-items: center; }
.verification-card { width: min(480px, 100%); padding: 38px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow-md); text-align: center; }
.verification-icon, .auth-icon { width: 54px; height: 54px; display: grid; place-items: center; margin: 0 auto 17px; border-radius: 16px; color: var(--accent); background: var(--accent-soft); }
.verification-card h1 { margin-top: 8px; font-size: 2rem; }
.verification-card > p { margin-top: 10px; font-size: .82rem; }
.verification-form { display: grid; gap: 9px; margin-top: 24px; text-align: left; }
.verification-form .code-input { min-height: 56px; color: var(--ink); font: 700 1.35rem/1 "Space Mono", monospace; letter-spacing: .18em; text-align: center; }
.verification-form .button { margin-top: 3px; }
.verification-links { display: flex; justify-content: center; gap: 16px; margin-top: 17px; font-size: .73rem; }
.verification-links form { display: inline; }
.link-button { padding: 0; border: 0; color: var(--accent); background: transparent; cursor: pointer; }
.link-button:hover { color: var(--accent-hover); text-decoration: underline; }

/* Help center */
.public-help-page { width: min(1160px, calc(100% - 44px)); margin: 0 auto; padding: 25px 0 75px; }
.help-brand { display: inline-flex; margin: 0 0 22px 4px; }
.help-brand img { width: 120px; height: 38px; object-fit: contain; }
.help-hero { padding: clamp(35px, 6vw, 66px) 25px; border-radius: var(--radius-lg); text-align: center; background: radial-gradient(circle at 75% 20%, #e6f1ec, transparent 32%), linear-gradient(135deg, #f8f4e8, #fffdf8); border: 1px solid var(--line); }
.help-hero h1 { margin-top: 7px; }
.help-hero > p { margin: 9px auto 0; max-width: 650px; }
.help-search { width: min(680px, 100%); display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; margin: 25px auto 0; padding: 7px 7px 7px 15px; border: 1px solid var(--line-strong); border-radius: 13px; background: var(--surface); box-shadow: var(--shadow-sm); }
.help-search > .ui-icon { color: var(--subtle); }
.help-search input { min-height: 37px; padding: 7px 5px; border: 0; background: transparent; }
.help-search input:focus { border: 0; box-shadow: none; background: transparent; }
.help-search .button { min-height: 38px; }
.help-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 18px; margin-top: 38px; align-items: start; }
.topic-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.topic-card { border: 1px solid var(--line); border-radius: 13px; background: var(--surface); box-shadow: var(--shadow-sm); }
.topic-card[open] { grid-column: 1 / -1; border-color: #c7dcd6; }
.topic-card summary { display: flex; justify-content: space-between; gap: 15px; padding: 18px; }
.topic-card summary > span:first-child { display: grid; }
.topic-card small { color: var(--accent); font-size: .58rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.topic-card strong { margin-top: 5px; font-size: .84rem; }
.topic-card em { margin-top: 5px; color: var(--muted); font-size: .72rem; font-style: normal; }
.topic-toggle { width: 28px; height: 28px; display: grid; place-items: center; flex: none; border-radius: 9px; color: var(--muted); background: var(--surface-soft); }
.topic-card[open] .topic-toggle .ui-icon { transform: rotate(180deg); }
.topic-answer { padding: 0 18px 18px; }
.topic-answer p { padding-top: 14px; border-top: 1px solid var(--line); font-size: .78rem; }
.help-contact-card { position: sticky; top: calc(var(--topbar-height) + 20px); padding: 24px; border: 1px solid var(--line); border-radius: var(--radius-md); background: linear-gradient(145deg, #f8f4e9, #fffdf8); box-shadow: var(--shadow-sm); }
.help-contact-card h2 { font-size: 1.2rem; }
.help-contact-card p { margin-top: 8px; font-size: .75rem; }
.help-contact-card .button { margin-top: 18px; }
.support-note { display: block; margin-top: 9px; color: var(--subtle); font-size: .63rem; text-align: center; }

/* Portrait and transcript */
.portrait-emblem { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 18px; color: var(--accent); background: var(--accent-soft); }
.portrait-run-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; margin: 18px 0 0; color: var(--subtle); font-size: .69rem; }
.portrait-run-meta > span { display: inline-flex; align-items: center; gap: 5px; }
.portrait-composition { display: grid; gap: 12px; margin-top: 25px; }
.portrait-prose { position: relative; padding: 23px 25px 23px 38px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); box-shadow: var(--shadow-sm); }
.portrait-prose p { color: var(--ink); font: 400 1rem/1.75 "Marcellus", Georgia, serif; }
.portrait-rule { position: absolute; left: 20px; top: 25px; bottom: 25px; width: 2px; border-radius: 2px; background: linear-gradient(var(--accent), var(--gold)); }
.portrait-claim .cardline { justify-content: flex-start; flex-wrap: wrap; }
.withheld-section { padding-top: 30px; border-top: 1px solid var(--line); }
.insight-card.withheld { background: rgb(255 253 248 / 48%); box-shadow: none; }
.back-link { display: inline-flex; margin-bottom: 17px; font-size: .75rem; font-weight: 700; }
.transcript-header { align-items: center; }
.privacy-chip { display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px; white-space: nowrap; border-radius: 999px; color: var(--accent-hover); background: var(--accent-soft); font-size: .67rem; font-weight: 700; }
.transcript-card { margin-top: 23px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-sm); }
.entry { display: grid; grid-template-columns: 52px auto minmax(0, 1fr); align-items: start; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.entry:last-child { border-bottom: 0; }
.entry-time { padding-top: 3px; color: var(--subtle); font: .65rem/1.4 "Space Mono", monospace; }
.entry-text { color: var(--ink); font-size: .82rem; }
.chip { display: inline-flex; align-items: center; justify-content: center; min-width: 50px; padding: 4px 8px; border-radius: 999px; color: #fff; font-size: .59rem; font-weight: 700; }
.chip.self { background: var(--accent); }
.chip.p0 { background: #238164; } .chip.p1 { background: #9a702a; } .chip.p2 { background: #795692; } .chip.p3 { background: #a84a3b; } .chip.unknown { background: #77837f; }
.lowconf { width: 16px; height: 16px; display: inline-grid; place-items: center; margin-left: 5px; border-radius: 50%; color: var(--white); background: var(--danger); font-size: .58rem; font-weight: 700; }

/* Authentication and public pages */
.guest-body { min-height: 100vh; background: radial-gradient(circle at 15% 15%, #e3efea, transparent 28%), radial-gradient(circle at 85% 75%, #efe5d1, transparent 31%), var(--canvas); }
.guest-main { min-height: calc(100vh - 66px); }
.auth-wrap { min-height: calc(100vh - 66px); display: grid; place-items: center; padding: 40px 22px; }
.auth-card { width: min(430px, 100%); padding: 38px; border: 1px solid var(--line); border-radius: 20px; background: rgb(255 253 248 / 94%); box-shadow: var(--shadow-md); text-align: center; }
.auth-card-wide { width: min(470px, 100%); }
.vmark-lg { width: 126px; height: 58px; display: block; object-fit: contain; margin: 0 auto 18px; }
.auth-card h1 { margin-top: 7px; font-size: 2rem; }
.auth-card .sub { margin-top: 8px; font-size: .79rem; }
.auth-form { display: grid; gap: 13px; margin-top: 24px; }
.auth-form .pw-wrap { display: block; margin: 0; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 44px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; display: grid; place-items: center; padding: 0; border: 0; color: var(--muted); background: transparent; cursor: pointer; opacity: .7; }
.pw-toggle:hover { opacity: 1; }
.auth-foot { display: flex; justify-content: center; gap: 7px; margin-top: 18px; font-size: .71rem; }
.auth-trust { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 21px; padding: 10px; border-radius: 9px; color: var(--accent-hover); background: var(--accent-soft); font-size: .68rem; font-weight: 700; }
.auth-legal { margin-top: 14px; color: var(--subtle); font-size: .62rem; }
.check-field { display: flex; align-items: flex-start; gap: 9px; color: var(--muted); font-size: .67rem; text-align: left; cursor: pointer; }
.check-field input { width: 16px; height: 16px; flex: none; margin-top: 2px; accent-color: var(--accent); }
.verification-auth-card .auth-icon { margin-top: -2px; }
.guest-footer { min-height: 66px; padding: 20px 24px; }
.guest-footer nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 16px; color: var(--subtle); font-size: .68rem; }
.guest-footer a { color: var(--subtle); }
.legal-foot { display: none; }
.wrap { width: min(900px, calc(100% - 44px)); margin: 0 auto; padding: 45px 0 70px; }
.legal h2 { margin: 27px 0 8px; }
.legal p, .legal li { color: var(--muted); font-size: .82rem; }

@media (max-width: 1080px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-orbit { opacity: .6; right: 30px; }
  .hero-copy { max-width: 72%; }
  .settings-layout, .help-layout { grid-template-columns: minmax(0, 1fr); }
  .settings-aside, .help-contact-card { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .help-contact-card { max-width: none; }
  .password-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  :root { --topbar-height: 62px; }
  .app-shell { display: block; }
  .sidebar { display: none; }
  .topbar { padding: 0 18px; }
  .mobile-menu { position: relative; display: block; }
  .mobile-menu > summary { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
  .mobile-menu-panel { position: fixed; z-index: 80; left: 0; top: var(--topbar-height); width: min(320px, calc(100vw - 42px)); height: calc(100dvh - var(--topbar-height)); padding: 19px 16px; overflow-x: hidden; overflow-y: auto; color: #dce8e5; background: var(--pine); box-shadow: 18px 0 45px rgb(7 31 28 / 25%); }
  .mobile-menu-head { padding: 4px 9px 7px; }
  .mobile-menu-head .sidebar-brand { padding: 0; }
  .mobile-menu .primary-navigation { margin-top: 25px; }
  .mobile-account-card { display: flex; align-items: center; gap: 11px; margin-top: 28px; padding: 14px 11px; border-top: 1px solid rgb(255 255 255 / 9%); }
  .app-footer { padding-left: 22px; padding-right: 22px; }
}

@media (max-width: 720px) {
  .page { padding: 27px 17px 55px; }
  .account-summary-name { display: none; }
  .topbar-context strong { font-size: .82rem; }
  .dashboard-hero { min-height: 320px; padding: 32px 25px; align-items: flex-start; }
  .hero-copy { max-width: 100%; }
  .hero-orbit { right: -25px; top: auto; bottom: -62px; transform: none; opacity: .45; }
  .metric-grid { margin: 12px 0 0; }
  .dashboard-split, .insight-grid, .topic-grid { grid-template-columns: 1fr; }
  .topic-card[open] { grid-column: auto; }
  .settings-form, .password-grid { grid-template-columns: 1fr; }
  .settings-form .field:last-of-type, .password-grid .field:last-of-type { grid-column: auto; }
  .security-setting { align-items: stretch; flex-direction: column; }
  .inline-security-form { width: 100%; }
  .settings-aside { grid-template-columns: 1fr; }
  .page-header { align-items: flex-start; flex-direction: column; }
  .profile-identity { width: 100%; }
  .privacy-chip { white-space: normal; }
  .conversation-row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .conversation-row .line-count { display: none; }
  .help-hero { padding: 36px 17px; }
  .help-search { grid-template-columns: auto minmax(0, 1fr); }
  .help-search .button { grid-column: 1 / -1; }
  .app-footer { align-items: flex-start; flex-direction: column; }
  .entry { grid-template-columns: 45px auto; }
  .entry-text { grid-column: 2; }
  .entry .txt { grid-column: 1 / -1; width: auto; }
}

@media (max-width: 480px) {
  .topbar-kicker, .icon-button { display: none; }
  .topbar { gap: 10px; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .metric-card { min-height: 83px; gap: 9px; padding: 12px; }
  .metric-icon { width: 32px; height: 32px; }
  .metric-card strong { font-size: 1.25rem; }
  .metric-card span:last-child { font-size: .61rem; }
  .panel-heading, .section-heading { gap: 12px; }
  .status-pill { display: none; }
  .section-heading p { display: none; }
  .settings-card, .aside-card { padding: 19px; }
  .auth-card, .verification-card { padding: 29px 22px; }
  .auth-wrap { padding: 24px 14px; }
  .public-help-page { width: min(100% - 28px, 1160px); }
  .verification-links { flex-direction: column; gap: 8px; }
}

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