/* Home concierge — plain CSS, no build step. */
:root {
    color-scheme: light;
    --bg: #faf8f5; --surface: #fff; --surface-2: #f6f3ee; --surface-3: #ece7df;
    --border: #e9e4dc; --border-strong: #d4ccc1;
    --text: #282a27; --text-2: #5d605a; --muted: #797b73;
    --accent: #bd511d; --accent-2: #ee8a44; --accent-soft: #f9e8da;
    --accent-ring: #df7b3324; --accent-text: #fff;
    --user-bubble: #333e37; --user-text: #fff;
    --danger: #bc3d30; --danger-bg: #fff0ed; --ok: #598369; --warn: #986424;
    --shadow-sm: 0 2px 4px #392b1705;
    --shadow-md: 0 8px 32px -14px #5e462129;
    --shadow-lg: 0 24px 70px -24px #47341f40;
    --radius-sm: 10px; --radius: 14px; --radius-lg: 20px;
    --ease: cubic-bezier(.2,.8,.2,1); --spring: cubic-bezier(.34,1.4,.64,1);
    --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    --mono: "JetBrains Mono", ui-monospace, monospace;
}
:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #20221f; --surface: #292c27; --surface-2: #30332d; --surface-3: #3b3f36;
    --border: #3b3e36; --border-strong: #54594b;
    --text: #f3eee5; --text-2: #c6c7bc; --muted: #a2a698;
    --accent: #ffa668; --accent-2: #ffba88; --accent-soft: #49362a;
    --accent-ring: #ed95542b; --accent-text: #28221c;
    --user-bubble: #4b614f; --danger: #ff9b8d; --danger-bg: #482e2a;
    --ok: #9ac3a3; --warn: #e9b86a;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { font: 14px/1.5 var(--font); color: var(--text); background: var(--bg); overflow: hidden; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: none; cursor: pointer; }
