@font-face {
  font-family: 'Bricolage';
  src: url('/fonts/BricolageGrotesque-Bold.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #f7f7f2;
  --surface: #ffffff;
  --soft: #eeeee8;
  --ink: #20251f;
  --muted: #686d65;
  --line: #dcdfd5;
  --blue: #2547df;
  --blue-hover: #1938c5;
  --blue-soft: #e9edff;
  --on-blue: #ffffff;
  --on-blue-muted: #dce3ff;
  --brand-field: #2547df;
  --danger: #a43635;
  --danger-soft: #fbeae7;
  --nav-height: 76px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --app-height: 100dvh;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
html[data-theme='dark'] {
  color-scheme: dark;
  --paper: #161b29;
  --surface: #202738;
  --soft: #282f40;
  --ink: #f1f3ef;
  --muted: #adb5c6;
  --line: #394256;
  --blue: #b3c2ff;
  --blue-hover: #cad5ff;
  --blue-soft: #2e395a;
  --brand-field: #213ab3;
  --danger: #ffb4aa;
  --danger-soft: #442c33;
}
* { box-sizing: border-box; }
html { min-width: 320px; background: var(--paper); scroll-padding-bottom: 110px; }
body { margin: 0; color: var(--ink); background: var(--paper); line-height: 1.5; }
button, input, textarea, select { font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; }
button { border: 0; cursor: pointer; touch-action: manipulation; }
button, a { -webkit-user-select: none; user-select: none; }
button:disabled { opacity: .5; cursor: wait; }
input, textarea { caret-color: var(--blue); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
textarea { resize: none; }
button, a, input, textarea, select, summary { outline-offset: 4px; }
:focus-visible { outline: 3px solid var(--blue); }
:focus:not(:focus-visible) { outline: none; }
::selection { background: var(--blue); color: var(--paper); }
a { color: var(--blue); text-underline-offset: 4px; }
h1, h2, h3, p { margin: 0; }
h1, h2 { letter-spacing: -.035em; font-weight: 650; line-height: 1.12; text-wrap: balance; }
h1 { font-size: 34px; }
h2 { font-size: 26px; }
h3 { font-size: 14px; font-weight: 500; }
svg { display: block; flex-shrink: 0; }
button svg { width: 20px; height: 20px; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: -80px; left: 16px; z-index: 100; padding: 12px 18px; background: var(--surface); color: var(--blue); border-radius: 8px; }
.skip-link:focus { top: 12px; }
#app { outline: none; }
.app-shell { min-height: var(--app-height); overflow-x: clip; padding: var(--safe-top) var(--safe-right) calc(var(--nav-height) + var(--safe-bottom)) var(--safe-left); }
.topbar { height: 78px; display: flex; align-items: center; gap: 12px; padding: 16px 24px; }
.brand { background: none; padding: 2px 0 6px; display: inline-flex; color: var(--blue); min-height: 44px; align-items: center; }
.brand-word { font-family: 'Bricolage', sans-serif; font-size: 42px; font-weight: 700; letter-spacing: -.04em; line-height: 1; }
.brand-word > span { color: currentColor; }
.version-badge { margin-left: auto; color: var(--muted); font-size: 12px; font-weight: 500; }
.avatar-button { width: 38px; height: 38px; min-width: 38px; border-radius: 50%; background: var(--blue-soft); color: var(--blue); font-size: 14px; font-weight: 600; }
.page { padding: 24px 24px 32px; }
.page-heading { margin-bottom: 32px; }
.page-heading > p { color: var(--muted); margin-top: 12px; line-height: 1.5; }
.primary-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; gap: 14px; min-height: 52px; padding: 13px 20px; border-radius: 12px; font-size: 15px; font-weight: 600; }
.primary-button { background: var(--blue); color: var(--paper); }
.secondary-button { background: var(--blue-soft); color: var(--blue); }
.primary-button svg:last-child { margin-left: auto; }
.icon-button { width: 44px; height: 44px; display: inline-grid; place-items: center; background: transparent; border-radius: 12px; }
.text-button { display: inline-flex; align-items: center; gap: 8px; padding: 10px 0; min-height: 44px; background: transparent; font-size: 13px; font-weight: 500; }
.text-button svg { width: 17px; height: 17px; }
.field { display: flex; flex-direction: column; gap: 10px; font-size: 14px; font-weight: 500; }
.field input, .field select { width: 100%; min-height: 52px; min-width: 0; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; font-size: 16px; font-weight: 400; }
.field-hint { font-size: 13px; color: var(--muted); margin: 8px 0 22px; }
.demo-note { font-size: 12px; color: var(--muted); line-height: 1.6; }
.error-box { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--danger-soft); color: var(--danger); padding: 12px 16px; border-radius: 12px; font-size: 14px; margin: 12px 0; overflow-wrap: anywhere; }
.error-box .text-button { flex: 0 0 auto; color: inherit; text-decoration: underline; text-underline-offset: 3px; }

/* Home: a single contextual workspace below five topic tabs. */
.is-home { background: var(--brand-field); }
.is-home .topbar, .is-welcome .topbar { color: var(--on-blue); }
.is-home .brand, .is-welcome .brand { color: var(--on-blue); }
.is-home .version-badge, .is-welcome .version-badge { color: var(--on-blue-muted); }
.is-home .avatar-button { background: #ffffff1a; color: var(--on-blue); }
.is-home .topbar :focus-visible, .is-welcome .topbar :focus-visible, .role-tab:focus-visible { outline-color: var(--on-blue); }
.home-page { background: var(--paper); }
.home-intro { padding: 18px 24px 30px; color: var(--on-blue); background: var(--brand-field); }
.home-intro h1 { font-size: 44px; line-height: 1.06; font-weight: 600; }
.home-intro p { color: var(--on-blue-muted); font-size: 15px; margin-top: 16px; overflow-wrap: anywhere; }
.role-tabs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; padding: 0 16px; background: var(--brand-field); }
.role-tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 72px; padding: 12px 2px 14px; background: transparent; color: var(--on-blue-muted); border-radius: 14px 14px 0 0; font-size: 13px; font-weight: 500; }
.role-tab[aria-selected='true'] { color: var(--blue); background: var(--paper); }
.role-tab svg { width: 21px; height: 21px; }
.home-workspace { padding: 28px 24px 0; }
.workspace-heading h2 { font-size: 27px; }
.workspace-heading p { max-width: 340px; color: var(--muted); font-size: 14px; line-height: 1.55; margin-top: 9px; }
.prompt-box { margin-top: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 17px 16px 12px; transition: border-color 150ms ease; }
.prompt-box:focus-within { border-color: var(--blue); }
.prompt-input { width: 100%; display: block; min-height: 85px; max-height: 190px; padding: 0; border: 0; background: transparent; font-size: 16px; line-height: 1.55; }
.prompt-input:focus-visible { outline: none; }
.prompt-box:has(.prompt-input:focus-visible) { outline: 2px solid var(--blue); outline-offset: 3px; }
.prompt-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; }
.input-context { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.input-context svg { width: 15px; height: 15px; }
.send-button { width: 44px; height: 44px; flex: 0 0 44px; display: inline-grid; place-items: center; background: var(--blue); color: var(--paper); border-radius: 50%; }
.ideas { margin-top: 28px; }
.ideas h3 { margin-bottom: 8px; color: var(--muted); }
.quick-list { display: flex; flex-direction: column; }
.quick-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; min-height: 51px; text-align: left; padding: 13px 0; background: transparent; border-bottom: 1px solid var(--line); font-size: 15px; }
.quick-card:last-child { border-bottom: 0; }
.quick-card svg { width: 18px; height: 18px; color: var(--muted); }
.open-conversation { color: var(--blue); margin-top: 12px; }
.open-conversation svg { transform: rotate(180deg); }
.home-note { padding: 22px 24px 28px; font-size: 11px; }

