@import url('./grain.css');
@import url('./card-material.css');
@import url('./answer-suggestions.css');
@font-face { font-family: 'Golos Text'; src: url('/assets/fonts/golos-text.ttf') format('truetype'); font-style: normal; font-weight: 400 900; font-display: swap; }
@font-face { font-family: 'Cormorant Garamond'; src: url('/assets/fonts/cormorant-garamond.ttf') format('truetype'); font-style: normal; font-weight: 300 700; font-display: swap; }

:root {
  color-scheme: light;
  --font-ui: 'Golos Text', system-ui, sans-serif;
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --background: #faf8f5; --sidebar: #f2f0eb; --surface: #f6f4ef; --composer-surface: #fdfbfa; --habit-surface: #f0eee8;
  --surface-hover: #e9e8e1; --user-surface: #eceee7;
  --text: #27251e; --text-secondary: #6d6b66; --sidebar-secondary: #6d6b66; --accent: #016a71;
  --on-accent: #edfffe; --border: #d1d1cd; --input-border: #c3c7bd;
  --focus: #016a71; --error: #a42c39; --error-surface: #fae9e9; --delete-action: #be283b;
  --experiment: #285bab; --experiment-border: #789acb;
  --shadow-composer: 0 4px 24px -12px rgb(39 37 30 / 18%);
  --gradient-pink: linear-gradient(130deg, #e2f3ef 0%, #fae9f3 100%);
  --gradient-blue: linear-gradient(130deg, #e2f3ef 0%, #e4eef8 100%);
  --gradient-yellow: linear-gradient(130deg, #e2f3ef 0%, #f6eedb 100%);
  --suggestion-text: #294a46; --suggestion-secondary: #52665d;
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-5: 20px; --space-6: 24px; --space-8: 32px; --space-12: 48px;
  --radius-small: 8px; --radius-card: 16px; --radius-composer: 20px;
  --chat-width: 720px; --sidebar-width: 240px;
  --ease-out: cubic-bezier(.23, 1, .32, 1); --duration-fast: 150ms;
  --ease-disclosure: cubic-bezier(.215, .61, .355, 1); --duration-disclosure: 350ms;
}
:root[data-theme='dark'] {
  color-scheme: dark;
  /* Perplexity dark tokens, read from the live site on 2026-10-13.
     Neutral overlays are composited on --bg-base (#161616). */
  --background: #161616; --sidebar: #161616; --surface: #1d1d1d; --composer-surface: var(--surface); --habit-surface: var(--surface);
  --surface-hover: #242424; --user-surface: #222222;
  --text: #dedede; --text-secondary: rgb(222 222 222 / 65%); --sidebar-secondary: var(--text-secondary); --accent: #4e99a3;
  --on-accent: #161616; --border: rgb(222 222 222 / 14%); --input-border: rgb(222 222 222 / 20%);
  --focus: #4e99a3; --error: #ffb6bd; --error-surface: #402d32; --delete-action: #f16a73;
  --experiment: #92b9fa; --experiment-border: #5479ae;
  --shadow-composer: 0 8px 32px -16px rgb(0 0 0 / 36%);
  --gradient-pink: linear-gradient(130deg, #232b2b 0%, #342c33 100%);
  --gradient-blue: linear-gradient(130deg, #232b2b 0%, #2a3038 100%);
  --gradient-yellow: linear-gradient(130deg, #232b2b 0%, #343329 100%);
  --suggestion-text: #dedede; --suggestion-secondary: var(--text-secondary);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body { background: var(--background); color: var(--text); font-family: var(--font-ui); font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
button, textarea { font: inherit; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
button, a, textarea { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, textarea:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
::selection { background: var(--accent); color: var(--on-accent); }
* { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.icon-definitions { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.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: 8px; left: 8px; transform: translateY(-160%); background: var(--surface); color: var(--text); padding: 12px; z-index: 10; }
.skip-link:focus { transform: none; }
.app-shell { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); height: 100dvh; }
.sidebar { --text-secondary: var(--sidebar-secondary); display: flex; flex-direction: column; gap: 2px; min-width: 0; min-height: 0; background: var(--sidebar); padding: 8px; border-right: 1px solid var(--border); }
.sidebar-top { display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding-left: 8px; margin-bottom: 8px; }
.wordmark { font-size: 19px; letter-spacing: -.035em; font-weight: 500; }
.wordmark-short { display: none; }
.wordmark > .wordmark-full { color: var(--text); font-weight: 500; }
.wordmark span { color: var(--accent); font-weight: 400; }
.new-conversation { display: flex; align-items: center; gap: 10px; min-height: 40px; border: 0; border-radius: var(--radius-small); background: transparent; padding: 8px; font-size: 14px; text-align: left; transition: background var(--duration-fast) ease; }
.new-conversation .icon { width: 18px; height: 18px; }
.new-conversation[aria-current='page'] { background: var(--surface-hover); }
.new-conversation:hover { background: var(--surface-hover); }
#sidebar-conversations { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.conversation-list { display: flex; flex-direction: column; gap: var(--space-1); overflow-y: auto; min-height: 0; padding: var(--space-1); margin: calc(-1 * var(--space-1)); }
.conversation-item { display: flex; align-items: center; text-align: left; width: 100%; flex-shrink: 0; min-height: 36px; background: transparent; border: 0; border-radius: var(--radius-small); padding: 6px 8px; font-size: 15px; transition: background var(--duration-fast) ease; }
.conversation-item:hover, .conversation-item[aria-current='true'] { background: var(--surface-hover); }
.conversation-item[aria-current='true'] { color: var(--accent); }
.history-empty { padding: 0 var(--space-3); color: var(--text-secondary); font-size: 13px; }
.sidebar-footer { display: flex; margin-top: auto; padding-top: 8px; color: var(--text-secondary); font-size: 12px; }
#account-open { display: flex; align-items: center; gap: 10px; text-decoration: none; text-align: left; width: 100%; min-height: 48px; padding: 8px 12px; border-radius: var(--radius-small); overflow: hidden; }
#account-open:is(:hover, :focus-visible, [aria-expanded='true']) { background: var(--surface-hover); color: var(--text); text-decoration: none; }
.account-label { display: flex; flex-direction: column; flex: 1; min-width: 0; }
#account-kind { font-size: 11px; line-height: 1.4; color: var(--text-secondary); }
#account-open .account-disclosure { width: 14px; height: 14px; opacity: 0; margin-left: auto; }
#account-open:is(:hover, :focus-visible, [aria-expanded='true']) .account-disclosure { opacity: 1; }
#account-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#account-open .icon { width: 18px; height: 18px; }
.presence-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.chat-shell { display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; }
.chat-header { flex-shrink: 0; min-height: 56px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; gap: var(--space-4); border-bottom: 1px solid var(--border); }
.workspace-tabs { display: flex; gap: 24px; align-self: stretch; }
.workspace-tabs button { position: relative; border: 0; background: transparent; font-size: 14px; padding: 16px 0; color: var(--text-secondary); }
.workspace-tabs button[aria-current='page'] { color: var(--text); }
.workspace-tabs button[aria-current='page']::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 2px; background: var(--text); }
.header-title:has(.workspace-tabs:not([hidden])) { align-self: stretch; }
.sidebar-collapsed { --sidebar-width: 56px; }
.sidebar-collapsed .wordmark, .sidebar-collapsed .nav-label, .sidebar-collapsed .history-heading, .sidebar-collapsed .conversation-list, .sidebar-collapsed .history-empty, .sidebar-collapsed #account-name { display: none; }
.sidebar-collapsed .account-label, .sidebar-collapsed #account-open .account-disclosure { display: none; }
.sidebar-collapsed .sidebar-top { padding: 0; }
.sidebar-collapsed .sidebar { padding-inline: 6px; }
.sidebar-collapsed .new-conversation, .sidebar-collapsed #account-open { justify-content: center; padding-inline: 0; }
.header-title { display: flex; gap: var(--space-3); align-items: center; min-width: 0; color: var(--text-secondary); font-size: 14px; }
#conversation-title { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex-shrink: 0; border: 0; border-radius: var(--radius-small); background: transparent; color: var(--text-secondary); transition: background var(--duration-fast) ease, color var(--duration-fast) ease; }
.icon-button:hover { color: var(--text); background: var(--surface-hover); }
.chat-scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior-y: contain; padding: 0 var(--space-8); mask-image: linear-gradient(to bottom, #000 calc(100% - 48px), calc(100% - 28px), transparent 100%); }
.welcome { max-width: var(--chat-width); margin: 0 auto; padding-top: clamp(32px, 9vh, 112px); padding-bottom: var(--space-8); }
.welcome h1 { font-family: var(--font-display); font-size: clamp(52px, 5.5vw, 76px); line-height: 1.04; letter-spacing: -.035em; font-weight: 500; margin: 0 0 var(--space-6); text-wrap: balance; }
.welcome h1 span { color: var(--accent); }
.welcome-description { color: var(--text-secondary); font-size: 16px; line-height: 1.7; margin: 0; text-wrap: pretty; }
.suggestions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); margin-top: var(--space-12); }
.suggestion { min-height: 146px; position: relative; text-align: left; border: 0; border-radius: var(--radius-card); padding: var(--space-5); color: var(--suggestion-text); transition: box-shadow var(--duration-fast) ease; }
.suggestion:hover { box-shadow: inset 0 0 0 1px var(--accent); }
.suggestion > span:first-child { display: block; font-size: 15px; font-weight: 500; margin-bottom: var(--space-2); }
.suggestion-description { display: block; font-size: 13px; line-height: 1.55; color: var(--suggestion-secondary); }
.suggestion-arrow { position: absolute; top: 20px; right: 16px; width: 16px; height: 16px; transform: rotate(45deg); }
.suggestion-pink { background: var(--gradient-pink); }
.suggestion-blue { background: var(--gradient-blue); }
.suggestion-yellow { background: var(--gradient-yellow); }
.messages { display: flex; flex-direction: column; gap: var(--space-8); max-width: var(--chat-width); width: 100%; margin: 0 auto; padding: var(--space-8) 0 64px; }
.messages:empty { display: none; }
.message { min-width: 0; overflow-wrap: anywhere; }
.message-user { align-self: flex-end; max-width: 86%; }
.message-user-content { background: var(--user-surface); border-radius: var(--radius-card) var(--radius-card) var(--space-1) var(--radius-card); padding: var(--space-3) var(--space-4); white-space: pre-wrap; }
.message-user .message-actions { justify-content: flex-end; }
.message-assistant { width: 100%; }
.message-content { line-height: 1.7; }
.message-content > :first-child { margin-top: 0; }
.message-content > :last-child { margin-bottom: 0; }
.message-content p { margin: 0 0 var(--space-4); }
.message-assistant .message-content strong { color: var(--accent); font-weight: 600; }
.message-content h1, .message-content h2, .message-content h3, .message-content h4 { font-family: var(--font-ui); font-size: 20px; line-height: 1.4; font-weight: 500; margin: var(--space-6) 0 var(--space-3); }
.message-content ul, .message-content ol { padding-left: var(--space-6); margin: 0 0 var(--space-4); }
.message-content li + li { margin-top: var(--space-2); }
.message-content a { color: var(--accent); text-underline-offset: 3px; }
.message-content pre { overflow-x: auto; padding: var(--space-4); border-radius: var(--radius-small); background: var(--user-surface); font-size: 13px; }
.message-content code { font-size: .875em; }
.message-content blockquote { margin: var(--space-4) 0; padding-left: var(--space-4); border-left: 1px solid var(--border); color: var(--text-secondary); }
.message-content table { display: block; overflow-x: auto; border-collapse: collapse; max-width: 100%; font-size: 14px; }
.message-content th, .message-content td { padding: var(--space-2); border: 1px solid var(--border); }
.message-actions { display: flex; align-items: center; gap: 2px; margin-top: var(--space-2); }
.message-usage { min-width: 0; color: var(--text-secondary); font-size: 12px; line-height: 1.5; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.message-actions .copy-button { flex-shrink: 0; }
.usage-details { flex: 1; min-width: 0; color: var(--text-secondary); font-size: 12px; line-height: 1.5; font-variant-numeric: tabular-nums; }
.usage-summary { display: flex; align-items: center; gap: var(--space-1); width: fit-content; max-width: 100%; min-height: 44px; list-style: none; cursor: pointer; border-radius: var(--radius-small); }
.usage-summary::-webkit-details-marker { display: none; }
.usage-summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
.usage-summary:hover { color: var(--text); }
.usage-summary .icon { width: 16px; height: 16px; flex-shrink: 0; }
.usage-details[open] > .usage-summary .icon { transform: rotate(180deg); }
.usage-calls { border-top: 1px solid var(--border); padding-top: var(--space-2); margin-bottom: var(--space-2); }
.usage-call-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-2); }
.usage-call { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, auto); gap: 0 var(--space-3); align-items: baseline; }
.usage-call-label, .usage-call-cost { overflow-wrap: anywhere; min-width: 0; }
.usage-call-cost { text-align: right; }
.usage-call-io { grid-column: 1 / -1; font: inherit; }
.usage-status { margin: 0; }
.usage-retry { background: transparent; border: 0; color: var(--accent); font: inherit; text-decoration: underline; text-underline-offset: 3px; padding: var(--space-2) 0; min-height: 44px; cursor: pointer; }
@media (max-width: 760px) {
  .usage-call { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .usage-call-label { grid-column: 1 / -1; }
}
.message-actions .message-action { position: relative; width: 28px; height: 28px; padding: 0; border: 1px solid transparent; border-radius: var(--radius-small); }
.message-actions .message-action:is(:hover, :focus-visible) { background: var(--surface-hover); }
.message-action-hint { position: fixed; inset: auto; margin: 0; transform: translateX(-50%); width: max-content; max-width: min(260px, calc(100vw - 16px)); padding: 5px 9px; border: 1px solid var(--border); border-radius: var(--radius-small); background: var(--surface); color: var(--text); font-family: var(--font-ui); font-size: 12px; font-weight: 400; line-height: 1.5; text-align: left; visibility: hidden; opacity: 0; pointer-events: none; }
.message-action-hint:popover-open { visibility: visible; opacity: 1; }
.message-timestamp { flex-shrink: 0; margin-left: 8px; color: var(--text-secondary); font-size: 12px; line-height: 1.5; font-variant-numeric: tabular-nums; white-space: nowrap; opacity: 0; transition: opacity var(--duration-fast) ease; }
.message-user .message-timestamp { margin-left: 0; margin-right: 8px; }
.message:is(:hover, :focus-within) .message-timestamp { opacity: 1; }
@media (hover: none), (pointer: coarse) {
  .message-timestamp { opacity: 1; }
}
@media (max-width: 760px), (pointer: coarse) {
  .message-actions .message-action { width: 44px; height: 44px; }
}
.copy-button .icon { width: 16px; height: 16px; }
.proposal { position: relative; isolation: isolate; overflow: hidden; margin-top: var(--space-5); max-width: 560px; border: 1px solid var(--border); border-radius: var(--radius-card); padding: 24px; background: var(--surface); transition: border-color var(--duration-fast) ease; }
.proposal[data-experiment='true'] { --accent: var(--experiment); --focus: var(--experiment); }
.proposal > :not(.proposal-glow) { position: relative; z-index: 1; }
.proposal-glow, .card-glow { position: absolute; pointer-events: none; width: 360px; height: 240px; right: -80px; bottom: -120px; background: radial-gradient(ellipse, color-mix(in srgb, var(--card-glow-color, var(--accent)) var(--card-glow-strength, 22%), transparent), transparent 68%); filter: blur(18px); opacity: .65; transition: transform var(--duration-fast) var(--ease-out), opacity var(--duration-fast) ease; }
.proposal-heading { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.proposal-heading .proposal-symbol { width: 18px; height: 18px; color: var(--accent); }
.proposal h3 { font-family: var(--font-display); font-size: 28px; font-weight: 500; line-height: 1.15; text-wrap: balance; margin: 0; }
.proposal-body { max-width: 46ch; margin: 12px auto 0; text-align: center; }
.proposal p { font-size: 13px; color: var(--text-secondary); line-height: 1.6; white-space: pre-wrap; margin: 0; }
.proposal-footer { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 4px 12px; margin-top: 18px; }
.proposal-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; width: fit-content; max-width: 100%; }
.action-button { min-height: 44px; padding: 9px var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-small); background: transparent; font-size: 14px; transition: background var(--duration-fast) ease; }
.action-button:hover { background: var(--surface-hover); }
.action-button-primary { border-color: transparent; background: var(--accent); color: var(--on-accent); }
.action-button-primary:hover { background: var(--accent); filter: brightness(.94); }
.action-button:disabled { opacity: .55; }
.proposal-actions .action-button { display: inline-flex; align-items: center; justify-content: center; min-width: 96px; min-height: 36px; padding: 7px 12px; border: 0; border-radius: var(--radius-small); background: transparent; color: var(--text-secondary); font-size: 13px; line-height: 1.5; transition: background var(--duration-fast) ease, color var(--duration-fast) ease; }
.proposal-actions .action-button-primary { background: var(--accent); color: var(--on-accent); font-weight: 500; }
.proposal-actions .action-button:hover:not(:disabled) { background: transparent; color: var(--text); filter: none; }
.proposal-actions .action-button-primary:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 90%, white); color: var(--on-accent); }
.proposal-actions .action-button-primary:disabled { opacity: .55; }
.proposal-status { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; color: var(--accent); font-size: 12px; }
.proposal-status[data-status='rejected'], .proposal-status[data-status='superseded'] { color: var(--text-secondary); }
.proposal:is([data-status='rejected'], [data-status='superseded']) .proposal-symbol { color: var(--text-secondary); }
.proposal-status .icon { width: 16px; height: 16px; }
.proposal:not([data-status='pending']) { padding: 14px 16px; border-radius: 12px; }
.proposal:not([data-status='pending']) .proposal-heading { flex-direction: row; align-items: flex-start; gap: 8px; text-align: left; }
.proposal:not([data-status='pending']) h3 { font-family: var(--font-ui); font-size: 14px; line-height: 1.5; text-wrap: wrap; }
.proposal:not([data-status='pending']) .proposal-symbol { width: 16px; height: 16px; margin-top: 2px; }
.proposal:not([data-status='pending']) .proposal-glow { opacity: 0; }
.proposal:not([data-status='pending']) .proposal-footer { justify-content: flex-start; margin-top: 4px; }
.proposal-details { margin: 4px 0 0 24px; }
.proposal-details summary { display: flex; align-items: center; gap: 6px; width: fit-content; min-height: 32px; color: var(--text-secondary); cursor: pointer; font-size: 12px; list-style: none; }
.proposal-details summary::-webkit-details-marker { display: none; }
.proposal-details summary .icon { width: 12px; height: 12px; }
.proposal-details[open] summary .icon { transform: rotate(180deg); }
.proposal-details .proposal-body { margin: 4px 0 10px; max-width: none; text-align: left; }
.proposal-body .dashboard-proposal-changes { text-align: left; }
@media (hover: hover) and (pointer: fine) {
  .proposal[data-status='pending']:hover { border-color: color-mix(in srgb, var(--accent) 38%, var(--border)); }
  .proposal[data-status='pending']:hover .proposal-glow { opacity: .85; }
}
@media (prefers-reduced-motion: reduce) { .proposal-glow, .card-glow { transform: none !important; } }
@media (pointer: coarse) { .proposal-actions .action-button { min-height: 44px; padding-inline: 12px; } }
.waiting { display: flex; align-items: center; gap: var(--space-3); color: var(--text-secondary); font-size: 14px; min-height: 40px; }
.history-loading { max-width: var(--chat-width); margin: var(--space-8) auto; color: var(--text-secondary); font-size: 14px; }
.composer-region { --scroll-button-gap: var(--space-4); flex-shrink: 0; position: relative; max-width: calc(var(--chat-width) + 64px); width: 100%; align-self: center; padding: 0 var(--space-8) max(var(--space-5), env(safe-area-inset-bottom)); }
.composer { border: 1px solid var(--input-border); border-radius: var(--radius-composer); background: var(--composer-surface); box-shadow: var(--shadow-composer); padding: var(--space-4) var(--space-4) var(--space-3); transition: border-color var(--duration-fast) ease; }
.composer:focus-within { border-color: var(--focus); }
.composer-input { position: relative; }
.composer textarea, .composer-editor { display: block; width: 100%; min-height: 30px; max-height: 180px; resize: none; overflow-y: hidden; background: transparent; border: 0; padding: 0 var(--space-1); margin: 0; color: var(--text); caret-color: var(--accent); font-size: 16px; line-height: 1.6; }
.composer textarea:focus-visible, .composer-editor:focus-visible { outline: none; }
.composer textarea::placeholder { color: var(--text-secondary); opacity: 1; }
.composer-placeholder { display: none; position: absolute; inset: 0 var(--space-1) auto; color: var(--text-secondary); font-size: 16px; line-height: 1.6; pointer-events: none; }
.composer[data-mode-enhanced] textarea::placeholder { color: transparent; }
.composer[data-mode-enhanced] .composer-placeholder { display: grid; }
.composer-placeholder > span { grid-area: 1 / 1; opacity: 0; filter: blur(2px); transition: opacity 200ms var(--ease-out), filter 200ms var(--ease-out); }
.composer-placeholder[data-mode='discuss'] > [data-placeholder-mode='discuss'], .composer-placeholder[data-mode='find_step'] > [data-placeholder-mode='find_step'] { opacity: 1; filter: blur(0); }
.composer-input[data-empty='false'] .composer-placeholder, .composer[data-composing] .composer-placeholder { visibility: hidden; }
.composer-toolbar { display: flex; justify-content: space-between; gap: var(--space-3); align-items: center; margin-top: var(--space-3); }
.composer-options { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; min-width: 0; }
.conversation-mode { position: relative; isolation: isolate; display: inline-grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px; flex-shrink: 0; background: var(--background); border-radius: 8px; padding: 3px; }
.composer[data-mode-enhanced] .conversation-mode::before { content: ''; position: absolute; z-index: 0; inset-block: 3px; left: 3px; width: calc((100% - 8px) / 2); border-radius: 6px; background: var(--surface-hover); pointer-events: none; transform: translateX(0); transition: transform 250ms var(--ease-out), opacity var(--duration-fast) ease; }
.composer[data-mode-enhanced] .conversation-mode[data-mode='find_step']::before { transform: translateX(calc(100% + 2px)); }
.composer[data-mode-enhanced] .conversation-mode:has(button:disabled)::before { opacity: .55; }
.conversation-mode button { position: relative; z-index: 1; border: 0; background: transparent; color: var(--text-secondary); border-radius: 6px; padding: 6px 10px; font: inherit; font-size: 12px; line-height: 20px; cursor: pointer; transition: color var(--duration-fast) ease; }
.conversation-mode button[aria-pressed='true'] { background: var(--surface-hover); color: var(--text); }
.composer[data-mode-enhanced] .conversation-mode button[aria-pressed='true'] { background: transparent; }
.composer[data-mode-instant] .conversation-mode::before, .composer[data-mode-instant] .composer-placeholder > span { transition: none; }
.conversation-mode button:hover:not(:disabled) { color: var(--text); }
.conversation-mode button:disabled { cursor: default; opacity: .55; }
.conversation-mode button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mode-hint { position: absolute; z-index: 10; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%); width: max-content; max-width: 210px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font-size: 12px; line-height: 1.4; text-align: center; pointer-events: none; opacity: 0; visibility: hidden; transition: opacity 140ms ease, visibility 140ms; }
.conversation-mode button:is(:hover, :focus-visible) .mode-hint { opacity: 1; visibility: visible; transition-delay: 180ms; }
@media (max-width: 760px) {
  .composer-options { gap: 4px; }
  .conversation-mode button { min-height: 44px; padding-inline: 10px; }
  .composer-options .input-status { width: 100%; font-size: 12px; }
  .mode-hint { left: 0; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .conversation-mode::before, .conversation-mode button, .composer-placeholder > span, .mode-hint { transition: none !important; }
}
.input-status { padding-left: var(--space-1); font-size: 12px; color: var(--text-secondary); }
.send-button { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 0; border-radius: var(--radius-small); background: var(--accent); color: var(--on-accent); transition: opacity var(--duration-fast) ease; }
.send-button:hover:not(:disabled) { opacity: .85; }
.send-button:disabled { background: var(--surface-hover); color: var(--text-secondary); }
.scroll-bottom { display: flex; align-items: center; justify-content: center; position: absolute; z-index: 1; bottom: calc(100% + var(--scroll-button-gap)); left: 50%; transform: translateX(-50%); width: 32px; height: 32px; padding: 0; border: 1px solid var(--border); border-radius: 50%; background: var(--surface); color: var(--text-secondary); box-shadow: var(--shadow-composer); transition: background var(--duration-fast) ease, color var(--duration-fast) ease; }
.scroll-bottom::before { content: ''; position: absolute; inset: -6px; border-radius: inherit; }
.scroll-bottom:hover { background: var(--surface-hover); color: var(--text); }
.scroll-bottom .icon { width: 16px; height: 16px; }
.scroll-bottom-hint { position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100vw - 32px); padding: 5px 9px; border: 1px solid var(--border); border-radius: var(--radius-small); background: var(--surface); color: var(--text); font-size: 12px; line-height: 1.5; visibility: hidden; opacity: 0; pointer-events: none; transition: opacity var(--duration-fast) ease; }
.scroll-bottom:is(:hover, :focus-visible) .scroll-bottom-hint { visibility: visible; opacity: 1; }
@media (pointer: coarse) { .scroll-bottom { width: 44px; height: 44px; } .scroll-bottom::before { inset: 0; } }
.error-banner { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); color: var(--error); background: var(--error-surface); font-size: 13px; padding: var(--space-3) var(--space-4); margin-bottom: var(--space-3); border-radius: var(--radius-small); }
.text-button { flex-shrink: 0; border: 0; background: transparent; color: inherit; min-height: 40px; text-decoration: underline; text-underline-offset: 3px; font-size: 13px; }
.mobile-only, .sidebar-backdrop { display: none; }
.noscript-message { position: fixed; inset: 20% 10% auto; background: var(--surface); padding: var(--space-6); }
@media (max-width: 1100px) { .suggestion { padding: var(--space-4); } .suggestion-arrow { top: 16px; right: 12px; } }
@media (max-width: 760px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(300px, 85vw); z-index: 5; visibility: hidden; transform: translateX(-100%); }
  .sidebar.is-open { visibility: visible; transform: none; }
  .sidebar-backdrop:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 4; border: 0; background: rgb(0 0 0 / 38%); }
  .mobile-only { display: inline-flex; }
  .desktop-only { display: none; }
  .chat-header { min-height: 56px; padding: 0 8px; }
  .chat-scroll { padding: 0 var(--space-5); }
  .welcome { padding-top: clamp(28px, 7vh, 64px); }
  .welcome h1 { font-size: 58px; margin-bottom: var(--space-5); }
  .welcome-description { font-size: 14px; }
  .desktop-break { display: none; }
  .suggestions { grid-template-columns: 1fr; gap: var(--space-2); margin-top: var(--space-8); }
  .suggestion { min-height: 72px; padding: var(--space-3) var(--space-4); }
  .suggestion > span:first-child { font-size: 14px; margin-bottom: 2px; }
  .suggestion-description { font-size: 12px; }
  .suggestion-description br { display: none; }
  .suggestion-arrow { top: 28px; right: 16px; }
  .composer-region { --scroll-button-gap: var(--space-3); padding: 0 var(--space-3) max(var(--space-3), env(safe-area-inset-bottom)); }
  .composer { padding: var(--space-3); }
  .messages { padding-top: var(--space-4); gap: var(--space-6); }
  .message-user { max-width: 92%; }
  .proposal { padding: 20px 16px; }
  .proposal h3 { font-size: 26px; }
}
@media (max-height: 650px) { .welcome { padding-top: var(--space-6); } .welcome h1 { font-size: 48px; } .suggestions { margin-top: var(--space-6); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* Habits inherit the chat's surface, type and spacing tokens. */
.habits-nav { margin-top: var(--space-2); }
.habits-nav[aria-current='page'] { background: var(--surface-hover); color: var(--accent); }
.habits-view { flex: 1; min-height: 0; overflow-y: auto; padding: 32px; container-type: inline-size; }
.habits-heading, .habit-grid, .habits-empty, #habits-status { max-width: 1120px; margin-inline: auto; }
.habits-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.habits-heading h1 { font-size: 24px; font-weight: 500; margin: 0; letter-spacing: -.02em; }
.habits-heading p, .habits-empty p { color: var(--text-secondary); line-height: 1.65; margin: 0; }
.habit-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); }
.habit-card { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 12px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--habit-surface); overflow-wrap: anywhere; }
.habit-card h2, .habit-card h3 { min-width: 0; font-size: 14px; font-weight: 500; line-height: 1.4; margin: 0; }
.habit-card-header { display: flex; justify-content: space-between; align-items: start; gap: 8px; }
.habit-card-header h2, .habit-card-header h3 { flex: 1; }
.habit-card-header .experiment-label { font-size: 0; gap: 0; padding-top: 8px; }
.habit-card-header .experiment-label .icon { width: 16px; height: 16px; }
.habit-open { border: 0; background: transparent; text-align: left; padding: 6px 0; font: inherit; color: var(--text); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.habit-open:hover { text-decoration: underline; text-underline-offset: 3px; }
.habit-card-footer { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-top: auto; padding-top: 4px; }
.habit-card-footer .action-button { flex: 0 0 auto; max-width: 100%; font-size: 12px; padding: 6px 10px; min-height: 36px; white-space: normal; overflow-wrap: normal; word-break: normal; }
.habit-indicators { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.habit-indicators .experiment-label { font-size: 11px; }
.habit-rule, .habit-description { color: var(--text-secondary); font-size: 13px; line-height: 1.6; margin: 0; }
.habit-description { margin-top: var(--space-2); }
.habit-progress { flex: 1 1 140px; min-width: 0; font-variant-numeric: tabular-nums; }
.habit-label, .habit-range { display: block; font-size: 12px; color: var(--text-secondary); }
.habit-today { display: block; font-size: 14px; line-height: 1.45; font-weight: 500; }
.habit-period { display: block; color: var(--text-secondary); font-size: 12px; margin-top: 2px; }
.habit-days { display: flex; gap: 5px; flex-wrap: wrap; margin: 4px 0; }
.habit-day { position: relative; width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 4px; background: transparent; font-size: 10px; padding: 0; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.habit-day:not(:disabled)::before { content: ''; position: absolute; inset: -3px; }
.habit-day[data-state='complete'] { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.habit-day[data-state='partial'], .habit-day[data-state='zero'] { background: var(--user-surface); border-color: var(--input-border); color: var(--text); }
.habit-day[data-state='unknown'] { border-style: dashed; }
.habit-day[data-state='future'] { background: transparent; }
.habit-day[data-today='true'] { outline: 1px solid var(--accent); outline-offset: 2px; }
.habit-result { font-size: 13px; margin: var(--space-4) 0 var(--space-2); color: var(--text-secondary); }
.habit-result[data-status='achieved'] { color: var(--accent); }
.habit-result[data-status='exceeded'], .habit-form-error { color: var(--error); }
.habit-period .habit-result { font-size: inherit; margin: 0; }
.habit-unknown { font-size: 12px; color: var(--text-secondary); line-height: 1.5; margin: 0 0 var(--space-4); }
.habits-empty { padding-block: var(--space-12); max-width: 540px; text-align: center; }
.habits-empty h2 { font-size: 22px; font-weight: 500; margin: 0 0 var(--space-3); }
.habits-empty .action-button { margin-top: var(--space-6); }
#habits-retry { display: block; margin: var(--space-4) auto; }
.habit-dialog { width: min(440px, calc(100% - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto; padding: var(--space-6); border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--surface); color: var(--text); }
.habit-dialog::backdrop { background: rgb(0 0 0 / 38%); }
.habit-dialog h2 { font-size: 22px; font-weight: 500; margin: 0 0 var(--space-2); overflow-wrap: anywhere; }
.habit-dialog label { display: block; font-size: 13px; margin: var(--space-5) 0 var(--space-2); }
.habit-dialog input { font: inherit; caret-color: var(--accent); width: 100%; min-height: 44px; padding: var(--space-2) var(--space-3); border: 1px solid var(--input-border); border-radius: var(--radius-small); background: var(--background); color: var(--text); font-size: 16px; font-variant-numeric: tabular-nums; }
.habit-dialog-actions { display: flex; gap: var(--space-2); margin-top: var(--space-6); }
.habit-form-error { font-size: 13px; line-height: 1.6; }
/* Forms use the existing detail frame and backdrop, with a compact body. */
.entity-dialog.creation-dialog { width: min(560px, calc(100vw - 32px)); height: fit-content; max-height: calc(100dvh - 32px); margin: auto; padding: 0; overflow-y: auto; border: 1px solid var(--border); border-radius: 12px; }
.entity-dialog.creation-dialog[open] { display: block; }
.creation-dialog .creation-header { min-height: 56px; padding: 12px 16px; gap: 16px; border-bottom: 0; }
.creation-dialog .creation-header h2 { margin: 0; font-size: 16px; line-height: 1.4; font-weight: 500; }
.creation-header .entity-close { position: relative; }
.creation-header .entity-close::before { content: ''; position: absolute; inset: -4px; }
.creation-body { padding: 4px 16px 16px; }
.creation-field { display: grid; gap: 6px; min-width: 0; }
.creation-field + .creation-field { margin-top: 16px; }
.creation-dialog .creation-field > label { margin: 0; font-size: 14px; line-height: 1.5; }
.creation-dialog .optional-label { color: var(--text-secondary); }
.creation-dialog .creation-field :is(input, textarea):not([type="hidden"]):not(.numInput) { display: block; width: 100%; min-width: 0; min-height: 40px; margin: 0; padding: 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; font-size: 14px; line-height: 1.5; caret-color: var(--accent); font-variant-numeric: tabular-nums; }
.creation-dialog .creation-field textarea { resize: vertical; min-height: 80px; }
.creation-dialog .creation-field :is(input, textarea):not([type="hidden"]):not(.numInput)::placeholder { color: var(--text-secondary); opacity: 1; }
.creation-dialog :is(input, textarea):focus-visible { outline: 2px solid var(--focus); outline-offset: 0; }
.creation-dialog .creation-toggle { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 20px 0 0; min-height: 44px; font-size: 14px; cursor: pointer; }
.creation-hint { display: block; margin-top: 4px; color: var(--text-secondary); font-size: 13px; line-height: 1.5; }
.creation-dialog .creation-toggle input { appearance: none; flex: 0 0 32px; width: 32px; min-height: 20px; height: 20px; padding: 2px; margin: 0; border: 0; border-radius: 999px; background: var(--text-secondary); cursor: pointer; }
.creation-toggle input::before { content: ''; display: block; width: 16px; height: 16px; border-radius: 50%; background: #fff; }
.creation-toggle input:checked { background: var(--experiment); }
.creation-toggle input:checked::before { transform: translateX(12px); }
.creation-dialog .creation-toggle input:disabled { cursor: default; opacity: .5; }
.creation-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 8px 16px 16px; }
.creation-actions .action-button { min-height: 32px; padding: 5px 12px; border: 0; background: transparent; color: var(--text-secondary); font-size: 13px; line-height: 1.5; }
.creation-actions .action-button:hover:not(:disabled) { background: var(--surface-hover); color: var(--text); }
.creation-actions .action-button-primary { background: var(--text); color: var(--background); }
.creation-actions .action-button-primary:hover:not(:disabled) { background: var(--text); color: var(--background); opacity: .85; }
.date-picker-field { position: relative; min-width: 0; }
.creation-dialog .date-picker-field > .date-picker-input { padding-right: 44px; cursor: pointer; }
.date-picker-field > input[type='hidden'] { display: none; }
.date-picker-trigger { position: absolute; right: 2px; top: 0; width: 40px; height: 40px; }
.date-picker-trigger .icon { width: 16px; height: 16px; }
.date-picker-panel { position: fixed; inset: auto; margin: 0; width: min(296px, calc(100vw - 16px)); max-height: calc(100dvh - 16px); overflow-y: auto; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--background); color: var(--text); font: inherit; }
.date-picker-panel .flatpickr-calendar { width: 100%; margin: 0; padding: 0; background: transparent; color: var(--text); box-shadow: none; border: 0; }
.date-picker-panel .flatpickr-calendar::before, .date-picker-panel .flatpickr-calendar::after { content: none; }
.date-picker-panel .flatpickr-months .flatpickr-month { height: 36px; background: transparent; color: var(--text); fill: var(--text); }
.date-picker-panel .flatpickr-current-month { height: 36px; padding: 3px 0 0; font-size: 14px; }
.date-picker-panel .flatpickr-current-month .flatpickr-monthDropdown-months { height: 28px; padding: 2px 0; background: var(--background); color: var(--text); border-radius: 4px; font: inherit; font-weight: 500; }
.date-picker-panel .flatpickr-current-month input.cur-year { color: var(--text); font: inherit; font-weight: 500; }
.date-picker-panel .numInputWrapper:hover, .date-picker-panel .flatpickr-current-month .flatpickr-monthDropdown-months:hover { background: var(--surface-hover); }
.date-picker-panel .numInputWrapper span { border-color: var(--border); }
.date-picker-panel .numInputWrapper span.arrowUp::after { border-bottom-color: var(--text-secondary); }
.date-picker-panel .numInputWrapper span.arrowDown::after { border-top-color: var(--text-secondary); }
.date-picker-panel .flatpickr-months :is(.flatpickr-prev-month, .flatpickr-next-month) { top: 0; height: 32px; width: 28px; padding: 8px 6px; border-radius: 6px; color: var(--text-secondary); fill: currentColor; }
.date-picker-panel .flatpickr-months :is(.flatpickr-prev-month, .flatpickr-next-month):hover { background: var(--surface-hover); color: var(--text); }
.date-picker-panel .flatpickr-months :is(.flatpickr-prev-month, .flatpickr-next-month) svg { fill: currentColor; }
.date-picker-panel .flatpickr-weekdays { margin-top: 4px; height: 28px; background: transparent; }
.date-picker-panel span.flatpickr-weekday { color: var(--text-secondary); font-size: 12px; font-weight: 400; background: transparent; }
.date-picker-panel :is(.flatpickr-innerContainer, .flatpickr-rContainer, .flatpickr-days) { width: 100%; }
.date-picker-panel .dayContainer { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); width: 100%; min-width: 0; max-width: none; padding: 0; }
.date-picker-panel .flatpickr-day { width: 100%; max-width: none; height: 36px; line-height: 34px; margin: 0; color: var(--text); border: 1px solid transparent; border-radius: 6px; font-size: 13px; }
.date-picker-panel .flatpickr-day:is(.prevMonthDay, .nextMonthDay) { color: var(--text-secondary); opacity: .55; }
.date-picker-panel .flatpickr-day:is(:hover, :focus-visible) { background: var(--surface-hover); border-color: transparent; }
.date-picker-panel .flatpickr-day.today { border-color: var(--accent); }
.date-picker-panel .flatpickr-day.selected { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.date-picker-panel :is(button, [role='button'], select, input):focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.date-picker-actions { display: flex; justify-content: space-between; gap: 8px; border-top: 1px solid var(--border); margin-top: 8px; padding-top: 8px; }
.date-picker-actions button { min-height: 36px; padding: 4px 8px; background: transparent; border: 0; border-radius: 6px; color: var(--text-secondary); font: inherit; font-size: 13px; }
.date-picker-actions button:hover { background: var(--surface-hover); color: var(--text); }
@media (max-width: 760px) {
  .creation-dialog .creation-field :is(input, textarea):not([type="hidden"]):not(.numInput) { min-height: 44px; font-size: 16px; }
  .creation-header .entity-close { width: 44px; height: 44px; }
  .creation-header .entity-close::before { content: none; }
  .creation-actions .action-button { min-height: 44px; }
  .date-picker-trigger { height: 44px; width: 44px; }
  .date-picker-panel .flatpickr-day { height: 40px; line-height: 38px; }
  .date-picker-actions button { min-height: 44px; }
}
.proposal p:is(.proposal-habit-rule, .proposal-goal-rule) { margin-top: 6px; color: var(--text); font-size: 12px; }
.proposal-habit-link { display: inline-flex; align-items: center; color: var(--accent); margin: 0; padding: 0; min-height: 32px; font-size: 12px; }
@media (pointer: coarse) { .proposal-habit-link { min-height: 44px; } }
@container (max-width: 900px) { .habit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container (max-width: 600px) { .habit-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  .habits-view { padding: var(--space-5) var(--space-5) var(--space-8); }
  .habit-grid { grid-template-columns: minmax(0, 1fr); }
  .habits-heading h1 { font-size: 24px; }
  .habit-dialog { padding: var(--space-5); }
}
.habits-view:focus { outline: none; }

/* Compact catalogues disclose their detail and settings in a shared window. */
.catalog-toolbar { max-width: 1120px; margin: 0 auto 24px; display: flex; gap: 12px; align-items: center; }
.catalog-search { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 8px; padding: 0 12px; color: var(--text-secondary); }
.catalog-search .icon { width: 16px; height: 16px; }
.catalog-search input { min-width: 0; width: 100%; min-height: 40px; background: transparent; border: 0; outline: none; font: inherit; font-size: 14px; color: var(--text); caret-color: var(--accent); }
.catalog-search:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.catalog-filter { position: relative; width: 200px; flex: 0 0 200px; min-width: 0; max-width: 100%; }
.catalog-filter > select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; }
.filter-select-trigger { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--background); color: var(--text); font: inherit; font-size: 13px; text-align: left; }
.filter-select-trigger:is(:hover, [aria-expanded='true']) { background: var(--surface-hover); }
.filter-select-value { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filter-select-trigger > .icon { width: 16px; height: 16px; color: var(--text-secondary); }
.filter-select-menu { position: fixed; inset: auto; margin: 0; max-width: calc(100vw - 16px); max-height: min(320px, calc(100dvh - 16px)); overflow-y: auto; padding: 4px; border: 1px solid var(--border); border-radius: 12px; background: var(--background); color: var(--text); }
.filter-select-option { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 36px; padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--text); font: inherit; font-size: 13px; line-height: 1.5; text-align: left; }
.filter-select-option > span { min-width: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.filter-select-option > .icon { width: 14px; height: 14px; color: var(--accent); opacity: 0; }
.filter-select-option[aria-selected='true'] > .icon { opacity: 1; }
.filter-select-option:is(:hover, :focus-visible, [aria-selected='true']) { background: var(--surface-hover); }
.filter-select-option:disabled { color: var(--text-secondary); }
.filter-select-trigger:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.filter-select-option:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.catalog-no-results { font-size: 14px; color: var(--text-secondary); max-width: 1120px; margin: 32px auto; }
.menu-anchor { flex-shrink: 0; }
.compact-menu-trigger { width: 32px; height: 32px; position: relative; }
.compact-menu-trigger::before { content: ''; position: absolute; inset: -6px; }
.compact-menu-trigger .icon { width: 16px; height: 16px; }
.compact-menu { position: fixed; inset: auto; margin: 0; padding: 4px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); width: max-content; max-width: calc(100vw - 16px); }
.compact-menu button { display: block; width: 100%; min-height: 40px; padding: 8px 12px; border: 0; border-radius: 4px; background: transparent; font: inherit; font-size: 13px; text-align: left; }
.compact-menu button:hover { background: var(--surface-hover); }
.compact-menu button:has(> .icon) { display: flex; align-items: center; gap: 10px; }
.compact-menu button > .icon { width: 16px; height: 16px; flex-shrink: 0; }
.entity-dialog { width: min(1180px, calc(100vw - 64px)); height: min(700px, calc(100dvh - 96px)); max-width: none; max-height: none; padding: 0; border: 1px solid var(--border); border-radius: 12px; background: var(--background); color: var(--text); overflow: hidden; }
.entity-dialog[open] { display: flex; flex-direction: column; }
.entity-dialog::backdrop { background: rgb(0 0 0 / 55%); backdrop-filter: blur(4px); }
.entity-frame { display: flex; flex-direction: column; flex: 1; min-height: 0; min-width: 0; }
.entity-header { flex-shrink: 0; display: flex; justify-content: space-between; gap: 16px; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--border); }
.entity-name { min-width: 0; display: flex; align-items: center; gap: 12px; }
.entity-name > .icon { width: 20px; height: 20px; }
.entity-name h2 { font-size: 16px; font-weight: 500; margin: 0; line-height: 1.4; overflow-wrap: anywhere; }
.entity-actions { flex-shrink: 0; display: flex; align-items: center; gap: 8px; }
.entity-actions .action-button { min-height: 32px; padding: 5px 12px; font-size: 13px; background: var(--text); color: var(--background); border: 0; }
.entity-close { width: 32px; height: 32px; }
.entity-close .icon { width: 16px; height: 16px; }
.entity-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); flex: 1; min-height: 0; }
.entity-aside { padding: 24px; border-right: 1px solid var(--border); overflow-y: auto; }
.entity-aside h3 { font-size: 12px; color: var(--text-secondary); font-weight: 500; margin: 0 0 8px; }
.entity-aside h3:not(:first-child) { margin-top: 24px; }
.entity-aside p { font-size: 13px; line-height: 1.6; margin: 0 0 12px; overflow-wrap: anywhere; }
.entity-aside .experiment-label { margin-bottom: 20px; }
.entity-content { min-width: 0; overflow-y: auto; padding: 28px 32px; font-size: 14px; }
.entity-content h3 { font-size: 16px; font-weight: 500; margin: 28px 0 8px; }
.entity-content p { overflow-wrap: anywhere; }
.entity-description { max-width: 65ch; margin: 0 0 28px; white-space: pre-wrap; }
.entity-muted { color: var(--text-secondary); font-size: 13px; }
.entity-related { display: block; width: 100%; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 13px; text-align: left; padding: 8px 0; overflow-wrap: anywhere; }
.entity-related:hover { text-decoration: underline; text-underline-offset: 3px; }
.habit-detail-summary { display: flex; flex-wrap: wrap; gap: 32px; }
.habit-detail-summary > div { display: flex; flex-direction: column; gap: 4px; }
.habit-detail-summary strong { font-size: 22px; line-height: 1.3; font-weight: 500; font-variant-numeric: tabular-nums; }
.entity-content .habit-days { gap: 8px; margin: 24px 0; }
.entity-content .habit-day { width: 36px; height: 36px; font-size: 12px; }
.entity-content .habit-day:not(:disabled)::before { inset: -4px; }
.habit-detail-result { color: var(--text-secondary); }
@media (max-width: 760px) {
  .catalog-toolbar { flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
  .catalog-search { flex-basis: 100%; }
  .catalog-filter { margin-left: auto; }
  .filter-select-trigger, .catalog-search input { height: 44px; }
  .filter-select-option { min-height: 44px; }
  .habit-card { padding: 12px 16px; }
  .habit-card-footer .action-button { min-height: 44px; }
  .habit-day { width: 28px; height: 28px; }
  .new-conversation { min-height: 44px; }
  .conversation-item { min-height: 44px; }
  .entity-dialog { width: 100%; height: 100dvh; margin: 0; border: 0; border-radius: 0; }
  .entity-header { padding: 12px 16px; flex-wrap: wrap; gap: 8px; }
  .entity-name { flex: 1 1 100%; }
  .entity-actions { width: 100%; justify-content: end; }
  .entity-actions .action-button { margin-right: auto; min-height: 44px; }
  .entity-close { width: 44px; height: 44px; }
  .entity-layout { display: block; overflow-y: auto; }
  .entity-aside { border-right: 0; border-bottom: 1px solid var(--border); padding: 20px; overflow: visible; }
  .entity-content { padding: 24px 20px; overflow: visible; }
  .habit-detail-summary { gap: 24px; }
}

.habit-dialog input:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }

/* Message feedback inherits the same compact frame and backdrop as entity details. */
.feedback-control { display: flex; align-items: center; gap: var(--space-1); }

.feedback-trigger::before { content: none; }
.feedback-trigger .icon { width: 20px; height: 20px; }
.feedback-trigger.has-feedback { color: var(--accent); }
.feedback-menu { min-width: 196px; }
.feedback-menu button { display: flex; align-items: center; gap: var(--space-2); }
.feedback-menu button .icon { width: 16px; height: 16px; flex-shrink: 0; }
.feedback-menu button[aria-pressed="true"] { color: var(--accent); }
.feedback-error { max-width: 88px; font-size: 11px; line-height: 1.4; color: var(--error); }
.entity-dialog.feedback-dialog { width: min(576px, calc(100vw - 32px)); height: fit-content; max-height: calc(100dvh - 32px); margin: auto; overflow-y: auto; border: 1px solid var(--border); border-radius: 12px; }
.feedback-dialog[open] { display: block; }
.feedback-header { min-height: 64px; padding: 16px 20px; border-bottom: 0; }
.feedback-header h2 { margin: 0; font-size: 16px; font-weight: 500; line-height: 1.5; }
.feedback-body { padding: 4px 20px 0; }
.feedback-reasons { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; padding: 0; border: 0; min-width: 0; }
.feedback-reason { min-height: 36px; padding: 7px 12px; border: 1px solid var(--border); border-radius: 999px; background: transparent; color: var(--text); font: inherit; font-size: 13px; line-height: 1.5; text-align: left; }
.feedback-reason:hover { background: var(--surface-hover); }
.feedback-reason[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); background: var(--surface-hover); }
.feedback-comment { display: block; width: 100%; min-height: 88px; max-height: 240px; padding: 10px 12px; resize: vertical; border: 1px solid var(--input-border); border-radius: 8px; background: transparent; color: var(--text); caret-color: var(--accent); font: inherit; font-size: 14px; line-height: 1.5; }
.feedback-comment::placeholder { color: var(--text-secondary); opacity: 1; }
.feedback-note { margin: 16px 0 0; padding: 10px 12px; border-radius: 8px; color: var(--text-secondary); background: var(--user-surface); font-size: 12px; line-height: 1.6; }
.feedback-actions .action-button { min-height: 36px; padding: 6px 14px; border: 0; background: var(--text); color: var(--background); font-size: 13px; }
.feedback-actions { display: flex; justify-content: flex-end; padding: 16px 20px 20px; }
.feedback-dialog :is(.feedback-reason, .feedback-comment):focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.feedback-dialog button:disabled { cursor: default; opacity: .5; }
@media (max-width: 760px) {
  .feedback-trigger { width: 44px; height: 44px; }
  .feedback-header { padding: 12px 16px; }
  .feedback-body { padding: 4px 16px 0; }
  .feedback-reason { min-height: 44px; }
  .feedback-comment { font-size: 16px; }
  .feedback-actions { padding: 16px; }
  .feedback-actions .action-button { min-height: 44px; }
}