button:disabled { cursor: not-allowed; }
svg { display: block; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
a { color: inherit; }
kbd { font: 10px/1 var(--mono); padding: 3px 5px; border-radius: 4px; border: 1px solid var(--border); background: var(--surface); }
code { font: .9em var(--mono); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
.hidden, [hidden] { display: none !important; }
.hint { font-size: 12px; line-height: 1.55; color: var(--muted); }
.hint:empty { display: none; }
.hint code { padding: 1px 4px; border-radius: 4px; background: var(--surface-3); }
.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.skip-link { position: fixed; left: 20px; top: -80px; padding: 12px; z-index: 100; background: var(--surface); }
.skip-link:focus { top: 10px; }
.icon-btn { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; color: var(--text-2); border: 1px solid transparent; transition: background .2s, transform .2s; flex-shrink: 0; }
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn:hover:not(:disabled) { background: var(--surface-3); color: var(--text); }
.icon-btn:active:not(:disabled) { transform: scale(.94); }
.icon-btn:disabled { opacity: .4; }
.icon-sun { display: none; }
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }
.app { display: flex; height: 100%; height: 100dvh; }
#sidebar { display: flex; flex-direction: column; width: 260px; min-width: 260px; background: var(--surface-2); border-right: 1px solid var(--border); z-index: 10; }
.brand { display: flex; flex-direction: column; align-items: flex-start; padding: 32px 25px 35px; text-decoration: none; }
.brand-logo { display: block; width: 100%; max-width: 178px; height: auto; fill: #000; stroke: none; overflow: visible; }
.brand-logomark { transform-origin: 18px 18px; transition: transform .4s var(--spring); }
.brand:hover .brand-logomark { transform: translateY(-2px) rotate(-6deg); }
.brand-caption { display: block; font-size: 9px; color: var(--muted); margin-top: 10px; letter-spacing: .1px; }
.side-scroll { padding: 0 18px; overflow-y: auto; flex: 1; scrollbar-width: thin; }
.new-chat.btn { justify-content: flex-start; padding: 14px 17px; font-size: 12px; border-radius: 12px; background: #df7133; color: #fff; box-shadow: 0 5px 12px #a4531b17; }
.new-chat svg { margin-right: 2px; }
.side-nav { display: grid; gap: 5px; padding: 25px 0 29px; }
.nav-item { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 14px; border-radius: 10px; font-size: 12px; color: var(--text-2); }
.nav-item svg { width: 18px; height: 18px; }
.nav-item > span:first-of-type { flex: 1; }
.nav-item:hover { background: var(--surface-3); }
.nav-item.active { background: var(--surface); color: var(--accent); box-shadow: var(--shadow-sm); }
.nav-arrow { width: 14px !important; }
.nav-item:not(.active) .nav-arrow { visibility: hidden; }
.count { min-width: 20px; padding: 2px 6px; text-align: center; border-radius: 6px; background: var(--surface-3); font-size: 10px; }
.section-label { font-size: 9px; font-weight: 600; letter-spacing: 1.6px; color: var(--muted); margin: 0 12px 16px; }
.session-empty { padding: 20px 12px; color: var(--muted); }
.session-empty svg { width: 25px; height: 25px; margin-bottom: 13px; color: var(--border-strong); }
.session-empty p { font-size: 12px; line-height: 1.8; }
.session-empty > span { display: block; font-size: 10px; margin-top: 9px; opacity: .85; }
.side-bottom { padding: 20px 18px 16px; }
.concierge-note { padding: 19px 18px; margin-bottom: 23px; border-radius: 14px; background: linear-gradient(130deg,var(--accent-soft),var(--surface-2)); border: 1px solid color-mix(in srgb,var(--accent) 10%,transparent); }
.concierge-note svg { color: var(--accent); width: 22px; height: 22px; margin-bottom: 12px; }
.concierge-note strong { display: block; font-size: 15px; font-weight: 500; line-height: 1.5; letter-spacing: -.3px; }
.concierge-note p { color: var(--muted); font-size: 10px; margin-top: 8px; }
.account-button { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; padding: 12px 1px; border-top: 1px solid var(--border); }
.account-avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; background: var(--surface-3); color: var(--text-2); text-transform: uppercase; font-weight: 600; }
.account-avatar svg { width: 17px; }
.account-copy { flex: 1; min-width: 0; }
.account-copy strong { display: block; font-size: 10px; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.account-copy small { display: block; color: var(--muted); font-size: 9px; margin-top: 3px; }
.account-button > svg { width: 16px; height: 16px; color: var(--muted); }
.account-button:hover .account-copy strong { color: var(--accent); }
.side-foot { display: flex; justify-content: space-between; color: var(--muted); font-size: 8px; margin-top: 12px; }
.powered { font-weight: 650; }
#main { position: relative; flex: 1; display: flex; flex-direction: column; min-width: 0; outline: none; }
#chat-header { flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 22px 42px; min-height: 88px; border-bottom: 1px solid var(--border); }
.chat-head-text { min-width: 0; flex: 1; }
.header-eyebrow { color: var(--muted); font-size: 8px; letter-spacing: 1.8px; margin-bottom: 4px; }
#chat-title { font-size: 15px; font-weight: 550; letter-spacing: -.35px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.ai-label { display: flex; align-items: center; gap: 7px; font-size: 10px; color: var(--text-2); padding-right: 15px; margin-right: 6px; border-right: 1px solid var(--border); }
.ai-label svg { color: var(--accent); width: 14px; height: 14px; }
.mobile-menu { display: none; }
#transcript { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 30px 42px 16px; scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
.thread { display: flex; flex-direction: column; gap: 14px; max-width: 840px; margin: 0 auto; min-height: 100%; padding: 12px 0; }
.welcome { max-width: 1180px; margin: 0 auto; animation: rise .6s var(--ease) both; }
.welcome-intro { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0 0 20px; }
.eyebrow { font-size: 9px; letter-spacing: 1.9px; font-weight: 600; color: var(--muted); }
.welcome-date { font-size: 10px; color: var(--muted); }
.welcome-hero { position: relative; min-height: 360px; height: clamp(350px,36vw,470px); max-height: 51vh; border-radius: 22px; overflow: hidden; background: #f2e5d4; isolation: isolate; }
.hero-image { position: absolute; width: 100%; height: 100%; object-fit: cover; object-position: center 59%; z-index: -2; }
.welcome-hero::before { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg,#f7eee1e8 0%,#f7eee1bb 31%,#f7eee100 65%); z-index: -1; }
.hero-copy { padding: clamp(28px,3.6vw,53px); color: #292d27; }
.hero-kicker { display: flex; align-items: center; gap: 7px; font-size: 10px; color: #616654; margin-bottom: 23px; }
.hero-kicker > span { width: 6px; height: 6px; border-radius: 50%; background: #6b895c; box-shadow: 0 0 0 4px #6b895c14; }
.hero-copy h1 { font-size: clamp(42px,4.9vw,72px); font-weight: 550; line-height: 1.04; letter-spacing: -3.8px; }
.hero-copy h1 > span { color: #d97132; }
.hero-copy p { font-size: clamp(11px,1.1vw,15px); line-height: 1.8; color: #63665a; margin: 22px 0; }
.hero-cta { display: flex; align-items: center; gap: 30px; padding: 12px 19px; background: #313d32; color: #fff; border-radius: 9px; font-size: 12px; font-weight: 500; box-shadow: 0 5px 15px #2735221a; transition: transform .25s, background .25s, box-shadow .25s; }
.hero-cta svg { width: 17px; height: 17px; }
.hero-cta:hover { background: #435340; transform: translateY(-2px); box-shadow: 0 9px 18px #27352230; }
.hero-footnote { display: block; font-size: 9px; color: #76786b; margin-top: 13px; }
.hero-caption { position: absolute; right: 24px; bottom: 22px; display: flex; align-items: center; gap: 8px; padding: 10px 14px; border: 1px solid #ffffffa0; border-radius: 11px; background: #fff9edc7; backdrop-filter: blur(12px); font-size: 10px; color: #655b45; box-shadow: 0 5px 15px #51382308; }
.hero-caption svg { width: 15px; height: 15px; color: #b86628; }
.topics { margin-top: 30px; }
.topics-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 17px; }
.topics-heading h2 { font-size: 18px; font-weight: 550; letter-spacing: -.6px; }
.topics-heading p { margin-top: 5px; color: var(--muted); font-size: 11px; }
.topics-heading > span { display: flex; align-items: center; gap: 8px; font-size: 9px; color: var(--muted); }
.topics-heading > span svg { width: 14px; }
.topic-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 13px; }
.topic-card { position: relative; display: flex; flex-direction: column; align-items: flex-start; text-align: left; padding: 21px 17px 17px; border: 1px solid var(--border); background: var(--surface); border-radius: 15px; transition: transform .25s var(--ease), box-shadow .25s, border-color .25s; }
.topic-card:hover { transform: translateY(-5px); border-color: color-mix(in srgb,var(--accent) 45%,var(--border)); box-shadow: var(--shadow-md); }
.topic-icon { display: grid; place-items: center; width: 37px; height: 37px; border-radius: 11px; margin-bottom: 19px; }
.topic-icon svg { width: 19px; height: 19px; }
.peach { color: #b9703c; background: #fcf0e6; }.sage { color: #688773; background: #edf3ec; }.lilac { color: #8b7dac; background: #f0ecf7; }.sand { color: #a88d50; background: #f7f3e7; }
.topic-arrow { position: absolute; right: 17px; top: 29px; width: 15px; height: 15px; color: var(--border-strong); transition: color .25s, transform .25s; }
.topic-card:hover .topic-arrow { color: var(--accent); transform: translateX(3px); }
.topic-card strong { font-size: 11px; letter-spacing: -.2px; font-weight: 600; margin-bottom: 7px; }
.topic-card > span:not(.topic-icon) { font-size: 10px; color: var(--muted); line-height: 1.6; }
.topic-card small { color: var(--text-2); font-size: 9px; margin-top: auto; padding-top: 19px; }
.welcome-values { display: flex; justify-content: center; flex-wrap: wrap; gap: 28px; margin: 26px 0 12px; }
.welcome-values > span { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 9px; }
.welcome-values svg { width: 13px; height: 13px; color: #839078; }
/* Native dialog keeps account and developer tools out of the presentation surface. */
#settings-dialog { margin: auto; width: min(520px,calc(100% - 32px)); max-height: calc(100dvh - 48px); overflow-y: auto; padding: 0; border: 1px solid var(--border); border-radius: 22px; background: var(--bg); color: var(--text); box-shadow: var(--shadow-lg); }
#settings-dialog::backdrop { background: #21251f60; backdrop-filter: blur(7px); }
#settings-dialog[open] { animation: rise .25s var(--ease); }
.dialog-heading { display: flex; justify-content: space-between; gap: 12px; padding: 28px 28px 20px; border-bottom: 1px solid var(--border); }
.dialog-heading h2 { font-size: 23px; letter-spacing: -.9px; font-weight: 550; margin: 9px 0 5px; }
.dialog-heading p { font-size: 12px; color: var(--muted); }
.settings-content { padding: 4px 28px 24px; }
.panel { padding: 20px 0; border-bottom: 1px solid var(--border); }
.panel:last-child { border: none; padding-bottom: 0; }
.panel h2 { font-size: 13px; font-weight: 600; margin-bottom: 16px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; }
.status-dot { width: 7px; height: 7px; background: var(--border-strong); border-radius: 50%; }
.status-dot.on { background: var(--ok); }
.sidebar-backdrop { position: fixed; inset: 0; background: #20251e66; backdrop-filter: blur(3px); z-index: 9; }
body.focus-mode #sidebar { display: none; }
body.focus-mode #focus-toggle { color: var(--accent); background: var(--accent-soft); }

/* ── Forms ───────────────────────────────────────────────────────── */

.stack { display: flex; flex-direction: column; }
.field { display: block; margin-bottom: 12px; }
.field > span {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-2);
    margin-bottom: 5px;
}

.field input, .field select, .field textarea {
    width: 100%;
    padding: 8px 11px;
    font-size: 13px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.field select {
    appearance: none;
    padding-right: 30px;
    background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position: calc(100% - 15px) 55%, calc(100% - 10px) 55%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}
.field textarea { font-family: var(--mono); font-size: 11px; resize: vertical; }
.field input:disabled, .field select:disabled { color: var(--muted); background: var(--surface-2); }

.field input:focus, .field select:focus, .field textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-ring);
}

/* Segmented control with a sliding thumb. */
.segmented {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 3px;
    border-radius: var(--radius-sm);
    background: var(--surface-3);
    isolation: isolate;
}
.segmented::before {
    content: '';
    position: absolute;
    top: 3px; bottom: 3px; left: 3px;
    width: calc(50% - 3px);
    border-radius: 6px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    transition: transform 0.35s var(--spring);
    z-index: -1;
}
.segmented:has(label:nth-child(2) input:checked)::before { transform: translateX(100%); }
.segmented label { position: relative; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.segmented span {
    display: block;
    text-align: center;
    padding: 6px 8px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--muted);
    border-radius: 6px;
    transition: color 0.25s;
}
.segmented input:checked + span { color: var(--text); font-weight: 600; }
.segmented input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -2px; }

/* Buttons */
.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    transition: transform 0.2s var(--spring), box-shadow 0.25s var(--ease), filter 0.2s, opacity 0.2s, background 0.2s;
}
.btn svg { width: 16px; height: 16px; }
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; }

.btn-primary {
    color: var(--accent-text);
    background: var(--accent);
    box-shadow: 0 6px 16px -8px var(--accent);
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.07); box-shadow: 0 10px 22px -8px var(--accent); transform: translateY(-1px); }

.btn-secondary {
    color: var(--text);
    background: var(--surface);
    border-color: var(--border);
}
.btn-secondary:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }

/* Busy state: the label fades out and a spinner takes its place. */
.spinner {
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid currentColor;
    border-right-color: transparent;
    opacity: 0;
    transform: scale(0.6);
    transition: opacity 0.2s, transform 0.2s;
}
.busy .spinner { opacity: 1; transform: none; animation: spin 0.8s linear infinite; }
.busy .btn-label, .busy .icon-send { opacity: 0; }
.btn-label, .icon-send { transition: opacity 0.2s; }

/* Identity card after sign-in */
.identity {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    animation: rise 0.45s var(--spring) both;
    margin-bottom: 10px;
}
.avatar {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    background: var(--user-bubble);
    text-transform: uppercase;
    flex-shrink: 0;
}
.identity-text { flex: 1; min-width: 0; }
.identity-name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.identity-sub { font: 11px/1.4 var(--mono); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Token panel */
details.panel > summary {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
}
details.panel > summary::-webkit-details-marker { display: none; }
details.panel > summary h2 { margin-bottom: 0; flex: 1; }
details.panel .chevron { width: 16px; height: 16px; color: var(--muted); transition: transform 0.3s var(--ease); }
details.panel[open] .chevron { transform: rotate(180deg); }
details.panel[open] > summary { margin-bottom: 14px; }
details.panel[open] > :not(summary) { animation: rise 0.35s var(--ease) both; }

.tag {
    font: 600 10px/1 var(--mono);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 4px 7px;
    border-radius: 5px;
    background: var(--surface-3);
    color: var(--muted);
    white-space: nowrap;
    transition: background 0.3s, color 0.3s;
}
.tag.on { background: var(--accent-soft); color: var(--accent); }
.tag.error { background: var(--danger-bg); color: var(--danger); }

.claims { font: 11px/1.6 var(--mono); margin-bottom: 12px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); }
.claims > div { display: flex; gap: 10px; }
.claims dt { color: var(--muted); min-width: 48px; }
.claims dd { color: var(--text); word-break: break-all; }
#token-panel .btn-secondary { margin-bottom: 10px; }
#login-status { margin-top: 10px; }

/* ── Session list ────────────────────────────────────────────────── */

.session-list { display: flex; flex-direction: column; gap: 4px; }

.session-item {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px 9px 12px;
    border-radius: 10px;
    text-align: left;
    border: 1px solid transparent;
    transition: background 0.2s, border-color 0.2s, transform 0.25s var(--spring);
    animation: rise 0.4s var(--ease) both;
}
.session-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 22%;
    bottom: 22%;
    width: 3px;
    border-radius: 3px;
    background: var(--accent);
    transform: scaleY(0);
    transition: transform 0.3s var(--spring);
}
.session-item:hover { background: var(--surface-2); }
.session-item:active { transform: scale(0.98); }
.session-item.active { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.session-item.active::before { transform: scaleY(1); }

.session-body { flex: 1; min-width: 0; }
.session-label { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.session-item.active .session-label { color: var(--accent); font-weight: 600; }
.session-sub { font: 11px/1.4 var(--mono); color: var(--muted); margin-top: 2px; }

.session-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--border-strong); flex-shrink: 0; transition: background 0.3s; }
.session-dot.live { background: var(--accent); animation: pulse-ring 1.4s ease-out infinite; }
.session-dot.error { background: var(--danger); }

.meta-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.meta-pills:empty { display: none; }
.pill-meta {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font: 500 11px/1 var(--mono);
    padding: 4px 8px;
    border-radius: 6px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-2);
    animation: rise 0.35s var(--ease) both;
    animation-delay: calc(var(--i, 0) * 50ms);
}
.pill-meta b { font-weight: 500; color: var(--muted); }
.pill-meta.copy { cursor: pointer; transition: border-color 0.2s, color 0.2s, background 0.2s; }
.pill-meta.copy:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.pill-meta svg { width: 12px; height: 12px; }

.turn-state {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font: 600 11px/1 var(--mono);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 6px 10px 6px 8px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--muted);
    white-space: nowrap;
    transition: color 0.3s, border-color 0.3s, background 0.3s;
}
.turn-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); transition: background 0.3s; }
.turn-state.streaming { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); background: var(--accent-soft); }
.turn-state.streaming .turn-dot { background: var(--accent); animation: pulse-ring 1.2s ease-out infinite; }
.turn-state.error { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); background: var(--danger-bg); }
.turn-state.error .turn-dot { background: var(--danger); }

/* ── Bubbles ─────────────────────────────────────────────────────── */

.msg { position: relative; display: flex; flex-direction: column; max-width: min(680px, 80%); animation: rise 0.4s var(--ease) both; }
.msg.user { align-self: flex-end; align-items: flex-end; animation-name: rise-right; }
.msg.assistant { align-self: flex-start; }

.bubble {
    position: relative;
    padding: 11px 15px;
    border-radius: var(--radius-lg);
    line-height: 1.6;
    overflow-wrap: anywhere;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.25s var(--ease);
}

.msg.user .bubble {
    background: var(--user-bubble);
    color: var(--user-text);
    border-bottom-right-radius: 6px;
    white-space: pre-wrap;
    box-shadow: 0 10px 24px -14px var(--accent), var(--shadow-sm);
}

.msg.assistant .bubble {
    background: var(--surface);
    border: 1px solid var(--border);
    border-bottom-left-radius: 6px;
}
.msg.assistant:hover .bubble { box-shadow: var(--shadow-md); }

.bubble a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.msg.assistant .bubble a { color: var(--accent); }

/* Timestamp and tools reveal on hover. The row always takes its height, so nothing shifts. */
.msg-foot {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 18px;
    margin-top: 3px;
    opacity: 0;
    transition: opacity 0.25s var(--ease);
    font: 11px/1 var(--mono);
    color: var(--muted);
    padding: 0 6px;
}
.msg:hover .msg-foot, .msg:focus-within .msg-foot { opacity: 1; }
.msg-foot button {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--muted);
    font: inherit;
    padding: 2px 6px;
    border-radius: 5px;
    transition: color 0.2s, background 0.2s;
}
.msg-foot button:hover { color: var(--accent); background: var(--accent-soft); }
.msg-foot button svg { width: 12px; height: 12px; }

/* Typing indicator */
.bubble.pending { padding: 14px 18px; }
.typing { display: inline-flex; gap: 5px; align-items: center; height: 10px; }
.typing span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--muted);
    animation: typing-bounce 1.2s ease-in-out infinite;
}
.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.30s; }