/* A stable, reachable navigation bar; a rail on wider viewports. */
.bottom-nav { position: fixed; z-index: 20; bottom: 0; left: 0; right: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 10px calc(16px + var(--safe-right)) calc(10px + var(--safe-bottom)) calc(16px + var(--safe-left)); min-height: calc(var(--nav-height) + var(--safe-bottom)); background: var(--paper); border-top: 1px solid var(--line); }
.nav-button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 54px; padding: 3px 4px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 500; border-radius: 12px; }
.nav-icon { display: grid; place-items: center; width: 46px; height: 27px; border-radius: 14px; }
.nav-button[aria-current='page'] { color: var(--blue); }
.nav-button[aria-current='page'] .nav-icon { background: var(--blue-soft); }
.nav-count { position: absolute; right: 16%; top: 1px; min-width: 16px; height: 16px; border-radius: 8px; padding-inline: 4px; background: var(--blue); color: var(--paper); font-size: 10px; line-height: 16px; }
.nav-caption { display: none; }

/* Welcome. */
.is-welcome { background: var(--brand-field); padding-bottom: var(--safe-bottom); }
.welcome-intro { color: var(--on-blue); padding: 28px 24px 36px; }
.welcome-intro h1 { font-size: 39px; line-height: 1.12; font-weight: 600; }
.welcome-intro h1 > span { color: var(--on-blue-muted); }
.welcome-intro > p { color: var(--on-blue-muted); font-size: 15px; margin-top: 26px; line-height: 1.6; }
.welcome-topics { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 32px; font-family: 'Bricolage', sans-serif; font-size: 18px; }
.welcome-form { padding: 32px 24px; background: var(--paper); border-radius: 24px 24px 0 0; }
.welcome-form h2 { font-size: 25px; margin-bottom: 24px; }
.welcome-form .primary-button { width: 100%; }
.welcome-form .demo-note { margin-top: 20px; }