/* Catalogue and goal detail share the same reading column. */
.goals-view { flex: 1; min-height: 0; overflow-y: auto; overflow-x: clip; scrollbar-gutter: stable; padding: 32px; container-type: inline-size; }
.goals-view:focus { outline: none; }
.goals-catalog { max-width: 900px; margin-inline: auto; }
.goal-catalog-heading { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-6); }
.goal-catalog-heading h1 { margin: 0; font-size: 28px; font-weight: 500; line-height: 1.3; letter-spacing: -.02em; }
.goal-catalog-heading .catalog-heading-actions { align-items: center; gap: var(--space-2); }
.goal-catalog-heading .action-button { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 36px; padding: 6px 14px; font-size: 13px; background: var(--text); color: var(--background); border: 0; }
.goal-catalog-heading .action-button:hover:not(:disabled) { opacity: .85; }
.goal-catalog-heading .action-button .icon { width: 16px; height: 16px; }
.goals-catalog .catalog-toolbar { margin-bottom: var(--space-8); }
.goals-catalog .catalog-filter { width: 180px; flex-basis: 180px; }
.goals-catalog .filter-select-trigger { border-radius: var(--radius-small); background: transparent; }
.goals-catalog .filter-select-trigger:is(:hover, [aria-expanded='true']) { background: var(--surface-hover); }
.catalog-heading-actions { display: flex; gap: 4px; }
.catalog-group-heading { font-size: 13px; font-weight: 400; color: var(--text-secondary); margin: 24px 0 12px; }
.goal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
.goal-card { min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); overflow-wrap: anywhere; transition: border-color var(--duration-fast) ease; }
.goal-item { display: flex; flex-direction: column; justify-content: space-between; gap: var(--space-4); width: 100%; height: 100%; min-height: 128px; padding: var(--space-5); border: 0; border-radius: inherit; background: transparent; color: var(--text); text-align: left; font: inherit; font-size: 15px; line-height: 1.5; transition: background var(--duration-fast) ease; }
.goal-item:hover { background: var(--surface-hover); }
.goal-card:has(.goal-item:is(:hover, :focus-visible)) { border-color: var(--accent); }
.goal-item-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-weight: 500; }
.goal-card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); font-size: 12px; color: var(--text-secondary); }
.goal-card-status, .goal-card-date { display: inline-flex; align-items: center; gap: 6px; }
.goal-card-meta .icon { width: 14px; height: 14px; }
.goal-card[data-status='achieved'] .goal-card-status { color: var(--accent); }
.goal-card-date time { font-variant-numeric: tabular-nums; }
.goal-focus-label { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--accent); }
.goal-focus-label .icon { width: 14px; height: 14px; }
.goal-card[data-focused='true'] .goal-item-title { color: var(--accent); }
/* A goal is a full page within the shell, never a modal layer. */
.goal-workspace { max-width: 900px; margin-inline: auto; container-type: inline-size; }
.goal-workspace .compact-menu-trigger::before { inset: 0; }
.goal-back { color: inherit; background: transparent; border: 0; padding: 0; min-height: 44px; font: inherit; }
.goal-back:hover { color: var(--text); }
.goal-page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.goal-page-heading h1 { margin: 0; font-size: 28px; font-weight: 500; line-height: 1.3; letter-spacing: -.02em; overflow-wrap: anywhere; min-width: 0; }
.goal-page-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.goal-page-actions .action-button { min-height: 36px; padding: 6px 14px; font-size: 13px; background: var(--text); color: var(--background); border: 0; }
#goal-properties { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 16px; margin: 16px 0 32px; font-size: 13px; }
#goal-properties p { margin: 0; } #goal-properties #goal-focus-note { flex-basis: 100%; }
.goal-conversations { margin-top: 32px; border-top: 1px solid var(--border); }
.goal-conversations > summary { display: flex; align-items: center; gap: 12px; min-height: 64px; padding-block: 12px; cursor: pointer; list-style: none; }
.goal-conversations > summary::-webkit-details-marker { display: none; }
.goal-conversations > summary .icon { width: 16px; height: 16px; margin-left: auto; color: var(--text-secondary); }
.goal-conversations > summary[data-motion] .icon { transition: transform var(--duration-disclosure) var(--ease-disclosure); }
.goal-conversations[data-expanded='true'] > summary .icon { transform: rotate(180deg); }
#goal-chats-count { color: var(--text-secondary); font-size: 13px; }
.goal-conversations > summary:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.goal-chat-actions { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 20px; padding: 8px 0; }
.goal-chat-actions .text-button { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; font-size: 13px; }
.goal-chat-actions .icon { width: 16px; height: 16px; }
#goal-chats-status:empty { display: none; }
.goal-conversations h2 { font-size: 15px; font-weight: 500; margin: 0; }
.goal-conversation { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; border: 0; border-radius: var(--radius-small); min-height: 56px; background: transparent; font: inherit; font-size: 14px; text-align: left; color: var(--text); transition: background var(--duration-fast) ease; }
.goal-conversation-name { flex: 1; min-width: 0; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.goal-conversation > .icon { flex-shrink: 0; width: 18px; height: 18px; color: var(--text-secondary); }
.goal-conversation > .icon:last-child { width: 16px; height: 16px; }
.goal-conversation:hover { background: var(--surface-hover); }
.goal-state { display: inline-block; font-size: 13px; color: var(--text-secondary); margin-bottom: 8px; }
#goal-focus[aria-pressed='true'] { color: var(--accent); }
#goal-focus-note { margin-top: 24px; }
.goal-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 12px; }
.goal-section-heading h3 { font-size: 15px; font-weight: 500; margin: 0; }
.goal-habits { margin-top: 32px; }
#goal-habit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.goal-link-option { display: flex !important; align-items: start; gap: 12px; min-height: 44px; cursor: pointer; padding-block: 8px; }
.goal-link-option input { width: 20px; height: 20px; min-height: 20px; flex-shrink: 0; margin-top: 3px; accent-color: var(--accent); }
#goal-link-close { margin-top: 20px; }
#goals-error, #goal-detail-error { font-size: 13px; }
.chat-goal-context { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--accent); margin-bottom: 8px; padding-left: 16px; }
.goal-create-recovery { margin: 0 auto 20px; padding: 16px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; }
.goal-create-recovery p { color: var(--text-secondary); line-height: 1.6; margin: 0 0 12px; }
.goal-create-recovery > div { display: flex; flex-wrap: wrap; gap: 12px; }
@container (max-width: 600px) { .goal-grid { grid-template-columns: minmax(0, 1fr); } #goal-habit-grid { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .goal-card, .goal-item { transition: none; } }
@media (max-width: 760px) {
  .goals-view { padding: 20px; }
  .goal-catalog-heading h1 { font-size: 24px; }
  .goal-catalog-heading .action-button { min-height: 44px; padding-inline: 12px; }
  .goals-catalog .catalog-toolbar { margin-bottom: var(--space-6); }
  .goal-item { padding: var(--space-4); min-height: 116px; }
  .goal-page-heading { flex-wrap: wrap; gap: 16px; }
  .goal-page-heading h1 { font-size: 24px; flex-basis: 100%; }
  .goal-page-actions .action-button { min-height: 44px; }
  #goal-properties { margin-bottom: 24px; }
}

/* Auth extends the existing palette and form controls. */
.auth-view { min-height: 100dvh; display: grid; place-items: center; padding: var(--space-8) var(--space-6); }
.auth-content { width: min(100%, 420px); }
.auth-content > .wordmark { display: inline-block; margin-bottom: var(--space-8); }
.auth-content h1 { font-family: var(--font-display); font-size: clamp(36px, 6vw, 48px); font-weight: 500; line-height: 1.1; letter-spacing: -.025em; margin: 0 0 var(--space-4); }
.auth-intro { color: var(--text-secondary); margin: 0 0 var(--space-8); line-height: 1.6; }
.auth-providers { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.auth-provider { flex: 1; min-width: 140px; }
.auth-divider { display: flex; align-items: center; gap: var(--space-4); margin: var(--space-6) 0; color: var(--text-secondary); font-size: 13px; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.auth-email-form label { display: block; margin: var(--space-4) 0 var(--space-2); font-size: 14px; }
.auth-email-form input { width: 100%; min-height: 48px; padding: var(--space-3); border: 1px solid var(--input-border); border-radius: var(--radius-small); background: var(--surface); color: var(--text); font: inherit; caret-color: var(--accent); }
.auth-email-form input:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.auth-email-form input:disabled { opacity: .55; }
.auth-email-form > .action-button { width: 100%; margin-top: var(--space-4); }
.auth-hint { color: var(--text-secondary); font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.auth-code-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-3); }
.entity-dialog.account-dialog { width: min(440px, calc(100vw - 32px)); }
.account-dialog::backdrop, .feedback-dialog::backdrop { background: rgb(0 0 0 / 38%); backdrop-filter: blur(3px); }
.account-body > .auth-hint { margin: 0 0 20px; }
.account-dialog .auth-providers { gap: 8px; }
.account-dialog .auth-provider { min-height: 40px; padding: 8px 12px; font-size: 14px; }
.account-dialog #account-email-section { margin-top: 24px; }
.account-dialog h3 { margin: 0 0 12px; font-size: 14px; line-height: 1.5; font-weight: 500; }
.account-dialog .auth-email-form > .auth-hint { margin: 8px 0 16px; }
.account-dialog .auth-email-form > .action-button-primary { min-height: 36px; padding: 8px 12px; border: 0; background: var(--text); color: var(--background); font-size: 13px; }
.account-dialog .auth-email-form > .action-button-primary:hover:not(:disabled) { opacity: .85; }
.account-dialog .auth-code-actions:has(> button:not([hidden])) { margin-top: 12px; }
.account-dialog .auth-code-actions:not(:has(> button:not([hidden]))) { display: none; }
.account-actions { display: flex; justify-content: flex-end; padding: 12px 16px; border-top: 1px solid var(--border); }
.account-actions .action-button { min-height: 36px; padding: 6px 12px; border: 0; background: transparent; color: var(--text-secondary); font-size: 13px; }
.account-actions .action-button:hover:not(:disabled) { background: var(--surface-hover); color: var(--text); }
@media (max-width: 760px) {
  .account-dialog .auth-provider, .account-dialog .auth-email-form > .action-button, .account-actions .action-button { min-height: 44px; }
}
#account-name { display: block; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@property --task-reveal-edge { syntax: '<length>'; inherits: false; initial-value: 0px; }

/* Skills-style task summaries: independent record control and disclosure. */
.task-list { display: flex; flex-direction: column; list-style: none; margin: 0; padding: 0; }
.task-row { display: flex; flex-shrink: 0; align-items: center; gap: 12px; min-width: 0; min-height: 56px; padding: 8px 4px; border-bottom: 1px solid var(--border); }
.task-body { min-width: 0; flex: 1; }
.task-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; width: 100%; min-height: 36px; padding: 4px 0; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 14px; line-height: 1.5; text-align: left; overflow-wrap: anywhere; }
.task-title:hover { text-decoration: underline; text-underline-offset: 3px; }
.task-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; font-size: 12px; color: var(--text-secondary); flex-shrink: 0; }
.task-meta .icon { width: 14px; height: 14px; }
.task-meta .task-compact-mark { font-size: 0; gap: 0; }
.task-focus-label { color: var(--accent); }
.task-due { flex-shrink: 0; font-size: 12px; color: var(--text-secondary); white-space: nowrap; }
.task-row[data-focused='true'] .task-title { color: var(--accent); }
.task-row[data-status='done'] .task-title { color: var(--text-secondary); text-decoration: line-through; }
.task-featured { display: flex; align-items: center; min-height: 80px; position: relative; isolation: isolate; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--surface); padding: 12px 16px; transition: border-color var(--duration-fast) ease; }
.task-featured[data-experiment='true'] { --accent: var(--experiment); --focus: var(--experiment); }
.task-featured .card-glow { width: 72%; height: 180%; right: -14%; bottom: -70%; background: radial-gradient(ellipse at 65% 50%, color-mix(in srgb, var(--card-glow-color, var(--accent)) var(--card-glow-strength, 24%), transparent), transparent 68%); filter: none; opacity: .75; }