/* Streaming caret at the tail of the growing text */
.bubble.streaming > :last-child::after,
.bubble.streaming:empty::after {
    content: '';
    display: inline-block;
    width: 2px;
    height: 1em;
    margin-left: 3px;
    vertical-align: text-bottom;
    border-radius: 1px;
    background: var(--accent);
    animation: caret-blink 0.9s steps(2, start) infinite;
}
.bubble.streaming > pre:last-child::after, .bubble.streaming > .table-scroll:last-child::after { display: none; }

.attachment-note { font: 11px/1.4 var(--mono); color: var(--muted); margin-top: 5px; padding: 0 6px; }

/* ── Ticket card ─────────────────────────────────────────────────── */

.ticket-card {
    position: relative;
    align-self: flex-start;
    width: min(680px, 80%);
    padding: 14px 16px 14px 18px;
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    margin: 6px 0;
    animation: card-in 0.55s var(--spring) both;
}
.ticket-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--accent), var(--accent-2));
}
.ticket-card::after {
    /* one-shot shine sweep when the card lands */
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 30%, color-mix(in srgb, var(--accent) 12%, transparent) 50%, transparent 70%);
    transform: translateX(-120%);
    animation: shine 1.2s var(--ease) 0.25s 1 both;
    pointer-events: none;
}