/* Chat keeps its composer above the keyboard and independent of navigation. */
.app-shell.is-chat { display: flex; flex-direction: column; height: var(--app-height); min-height: 0; padding-bottom: var(--safe-bottom); }
.is-chat .topbar { display: none; }
.is-chat .bottom-nav { display: none; }
.chat-page { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.chat-heading { display: flex; align-items: center; gap: 12px; padding: 12px 16px; flex-shrink: 0; border-bottom: 1px solid var(--line); }
.chat-heading > div { flex: 1; min-width: 0; }
.chat-heading h1 { font-size: 19px; letter-spacing: -.025em; }
.chat-heading h1 span { color: var(--blue); }
.chat-heading p { font-size: 12px; margin-top: 4px; color: var(--muted); }
.role-icon { display: inline-grid; place-items: center; width: 40px; height: 40px; background: var(--blue-soft); color: var(--blue); border-radius: 12px; }
.chat-disclosure { flex-shrink: 0; padding: 10px 16px; color: var(--muted); font-size: 11px; text-align: center; }
.chat-messages { flex: 1; overflow-y: auto; min-height: 0; padding: 16px 24px; overscroll-behavior-y: contain; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.chat-messages { -webkit-overflow-scrolling: touch; scroll-padding-block: 16px; }
.message { max-width: 100%; margin: 0 0 28px; overflow-wrap: anywhere; }
.message.user { background: var(--blue-soft); border-radius: 16px 16px 4px 16px; padding: 14px 16px; width: fit-content; max-width: 90%; margin-left: auto; }
.message-label { display: block; font-size: 11px; font-weight: 500; color: var(--muted); margin-bottom: 8px; }
.message.assistant > .message-label { color: var(--blue); font-weight: 600; }
.message.user > .message-label { color: var(--blue); }
.message-text { font-size: 16px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.message-text p { margin: 0 0 .8em; }
.message-text p:last-child { margin-bottom: 0; }
.message-text ul, .message-text ol { margin: .45em 0 .85em; padding-inline-start: 1.45em; }
.message-text li + li { margin-top: .25em; }
.message-text a { color: var(--blue); text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }
.message-actions { display: flex; flex-wrap: wrap; gap: 4px 22px; margin-top: 10px; color: var(--muted); }
.message-actions [aria-pressed='true'] { color: var(--blue); }
.chat-page > .error-box { margin: 8px 20px; flex-shrink: 0; }
.suggestions { display: flex; flex-direction: column; gap: 0; padding: 0 24px 16px; max-height: 33%; overflow-y: auto; flex-shrink: 0; }
.suggestion { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 46px; padding: 12px 0; text-align: left; border-bottom: 1px solid var(--line); background: transparent; font-size: 13px; }
.suggestion:last-child { border: 0; }
.suggestion svg { width: 16px; height: 16px; color: var(--muted); }
.composer { display: flex; align-items: flex-end; gap: 10px; flex-shrink: 0; border: 1px solid var(--line); border-radius: 16px; padding: 8px; margin: 0 16px 12px; background: var(--surface); }
.composer:focus-within { border-color: var(--blue); }
.composer textarea { display: block; flex: 1; width: 0; min-width: 0; min-height: 44px; max-height: 144px; line-height: 24px; padding: 10px 6px; border: 0; background: transparent; font-size: 16px; }
@media (max-width: 390px) {
  .chat-heading { gap: 8px; padding: 9px 12px; }
  .chat-disclosure { padding: 7px 12px; }
  .chat-messages { padding: 12px 14px; }
  .message { margin-bottom: 20px; }
  .composer { gap: 6px; margin: 0 10px max(8px, var(--safe-bottom)); padding: 6px; }
  .composer textarea { min-height: 42px; max-height: 120px; }
}
.composer textarea:focus-visible { outline: none; }
.composer:has(textarea:focus-visible) { outline: 2px solid var(--blue); outline-offset: 3px; }
.empty-state { display: flex; flex-direction: column; align-items: flex-start; padding: 56px 0; max-width: 400px; }
.empty-symbol { display: grid; place-items: center; width: 68px; height: 68px; margin-bottom: 24px; background: var(--blue-soft); color: var(--blue); border-radius: 16px; }
.empty-symbol svg { width: 30px; height: 30px; }
.empty-state h2 { font-size: 28px; }
.empty-state > p { margin-top: 12px; color: var(--muted); font-size: 15px; line-height: 1.6; }
.empty-state > button { margin-top: 28px; }
.chat-empty { justify-content: center; min-height: 100%; padding: 26px 0; }
.pending-message { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; padding: 8px 0 20px; }
.loading-dots { display: inline-flex; gap: 4px; }
.loading-dots i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; animation: pulse 1.2s ease-in-out infinite; }
.loading-dots i:nth-child(2) { animation-delay: .15s; }
.loading-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes pulse { 0%, 80%, 100% { opacity: .35; } 40% { opacity: 1; } }

/* Saved results and profile share the same quiet reading surface. */
.saved-page .page-heading h1 { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; font-size: 32px; }
.heading-count { font-size: 14px; font-weight: 500; letter-spacing: 0; color: var(--muted); background: var(--soft); min-width: 28px; padding: 6px 8px; border-radius: 50%; text-align: center; }
.filter-row { display: flex; gap: 6px; overflow-x: auto; padding: 4px 2px 12px; margin: 0 -2px 8px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.filter-chip { flex-shrink: 0; min-height: 44px; padding: 10px 14px; border-radius: 12px; color: var(--muted); background: transparent; font-size: 14px; }
.filter-chip.active { color: var(--paper); background: var(--blue); }
.saved-list { display: flex; flex-direction: column; gap: 18px; }
.saved-card { padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.saved-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 15px; }
.saved-card-heading .message-label { margin: 0; }
.role-pill { display: inline-flex; align-items: center; gap: 7px; background: transparent; color: var(--blue); min-height: 44px; padding: 0; font-size: 14px; font-weight: 600; }
.role-pill svg { width: 17px; height: 17px; }
.saved-card .message-text { font-size: 15px; }
.profile-page .page-heading { margin-bottom: 28px; }
.profile-identity { display: flex; align-items: center; gap: 16px; padding: 0 0 28px; border-bottom: 1px solid var(--line); }
.profile-avatar { display: grid; place-items: center; width: 64px; height: 64px; flex-shrink: 0; border-radius: 50%; background: var(--blue); color: var(--paper); font-size: 25px; }
.profile-identity h2 { font-size: 23px; overflow-wrap: anywhere; }
.profile-identity p { color: var(--muted); font-size: 12px; margin-top: 6px; }
.profile-card { padding: 24px 0; border-bottom: 1px solid var(--line); }
.profile-card h2 { font-size: 20px; margin-bottom: 14px; }
.profile-card > p { color: var(--muted); font-size: 14px; line-height: 1.65; margin-top: 10px; }
.profile-card .primary-button { margin-top: 14px; width: 100%; }
.privacy-section .text-button { margin-top: 16px; text-align: left; }
.danger-button.text-button { color: var(--danger); }
.danger-button.primary-button { background: var(--danger); color: var(--paper); }
.about-pinki { padding: 22px 0 4px; }
.about-pinki summary { cursor: pointer; font-size: 14px; min-height: 44px; padding-block: 10px; }
.about-pinki summary span { float: right; font-size: 12px; color: var(--muted); }
.about-pinki p { font-size: 13px; line-height: 1.65; color: var(--muted); margin-top: 14px; }
dialog { width: min(390px, calc(100% - 40px)); padding: 26px; color: var(--ink); background: var(--surface); border: 0; border-radius: 16px; box-shadow: 0 18px 64px #10204433; }
dialog::backdrop { background: #10183066; }
dialog h2 { font-size: 24px; }
dialog p { margin-top: 12px; font-size: 14px; color: var(--muted); }
.dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 24px; }
.toast { position: fixed; z-index: 100; bottom: calc(var(--nav-height) + var(--safe-bottom) + 12px); left: 50%; transform: translate(-50%, 8px); padding: 13px 18px; width: max-content; max-width: calc(100% - 32px); color: var(--paper); background: var(--ink); border-radius: 12px; font-size: 13px; opacity: 0; pointer-events: none; transition: opacity 160ms ease, transform 160ms ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.initial-loading { min-height: var(--app-height); display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 24px; padding: 24px; color: var(--blue); }
.initial-loading .brand-word { font-size: 64px; }
.initial-loading p { color: var(--muted); font-size: 14px; }
@media (hover: hover) {
  .primary-button:hover, .send-button:hover { background: var(--blue-hover); }
  .quick-card:hover, .suggestion:hover { color: var(--blue); }
  .quick-card:hover svg, .suggestion:hover svg { color: var(--blue); transform: translateX(3px); }
  .quick-card svg, .suggestion svg { transition: transform 150ms ease; }
  .text-button:hover { color: var(--blue); }
  .secondary-button:hover, .icon-button:hover, .filter-chip:not(.active):hover { background: var(--soft); }
  .role-tab:not([aria-selected='true']):hover { background: #ffffff12; }
  .nav-button:hover { color: var(--blue); }
}
@media (prefers-reduced-motion: no-preference) {
  .send-button, .primary-button, .secondary-button, .avatar-button { transition: background-color 150ms ease, transform 150ms ease; }
  .send-button:active, .primary-button:active, .secondary-button:active, .avatar-button:active { transform: scale(.97); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (max-width: 359px) {
  .topbar, .page { padding-inline: 20px; }
  .home-intro { padding-inline: 20px; }
  .home-intro h1 { font-size: 40px; }
  .home-workspace { padding-inline: 20px; }
  .role-tabs { padding-inline: 12px; gap: 2px; }
  .role-tab { font-size: 12px; }
  .saved-page .page-heading h1 { font-size: 28px; }
  .welcome-intro h1 { font-size: 34px; }
  .chat-messages, .suggestions { padding-inline: 20px; }
}
@media (min-width: 600px) and (max-width: 899px) {
  .page, .home-workspace, .home-intro, .home-note, .welcome-intro, .welcome-form { padding-inline: 48px; }
  .role-tabs { padding-inline: 40px; }
  .home-intro h1 { font-size: 52px; }
  .home-workspace { max-width: 700px; margin-inline: auto; }
  .chat-messages, .suggestions { padding-inline: 40px; }
}
@media (min-width: 900px) {
  .app-shell { --rail-width: 224px; margin-left: var(--rail-width); padding-bottom: 0; }
  .topbar { height: 88px; padding-inline: 52px; }
  .brand { position: fixed; z-index: 31; top: calc(28px + var(--safe-top)); left: 30px; color: var(--on-blue); }
  .brand-word { font-size: 48px; }
  .version-badge { margin-left: auto; }
  .bottom-nav { top: 0; bottom: 0; right: auto; width: var(--rail-width); display: flex; flex-direction: column; gap: 6px; padding: calc(140px + var(--safe-top)) 18px 24px; border: 0; background: var(--brand-field); }
  .nav-button { min-height: 52px; flex-direction: row; justify-content: flex-start; gap: 12px; padding: 12px; font-size: 14px; color: var(--on-blue-muted); }
  .nav-icon { width: 24px; height: 26px; border-radius: 0; }
  .nav-button[aria-current='page'] { color: var(--on-blue); background: #ffffff1a; }
  .nav-button[aria-current='page'] .nav-icon { background: transparent; }
  .nav-button:hover { color: var(--on-blue); }
  .nav-count { top: 18px; right: 8px; color: var(--brand-field); background: var(--on-blue); }
  .nav-caption { display: block; margin-top: auto; padding: 28px 12px 8px; font-size: 12px; line-height: 1.7; color: var(--on-blue-muted); }
  .page { max-width: 780px; margin-inline: auto; padding: 32px 52px 60px; }
  .page-heading h1 { font-size: 40px; }
  .home-intro { padding: 12px 52px 40px; }
  .home-intro h1 { font-size: 56px; }
  .home-intro p { margin-top: 20px; }
  .role-tabs { padding-inline: 44px; max-width: 820px; gap: 8px; }
  .role-tab { flex-direction: row; gap: 10px; min-height: 60px; font-size: 15px; }
  .home-workspace { padding: 36px 52px 0; max-width: 820px; }
  .workspace-heading h2 { font-size: 32px; }
  .workspace-heading p { max-width: none; font-size: 15px; }
  .prompt-input { min-height: 106px; }
  .prompt-box { padding: 22px 22px 14px; }
  .ideas { margin-top: 30px; }
  .home-note { padding: 24px 52px 40px; }
  .home-page { min-height: calc(var(--app-height) - 88px); }
  .is-chat .topbar { display: flex; height: 0; padding: 0; }
  .is-chat .topbar > :not(.brand) { display: none; }
  .is-chat .bottom-nav { display: flex; }
  .chat-page { max-width: 820px; width: 100%; margin-inline: auto; }
  .chat-heading { padding: 24px 36px; }
  .chat-messages { padding: 20px 52px; }
  .suggestions { padding-inline: 52px; }
  .composer { margin: 0 40px 28px; }
  .chat-empty { max-width: 460px; }
  .saved-page .page-heading h1 { font-size: 40px; }
  .saved-list .empty-state { padding-block: 64px; }
  .is-welcome { margin-left: 0; }
  .is-welcome .brand { position: static; }
  .is-welcome .topbar { padding: 28px 6%; height: 100px; }
  .onboarding { display: grid; grid-template-columns: 1.2fr 1fr; gap: 60px; align-items: center; min-height: calc(var(--app-height) - 100px); padding: 24px 8% 80px; max-width: 1400px; margin-inline: auto; }
  .welcome-intro { padding: 0; }
  .welcome-intro h1 { font-size: 54px; }
  .welcome-intro > p { font-size: 18px; }
  .welcome-topics { font-size: 23px; gap: 22px; }
  .welcome-form { padding: 40px; border-radius: 16px; }
  .toast { left: calc(50% + 112px); bottom: 28px; max-width: 560px; }
}
.home-intro { position: relative; }
.home-intro h1, .home-intro p { position: relative; z-index: 1; }
.home-bird { position: absolute; width: 140px; height: 140px; object-fit: contain; right: 2px; top: 10px; pointer-events: none; }
.home-intro p { max-width: 70%; }
.welcome-form { position: relative; }
.welcome-bird { float: right; width: 92px; height: 92px; margin: -26px -8px -16px 12px; object-fit: contain; }
@media (min-width: 600px) { .home-bird { width: 190px; height: 190px; right: 48px; top: -5px; } }
@media (min-width: 900px) { .home-bird { right: max(52px, calc(100% - 790px)); width: 230px; height: 230px; top: -20px; } }
@media (max-width: 359px) { .home-bird { width: 108px; height: 108px; right: 0; top: 20px; } }
button[aria-disabled='true'] { opacity: .5; cursor: wait; }
@media (min-width: 900px) { .bottom-nav :focus-visible, .brand:focus-visible { outline-color: var(--on-blue); } }
@media (min-width: 900px) {
  .app-shell.is-error { margin-left: 0; }
  .is-error .brand { position: static; color: var(--blue); }
}

/* Motion: topic continuity, brief action feedback, no decorative loops. */
.role-tabs { position: relative; --topic-gutter: 16px; --topic-gap: 4px; --active-topic: 0; }
.role-tab { position: relative; z-index: 1; transition: color 160ms ease; }
.role-tab-indicator { display: none; position: absolute; z-index: 0; top: 0; bottom: 0; left: var(--topic-gutter); width: calc((100% - var(--topic-gutter) * 2 - var(--topic-gap) * 4) / 5); background: var(--paper); border-radius: 14px 14px 0 0; transform: translateX(calc(var(--active-topic) * (100% + var(--topic-gap)))); transition: transform 300ms cubic-bezier(.16,1,.3,1); pointer-events: none; }
.has-indicator .role-tab-indicator { display: block; }
.has-indicator .role-tab[aria-selected='true'] { background: transparent; }
.nav-icon { transition: background-color 160ms ease, color 160ms ease; }
.message-actions [aria-pressed='true'] { transition: color 160ms ease; }
html[data-platform='telegram'] .app-shell:not(.is-chat) .topbar { height: 64px; }
html[data-platform='telegram'] .brand-word { font-size: 36px; }
html[data-keyboard='open'] .bottom-nav { display: none; }
html[data-keyboard='open'] .app-shell:not(.is-chat) { padding-bottom: 20px; }
@media (max-width: 359px) { .role-tabs { --topic-gutter: 12px; --topic-gap: 2px; } }
@media (min-width: 600px) and (max-width: 899px) { .role-tabs { --topic-gutter: 40px; } }
@media (min-width: 900px) {
  .role-tabs { --topic-gutter: 44px; --topic-gap: 8px; }
  html[data-keyboard='open'] .bottom-nav { display: flex; }
}
@media (prefers-reduced-motion: reduce) { .role-tab-indicator { transition: none; } }

.context-opt-in { display: flex; align-items: center; gap: 8px; padding: 6px 16px; color: var(--muted); font-size: 12px; }
.context-opt-in input { accent-color: var(--blue); }
.consent-context { padding: 8px 0; }