.task-featured > :not(.card-glow) { position: relative; z-index: 1; }
.task-featured .task-title { font-size: 16px; font-weight: 500; line-height: 1.5; }
.task-featured .task-meta { margin: 0; color: var(--accent); }
.task-featured .task-due { margin: 0; color: var(--accent); }
.task-featured .task-check { min-height: 44px; }
.task-featured .task-check input { width: 28px; height: 28px; border-color: var(--accent); }
.task-featured .task-check-glyph { width: 20px; height: 20px; }
.task-featured .task-check input:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.task-featured .compact-menu-trigger:hover { color: var(--accent); }
@media (hover: hover) and (pointer: fine) {
  .task-featured:hover { border-color: color-mix(in srgb, var(--accent) 38%, var(--border)); }
  .task-featured:hover .card-glow { opacity: .85; }
  .task-row:not(.task-featured):hover { background: var(--surface-hover); }
  .task-row > .menu-anchor > .compact-menu-trigger { opacity: 0; }
  .task-row:is(:hover, :focus-within) > .menu-anchor > .compact-menu-trigger { opacity: 1; }
}
.task-check { display: grid; place-items: center; flex: 0 0 32px; min-height: 44px; cursor: pointer; }
.task-check input { appearance: none; position: relative; width: 24px; height: 24px; margin: 0; border: 1px solid var(--text-secondary); border-radius: 6px; background: transparent; cursor: pointer; }
.task-check input:checked { border-color: var(--accent); }
.task-check-glyph { position: relative; z-index: 2; grid-area: 1 / 1; width: 18px; height: 18px; fill: none; stroke: var(--on-accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.task-check-glyph path { stroke-dasharray: 1; stroke-dashoffset: 1; opacity: 0; }
.task-check input { grid-area: 1 / 1; }
.task-check-fill { position: relative; z-index: 1; grid-area: 1 / 1; width: 24px; height: 24px; border-radius: 6px; background: var(--accent); opacity: 0; transform: scale(.7); pointer-events: none; }
.task-featured .task-check-fill { width: 28px; height: 28px; }
.task-check input:checked ~ .task-check-fill { opacity: 1; transform: scale(1); }
.task-check[data-motion] .task-check-fill { transition: transform 180ms var(--ease-out), opacity 120ms ease; }
.task-check input:checked ~ .task-check-glyph path { stroke-dashoffset: 0; opacity: 1; }
.task-check[data-motion] .task-check-glyph path { transition: stroke-dashoffset 200ms var(--ease-out) 40ms, opacity 80ms ease 40ms; }
.task-check input { transition: background var(--duration-fast) ease, border-color var(--duration-fast) ease; }
.task-row[data-completing='true'] .task-check { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .task-check[data-motion] .task-check-glyph path { transition: opacity 120ms ease; }
  .task-check-fill { transform: none; }
  .task-check[data-motion] .task-check-fill { transition: opacity 120ms ease; }
}
.task-check input:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.task-check:has(input:disabled) { cursor: default; }
.task-paging { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.task-paging .icon-button { width: 32px; height: 32px; }
.task-paging .icon { width: 16px; height: 16px; }
.task-paging .text-button { font-size: 13px; text-decoration: none; min-height: 36px; }
.task-disclosure { display: inline-flex; align-items: center; gap: 6px; }
.task-disclosure[data-motion] .icon { transition: transform var(--duration-fast) var(--ease-out); }
.task-disclosure[aria-expanded='true'] .icon { transform: rotate(180deg); }

.task-done { margin-top: 16px; }
.task-disclosure .icon { width: 16px; height: 16px; }
.task-done .task-disclosure { min-height: 44px; padding: 12px 0; font-size: 13px; text-decoration: none; }
#tasks-error[hidden] + #tasks-retry { display: none; }
.task-detail-dialog { width: min(760px, calc(100vw - 64px)); height: min(460px, calc(100dvh - 96px)); }
.task-detail-dialog .entity-layout { grid-template-columns: 180px minmax(0, 1fr); }
.morphing-entity-dialog[data-morph]::backdrop { opacity: 0; transition: opacity 250ms var(--ease-out); }
.morphing-entity-dialog[data-morph-visible]::backdrop { opacity: 1; }
.morphing-entity-dialog:is([data-morph='opening'], [data-morph='closing']) { background: transparent; border-color: transparent; overflow: visible; }
.morphing-entity-dialog[data-morph] > :not(.dialog-morph-surface) { position: relative; z-index: 1; }
.dialog-morph-surface { position: fixed; z-index: 0; pointer-events: none; background: var(--background); }
.dialog-morph-rim, .dialog-morph-fill { position: absolute; inset: 0; pointer-events: none; }
.dialog-morph-rim { background: var(--border); }
.dialog-morph-fill { background: var(--background); }

@media (max-width: 760px) {
  .task-detail-dialog { width: 100%; height: 100dvh; }
  .task-detail-dialog .entity-layout { display: block; }
  .task-paging .icon-button { width: 44px; height: 44px; }
  .task-check { flex-basis: 32px; }
  .task-title { min-height: 44px; }
  .task-row { gap: 8px; }
  .task-featured { min-height: 88px; padding: 12px; }
  .task-row:not(.task-featured) .task-meta { gap: 4px; }
  .task-row .compact-menu-trigger { width: 32px; height: 44px; }
  .task-paging .text-button { min-height: 44px; }
}

/* Experiments share ordinary progress and completion controls. */
.experiment-label { display: inline-flex; align-items: center; gap: var(--space-1); color: var(--experiment); font-size: 12px; line-height: 1.6; }
.experiment-label .icon { width: 16px; height: 16px; }
.habit-card > .experiment-label { margin-bottom: var(--space-2); }
.habit-deadline { display: block; margin-top: var(--space-2); font-size: 12px; color: var(--text-secondary); }
.habit-experiment-settings { align-self: center; margin-top: var(--space-2); color: var(--text-secondary); white-space: normal; }
.task-row[data-experiment='true'][data-status='active']:not([data-focused='true']) .task-title { color: var(--experiment); }
.experiment-toggle { display: flex !important; align-items: center; gap: var(--space-3); min-height: 44px; cursor: pointer; }
.habit-dialog .experiment-toggle input { width: 20px; min-height: 20px; height: 20px; margin: 0; padding: 0; flex-shrink: 0; accent-color: var(--experiment); }
.habit-dialog .experiment-toggle input:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
.proposal-body > .experiment-label { margin-top: var(--space-2); }

.dashboard-view { flex: 1; min-height: 0; overflow: auto; padding: var(--space-6) var(--space-8) var(--space-12); container-type: inline-size; }
.dashboard-view:focus { outline: none; }
.dashboard-content { max-width: 900px; margin-inline: auto; container-type: inline-size; }
.dashboard-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: var(--space-4); margin-bottom: var(--space-6); }
.dashboard-heading h1 { font-size: 32px; line-height: 1.25; font-weight: 500; letter-spacing: -.02em; margin: 0 0 var(--space-2); }
.dashboard-heading p { margin: 0; color: var(--text-secondary); font-size: 14px; }
.dashboard-heading-actions { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2); }
.dashboard-grid { --cell: calc((100cqw - 48px) / 4); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: minmax(var(--cell), auto); gap: var(--space-4); align-items: stretch; }
.dashboard-widget { min-width: 0; display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius-card); padding: var(--space-4); background: var(--surface); }
.dashboard-widget[data-size='wide'], .dashboard-widget[data-size='large'] { grid-column: span 2; }
.dashboard-widget[data-size='large'] { grid-row: span 2; }
.widget-heading { display: flex; align-items: center; gap: var(--space-1); margin-bottom: var(--space-2); min-width: 0; }
.widget-heading h2 { font-size: 13px; line-height: 1.4; color: var(--text-secondary); font-weight: 500; margin: 0; flex: 1; overflow-wrap: anywhere; }
.widget-heading > .widget-pin { width: 14px; height: 14px; color: var(--text-secondary); }
.widget-menu-trigger { padding: 0; background: transparent; color: var(--text-secondary); border: 0; display: grid; place-items: center; width: 32px; min-height: 36px; flex-shrink: 0; border-radius: var(--radius-small); cursor: pointer; }
.widget-menu-trigger:hover { background: var(--surface-hover); color: var(--text); }
.widget-menu-trigger .icon { width: 20px; height: 20px; }
.dashboard-widget-body { display: flex; flex-direction: column; gap: var(--space-2); flex: 1; min-width: 0; overflow: visible; }
.dashboard-muted { font-size: 12px; color: var(--text-secondary); line-height: 1.5; margin: 0; overflow-wrap: anywhere; }
.widget-source-name, .widget-goal-name, .widget-experiment-source { padding: 0; background: transparent; border: 0; font: inherit; text-align: left; overflow-wrap: anywhere; cursor: pointer; }
.widget-source-name { font-size: 16px; line-height: 1.35; font-weight: 500; }
.widget-source-name:hover, .widget-goal-name:hover, .widget-experiment-source:hover { text-decoration: underline; text-underline-offset: 3px; }
.widget-metric { font-size: 36px; font-weight: 500; line-height: 1.15; margin: auto 0 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.widget-unit { font-size: 13px; line-height: 1.4; font-weight: 400; color: var(--text-secondary); }
.widget-record { border: 0; background: var(--accent); color: var(--on-accent); padding: 8px 12px; min-height: 40px; border-radius: var(--radius-small); font-size: 13px; cursor: pointer; width: fit-content; max-width: 100%; }
.widget-record:active { opacity: .8; }
.widget-link { border: 0; background: transparent; color: var(--accent); font-size: 13px; padding: 0; margin-top: auto; min-height: 32px; text-align: left; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; overflow-wrap: anywhere; }
.widget-goal-name { font-size: 26px; line-height: 1.2; font-weight: 500; letter-spacing: -.02em; }
.widget-goal-state { color: var(--accent); font-size: 12px; margin: 0 0 auto; }
.widget-tasks { display: flex; flex-direction: column; gap: var(--space-3); }
.widget-task { display: flex; gap: var(--space-3); align-items: flex-start; cursor: pointer; min-height: 44px; }
.widget-task input { flex-shrink: 0; width: 20px; height: 20px; margin-top: 2px; accent-color: var(--accent); }
.widget-task-text { min-width: 0; display: flex; flex-direction: column; gap: var(--space-1); }
.widget-task-name { font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.widget-experiment-meaning { font-size: 22px; line-height: 1.3; font-weight: 500; margin: 0; overflow-wrap: anywhere; }
.widget-experiment-source { color: var(--text-secondary); font-size: 13px; line-height: 1.4; }
.dashboard-widget[data-kind='experiment'] .widget-heading h2, .widget-review-date { color: var(--experiment); }
.widget-review-date { font-size: 13px; margin: auto 0 0; }
.widget-empty-text { font-size: 16px; line-height: 1.45; margin: auto 0; overflow-wrap: anywhere; }
.widget-chart-caption { font-size: 13px; color: var(--text-secondary); line-height: 1.3; margin: 0; overflow-wrap: anywhere; }
.widget-chart-summary { display: flex; align-items: baseline; gap: var(--space-2); }
.widget-chart-total { margin: 0; font-size: 24px; line-height: 1.2; font-weight: 500; font-variant-numeric: tabular-nums; }
.widget-bars { position: relative; height: 112px; flex-shrink: 0; margin-top: var(--space-4); }
.widget-bars-columns { display: flex; align-items: end; gap: 5px; height: 100%; position: relative; }
.widget-bar { height: 100%; flex: 1; min-width: 0; background: transparent; border: 0; padding: 0; display: flex; align-items: end; position: relative; cursor: pointer; }
.widget-bar-fill { display: block; width: 100%; min-height: 3px; border-radius: 4px 4px 0 0; background: var(--accent); }
.widget-bar[data-state='unknown'] .widget-bar-fill { background: transparent; border-bottom: 1px dashed var(--text-secondary); border-radius: 0; }
.widget-bar[data-state='zero'] .widget-bar-fill { height: 2px !important; background: var(--text-secondary); border-radius: 0; }
.widget-bar:hover .widget-bar-fill, .widget-bar:focus-visible .widget-bar-fill { opacity: .65; }
.widget-chart-plan { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--text-secondary); pointer-events: none; z-index: 1; }
.widget-chart-plan span { position: absolute; right: 0; bottom: 3px; background: var(--surface); padding-left: 4px; font-size: 11px; color: var(--text-secondary); }
.widget-chart-max { position: absolute; left: 0; top: -19px; color: var(--text-secondary); font-size: 11px; }
.widget-chart-range { display: flex; justify-content: space-between; color: var(--text-secondary); font-size: 11px; }
.widget-chart-output { font-size: 12px; color: var(--text-secondary); min-height: 18px; overflow-wrap: anywhere; }
.widget-menu { position: fixed; margin: 0; width: 220px; padding: var(--space-2); border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--surface); color: var(--text); }
.widget-menu-action { display: block; border: 0; background: transparent; color: inherit; font: inherit; font-size: 14px; padding: 8px; text-align: left; width: 100%; min-height: 40px; border-radius: var(--radius-small); cursor: pointer; }
.widget-menu-action:hover { background: var(--surface-hover); }
.widget-menu-remove { color: var(--error); }
.widget-catalog { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); padding-bottom: var(--space-6); }
.widget-catalog-item { padding: var(--space-3); font: inherit; font-size: 14px; min-height: 48px; text-align: left; border: 1px solid var(--border); border-radius: var(--radius-small); background: var(--surface); color: var(--text); cursor: pointer; }
.widget-catalog-item:hover { background: var(--surface-hover); }
.widget-editor-form { display: flex; flex-direction: column; gap: var(--space-4); }
.widget-editor-field { display: flex; flex-direction: column; gap: var(--space-1); font-size: 14px; }
.widget-editor select, .widget-editor textarea { width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--input-border); border-radius: var(--radius-small); color: var(--text); background: var(--surface); font: inherit; }
.widget-editor textarea { min-height: 96px; resize: vertical; }
.widget-editor-actions { display: flex; justify-content: flex-end; gap: var(--space-2); }
.dashboard-empty { max-width: 560px; padding-block: var(--space-8); }
.dashboard-empty h2 { font-size: 22px; font-weight: 500; margin: 0 0 var(--space-3); }
.dashboard-empty p { color: var(--text-secondary); line-height: 1.7; margin: 0 0 var(--space-5); }
#dashboard-error[hidden] + #dashboard-retry { display: none; }
.dashboard-proposal-changes { padding-left: var(--space-5); font-size: 13px; overflow-wrap: anywhere; }
@media (max-width: 1100px) {
  .dashboard-grid { --cell: calc((100cqw - 16px) / 2); grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .widget-catalog { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .dashboard-view { padding: var(--space-4); }
  .dashboard-heading { margin-bottom: var(--space-4); }
  .dashboard-heading h1 { font-size: 28px; }
  .dashboard-heading-actions { width: 100%; }
  .dashboard-heading-actions .action-button { font-size: 12px; padding: 8px; }
  .dashboard-grid { --cell: calc((100cqw - 12px) / 2); gap: 12px; }
  .dashboard-widget { padding: 14px; }
  .dashboard-widget[data-size='small'] .widget-heading { margin-bottom: 2px; }
  .dashboard-widget[data-size='small'] .dashboard-widget-body { gap: 4px; }
  .dashboard-widget[data-size='small'] .widget-source-name { font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .dashboard-widget[data-size='small'] .widget-metric { font-size: 28px; }
  .dashboard-widget[data-size='small'] .widget-heading h2 { font-size: 12px; }
  .widget-goal-name { font-size: 24px; }
  .widget-menu-trigger { width: 28px; min-height: 32px; }
  .widget-catalog { grid-template-columns: 1fr 1fr; }
}
.dashboard-proposal-changes li + li { margin-top: var(--space-3); }
.dashboard-proposal-changes strong { font-weight: 500; }
.dashboard-proposal-changes li > span { display: block; color: var(--text-secondary); line-height: 1.6; margin-top: var(--space-1); }
.dashboard-preview-status { font-size: 13px; color: var(--text-secondary); }
.dashboard-preview-status[role='alert'] { color: var(--error); }

/* Overview charts reserve detail for the habit page. */
.dashboard-widget[data-kind='habit_chart'] .dashboard-widget-body { gap: 6px; }
.dashboard-widget[data-kind='habit_chart'][data-size='wide'] .widget-bars { height: 88px; }
.dashboard-widget[data-kind='habit_chart'][data-size='large'] .widget-bars { flex: 1; min-height: 120px; }
.widget-heading > .icon:not(.widget-pin) { width: 16px; height: 16px; color: var(--experiment); }
.widget-menu-trigger { position: relative; }
.widget-menu-trigger::before { content: ''; position: absolute; inset: -8px; }

/* Project-style goal navigation and unified record search. */
.sidebar-section-heading { display: flex; align-items: center; gap: 2px; min-height: 36px; flex-shrink: 0; margin-top: 20px; padding: 4px; border-radius: var(--radius-small); cursor: pointer; }
.sidebar-section-heading:is(:hover, :focus-within) { background: var(--surface-hover); }
.sidebar-section-link { flex: 1; min-width: 0; align-self: stretch; border: 0; background: transparent; padding: 0 4px; color: var(--text-secondary); font: inherit; font-size: 14px; text-align: left; }
.sidebar-section-heading:is(:hover, :focus-within) > :is(.sidebar-section-link, .icon-button) { color: var(--text); }
.sidebar-section-toggle .icon { transition: transform var(--duration-fast) var(--ease-out); }
.sidebar-section-toggle[aria-expanded='false'] .icon { transform: rotate(-90deg); }
.sidebar-section-heading > .icon-button { width: 24px; height: 24px; padding: 0; border-radius: 6px; }
.sidebar-section-heading > .icon-button:hover { background: var(--border); }
.sidebar-section-heading > .icon-button .icon { width: 16px; height: 16px; stroke-width: 1.8; }
@media (hover: hover) and (pointer: fine) {
  .sidebar-section-extra { opacity: 0; pointer-events: none; }
  .sidebar-section-heading:is(:hover, :focus-within) > .sidebar-section-extra { opacity: 1; pointer-events: auto; }
}
#sidebar-goals { max-height: 34dvh; overflow-y: auto; flex-shrink: 1; }
#sidebar-goals-status:empty { display: none; }
.sidebar-goal-item { display: flex; align-items: center; gap: 6px; width: 100%; min-height: 36px; border: 0; padding: 8px 12px; border-radius: 8px; background: transparent; color: var(--text); font: inherit; font-size: 14px; line-height: 1.4; text-align: left; overflow-wrap: anywhere; }
.sidebar-goal-item .icon { width: 14px; height: 14px; }
.sidebar-goal-item:hover, .sidebar-goal-item[aria-current='page'] { background: var(--surface-hover); }
.sidebar-goal-item.is-focused { color: var(--accent); }
.sidebar-goals-all { color: color-mix(in srgb, var(--text-secondary) 75%, var(--sidebar)); }
.sidebar-goals-all:is(:hover, :focus-visible) { color: var(--text); background: var(--surface-hover); }
.collapsed-goals-nav { display: none; }
.sidebar-collapsed .sidebar-section-heading, .sidebar-collapsed #sidebar-goals, .sidebar-collapsed #sidebar-conversations { display: none; }
.sidebar-collapsed .collapsed-goals-nav { display: flex; }
.search-view { flex: 1; min-height: 0; overflow-y: auto; padding: 32px; }
.search-content { max-width: 900px; margin-inline: auto; container-type: inline-size; }
.search-kinds { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0; }
.search-kinds button { border: 1px solid var(--border); border-radius: 999px; background: transparent; color: var(--text); padding: 5px 12px; min-height: 32px; font: inherit; font-size: 13px; }
.search-kinds button[aria-pressed='true'] { background: var(--surface-hover); border-color: transparent; }
.search-result { display: flex; align-items: flex-start; gap: 16px; width: 100%; padding: 16px 4px; min-height: 72px; border: 0; border-bottom: 1px solid var(--border); background: transparent; color: var(--text); font: inherit; text-align: left; }
.search-result > .icon { width: 18px; height: 18px; margin-top: 3px; color: var(--text-secondary); }
.search-result-body { min-width: 0; display: grid; gap: 4px; }
.search-result-title { font-size: 14px; overflow-wrap: anywhere; }
.search-result-kind, .search-result-description { font-size: 12px; color: var(--text-secondary); }
.search-result-description { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.search-result:hover .search-result-title { text-decoration: underline; text-underline-offset: 3px; }
.search-result:focus-visible { outline-offset: -2px; }
#search-more { margin-top: 20px; }
@container (max-width: 600px) {
  .catalog-toolbar { flex-wrap: wrap; gap: 8px; }
  .catalog-search { flex-basis: 100%; }
  .catalog-filter { margin-left: auto; }
}
@media (max-width: 760px) {
  .search-view { padding: 20px; }
  .sidebar-section-heading { min-height: 44px; padding-block: 0; }
  .sidebar-goal-item, .sidebar-section-link, .sidebar-section-heading > .icon-button { min-height: 44px; }
  .sidebar-section-heading > .icon-button { width: 44px; height: 44px; }
  .search-kinds button { min-height: 44px; }
}

.goal-next { margin: 0 0 32px; }
.goal-next h2 { font-size: 15px; font-weight: 500; margin: 0 0 12px; }
.habit-card-compact { padding: 16px; }
.habit-card-compact .habit-card-header { align-items: flex-start; }
.habit-card-compact .habit-card-footer { margin-top: 16px; align-items: center; }
.habit-card-compact .habit-today { font-size: 16px; font-weight: 500; }
.habit-card-compact .habit-period { display: none; }
.habit-card-compact[data-mode='limit'] .habit-period { display: block; }
.habit-card-compact .habit-label { margin-bottom: 2px; }
.habit-card-compact .habit-indicators { margin-top: 12px; }
.habit-card-compact .habit-days { margin: 0; gap: 6px; }
.habit-card-compact .habit-card-footer .action-button { min-height: 36px; padding: 6px 12px; font-size: 13px; }
@media (pointer: coarse) {
  .task-check { flex-basis: 44px; }
  .task-row .compact-menu-trigger { width: 44px; height: 44px; }
  .habit-card-compact .habit-day { width: 32px; height: 32px; }
  .habit-card-compact .habit-card-footer .action-button { min-height: 44px; }
}

#goal-title:focus { outline: none; }
.sidebar-title { --title-edge-inset: 8px; display: block; min-width: 0; flex: 1; overflow: hidden; white-space: nowrap; margin-left: calc(-1 * var(--title-edge-inset)); padding-left: var(--title-edge-inset); }
.sidebar-goal-item .sidebar-title { --title-edge-inset: 12px; }
:is(.sidebar-goal-item.is-focused, .conversation-item.is-pinned) .sidebar-title { --title-edge-inset: 6px; }
.sidebar-title-text { display: block; width: max-content; transform: translateX(0); transition: transform var(--duration-fast) var(--ease-out); }
.sidebar-title[data-overflow='true'] { mask-image: linear-gradient(to right, #000 calc(100% - 16px), transparent); }
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  :is(.sidebar-goal-item, .conversation-item):hover .sidebar-title[data-overflow='true'] { mask-image: linear-gradient(to right, transparent, #000 6px, #000); }
  :is(.sidebar-goal-item, .conversation-item):hover .sidebar-title[data-overflow='true'] .sidebar-title-text { transform: translateX(var(--title-shift)); transition: transform var(--title-travel) linear 450ms; }
}

/* Sidebar disclosure overlays keep the complete idle title width. */
.sidebar-record { position: relative; min-width: 0; flex-shrink: 0; border-radius: 8px; }
.sidebar-record:is(:hover, :focus-within, :has(:popover-open)) > :is(.conversation-item, .sidebar-goal-item) { background: var(--surface-hover); }
.sidebar-record-menu { display: flex; position: absolute; z-index: 3; right: 4px; top: 50%; transform: translateY(-50%); opacity: 0; pointer-events: none; }
.sidebar-record:is(:hover, :focus-within, :has(:popover-open)) > .sidebar-record-menu { opacity: 1; pointer-events: auto; }
.sidebar-record-menu::before { content: ''; position: absolute; inset: -4px -4px -4px -12px; border-radius: 0 var(--radius-small) var(--radius-small) 0; background: linear-gradient(to right, transparent, var(--surface-hover) 12px); pointer-events: none; }
.sidebar-record-menu > .compact-menu-trigger { position: relative; width: 28px; height: 28px; background: var(--surface-hover); }
.sidebar-record-menu > .compact-menu-trigger::before { inset: -4px; }
.sidebar-record-menu > .compact-menu-trigger:hover { background: color-mix(in srgb, var(--surface-hover), white 6%); }
.sidebar-record-menu .compact-menu { min-width: 172px; }
.sidebar-record-menu .compact-menu button { display: flex; align-items: center; gap: 10px; }
.sidebar-record-menu .compact-menu .icon { width: 16px; height: 16px; flex-shrink: 0; }
.compact-menu .menu-danger { color: var(--delete-action); }
.conversation-item.is-pinned { gap: 6px; }
.conversation-item.is-pinned > .icon { width: 14px; height: 14px; flex-shrink: 0; color: var(--text-secondary); }
.sidebar-action-error { margin: 8px; font-size: 12px; line-height: 1.5; color: var(--error); }
.record-dialog::backdrop { background: rgb(0 0 0 / 38%); backdrop-filter: blur(3px); }
.record-action-description { margin: 0 0 8px; color: var(--text-secondary); font-size: 14px; overflow-wrap: anywhere; }
.creation-actions .record-delete, .creation-actions .record-delete:hover:not(:disabled) { background: var(--error); color: var(--background); }
@media (hover: none), (pointer: coarse) {
  .sidebar-record-menu { opacity: 1; pointer-events: auto; }
  .sidebar-record > :is(.conversation-item, .sidebar-goal-item) { padding-right: 48px; }
  .sidebar-record-menu::before { display: none; }
  .sidebar-record-menu > .compact-menu-trigger { width: 40px; height: 40px; background: transparent; }
  .sidebar-record-menu > .compact-menu-trigger::before { inset: -2px; }
}

/* Unread replaces the idle row action at the same edge, without moving text. */
.conversation-unread-dot { position: absolute; z-index: 2; right: 16px; top: 50%; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); transform: translateY(-50%); pointer-events: none; }
.sidebar-record:has(> .conversation-item[aria-current='true']) { --record-idle-bg: var(--surface-hover); }
.sidebar-record[data-unread='true']::before { content: ''; position: absolute; z-index: 1; right: 0; top: 50%; transform: translateY(-50%); height: 36px; width: 44px; border-radius: 0 var(--radius-small) var(--radius-small) 0; background: linear-gradient(to right, transparent, var(--record-idle-bg, var(--sidebar)) 12px); pointer-events: none; }
@media (hover: hover) and (pointer: fine) {
  .sidebar-record:is(:hover, :focus-within, :has(:popover-open)) .conversation-unread-dot { opacity: 0; }
  .sidebar-record[data-unread='true']:is(:hover, :focus-within, :has(:popover-open))::before { background: linear-gradient(to right, transparent, var(--surface-hover) 12px); }
}
@media (hover: none), (pointer: coarse) {
  .conversation-unread-dot { right: 48px; }
  .sidebar-record[data-unread='true'] > .conversation-item { padding-right: 64px; }
  .sidebar-record[data-unread='true']::before { display: none; }
}

/* Account menu stays anchored above the footer; the owned profiles open beside it. */
.account-menu { width: 224px; max-height: calc(100dvh - 16px); overflow-y: auto; }
.account-submenu { width: 232px; max-height: min(360px, calc(100dvh - 16px)); overflow-y: auto; }
:is(.account-menu, .account-submenu) > button { display: flex; align-items: center; gap: 10px; min-height: 36px; }
:is(.account-menu, .account-submenu) > button > .icon { width: 16px; height: 16px; flex-shrink: 0; }
.account-menu > button > span { min-width: 0; }
.account-menu > button:disabled { opacity: .55; cursor: default; }
.account-menu > button:disabled:hover { background: transparent; }
.account-menu-identity > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
:is(.account-menu-identity, .account-switch-name, #account-theme) small { display: block; font-size: 11px; color: var(--text-secondary); font-weight: 400; overflow: hidden; text-overflow: ellipsis; }
:is(#account-switch, #account-theme) > .icon:last-child { margin-left: auto; }
.theme-option-check { margin-left: auto; color: var(--accent); }
.account-menu-divider { border-top: 1px solid var(--border); margin: 4px 8px; }
.account-menu-error, .account-menu-status { padding: 8px 12px; margin: 0; font-size: 12px; white-space: normal; overflow-wrap: anywhere; }
.account-menu-error { color: var(--error); }
.account-menu-status { color: var(--text-secondary); }
.account-avatar { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 1px solid var(--border); border-radius: 50%; background: var(--surface-hover); color: var(--text-secondary); font-size: 10px; font-variant-numeric: tabular-nums; flex-shrink: 0; }
.account-switch-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-switch-item[aria-current='true'] { background: var(--surface-hover); }
.account-submenu-back > .icon { transform: rotate(180deg); }
.account-menu[data-stacked='true']:has(> .account-submenu:popover-open) { background: transparent; border-color: transparent; overflow: visible; }
.account-menu[data-stacked='true']:has(> .account-submenu:popover-open) > :not(.account-submenu) { visibility: hidden; }
@media (hover: none), (pointer: coarse) {
  :is(.account-menu, .account-submenu) > button { min-height: 44px; }
  #account-open .account-disclosure { opacity: 1; }
}

/* One shared week and an inline selected day for the habits linked to a goal. */
.habit-grid.habit-week-host { display: block; }
.habit-week-heading { margin: 0 0 12px; }
.habit-week-heading p { margin: 0; color: var(--text-secondary); font-size: 13px; }
.habit-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.habit-day-tile { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; padding: 12px 6px 8px; border: 1px solid transparent; border-radius: var(--radius-card); background: var(--surface); color: var(--text-secondary); cursor: pointer; transition: border-color var(--duration-fast) ease, transform var(--duration-fast) var(--ease-out); }
.habit-day-tile[aria-pressed='true'] { border-color: var(--accent); color: var(--accent); }
.habit-day-tile[data-today='true'] .habit-day-caption { color: var(--accent); }
.habit-day-tile:disabled { cursor: default; opacity: .45; }
.habit-day-tile:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.habit-weekday { text-transform: capitalize; font-size: 12px; }
.habit-day-wheel { position: relative; display: block; width: min(100%, 80px); aspect-ratio: 1; }
.habit-day-ring { display: block; width: 100%; height: 100%; overflow: visible; }
.habit-wheel-date { position: absolute; inset: 0; display: grid; place-items: center; font-size: 20px; font-weight: 500; font-variant-numeric: tabular-nums; color: var(--text); }
.habit-day-caption { font-size: 11px; line-height: 1.5; }
.habit-day-ring g { transform-origin: 50px 50px; }
.habit-day-ring g[data-experiment='true'] { --accent: var(--experiment); }
.habit-day-ring g[data-mode='limit'] { --accent: var(--text-secondary); }
.habit-day-ring g[data-mode='limit'][data-exceeded='true'] { --accent: var(--error); }
.habit-day-ring g[data-mode='limit'] :is(.ring-track, .ring-fill) { stroke-width: 6; }
.habit-day-ring g[data-mode='limit'] .ring-hit { stroke-width: 12; }
.ring-track, .ring-fill { stroke: var(--accent); stroke-width: 7; stroke-linecap: round; pointer-events: none; }
.ring-track { opacity: .13; }
.ring-fill { opacity: 1; }
g[data-segmented='true'] :is(.ring-track, .ring-fill) { stroke-linecap: butt; }
g:is([data-state='future'], [data-state='inactive']) .ring-track { stroke: var(--text-secondary); opacity: .13; }
.ring-hit { stroke: transparent; stroke-width: 18; pointer-events: stroke; cursor: pointer; }
.habit-day-panel { margin-top: 16px; padding: 24px; border-radius: var(--radius-card); background: var(--surface); }
.week-day-layout { display: grid; grid-template-columns: minmax(160px, .44fr) minmax(0, 1fr); gap: 24px; min-height: 280px; }
.week-day-aside { display: flex; align-items: center; justify-content: center; min-width: 0; padding: 16px 0; }
.week-day-content { min-width: 0; }
.week-day-title { margin: 0 12px 12px; font-size: 15px; font-weight: 500; line-height: 1.6; }
.week-day-title::first-letter { text-transform: uppercase; }
.week-expanded-wheel { position: relative; width: min(100%, 220px); aspect-ratio: 1; flex-shrink: 0; }
.week-wheel-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.week-wheel-center strong { font-size: 36px; font-weight: 500; line-height: 1.2; font-variant-numeric: tabular-nums; }
.week-wheel-center span { font-size: 13px; color: var(--text-secondary); }
.week-day-status { margin: 0 12px 8px; color: var(--text-secondary); font-size: 12px; }
.week-habit-group:not([hidden]) + .week-habit-group:not([hidden]) { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.week-habit-group-title { display: flex; align-items: center; gap: 8px; margin: 0 12px 4px; min-height: 24px; font-size: 12px; line-height: 1.6; font-weight: 500; color: var(--text-secondary); }
.week-habit-group-title svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; }
.week-habit-group[data-mode='build'] .week-habit-group-title { color: var(--accent); }
.week-day-row { position: relative; display: flex; align-items: center; gap: 12px; height: 76px; min-height: 76px; padding: 12px; border-radius: var(--radius-small); transition: background var(--duration-fast) ease; }
.week-day-row[data-experiment='true'] { --accent: var(--experiment); --focus: var(--experiment); }
.week-day-row::after { content: ''; position: absolute; inset: auto 12px 0; border-bottom: 1px solid var(--border); pointer-events: none; }
.week-day-row:last-child::after { display: none; }
.week-day-row[data-highlighted='true'] { background: var(--surface-hover); }
.week-day-row-body { flex: 1; min-width: 0; }
.week-day-row .week-day-name { display: block; width: 100%; font-size: 14px; line-height: 1.5; padding: 4px 0; overflow: visible; overflow-wrap: normal; }
.week-day-name .sidebar-title { --title-edge-inset: 6px; }
.week-day-row[data-experiment='true'] .week-day-name { color: var(--experiment); }
.week-day-row .week-day-name:hover { text-decoration: none; }
.week-day-row .week-day-name:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--radius-small); }
.week-day-row .experiment-label { flex-shrink: 0; width: 16px; overflow: hidden; white-space: nowrap; }
.week-day-row .action-button { flex-shrink: 0; min-height: 44px; font-size: 13px; padding: 6px 10px; border-color: transparent; background: var(--background); }
.week-day-metadata { display: block; width: 100%; min-width: 0; height: 20px; padding: 0; border: 0; background: transparent; text-align: left; white-space: nowrap; font: inherit; font-size: 12px; line-height: 1.6; color: var(--text-secondary); font-variant-numeric: tabular-nums; cursor: pointer; }
.week-day-metadata[data-error='true'] { color: var(--error); }
.week-day-metadata:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--radius-small); }
.week-limit-note[data-exceeded='true'] { color: var(--error); }
.habit-inline-control { display: flex; align-items: center; justify-content: flex-end; flex: 0 0 128px; width: 128px; height: 44px; }
.habit-check { flex-basis: 44px; width: 44px; }
.habit-counter { display: flex; align-items: center; width: 128px; height: 44px; border-radius: var(--radius-small); background: var(--background); }
.habit-counter-step { display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; padding: 0; border: 0; border-radius: var(--radius-small); background: transparent; color: var(--text-secondary); cursor: pointer; transition: background var(--duration-fast) ease, color var(--duration-fast) ease, transform 150ms var(--ease-out); }
.habit-counter-step svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.habit-counter-step:disabled { opacity: .35; cursor: default; }
.habit-counter-step:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.habit-counter-value { position: relative; flex: 0 0 40px; width: 40px; height: 44px; overflow: hidden; }
.habit-counter-input, .habit-counter-display { position: absolute; inset: 0; width: 100%; height: 100%; font: inherit; font-size: 14px; text-align: center; font-variant-numeric: tabular-nums; }
.habit-counter-display { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; line-height: 44px; pointer-events: none; }
.habit-counter-input { appearance: textfield; padding: 0 2px; border: 0; background: transparent; color: transparent; caret-color: var(--text); }
.habit-counter-input::-webkit-inner-spin-button, .habit-counter-input::-webkit-outer-spin-button { appearance: none; margin: 0; }
.habit-counter-input::placeholder { color: transparent; }
.habit-counter-input:focus { outline: 0; color: var(--text); }
.habit-counter-value:focus-within .habit-counter-display { visibility: hidden; }
.habit-counter:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.habit-inline-control[data-error='true'] .habit-counter { outline: 1px solid var(--error); }
.week-day-extra { min-height: 0; }
.week-day-more { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; min-height: 44px; padding: 8px 12px; border: 0; border-radius: var(--radius-small); background: transparent; color: var(--text-secondary); font: inherit; font-size: 13px; }
.week-day-more:hover { background: var(--surface-hover); color: var(--text); }
.week-day-more svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; transition: transform var(--duration-disclosure) var(--ease-disclosure); }
.week-day-more[aria-expanded='true'] svg { transform: rotate(180deg); }
@media (prefers-reduced-motion: no-preference) {
  .week-day-aside .habit-day-ring g { transition: transform 150ms var(--ease-out); }
  .week-day-aside g[data-highlighted='true'] { transform: scale(1.055); }
  .week-day-row:focus-within .sidebar-title[data-overflow='true'] .sidebar-title-text { transform: translateX(var(--title-shift)); transition: transform var(--title-travel) linear 450ms; }
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .habit-day-tile:not(:disabled):hover { border-color: var(--accent); transform: translateY(-2px); }
  .week-day-row:hover .sidebar-title[data-overflow='true'] .sidebar-title-text { transform: translateX(var(--title-shift)); transition: transform var(--title-travel) linear 450ms; }
}
@media (hover: hover) and (pointer: fine) {
  .habit-counter-step:not(:disabled):hover { background: var(--surface-hover); color: var(--accent); }
}
@media (prefers-reduced-motion: no-preference) {
  .habit-counter-step:not(:disabled):active { transform: scale(.95); }
}
@media (max-width: 760px) {
  .habit-week { gap: 3px; }
  .habit-day-tile { padding: 10px 2px 6px; gap: 6px; border-radius: var(--radius-small); }
  .habit-wheel-date { font-size: 12px; }
  .habit-weekday { font-size: 11px; }
  .habit-day-caption { font-size: 9px; }
  .habit-day-panel { padding: 16px 8px 8px; margin-top: 12px; }
  .week-day-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .week-day-aside { padding: 4px 0; }
  .week-expanded-wheel { width: 160px; }
  .week-wheel-center strong { font-size: 30px; }
  .week-day-title { margin-bottom: 8px; }
  .week-day-row { gap: 8px; }
}

/* Memory diagnostics sit beside usage, before the final message timestamp. */
.message-diagnostics { display: flex; align-items: flex-start; gap: 4px; flex: 0 1 auto; min-width: 0; margin-left: 8px; }
.message-diagnostics .usage-details { flex: 0 1 auto; }
.message-diagnostics .usage-details[open] { flex: 1; }
.message-memory-control { display: flex; align-items: center; min-height: 44px; flex-shrink: 0; }
.message-memory-trigger { color: var(--text-secondary); }
.message-memory-trigger .icon { width: 16px; height: 16px; }
.message-memory-count { font-size: 10px; position: absolute; right: -1px; top: -3px; color: var(--accent); }
.message-memory-panel { width: min(400px, calc(100vw - 16px)); max-height: min(440px, calc(100dvh - 16px)); overflow: auto; padding: 12px; font-size: 13px; line-height: 1.6; }
.message-memory-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.message-memory-header h3 { margin: 0; font-size: 14px; font-weight: 500; }
.message-memory-panel .message-memory-close { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 28px; width: 28px; height: 28px; min-height: 28px; padding: 0; }
.message-memory-close .icon { width: 16px; height: 16px; }
.message-memory-list { list-style: none; padding: 0; margin: 0; }
.message-memory-item + .message-memory-item { border-top: 1px solid var(--border); margin-top: 12px; padding-top: 12px; }
.message-memory-content { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.message-memory-state { display: flex; flex-wrap: wrap; gap: 2px 8px; margin: 6px 0 0; color: var(--text-secondary); font-size: 12px; }
.message-memory-state [data-status='superseded'] { color: var(--delete-action); }
@media (pointer: coarse) { .message-memory-panel .message-memory-close { flex-basis: 44px; width: 44px; height: 44px; min-height: 44px; } }

/* Daily editorial widgets use the same surfaces as user-pinned widgets. */
/* Daily curation has its own content-sized rows, independent of manual widgets. */
.daily-dashboard-grid { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); align-items: stretch; }
.daily-widget { position: relative; padding: var(--space-6); min-height: 232px; }
.daily-dashboard-grid .daily-widget { grid-column: auto; grid-row: auto; }
.daily-dashboard-grid .daily-widget[data-size='large'][data-kind='habit_chart'] { grid-column: 1 / -1; }
.daily-title { font-size: 14px; line-height: 1.4; font-weight: 500; margin: 0 32px 20px 0; overflow-wrap: anywhere; }
.daily-dismiss { position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; padding: 0; }
.daily-dismiss::before { content: ''; position: absolute; inset: -6px; }
.daily-dismiss .icon { width: 16px; height: 16px; }
.daily-widget .dashboard-widget-body { gap: 0; }
.daily-question { font-size: 19px; font-weight: 400; line-height: 1.45; margin: 0 24px 24px 0; overflow-wrap: anywhere; text-wrap: pretty; }
.daily-statement { font-family: 'Cormorant Garamond', Georgia, serif; font-size: 32px; font-weight: 500; line-height: 1.15; margin: auto 12px auto 0; overflow-wrap: anywhere; text-wrap: pretty; }
.daily-widget[data-kind='statement'] { background: color-mix(in srgb, var(--accent) 7%, var(--surface)); border-color: transparent; }
.daily-widget[data-kind='statement'] .daily-statement { color: var(--text); }
.daily-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: auto; padding-top: 20px; min-height: 52px; }
.daily-actions:empty { display: none; }
.daily-widget .daily-discuss { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; margin: 0; min-height: 32px; text-decoration: none; }
.daily-discuss .icon { width: 16px; height: 16px; }
.daily-widget[data-kind='statement'] .daily-actions { justify-content: flex-end; padding-top: 12px; }
.daily-widget[data-kind='statement'] .daily-discuss { justify-content: center; width: 32px; border-radius: var(--radius-small); }
.daily-widget .daily-feedback { font-size: 12px; color: var(--text-secondary); margin: 0 auto 0 0; }
.daily-feedback::before { content: ''; display: inline-block; width: 10px; height: 6px; margin: 0 8px 3px 0; border-bottom: 1.5px solid currentColor; border-left: 1.5px solid currentColor; transform: rotate(-45deg); }
.daily-widget .habit-form-error { margin: 12px 0 0; }
.daily-rating { margin-top: auto; }
.daily-rating-ruler { position: relative; height: 112px; isolation: isolate; }
.daily-rating-position { position: absolute; top: 0; left: 0; width: calc((100% - 44px) / 4); pointer-events: none; transition: transform 250ms var(--ease-out); }
.daily-rating-value { position: relative; display: grid; place-items: center; width: 44px; height: 48px; border: 1px solid var(--input-border); border-radius: var(--radius-card); background: var(--background); color: var(--text-secondary); font-size: 28px; line-height: 1; font-weight: 500; font-variant-numeric: tabular-nums; }
.daily-rating-value::after { content: ''; position: absolute; top: calc(100% + 6px); height: 22px; width: 3px; border-radius: 2px; background: var(--text-secondary); }
.daily-rating[data-selected='true'] .daily-rating-value { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.daily-rating[data-selected='true'] .daily-rating-value::after { background: var(--accent); }
.daily-rating-ticks { position: absolute; top: 60px; left: 22px; right: 22px; height: 20px; display: flex; align-items: center; justify-content: space-between; pointer-events: none; }
.daily-rating-ticks > span { width: 2px; height: 10px; border-radius: 1px; background: var(--border); transition: transform var(--duration-fast) var(--ease-out), background var(--duration-fast) ease; }
.daily-rating-ticks > span[data-major='true'] { height: 20px; background: var(--text-secondary); }
.daily-rating-ticks > span[data-active='true'] { background: var(--accent); }
.daily-rating-numbers { position: absolute; top: 90px; left: 0; right: 0; display: flex; justify-content: space-between; font-size: 11px; color: var(--text-secondary); pointer-events: none; }
.daily-rating-numbers > span { width: 44px; text-align: center; }
.daily-rating-range { position: absolute; inset: 0 0 auto; width: 100%; height: 88px; margin: 0; padding: 0; opacity: 0; cursor: ew-resize; appearance: none; touch-action: pan-y; }
.daily-rating-range::-webkit-slider-thumb { appearance: none; width: 44px; height: 88px; }
.daily-rating-range::-moz-range-thumb { border: 0; width: 44px; height: 88px; }
.daily-rating-ruler:has(.daily-rating-range:focus-visible) { outline: 2px solid var(--accent); outline-offset: 6px; border-radius: var(--radius-small); }
.daily-rating[data-dragging='true'] .daily-rating-position, .daily-rating[data-motion='keyboard'] :is(.daily-rating-position, .daily-rating-ticks > span) { transition: none; }
.daily-rating-labels { display: flex; justify-content: space-between; gap: 16px; font-size: 12px; line-height: 1.4; color: var(--text-secondary); overflow-wrap: anywhere; }
.daily-rating-labels > span { max-width: 46%; }
.daily-rating-labels > span:last-child { text-align: right; }
.daily-actions .action-button { font-size: 13px; padding: 6px 14px; min-height: 36px; }
.daily-progress-value { font-size: 48px; font-weight: 500; line-height: 1.1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; margin: auto 0 8px; overflow-wrap: anywhere; }
.daily-progress-value > span { font-size: 24px; color: var(--text-secondary); letter-spacing: 0; }
.daily-progress-segments { display: flex; gap: 4px; margin-top: 20px; }
.daily-progress-segments > span { position: relative; flex: 1; height: 20px; overflow: hidden; border-radius: 4px; background: var(--surface-hover); }
.daily-progress-segments > span > span { display: block; width: 100%; height: 100%; background: var(--accent); transform-origin: left; }
.daily-widget .widget-chart-summary { flex-wrap: wrap; gap: 4px 8px; margin-bottom: 12px; }
.daily-widget .widget-chart-total { font-size: 32px; }
.daily-widget .widget-bars { margin-top: 20px; }
.daily-widget .widget-chart-range { margin-top: 8px; }
.daily-widget .widget-chart-output { margin-top: 4px; }
.daily-widget .widget-link:not(.daily-discuss) { min-height: 32px; align-self: flex-start; margin-top: 12px; text-decoration: none; }
#dashboard-regenerate { display: inline-flex; align-items: center; gap: 8px; }
#dashboard-regenerate .icon { width: 16px; height: 16px; }
#dashboard-regenerate[data-loading='true'] { color: var(--accent); }
@media (hover: hover) and (pointer: fine) {
  .daily-discuss:hover { text-decoration: underline; text-underline-offset: 4px; }
  .daily-widget[data-kind='statement'] .daily-discuss:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }
}
@container (max-width: 600px) {
  .daily-dashboard-grid { grid-template-columns: minmax(0, 1fr); gap: var(--space-3); }
  .daily-widget { padding: var(--space-5); min-height: 216px; }
  .daily-question { font-size: 18px; }
  .daily-statement { font-size: 30px; }
  .daily-widget[data-kind='rating'] { min-height: 308px; }
  .daily-dashboard-grid .daily-widget[data-size='large'][data-kind='habit_chart'] { grid-column: auto; }
}
@media (pointer: coarse) {
  .daily-widget .daily-discuss, .daily-actions .action-button { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .daily-rating-position, .daily-rating-ticks > span { transition: none; }
}
@media (forced-colors: active) {
  .daily-rating-range { opacity: 1; appearance: auto; }
  .daily-rating-range::-webkit-slider-thumb { appearance: auto; width: auto; height: auto; }
  .daily-rating-range::-moz-range-thumb { width: auto; height: auto; }
  .daily-rating-position, .daily-rating-ticks, .daily-rating-numbers { visibility: hidden; }
  .daily-progress-segments > span { border: 1px solid CanvasText; }
  .daily-progress-segments > span > span { background: Highlight; }
}

.composer-editor { white-space: pre-wrap; overflow-wrap: anywhere; outline: none; }
.composer-editor[aria-disabled='true'] { cursor: wait; }
.composer-editor strong, .answer-suggestions-rail strong { font-weight: 600; }
.composer-editor em { font-style: italic; }
.composer-editor code { font-family: monospace; font-size: .9em; background: var(--surface-hover); border-radius: var(--radius-small); padding: 1px 3px; }
.composer-editor s { text-decoration: line-through; }
::highlight(answer-insertion) { color: var(--accent); }
.composer-input[data-empty='false'] .composer-placeholder { visibility: hidden; }