.ticket-card.draft { border-style: dashed; background: color-mix(in srgb, var(--surface) 60%, transparent); box-shadow: none; }
.ticket-card.draft::before { background: var(--border-strong); }
.ticket-card.draft::after { display: none; }

.ticket-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.ticket-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font: 600 11px/1 var(--mono);
    letter-spacing: 0.04em;
    color: var(--accent);
    padding: 5px 9px 5px 6px;
    border-radius: 999px;
    background: var(--accent-soft);
}
.ticket-card.draft .ticket-badge { color: var(--muted); background: var(--surface-3); text-transform: uppercase; }
.ticket-badge svg { width: 14px; height: 14px; }
.ticket-badge .check { stroke-dasharray: 24; stroke-dashoffset: 24; animation: draw 0.6s var(--ease) 0.35s forwards; }
.ticket-head .pill { margin-left: auto; }

.ticket-title { font-weight: 650; font-size: 15px; letter-spacing: -0.01em; margin-bottom: 4px; }
.ticket-content { line-height: 1.6; overflow-wrap: anywhere; color: var(--text-2); }
.ticket-date { font: 11px/1.4 var(--mono); color: var(--muted); margin-top: 10px; }

.pill {
    font: 650 10px/1 var(--mono);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid currentColor;
    white-space: nowrap;
}
.pill.open { color: var(--ok); }
.pill.inprogress { color: var(--warn); }
.pill.closed { color: var(--muted); }

/* ── Rendered markdown ───────────────────────────────────────────── */

.markdown > *:first-child { margin-top: 0; }
.markdown > *:last-child { margin-bottom: 0; }
.markdown p { margin: 0 0 0.7em; }
.markdown h1, .markdown h2, .markdown h3, .markdown h4, .markdown h5, .markdown h6 { margin: 1em 0 0.4em; line-height: 1.3; font-weight: 650; letter-spacing: -0.01em; }
.markdown h1 { font-size: 1.3em; }
.markdown h2 { font-size: 1.18em; }
.markdown h3 { font-size: 1.08em; }
.markdown h4, .markdown h5, .markdown h6 { font-size: 1em; }
.markdown ul, .markdown ol { margin: 0.45em 0 0.7em; padding-left: 1.5em; }
.markdown li { margin: 0.25em 0; }
.markdown li::marker { color: var(--accent); }
.markdown li > ul, .markdown li > ol { margin: 0.2em 0; }
.markdown li > p { margin: 0 0 0.4em; }
.markdown strong { font-weight: 650; }
.markdown code { font-family: var(--mono); font-size: 0.86em; padding: 0.15em 0.4em; border-radius: 5px; background: var(--surface-3); overflow-wrap: anywhere; }
.markdown pre { margin: 0.6em 0 0.8em; padding: 12px 14px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); overflow-x: auto; }
.markdown pre code { display: block; padding: 0; background: none; font-size: 0.86em; line-height: 1.55; white-space: pre; overflow-wrap: normal; }
.markdown blockquote { margin: 0.6em 0 0.8em; padding: 0.2em 0 0.2em 1em; border-left: 3px solid var(--accent); color: var(--text-2); }
.markdown hr { margin: 1em 0; border: none; border-top: 1px solid var(--border); }
.markdown .table-scroll { margin: 0.6em 0 0.8em; overflow-x: auto; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.markdown table { border-collapse: collapse; font-size: 0.94em; width: 100%; }
.markdown th, .markdown td { padding: 7px 11px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.markdown tr:last-child td { border-bottom: none; }
.markdown th { background: var(--surface-2); font-weight: 650; white-space: nowrap; }
.markdown a.md-image-link::before { content: '🖼 '; }

.msg.user .markdown code, .msg.user .markdown pre, .msg.user .markdown th { background: rgb(255 255 255 / 0.16); border-color: rgb(255 255 255 / 0.28); }
.msg.user .markdown blockquote { border-left-color: rgb(255 255 255 / 0.5); color: inherit; }

/* ── Notices ─────────────────────────────────────────────────────── */

.notice {
    align-self: stretch;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4px 12px;
    padding: 12px 16px;
    border-radius: var(--radius);
    background: var(--danger-bg);
    border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent);
    line-height: 1.55;
    margin: 6px 0;
    animation: shake-in 0.5s var(--ease) both;
}
.notice-icon { grid-row: 1 / span 3; width: 20px; height: 20px; color: var(--danger); margin-top: 1px; }
.notice-head { display: flex; align-items: center; gap: 8px; }
.notice-code { font: 650 11px/1 var(--mono); color: var(--danger); }
.notice-body { color: var(--text); }
.notice-meta { font: 11px/1.4 var(--mono); color: var(--muted); overflow-wrap: anywhere; }
.notice-action {
    grid-column: 2;
    justify-self: start;
    margin-top: 6px;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 7px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    transition: border-color 0.2s, color 0.2s, transform 0.2s var(--spring);
}
.notice-action:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }

.system-note {
    align-self: center;
    font: 11px/1 var(--mono);
    color: var(--muted);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 5px 12px;
    margin: 6px 0;
    animation: rise 0.35s var(--ease) both;
}

/* ── Composer ────────────────────────────────────────────────────── */

#composer {
    padding: 8px 28px 18px;
    animation: rise 0.6s var(--ease) 0.1s both;
}
#composer > * { max-width: 880px; margin-left: auto; margin-right: auto; }

.composer-card {
    padding: 10px 10px 10px 12px;
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease), transform 0.25s var(--ease);
}
.composer-card:focus-within {
    border-color: color-mix(in srgb, var(--accent) 55%, transparent);
    box-shadow: 0 0 0 4px var(--accent-ring), var(--shadow-lg);
    transform: translateY(-1px);
}

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips:not(:empty) { margin: 2px 2px 10px; }
.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
    background: var(--accent-soft);
    color: var(--accent);
    transition: background 0.2s, transform 0.25s var(--spring), box-shadow 0.25s;
    animation: rise 0.4s var(--spring) both;
    animation-delay: calc(var(--i, 0) * 45ms);
}
.chip::before { content: '↳'; opacity: 0.6; font-size: 11px; }
.chip:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 18%, transparent); transform: translateY(-1px); box-shadow: 0 6px 14px -8px var(--accent); }
.chip:active:not(:disabled) { transform: scale(0.96); }
.chip:disabled { opacity: 0.45; }

.pending-files { display: flex; flex-wrap: wrap; gap: 6px; }
.pending-files:not(:empty) { margin: 2px 2px 10px; }
.file-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font: 12px/1 var(--mono);
    padding: 6px 6px 6px 10px;
    border-radius: 8px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    animation: rise 0.35s var(--spring) both;
}
.file-chip svg { width: 13px; height: 13px; color: var(--muted); }
.file-chip.invalid { border-color: var(--danger); color: var(--danger); background: var(--danger-bg); }
.file-chip button { color: var(--muted); font-size: 14px; line-height: 1; padding: 2px 4px; border-radius: 4px; transition: color 0.2s, background 0.2s; }
.file-chip button:hover { color: var(--danger); background: var(--surface); }

.composer-row { display: flex; gap: 8px; align-items: flex-end; }

#message-input {
    flex: 1;
    padding: 8px 6px;
    font-size: 14.5px;
    line-height: 1.5;
    color: var(--text);
    background: none;
    border: none;
    resize: none;
    outline: none;
    max-height: 180px;
    overflow-y: auto;
    scrollbar-width: thin;
}
#message-input::placeholder { color: var(--muted); transition: color 0.3s; }
#message-input:disabled::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }

.icon-btn.attach { width: 36px; height: 36px; }
/* Appears only when the turn asks for a file, so make the arrival visible: accent tint and a pop. */
.icon-btn.attach:not(.hidden) { color: var(--accent); background: var(--accent-soft); animation: pop 0.5s var(--spring); }

.send-btn {
    position: relative;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: var(--accent-text);
    background: var(--accent);
    box-shadow: 0 8px 18px -8px var(--accent);
    transition: transform 0.25s var(--spring), box-shadow 0.25s, opacity 0.25s, filter 0.2s;
}
.send-btn svg { width: 17px; height: 17px; transition: transform 0.25s var(--spring), opacity 0.2s; }
.send-btn:hover:not(:disabled) { filter: brightness(1.07); box-shadow: 0 12px 24px -8px var(--accent); }
.send-btn:hover:not(:disabled) svg { transform: translate(1px, -1px) rotate(-8deg); }
.send-btn:active:not(:disabled) { transform: scale(0.9); }
.send-btn:disabled { opacity: 0.35; box-shadow: none; }
.send-btn.sent .icon-send { animation: fly 0.5s var(--ease) both; }

#composer-hint { margin-top: 8px; padding: 0 12px; animation: fade-in 0.3s var(--ease) both; }

/* Floating scroll-to-bottom */
.scroll-bottom {
    position: absolute;
    right: 32px;
    bottom: 120px;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    color: var(--text-2);
    z-index: 3;
    transition: transform 0.35s var(--spring), opacity 0.25s, color 0.2s;
}
.scroll-bottom svg { width: 16px; height: 16px; }
.scroll-bottom:hover { color: var(--accent); transform: translateY(-2px); }
.scroll-bottom.away { opacity: 0; transform: translateY(16px) scale(0.8); pointer-events: none; }

/* Drop overlay */
.drop-overlay {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: grid;
    place-items: center;
    background: color-mix(in srgb, var(--bg) 70%, transparent);
    backdrop-filter: blur(6px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s var(--ease);
}
#main.dragging .drop-overlay { opacity: 1; }
.drop-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 40px 60px;
    border-radius: 24px;
    border: 2px dashed var(--accent);
    color: var(--accent);
    font-weight: 600;
    font-size: 16px;
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    animation: pulse-scale 1.6s ease-in-out infinite;
}
.drop-inner svg { width: 34px; height: 34px; }

/* Toast */
.toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translate(-50%, 20px);
    opacity: 0;
    padding: 10px 16px;
    border-radius: 999px;
    background: var(--text);
    color: var(--bg);
    font-size: 13px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    pointer-events: none;
    z-index: 50;
    transition: transform 0.35s var(--spring), opacity 0.25s;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* ── Keyframes ───────────────────────────────────────────────────── */

@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes rise-right { from { opacity: 0; transform: translate(10px, 8px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes slide-in-left { from { transform: translateX(-24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes card-in { from { opacity: 0; transform: translateY(16px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes shine { to { transform: translateX(120%); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes caret-blink { 50% { opacity: 0; } }
@keyframes typing-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: 0.45; } 30% { transform: translateY(-5px); opacity: 1; } }
@keyframes pulse-ring { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 40%, transparent); } 100% { box-shadow: 0 0 0 8px transparent; } }
@keyframes pulse-scale { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.03); } }
@keyframes shake-in { 0% { opacity: 0; transform: translateX(-6px); } 40% { transform: translateX(4px); } 70% { transform: translateX(-2px); } 100% { opacity: 1; transform: none; } }
@keyframes fly { 0% { transform: none; opacity: 1; } 50% { transform: translate(22px, -22px) scale(0.6); opacity: 0; } 51% { transform: translate(-16px, 16px) scale(0.6); } 100% { transform: none; opacity: 1; } }
@keyframes orb-spin { to { transform: rotate(360deg); } }
@keyframes orb-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(0.92); } }
@keyframes glow-drift { to { transform: translate(-3%, 2%) scale(1.05); } }

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



/* Conversation refinements. */
.session-sub { font-family: var(--font); font-size: 10px; margin-top: 5px; }
.session-item { padding: 12px; }
.session-label { font-size: 11px; }
.meta-pills { gap: 5px; }
.pill-meta { font: 10px var(--font); padding: 2px 6px; border: none; }
.turn-state { font: 10px var(--font); text-transform: none; letter-spacing: 0; border: none; background: transparent; }
.turn-state.idle .turn-dot { background: var(--ok); }
.turn-state.idle { color: var(--ok); }
#main:not(.at-home) .ai-label { display: none; }
.msg { max-width: min(700px,88%); }
.msg.assistant { padding-left: 44px; }
.message-avatar { position: absolute; top: 0; left: 0; width: 31px; height: 34px; display: grid; place-items: center; border-radius: 11px; color: var(--accent); background: var(--accent-soft); }
.message-avatar svg { width: 18px; height: 18px; }
.message-author { color: var(--muted); font-size: 10px; margin-bottom: 7px; font-weight: 550; }
.bubble { padding: 17px 20px; line-height: 1.8; }
.msg.user .bubble { border-radius: 20px 20px 5px 20px; box-shadow: none; }
.msg.assistant .bubble { border-radius: 0 17px 17px 17px; }
.msg-foot { font-family: var(--font); font-size: 10px; height: 22px; margin-top: 5px; }
.ticket-card { margin-left: 44px; border-radius: 16px; }
#composer { padding: 14px 42px 21px; }
#composer > * { max-width: 840px; }
.composer-card { padding: 12px 14px; border-radius: 19px; box-shadow: 0 6px 24px #34281509; }
.composer-card:focus-within { box-shadow: 0 0 0 3px var(--accent-ring),var(--shadow-md); }
#message-input { min-width: 0; font-size: 13px; padding: 10px 4px; }
.send-btn { width: 40px; height: 40px; flex-shrink: 0; border-radius: 12px; }
.composer-footer { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 9px; margin-top: 12px; padding: 0 6px; }
.composer-footer kbd { font-size: 8px; }
.scroll-bottom.away { visibility: hidden; }
@media (min-width: 1600px) { #transcript { padding-top: 42px; }.welcome-hero { max-height: none; }.topic-card { padding: 24px; }.topic-card strong { font-size: 13px; }.topic-card > span:not(.topic-icon) { font-size: 11px; } }
@media (max-height: 820px) and (min-width: 1001px) { .welcome-hero { min-height: 315px; height: 37vh; }.hero-copy { padding: 28px 35px; }.hero-copy h1 { font-size: 51px; }.hero-kicker { margin-bottom: 15px; }.hero-copy p { margin: 16px 0; }.hero-footnote { display: none; }.topics { margin-top: 23px; }.topic-card { padding-top: 15px; }.topic-icon { margin-bottom: 13px; }.welcome-values { margin-top: 20px; } }
@media (max-width: 1200px) { #sidebar { width: 228px; min-width: 228px; }#chat-header { padding: 20px 28px; }#transcript { padding: 25px 28px 16px; }#composer { padding-left: 28px; padding-right: 28px; }.topic-grid { gap: 10px; }.topic-card { padding-left: 13px; padding-right: 13px; }.topic-card strong { font-size: 10px; }.hero-copy h1 { letter-spacing: -2.8px; }.hero-caption { right: 15px; bottom: 15px; font-size: 9px; }.topics-heading > span { display: none; } }
@media (max-width: 1000px) { .topic-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }.topic-card strong { font-size: 12px; }.topic-card { padding: 17px; }.topic-card small { padding-top: 14px; }.welcome-hero { min-height: 350px; max-height: none; }.hero-copy h1 { font-size: 46px; }.hero-copy { padding: 29px; }.hero-copy p { max-width: 220px; }.hero-copy p br { display: none; }.hero-caption { display: none; }.hero-image { object-position: 58% center; }.concierge-note { padding: 15px; }.welcome-values { gap: 12px; }.welcome-date { display: none; }.ai-label { display: none; } }
@media (max-width: 760px) {
    #sidebar { position: fixed; top: 0; bottom: 0; left: 0; width: 270px; min-width: 270px; transform: translateX(-100%); visibility: hidden; transition: transform .25s var(--ease), visibility .25s; box-shadow: var(--shadow-lg); }
    body.nav-open #sidebar { transform: translateX(0); visibility: visible; }
    .mobile-menu { display: grid; }
    body.focus-mode .mobile-menu { display: none; }
    #chat-header { padding: 15px 18px; gap: 10px; min-height: 77px; }
    .header-eyebrow { font-size: 7px; letter-spacing: 1.3px; }
    #chat-title { font-size: 13px; }
    .header-actions { gap: 2px; }
    #transcript { padding: 22px 20px 12px; }
    .welcome-intro { margin-bottom: 14px; }.eyebrow { font-size: 8px; letter-spacing: 1.4px; }
    .welcome-hero { height: 430px; min-height: 0; border-radius: 18px; }
    .hero-image { object-position: 62% bottom; }
    .welcome-hero::before { background: linear-gradient(90deg,#f7eee1ef,#f7eee1a8 38%,#f7eee100 75%); }
    .hero-copy { padding: 32px 25px; }.hero-copy h1 { font-size: 49px; }.hero-copy p { font-size: 12px; max-width: 195px; }.hero-kicker { font-size: 9px; }.hero-footnote { max-width: 135px; }
    .topics-heading h2 { font-size: 18px; }.topics-heading p { font-size: 11px; }.topic-grid { gap: 10px; }.topic-card { padding: 16px 14px; }.topic-card strong { font-size: 11px; }.topic-card > span:not(.topic-icon) { font-size: 10px; }.topic-icon { margin-bottom: 16px; }.welcome-values { flex-direction: column; align-items: center; margin: 23px 0 15px; }
    #composer { padding: 10px 16px max(14px, env(safe-area-inset-bottom)); }.composer-footer > span:last-child { display: none; }.composer-footer { justify-content: center; font-size: 8px; text-align: center; }
    .msg { max-width: 95%; }.msg.assistant { padding-left: 35px; }.message-avatar { width: 26px; height: 29px; }.message-avatar svg { width: 15px; }.bubble { padding: 13px 15px; font-size: 13px; }.msg-foot { opacity: 1; }.ticket-card { margin-left: 35px; max-width: calc(100% - 35px); }.turn-state { padding: 5px; }.turn-state-label { font-size: 9px; }.turn-state.idle { display: none; }.pill-meta { font-size: 9px; }.pill-meta:nth-child(n+3) { display: none; }.scroll-bottom { right: 20px; }
    .dialog-heading { padding: 23px 22px 18px; }.settings-content { padding: 0 22px 22px; }
}
@media (max-width: 390px) { #transcript { padding-left: 14px; padding-right: 14px; }.hero-copy { padding: 26px 20px; }.hero-copy h1 { font-size: 43px; }.hero-copy p { max-width: 160px; }.hero-image { object-position: 60% bottom; }.header-actions .icon-btn { width: 32px; }.topic-card strong { font-size: 10px; } }
@media (max-height: 650px) { .concierge-note { display: none; }.brand { padding-top: 22px; padding-bottom: 24px; }.side-bottom { padding-top: 10px; } }
/* A little more care: motion, reading rhythm, and conversation feedback. */
::selection { color: var(--text); background: var(--accent-ring); }
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
#chat-header {
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(18px);
    z-index: 3;
}
#main:not(.at-home) {
    background: radial-gradient(ellipse at 50% 12%, var(--accent-soft), transparent 55%);
}
#main:not(.at-home) #transcript { overflow-anchor: none; }
#sidebar { transition: width .3s var(--ease), min-width .3s var(--ease); }
.welcome-hero { box-shadow: 0 8px 34px -22px #6c4a2c33; }
.hero-image { transition: transform 1.2s var(--ease); }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
    .welcome-hero:hover .hero-image { transform: scale(1.018); }
    .topic-card:hover .topic-icon { transform: translateY(-2px) rotate(-5deg); }
    .hero-cta:hover svg { transform: translateX(4px); }
}
.hero-cta svg, .topic-icon { transition: transform .4s var(--spring); }
.hero-cta:active { transform: translateY(0) scale(.98); }
.hero-cta:disabled { opacity: .65; cursor: wait; }
.topic-card { animation: welcome-card-in .55s var(--ease) both; }
.topic-card:nth-child(2) { animation-delay: 55ms; }
.topic-card:nth-child(3) { animation-delay: 110ms; }
.topic-card:nth-child(4) { animation-delay: 165ms; }
.topic-card:active { transform: translateY(-1px) scale(.985); }
.resume-chat {
    display: flex; align-items: center; gap: 13px; width: 100%; text-align: left;
    background: var(--surface); border: 1px solid var(--border); border-radius: 13px;
    padding: 13px 17px; margin: 0 0 18px; animation: rise .35s var(--ease) both;
    transition: border-color .2s, box-shadow .2s;
}
.resume-chat:hover { border-color: var(--accent); box-shadow: var(--shadow-md); }
.resume-chat > span:nth-child(2) { flex: 1; min-width: 0; }
.resume-chat small { display: block; font-size: 8px; letter-spacing: 1.5px; color: var(--muted); }
.resume-chat strong { display: block; font-size: 12px; font-weight: 500; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.resume-chat > svg { width: 16px; color: var(--accent); }
.resume-icon { padding: 10px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.resume-icon svg { width: 17px; height: 17px; }
.thread { gap: 19px; padding-bottom: 22px; }
.thread-enter { animation: conversation-in .32s var(--ease); }
.conversation-intro { text-align: center; padding: 8px 0 4px; margin-bottom: 9px; }
.concierge-portrait {
    width: 76px; height: 76px; margin: 0 auto 18px; border-radius: 26px;
    background: #f1e5d5 url('/images/home-concierge.png') 82% 54% / 300% auto;
    box-shadow: 0 7px 24px -12px #7b563e55, inset 0 0 0 1px #fff6;
}
.conversation-intro .greeting { font-size: 21px; line-height: 1.45; font-weight: 500; letter-spacing: -.6px; margin: 0 auto 16px; max-width: 560px; min-height: 30px; display: flex; justify-content: center; align-items: center; }
.starter-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.starter-card {
    display: flex; flex-direction: column; gap: 5px; text-align: left; padding: 13px 15px;
    border: 1px solid var(--border); background: var(--surface); border-radius: 13px;
    animation: welcome-card-in .45s var(--ease) both; animation-delay: calc(var(--i, 0) * 55ms);
    transition: transform .25s var(--ease), box-shadow .25s, border-color .25s;
}
.starter-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); box-shadow: var(--shadow-md); }
.starter-card strong { font-size: 12px; font-weight: 600; letter-spacing: -.2px; }
.starter-card span { font-size: 10.5px; line-height: 1.55; color: var(--muted); }
.thread:has(.msg.user) .starter-cards { display: none; }
.conversation-context {
    display: inline-flex; gap: 7px; align-items: center; max-width: 100%;
    padding: 6px 12px; color: var(--text-2); border: 1px solid var(--border);
    background: color-mix(in srgb, var(--surface) 70%, transparent); border-radius: 999px; font-size: 10px;
}
.conversation-context svg { width: 13px; height: 13px; color: var(--accent); }
.conversation-date { display: flex; align-items: center; gap: 16px; margin: 27px 0 5px; color: var(--muted); font-size: 9px; }
.conversation-date::before, .conversation-date::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.msg { max-width: min(720px, 91%); }
.msg.user { max-width: min(600px, 80%); }
.msg.assistant .bubble {
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    box-shadow: 0 3px 15px -10px #513e3222;
}
.msg.assistant:hover .bubble { box-shadow: 0 4px 20px -12px #513e322c; }
.bubble { font-size: 14px; line-height: 1.85; }
.message-author { font-size: 10px; letter-spacing: .1px; margin-bottom: 8px; }
.message-avatar { top: 21px; box-shadow: 0 3px 8px #54341d07; }
.msg.assistant:has(.pending, .streaming) .message-avatar { animation: concierge-breathe 2.2s ease-in-out infinite; }
.bubble.pending { display: flex; align-items: center; gap: 14px; min-height: 58px; }
.thinking-label { color: var(--muted); font-size: 11px; }
.typing { gap: 4px; }
.typing span { background: var(--accent); width: 5px; height: 5px; }
.msg:has(.pending, .streaming) .msg-foot { visibility: hidden; }
.bubble.streaming { border-color: color-mix(in srgb, var(--accent) 24%, var(--border)); }
.bubble.streaming > :last-child::after { width: 5px; height: 5px; border-radius: 50%; margin: 0 0 4px 6px; }
.bubble.markdown > * { animation: block-arrive .2s var(--ease); }
.bubble.markdown p + p { margin-top: .9em; }
.bubble.markdown h2, .bubble.markdown h3 { letter-spacing: -.3px; }
.msg-foot { gap: 12px; opacity: .6; }
.msg-foot button { min-height: 28px; padding: 3px 7px; }
.msg-foot button.copied { color: var(--ok); }
.msg-foot button:active { transform: scale(.96); }
.ticket-card { box-shadow: 0 9px 32px -18px #80542b3b; }
.ticket-reassurance { font-size: 10px; color: var(--muted); padding: 13px 18px; border-top: 1px solid var(--border); background: var(--surface-2); }
.session-item { animation: none; }
.session-item.unread .session-dot { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.session-item.unread .session-sub { color: var(--accent); }
.session-item.unread .session-label { font-weight: 650; }
#composer {
    position: relative; z-index: 2; padding-top: 8px;
    background: linear-gradient(0deg, var(--bg) 78%, transparent);
}
.composer-presence { display: flex; align-items: center; gap: 7px; padding: 8px 6px 11px; color: var(--muted); font-size: 10px; }
.presence-mark { width: 5px; height: 5px; border-radius: 50%; background: var(--ok); flex-shrink: 0; }
.draft-state { margin-left: auto; font-size: 9px; }
.is-busy .presence-mark { background: var(--accent); animation: concierge-breathe 1.5s ease-in-out infinite; }
.is-busy .composer-presence { color: var(--accent); }
.composer-card { position: relative; padding: 15px; box-shadow: 0 7px 28px -12px #543c2524; }
.composer-card:focus-within { transform: none; }
.has-draft .composer-card { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.is-busy .composer-card { background: color-mix(in srgb, var(--surface) 70%, var(--bg)); }
#message-input { font-size: 14px; line-height: 1.7; }
.send-btn { box-shadow: 0 4px 12px var(--accent-ring); }
.send-btn:not(:disabled) { transform: scale(1.02); }
.send-btn.busy:disabled { opacity: .7; background: var(--accent-soft); color: var(--accent); }
.chips:not(:empty) { padding-bottom: 11px; margin-bottom: 9px; border-bottom: 1px solid var(--border); }
.chip { border-radius: 10px; padding: 8px 12px; font-size: 12px; background: var(--surface-2); border-color: var(--border); color: var(--text-2); }
.chip:hover:not(:disabled) { color: var(--accent); border-color: var(--accent); }
.chip::before { content: '+'; font-size: 13px; }
.scroll-bottom {
    left: 50%; right: auto; bottom: calc(var(--composer-height, 152px) + 8px);
    transform: translateX(-50%); display: flex; gap: 9px; width: max-content; height: 36px;
    padding: 0 14px; font-size: 11px; backdrop-filter: blur(12px);
    background: color-mix(in srgb, var(--surface) 90%, transparent);
}
.scroll-bottom:hover { transform: translate(-50%, -2px); }
.scroll-bottom.away { transform: translate(-50%, 10px); }
.file-chip { max-width: 100%; font: 11px var(--font); padding: 6px 8px; }
.file-chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-chip button { min-width: 28px; min-height: 28px; flex-shrink: 0; }
.file-chip .file-preview { padding: 0; border-radius: 7px; overflow: hidden; }
.file-preview img { display: block; width: 40px; height: 40px; object-fit: cover; }
.attachment-note { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin-top: 10px; max-width: 100%; }
.sent-attachment { display: flex; align-items: center; gap: 9px; max-width: 100%; padding: 7px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); font: 10px var(--font); }
.sent-attachment span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sent-attachment img { width: 76px; height: 58px; object-fit: cover; border-radius: 6px; }
button.sent-attachment:hover { border-color: var(--accent); }
#preview-dialog { margin: auto; width: min(900px, calc(100% - 32px)); max-height: calc(100dvh - 40px); padding: 16px; border: 1px solid var(--border); border-radius: 19px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
#preview-dialog::backdrop { background: #171c19b0; backdrop-filter: blur(12px); }
.preview-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.preview-heading h2 { font-size: 13px; font-weight: 500; overflow-wrap: anywhere; }
#preview-image { display: block; max-width: 100%; max-height: calc(100dvh - 150px); object-fit: contain; margin: auto; border-radius: 9px; }
body.focus-mode #main:not(.at-home) .bubble { font-size: 16px; }
@keyframes welcome-card-in { from { opacity: 0; translate: 0 12px; } to { opacity: 1; translate: 0 0; } }
@keyframes conversation-in { from { opacity: .2; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes block-arrive { from { opacity: .5; } to { opacity: 1; } }
@keyframes concierge-breathe { 0%, 100% { opacity: .65; } 50% { opacity: 1; box-shadow: 0 0 0 4px var(--accent-ring); } }
@media (max-width: 760px) {
    .conversation-intro { padding-top: 0; }
    .concierge-portrait { width: 62px; height: 62px; border-radius: 21px; margin-bottom: 13px; }
    .conversation-intro .greeting { font-size: 17px; max-width: 320px; }
    .conversation-context { font-size: 9px; }
    .conversation-date { margin-top: 20px; }
    .thread { gap: 13px; }
    .msg { max-width: 98%; }
    .msg.user { max-width: 87%; }
    .bubble { font-size: 13px; }
    .bubble.pending { gap: 10px; padding: 13px; }
    .thinking-label { font-size: 10px; }
    .composer-presence { font-size: 9px; padding-bottom: 8px; }
    .draft-state { display: none; }
    .composer-card { padding: 10px; }
    #message-input { font-size: 16px; }
    .scroll-bottom { right: auto; }
    .msg-foot button { min-height: 32px; }
    .resume-chat { padding: 11px; }
    .resume-chat strong { font-size: 11px; }
    #turn-state-label { max-width: 92px; overflow: hidden; text-overflow: ellipsis; }
    body.focus-mode #main:not(.at-home) .bubble { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }
