/* v190 guidance-focus screens, built on css/minimal.css (see docs/design-system-v190.md). Scoped to this area only. */

/* ============================================================
   Shared bits for AI guidance and Focus
   ============================================================ */
.gd-page, .focus-page { padding-bottom: 28px; }
.gd-page .m-related, .focus-page .m-related { margin-bottom: 8px; }

/* quiet text action, used where a full button would shout */
.gd-text-btn {
  flex: none; min-height: 32px; padding: 0 2px; border: 0; background: none; cursor: pointer;
  color: var(--blue-2, var(--accent)); font: inherit; font-size: 13px; font-weight: 600;
}
.gd-text-btn:disabled { opacity: .45; cursor: default; }
.gd-fine { margin: 0; font-size: 12px; line-height: 1.5; color: var(--tx-3); }

/* ============================================================
   AI guidance
   ============================================================ */
.gd-page .topbar { margin-bottom: 4px; }

/* Your read: one hero, one fill, one line of meaning */
.gd-read .m-hero { gap: 8px; }
.gd-read .gd-grade { font-size: 38px; line-height: 1.05; text-wrap: balance; }
.gd-meter { height: 4px; margin: 16px 0 0; border-radius: 99px; background: var(--m-surface-2); overflow: hidden; }
.gd-meter i { display: block; height: 100%; border-radius: inherit; background: var(--accent); transform-origin: left; animation: gdFill .8s cubic-bezier(.22, 1, .36, 1) both; }
@keyframes gdFill { from { transform: scaleX(0); } }
.gd-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 10px; font-size: 13px; color: var(--tx-3); }
.gd-meta b { font-weight: 600; color: var(--tx); font-variant-numeric: tabular-nums; }
.gd-read-copy { margin: 14px 0 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: 14.5px; line-height: 1.5; color: var(--tx-2); }

/* 7-day roadmap: a numbered list, not boxes */
ol.gd-steps { margin: 0; padding: 0; list-style: none; }
.gd-steps > .m-row { align-items: flex-start; gap: 14px; padding: 14px; cursor: default; }
.gd-steps > .m-row:active { background: transparent; }
.gd-step-n {
  flex: none; display: grid; place-items: center; width: 24px; height: 24px; margin-top: -1px; border-radius: 50%;
  border: 1px solid var(--line-2); color: var(--tx-2); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.gd-step-txt { flex: 1; min-width: 0; font-size: 14.5px; line-height: 1.5; color: var(--tx-2); overflow-wrap: anywhere; }
.gd-step-txt b { font-weight: 600; color: var(--tx); }

/* Ask: suggestion chips, then one chat surface */
.gd-prompts { margin-bottom: 10px; }
.gd-prompts .m-chip { max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.gd-chat { padding: 14px; }
.gd-chat .gd-log { max-height: 280px; margin: 0 0 12px; padding: 2px 0 4px; gap: 8px; }
.gd-chat .msg { max-width: 86%; padding: 10px 14px; border: 0; border-radius: 18px; font-size: 14px; line-height: 1.5; animation: none; }
.gd-chat .msg.ai { background: var(--m-surface-2); color: var(--tx); border-bottom-left-radius: 6px; }
.gd-chat .msg.me { background: var(--blue-grad, var(--accent)); color: #fff; border-bottom-right-radius: 6px; }
.gd-chat .gd-status { font-size: 13px; line-height: 1.45; color: var(--tx-2); }
.gd-chat .gd-status:not(:empty) { margin: -4px 2px 12px; }
.gd-send { width: 44px; padding: 0; display: grid; place-items: center; }
.gd-send svg { width: 20px; height: 20px; }
.gd-send:disabled, .gd-chat .m-input:disabled { opacity: .55; }
.gd-chat-foot { display: flex; align-items: flex-start; gap: 12px; margin-top: 10px; padding: 0 4px; }
.gd-chat-foot .gd-fine { flex: 1; min-width: 0; }
.gd-chat-foot .gd-text-btn { margin-top: -7px; }

/* consent: plain text and two calm buttons, no coloured box */
.gd-chat .gd-consent { margin: 0 0 14px; padding: 14px 2px 2px; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; }
.gd-chat .gd-consent b { font-size: 14px; font-weight: 600; }
.gd-chat .gd-consent p { margin: 6px 0 12px; font-size: 13px; line-height: 1.5; color: var(--tx-2); }
.gd-chat .gd-consent .ai-consent-actions { gap: 8px; }
.gd-chat .gd-consent .m-btn { flex: 1; }

/* sign-in: one quiet row that opens */
.gd-auth { margin-top: 10px; }
.gd-auth > summary { gap: 12px; }
.gd-auth-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.gd-auth-txt b { font-size: 15px; font-weight: 500; }
.gd-auth-txt small { font-size: 12.5px; font-weight: 400; color: var(--tx-3); }
.gd-auth-body .auth-panel { gap: 10px; padding: 2px 0 0; }
.gd-auth-body .auth-panel > span { font-size: 14px; color: var(--tx-2); }
.gd-auth-body .auth-panel label { font-size: 12.5px; color: var(--tx-3); }
.gd-auth-body .auth-panel input {
  min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2);
  background: var(--m-surface); color: var(--tx); font: inherit; font-size: 15px;
}
.gd-auth-body .auth-panel .btn { min-height: 44px; box-shadow: none; }
.gd-auth-body .auth-panel:has(> span) { flex-direction: row; align-items: center; justify-content: space-between; }
.gd-auth-body .auth-delete { min-height: 44px; border-radius: 999px; background: transparent; font-size: 13.5px; }
.gd-auth-body .auth-delete.armed { background: var(--red, #ff6b6b); }
.gd-auth-body #authStatus:empty { display: none; }

/* This week: review and recommended move, one card split by a hairline */
.gd-week { padding: 16px; }
.gd-block + .gd-block { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.gd-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 32px; }
.gd-head small { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--tx-3); }
.gd-focus-name { display: block; margin-top: 4px; font-family: var(--font-display, inherit); font-size: 28px; font-weight: 400; line-height: 1.15; letter-spacing: -.01em; color: var(--tx); overflow-wrap: anywhere; }
.gd-focus-action { margin: 8px 0 10px; font-size: 14px; line-height: 1.5; color: var(--tx-2); }
.gd-move-copy { margin: 6px 0 0; font-size: 15px; line-height: 1.5; color: var(--tx); }
.gd-move-copy b { font-weight: 600; }
.gd-tip { margin-top: 12px; }
.gd-tip > summary {
  display: flex; align-items: baseline; gap: 8px; min-height: 36px; padding: 8px 0 0; list-style: none; cursor: pointer;
  font-size: 13.5px; color: var(--tx-2);
}
.gd-tip > summary::-webkit-details-marker { display: none; }
.gd-tip > summary span { flex: none; color: var(--tx-3); }
.gd-tip > summary b { flex: 1; min-width: 0; font-weight: 500; color: var(--blue-2, var(--tx)); }
.gd-tip > summary::after { content: '›'; flex: none; font-size: 18px; line-height: 1; color: var(--tx-3); transition: transform .2s; }
.gd-tip[open] > summary::after { transform: rotate(90deg); }
.gd-tip p { margin: 6px 0 0; font-size: 13.5px; line-height: 1.55; color: var(--tx-2); }
.gd-tip p b { font-weight: 600; color: var(--tx); }

/* Playbook: rows that open in place */
.gd-playbook .gd-qa { min-height: 54px; }
.gd-playbook .gd-qa .m-row-txt b { line-height: 1.35; }
.gd-playbook .gd-qa .m-row-go { transition: transform .2s; }
.gd-playbook .gd-qa[aria-expanded="true"] .m-row-go { transform: rotate(90deg); }
.gd-playbook > .gd-answer { border-top: 0; padding: 0 40px 16px 14px; font-size: 14px; line-height: 1.55; color: var(--tx-2); animation: gdReveal .22s ease both; }
.gd-playbook > .gd-answer b { font-weight: 600; color: var(--tx); }
@keyframes gdReveal { from { opacity: 0; transform: translateY(-4px); } }

/* Forge mode: one card */
.gd-pro { margin-left: 6px; padding: 2px 7px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 10px; letter-spacing: .08em; color: var(--tx-2); vertical-align: 1px; }
.gd-forge-title { display: block; font-family: var(--font-display, inherit); font-size: 22px; font-weight: 400; color: var(--tx); }
.gd-forge-copy { margin: 6px 0 14px; font-size: 14px; line-height: 1.5; color: var(--tx-2); }
.gd-forge .m-btn { width: 100%; }
.gd-forge.is-on .gd-forge-copy { margin: 12px 0 4px; }
.gd-forge-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin-top: 14px; }
.gd-forge-days i { height: 4px; border-radius: 99px; background: var(--m-surface-2); }
.gd-forge-days i.on { background: var(--accent); }
.gd-forge-list { margin: 8px 0 0; padding: 0; list-style: none; }
.gd-forge-list li { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.gd-forge-list .m-row-ico { margin-top: 1px; }
.gd-forge-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.gd-forge-txt b { font-size: 15px; font-weight: 500; color: var(--tx); overflow-wrap: anywhere; }
.gd-forge-txt small { font-size: 13px; line-height: 1.45; color: var(--tx-3); }
.gd-forge-end { margin-top: 4px; color: var(--tx-3); }

/* ============================================================
   Focus
   ============================================================ */
.focus-page .focus-header { align-items: flex-start; }
.focus-page .focus-today-total { padding: 4px 0 0 14px; }
.focus-page .focus-today-total span { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--tx-3); }
.focus-page .focus-today-total strong { margin-top: 4px; font-family: var(--font-display, inherit); font-size: 26px; font-weight: 400; letter-spacing: -.01em; }
.focus-page .focus-today-total em, .focus-page .focus-week-head em { margin-left: 1px; font-size: .6em; font-style: normal; color: var(--tx-3); }

/* the timer is the hero */
.focus-page .focus-stage { padding: 18px 0 4px; }
.focus-page .focus-intention > span { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--tx-3); }
.focus-page .focus-intention h2 { margin-top: 8px; font-family: var(--font-display, inherit); font-size: 24px; font-weight: 400; letter-spacing: -.01em; }
.focus-page .focus-session-ring { width: 236px; margin: 22px auto 24px; }
.focus-page .focus-session-ring::before { opacity: .55; }
.focus-page .focus-session-ring::after { background: conic-gradient(var(--accent) var(--focus-angle), var(--line-2) 0); }
.focus-page .focus-session-ring strong { font-family: var(--font-display, inherit); font-size: 60px; font-weight: 400; letter-spacing: -.02em; }
.focus-page .focus-session-ring .focus-dial-done { font-size: 30px; }
.focus-page .focus-session-ring small { margin-top: 8px; font-size: 12px; }
.focus-page .focus-dial-icon { margin-bottom: 10px; }

/* presets as chips, then one primary action */
.focus-page .focus-duration-grid { display: flex; justify-content: center; max-width: none; margin: 0 auto 18px; padding: 0; border: 0; gap: 8px; }
.focus-page .focus-preset { min-width: 76px; font-variant-numeric: tabular-nums; }
.focus-page .focus-stage .focus-begin {
  display: flex; align-items: center; justify-content: center; width: 100%; max-width: 320px; min-height: 52px; margin: 0 auto;
  border-radius: 999px; background: var(--blue-grad, var(--accent)); color: #fff; font-size: 16px; font-weight: 600;
  box-shadow: 0 6px 18px rgba(47, 93, 242, .26);
}
.focus-page .focus-adjust { min-height: 44px; margin-top: 4px; font-size: 13.5px; color: var(--tx-3); }
.focus-page .focus-session-state, .focus-page .focus-complete-note { margin: -6px 0 18px; font-size: 12.5px; }

/* session rows: adjust + distractions */
.focus-page .focus-session-list:empty { display: none; }
.focus-page .focus-protection-toggle { display: flex; grid-template-columns: none; min-height: 56px; padding: 10px 14px; gap: 12px; color: var(--tx); }
.focus-page .focus-protection-toggle small { margin-top: 0; }
.focus-page .focus-protection-state { font-size: 13px; font-weight: 500; color: var(--tx-3); white-space: nowrap; }
.focus-page .focus-protection-toggle .m-row-go { transition: transform .2s; }
.focus-page .focus-protection-toggle[aria-expanded="true"] .m-row-go { transform: rotate(90deg); }
.focus-page .focus-protection-section { padding: 0; border-top: 0; }
.focus-page .m-list > .m-row + .focus-protection-section { border-top: 1px solid var(--line); }
.focus-page .focus-protection-details { padding: 2px 14px 16px; }
.focus-native-line { display: flex; align-items: flex-start; gap: 10px; margin: 0; padding: 4px 0 12px; font-size: 13px; line-height: 1.45; color: var(--tx-3); }
.focus-native-line + .focus-native-line { padding-top: 12px; border-top: 1px solid var(--line); }
.focus-native-line > i { flex: none; width: 7px; height: 7px; margin-top: 6px; border-radius: 50%; background: var(--tx-3); }
.focus-native-line.ready > i { background: var(--accent); }
.focus-native-line.warning > i { background: var(--red, #ff6b6b); }
.focus-native-line > span { flex: 1; min-width: 0; }
.focus-native-line b { display: block; font-size: 13.5px; font-weight: 600; color: var(--tx); }
.focus-native-line .focus-retry { min-height: 36px; padding: 0 14px; font-size: 13px; }
.focus-page .focus-detail-head { display: flex; justify-content: space-between; align-items: baseline; margin: 6px 0 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.focus-page .focus-detail-head > span { font-size: 14px; font-weight: 600; color: var(--tx); }
.focus-page .focus-detail-head small { font-size: 12.5px; color: var(--tx-3); }
.focus-page .focus-empty-hint { margin: 0 0 10px; font-size: 13px; color: var(--tx-3); }
.focus-page .focus-target-grid { margin-bottom: 8px; }
.focus-page .focus-target-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; color: var(--tx); background: var(--m-surface-2); border-color: transparent; }
.focus-page .focus-target-chip b { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: inherit; line-height: 1.2; font-weight: 500; }
.focus-page .focus-target-chip span { display: grid; flex: none; width: 14px; height: 14px; color: var(--tx-3); letter-spacing: 0; }
.focus-page .focus-target-chip svg { width: 14px; height: 14px; }
.focus-page .focus-target-more { display: inline-flex; align-items: center; cursor: default; color: var(--tx-3); }
.focus-page .focus-chip-row { margin-bottom: 12px; }
.focus-page .focus-add-row + .focus-add-row { margin-top: 8px; }
.focus-page .focus-add-row .m-btn { min-width: 64px; }
.focus-page .focus-allday-control { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.focus-page .focus-allday-control b { font-size: 14px; font-weight: 600; }
.focus-page .focus-allday-control span { font-size: 12.5px; }
[data-skin="ember"] .focus-page .allday-switch.on { background: var(--blue-grad); border-color: transparent; }

/* week: total, active days, quiet bars */
.focus-page .focus-week-section { margin: 0; padding: 16px; border-top: 1px solid var(--line); }
.focus-week-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.focus-week-head .m-hero strong { font-size: 36px; }
.focus-week-days { padding-bottom: 4px; font-size: 13px; color: var(--tx-3); white-space: nowrap; }
.focus-page .focus-week-bars { height: 76px; margin-top: 18px; gap: 6px; }
.focus-page .focus-week-day { grid-template-rows: minmax(0, 1fr) 14px; gap: 8px; }
.focus-page .focus-week-track { max-width: 10px; border-radius: 99px; background: var(--m-surface-2); }
.focus-page .focus-week-day i { border-radius: 99px; background: color-mix(in srgb, var(--accent) 55%, transparent); }
.focus-page .focus-week-day.today i { background: var(--accent); }
.focus-page .focus-week-day small { font-size: 11px; font-weight: 500; }
.focus-page .focus-week-day.today small { color: var(--tx); font-weight: 700; }

/* meditation rows */
.focus-meditation .m-row-val { color: var(--tx-2); }

/* premium lock: a line-icon tile, no glow */
.focus-locked .premium-tab-lock { padding: 28px 20px 24px; border-radius: var(--m-radius); border: 1px solid var(--line); background: var(--m-surface); box-shadow: none; }
.focus-locked .ptl-icon { margin-bottom: 8px; filter: none; }
.focus-locked .ptl-icon .m-tile { width: 48px; height: 48px; border-radius: 14px; }
.focus-locked .ptl-icon .m-tile svg { width: 24px; height: 24px; }
.focus-locked .ptl-title { font-family: var(--font-display, inherit); font-size: 24px; font-weight: 400; }
.focus-locked .ptl-points li::before { content: ''; top: .55em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.focus-locked .ptl-price b { font-family: var(--font-display, inherit); font-weight: 400; }
.focus-locked .ptl-cta { border-radius: 999px; box-shadow: none; }

@media (hover: hover) {
  .gd-text-btn:hover { text-decoration: underline; text-underline-offset: 3px; }
  .gd-page .m-row.gd-qa:hover, .focus-page .m-row:hover { background: var(--m-surface-2); }
  .focus-page .focus-protection-toggle:hover { color: var(--tx); }
}
@media (max-width: 360px) {
  .gd-read .gd-grade { font-size: 32px; }
  .focus-page .focus-session-ring { width: 208px; }
  .focus-page .focus-session-ring strong { font-size: 50px; }
  .focus-page .focus-preset { min-width: 0; padding: 0 12px; }
  .focus-page .focus-protection-state { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .gd-meter i, .gd-playbook > .gd-answer { animation: none; }
  .gd-tip > summary::after, .gd-playbook .gd-qa .m-row-go, .focus-page .focus-protection-toggle .m-row-go { transition: none; }
}
[data-motion="reduced"] .gd-meter i, [data-motion="reduced"] .gd-playbook > .gd-answer { animation: none; }

/* ============================================================
   AI guide (v198): just the guide. A face, a conversation, one composer.
   ============================================================ */
/* One screen, no scroll, two windows (v218). Home: the greeting over an aurora rising from the bottom, a scattered cloud of
   questions and the composer. Chat: the portrait in the stage, the latest exchange in plain text under
   it, the composer pinned at the bottom. No page scroll on either at phone heights. */
:root { --ai-pool: rgba(0, 0, 0, .5); --ai-ink: var(--blue-2, #7d9dff); --ai-ink-2: var(--blue-3, #c3d1ff); }
:root[data-palette="greyblack"] { --ai-pool: rgba(0, 0, 0, .35); }
.ai-page {
  position: relative; isolation: isolate; display: grid; grid-template-columns: minmax(0, 1fr); box-sizing: border-box;
  padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px));   /* 16px between the composer and the tab bar */
}
#app:has(.ai-page), .screen:has(> .ai-page) { padding-bottom: 0; }
.screen:has(> .ai-page) { overflow-x: clip; }   /* the aurora, the cloud and the stage run past the gutters */
#app:has(.sl-dock) .ai-page { padding-bottom: calc(168px + env(safe-area-inset-bottom, 0px)); }
.ai-page > * { position: relative; z-index: 1; }
.ai-page.is-home { grid-template-rows: auto auto auto minmax(0, 1fr) auto; min-height: calc(100dvh - 14px - env(safe-area-inset-top, 0px)); }
.ai-page.is-chat { grid-template-rows: auto auto minmax(0, 1fr) auto auto; height: calc(100dvh - 14px - env(safe-area-inset-top, 0px)); overflow-x: visible; overflow-y: clip; }

/* the row under the brandbar: a pill in the middle, round ghost buttons at the edges */
.ai-top { display: grid; grid-template-columns: 36px minmax(0, 1fr) 36px; align-items: center; min-height: 36px; margin: 6px 0 0; }
.is-home .ai-top { margin-top: 34px; }
.is-chat .ai-top { align-items: start; }
.ai-mid { display: grid; justify-items: center; gap: 6px; min-width: 0; }
.ai-pill {
  justify-self: center; display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 999px;
  font-size: 12px; font-weight: 500; letter-spacing: .01em; color: var(--tx-2); white-space: nowrap;
}
.ai-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; line-height: 16px; color: var(--tx-3); white-space: nowrap; }
.ai-status i { width: 7px; height: 7px; border-radius: 50%; background: #3ddc84; box-shadow: 0 0 8px #3ddc84; transition: background-color .3s, box-shadow .3s; }
.ai-page:has(.ai-stage[data-state="listening"]) .ai-status i, .ai-page:has(.ai-stage[data-state="thinking"]) .ai-status i, .ai-page:has(.ai-stage[data-state="speaking"]) .ai-status i { background: var(--ai-ink); box-shadow: 0 0 8px var(--ai-ink); }
.ai-round {
  display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 1px solid var(--line-2); border-radius: 50%;
  background: color-mix(in srgb, var(--tx) 5%, transparent); color: var(--tx-2); cursor: pointer; transition: background-color .2s, color .2s, transform .15s;
}
.ai-round svg { width: 18px; height: 18px; stroke-width: 1.8; }
.ai-round:active { background: color-mix(in srgb, var(--tx) 12%, transparent); color: var(--tx); transform: scale(.94); }

/* window 1: the greeting */
.ai-hello {
  margin: 14px 0 0; font-family: var(--font-display, inherit); font-size: 30px; font-weight: 400; line-height: 1.15; letter-spacing: -.01em; text-align: center; color: var(--tx);
}
:root[data-palette="greyblack"] .ai-hello { font-weight: 700; letter-spacing: -.03em; }
/* the aurora: an elliptical dome of the ink rising from the bottom, its crest under the greeting and its sides lower, grain over it.
   It is alive: the dome breathes, two pools of color drift through it and a crest of light rises and falls. Every layer moves by
   transform and opacity only, so the phone composites it without repainting. */
.ai-aurora {
  position: absolute; left: -20px; right: -20px; bottom: 0; height: 70%; z-index: 0; overflow: hidden; pointer-events: none;
  -webkit-mask-image: linear-gradient(to top, #000 92%, transparent); mask-image: linear-gradient(to top, #000 92%, transparent);
}
.ai-aurora::before {
  content: ''; position: absolute; inset: 0; transform-origin: 50% 100%; will-change: transform;
  background: radial-gradient(74% 78% at 50% 83%, color-mix(in srgb, var(--ai-ink) 84%, var(--bg)) 0%, color-mix(in srgb, var(--ai-ink) 70%, var(--bg)) 42%, color-mix(in srgb, var(--ai-ink) 40%, transparent) 76%, transparent 100%);
  animation: aiDome 9s ease-in-out infinite;
}
.ai-aurora i { position: absolute; border-radius: 50%; will-change: transform, opacity; }
.ai-aurora i:nth-child(1) { left: -18%; bottom: 0; width: 86%; height: 64%; opacity: .5; background: radial-gradient(closest-side, color-mix(in srgb, var(--ai-ink-2) 72%, transparent), color-mix(in srgb, var(--ai-ink-2) 30%, transparent) 50%, transparent); animation: aiBlobA 11s ease-in-out infinite; }
.ai-aurora i:nth-child(2) { right: -22%; bottom: -14%; width: 84%; height: 62%; opacity: .45; background: radial-gradient(closest-side, color-mix(in srgb, var(--ai-ink) 85%, transparent), color-mix(in srgb, var(--ai-ink) 35%, transparent) 50%, transparent); animation: aiBlobB 14s ease-in-out infinite; }
.ai-aurora i:nth-child(3) { left: -10%; right: -10%; bottom: 34%; height: 38%; opacity: .4; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--ai-ink-2) 60%, transparent), transparent); animation: aiCrest 7s ease-in-out infinite; }
.ai-aurora::after {
  content: ''; position: absolute; inset: 0; opacity: .1; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
}
[data-theme="light"] .ai-aurora::after { mix-blend-mode: multiply; opacity: .14; }
@keyframes aiDome { 50% { transform: translateY(-2.5%) scale(1.06, 1.08); } }
@keyframes aiBlobA { 0%, 100% { transform: translate(0, 0) scale(1); opacity: .5; } 50% { transform: translate(28%, -18%) scale(1.18); opacity: .72; } }
@keyframes aiBlobB { 0%, 100% { transform: translate(0, 0) scale(1); opacity: .45; } 50% { transform: translate(-30%, -14%) scale(1.14); opacity: .7; } }
@keyframes aiCrest { 0%, 100% { transform: translate(-6%, 0) scale(1); opacity: .32; } 50% { transform: translate(6%, -16%) scale(1.08, 1.2); opacity: .6; } }

/* window 1: the cloud of questions in three staggered rows, the wide middle row cut by both screen edges, each chip
   tilted a little and floating a little, never overlapping */
.ai-cloud { align-self: end; display: grid; gap: 10px; min-width: 0; padding: 24px 0 0; margin: 0 -24px 14px; }
.ai-row { display: flex; justify-content: center; gap: 8px; min-width: 0; }
.ai-row:nth-child(1) { transform: translateX(-30px); }
.ai-row:nth-child(2) { transform: translateX(2px); }
.ai-row:nth-child(3) { transform: translateX(32px); }
.ai-chip, .ai-cloud .m-chip {
  flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; height: 44px; padding: 0 16px 0 14px; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--tx) 14%, transparent); background: color-mix(in srgb, var(--tx) 10%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  color: var(--tx); font-size: 13.5px; font-weight: 500; white-space: nowrap; animation: aiFloat 6s ease-in-out infinite;
}
.ai-chip svg { width: 16px; height: 16px; flex: none; stroke-width: 1.8; }
.ai-chip:active { background: color-mix(in srgb, var(--tx) 18%, transparent); }
.ai-row:nth-child(1) .ai-chip:nth-child(1) { transform: translateY(4px) rotate(-2deg); animation-delay: -1.2s; }
.ai-row:nth-child(1) .ai-chip:nth-child(2) { transform: translateY(-3px) rotate(1.5deg); animation-delay: -3.4s; animation-duration: 7s; }
.ai-row:nth-child(2) .ai-chip:nth-child(1) { transform: translateY(2px) rotate(-1deg); animation-delay: -5.1s; animation-duration: 5.4s; }
.ai-row:nth-child(2) .ai-chip:nth-child(2) { transform: translateY(-2px) rotate(2deg); animation-delay: -2.2s; animation-duration: 6.6s; }
.ai-row:nth-child(2) .ai-chip:nth-child(3) { transform: translateY(3px) rotate(-2.5deg); animation-delay: -0.6s; animation-duration: 5.8s; }
.ai-row:nth-child(3) .ai-chip:nth-child(1) { transform: translateY(-2px) rotate(1deg); animation-delay: -4.3s; animation-duration: 7.2s; }
.ai-row:nth-child(3) .ai-chip:nth-child(2) { transform: translateY(3px) rotate(-1.5deg); animation-delay: -2.9s; animation-duration: 6.2s; }
@keyframes aiFloat { 50% { translate: 0 -3px; } }

/* the composer pill: "+" (home), the input, the round ink button */
.ai-dock { align-self: end; }
.ai-compose {
  display: flex; align-items: center; gap: 4px; padding: 8px 8px 8px 10px; border-radius: 999px;
  border: 1px solid var(--line-2); background: color-mix(in srgb, var(--bg, #060a16) 70%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(140%); backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .22);
}
.ai-compose .ai-plus { margin-left: -4px; }
.ai-input { flex: 1; min-width: 0; min-height: 44px; padding: 0 6px; border: 0; border-radius: 0; background: transparent; box-shadow: none; font: inherit; font-size: 16px; color: var(--tx); -webkit-appearance: none; appearance: none; }
.ai-input::placeholder { color: var(--tx-3); }
.ai-input:focus, .ai-input:focus-visible { outline: none; box-shadow: none; }
.ai-compose:focus-within { border-color: color-mix(in srgb, var(--ai-ink) 55%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ai-ink) 14%, transparent), 0 10px 30px rgba(0, 0, 0, .22); }
:root .ai-page .ai-send, :root[data-palette] .ai-page .ai-send {
  flex: none; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%;
  background: var(--ai-ink); color: var(--bg); cursor: pointer; transition: transform .15s;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: none;
}
.ai-send:active { transform: scale(.94); }
.ai-send:disabled { opacity: .5; cursor: default; }
.ai-send svg { width: 19px; height: 19px; }
/* with dictation: the mic leads while the field is empty, the arrow takes over once there are words */
.ai-compose.can-talk:not(.has-text) .ai-go, .ai-compose.has-text .ai-mic { display: none; }
.ai-compose.listening { border-color: color-mix(in srgb, var(--ai-ink) 60%, transparent); }
.ai-compose.listening .ai-mic { animation: aiPulse 1.2s ease-in-out infinite; }
@keyframes aiPulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ai-ink) 55%, transparent); } 50% { box-shadow: 0 0 0 10px transparent; } }
.ai-fine { min-height: 0; margin: 6px 8px 0; font-size: 12px; line-height: 1.45; text-align: center; color: var(--tx-3); }
.ai-fine:empty { display: none; }
.ai-page .ai-consent { margin: 0 0 12px; }

/* window 2: the stage with the portrait, large and centred, its torso dissolving into the page over the last 100px */
.ai-stage {
  position: relative; min-height: 0; margin: 4px -16px 0; overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 100px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 100px), transparent);
}
/* until the portrait has drawn its first frame, a soft halo of the ink breathes where the face will be; it fades as the portrait fades in */
.ai-stage::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; transition: opacity .7s ease;
  background: radial-gradient(circle 100px at 50% 55%, color-mix(in srgb, var(--ai-ink) 30%, transparent), color-mix(in srgb, var(--ai-ink) 9%, transparent) 62%, transparent 100%);
  animation: aiBreathe 4.2s ease-in-out infinite;
}
.ai-stage:has(.ai-face[data-ready])::before { opacity: 0; animation: none; }
/* the pool behind the portrait rides on the canvas itself, so it arrives with the first frame */
.ai-face {
  position: absolute; inset: 0; width: 100%; height: 100%; color: var(--tx); opacity: 0; transition: opacity .7s ease;
  background: radial-gradient(ellipse 30% 26% at 50% 36%, color-mix(in srgb, var(--ai-ink) 16%, transparent), transparent 70%),
    radial-gradient(ellipse 46% 50% at 50% 44%, var(--ai-pool), transparent 74%);
}
[data-theme="light"] .ai-face {
  background: radial-gradient(ellipse 30% 26% at 50% 36%, color-mix(in srgb, var(--ai-ink) 14%, transparent), transparent 70%),
    radial-gradient(ellipse 46% 50% at 50% 44%, color-mix(in srgb, var(--ai-ink) 8%, transparent), transparent 74%);
}
.ai-face[data-ready] { opacity: 1; }
/* the latest exchange, in plain text under the portrait: the question small, the answer in the display font */
.ai-say { display: grid; justify-items: center; padding: 20px 12px 24px; text-align: center; }
.ai-cards { position: relative; display: grid; justify-items: center; width: 100%; }
.ai-cards > .ai-card { grid-area: 1 / 1; }
.ai-page .ai-card { width: min(100%, 360px); display: grid; justify-items: center; gap: 6px; padding: 0; border: 0; background: none; box-shadow: none; }
.ai-card.is-in { animation: aiCardIn .55s cubic-bezier(.2, .8, .2, 1) both; }
.ai-card.is-out { animation: aiCardOut .15s ease-out both; pointer-events: none; }
.ai-q { max-width: 100%; font-size: 13px; color: var(--tx-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-a {
  margin: 0; max-width: 100%; font-family: var(--font-display, inherit); font-size: 22px; font-weight: 400; line-height: 1.35; letter-spacing: -.005em; color: var(--tx);
  white-space: pre-wrap; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 5; overflow: hidden; position: relative;
}
.ai-a-size { visibility: hidden; }
.ai-a-text { position: absolute; left: 0; right: 0; top: 0; }
:root[data-palette="greyblack"] .ai-a { font-weight: 600; letter-spacing: -.02em; }
#aiTypingText::after { content: ''; display: inline-block; width: 7px; height: 7px; margin-left: 5px; border-radius: 50%; background: var(--tx-2); vertical-align: middle; animation: aiBlink 1s ease-in-out infinite; }
.ai-dots { display: inline-flex; gap: 5px; padding: 10px 0; }
.ai-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--ai-ink); animation: aiDot 1.2s ease-in-out infinite; }
.ai-dots i:nth-child(2) { animation-delay: .15s; }
.ai-dots i:nth-child(3) { animation-delay: .3s; }

/* sheets: menu, conversation, week, Forge, account */
.ai-sheet { display: grid; gap: 14px; padding: 6px 0 4px; }
.ai-sheet .gd-head { min-height: 28px; }
.ai-sheet .gd-forge { padding: 0; border: 0; background: none; box-shadow: none; }
.ai-sheet .gd-forge-copy { margin-top: 8px; }
.ai-sheet.gd-auth-body { padding: 6px 0 4px; }
.ai-menu { gap: 0; }
.ai-menu .m-row-ico svg { stroke-width: 1.8; }
.ai-note { margin: 2px 0 0; font-size: 11px; line-height: 1.45; color: var(--tx-3); }
.ai-note.is-err { color: var(--red, #ff6b6b); }
.gd-lack { display: grid; }
.gd-lack .m-cap { margin: 6px 2px 2px; }
.gd-lack-row { position: relative; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 11px 2px 12px; border-bottom: 1px solid var(--line); }
.gd-lack-row b { font-size: 15.5px; font-weight: 500; color: var(--tx); }
.gd-lack-row span { font-size: 13px; color: var(--tx-3); font-variant-numeric: tabular-nums; }
.gd-lack-row i { position: absolute; left: 2px; bottom: -1px; height: 2px; width: var(--p, 0%); border-radius: 99px; background: var(--red, #ff6b6b); }
.gd-lack-row.is-anchor i { background: var(--accent); }
.ai-own { display: grid; gap: 10px; }
.ai-prov { display: flex; gap: 6px; }
.ai-keyrow { display: flex; gap: 8px; }
.ai-keyrow .m-input { flex: 1; min-width: 0; }
.ai-own-row { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.ai-own-row b { font-weight: 500; }
.ai-own-row small { flex: 1; font-size: 13px; color: var(--tx-3); letter-spacing: .04em; }
.ai-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: #3ddc84; box-shadow: 0 0 8px #3ddc84; }
.ai-log .ai-thread { display: grid; gap: 10px; max-height: 52dvh; overflow: auto; padding: 2px 2px 6px; }
.ai-msg { max-width: 92%; font-size: 15px; line-height: 1.55; color: var(--tx); white-space: pre-wrap; overflow-wrap: anywhere; }
.ai-msg.me { justify-self: end; max-width: 80%; padding: 8px 13px; border-radius: 16px 16px 5px 16px; background: var(--m-surface-2); color: var(--tx-2); }
.ai-msg.ai { justify-self: start; padding: 0 4px; }
.ai-empty { margin: 0; padding: 12px 0; text-align: center; font-size: 14px; color: var(--tx-3); }
.ai-hist-foot { display: flex; justify-content: space-between; gap: 8px; }
.ai-hist-foot .m-btn { flex: 1; }

/* the tab bar in light: the same pill as the dark themes, so the guide reads the same everywhere */
[data-theme="light"] .tabbar-dock { padding: 0 16px calc(12px + env(safe-area-inset-bottom)); border-top: 0; background: linear-gradient(180deg, transparent, var(--bg) 45%); -webkit-backdrop-filter: none; backdrop-filter: none; }
[data-theme="light"] .tabbar-row { gap: 10px; }
[data-theme="light"] .tabbar {
  height: 64px; max-width: 380px; margin: 0 auto; padding: 0 6px; gap: 2px; justify-content: space-around; align-items: center;
  border: 1px solid var(--line-2); border-radius: 34px; background: color-mix(in srgb, var(--bg) 86%, transparent); box-shadow: 0 12px 34px rgba(41, 43, 45, .12);
  -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
}
[data-theme="light"] .tabbar .tab-btn { flex: 1 1 0; height: 52px; min-height: 52px; padding: 0; border-radius: 26px; gap: 3px; justify-content: center; font-size: 10.5px; font-weight: 600; letter-spacing: .01em; }
[data-theme="light"] .tabbar .tab-btn.active { background: var(--accent); color: #fff; }
[data-theme="light"] .tabbar .tab-btn.active svg { color: #fff; filter: none; }
[data-theme="light"] .tabbar .tab-btn.active::before, [data-theme="light"] .tabbar .tab-cursor { display: none; }

@keyframes aiCardIn { from { opacity: 0; transform: translateY(22px) scale(.97); } }
@keyframes aiCardOut { to { opacity: 0; transform: translateY(-10px); } }
@keyframes aiDot { 0%, 100% { opacity: .3; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }
@keyframes aiBlink { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
@keyframes aiBreathe { 50% { transform: scale(1.04); opacity: .8; } }
@media (max-height: 700px) {
  .is-home .ai-top { margin-top: 18px; }
  .ai-hello { margin-top: 10px; }
  .ai-say { padding: 16px 12px 20px; }
  .ai-a { -webkit-line-clamp: 3; font-size: 20px; }
}
@media (max-width: 374px) {
  .ai-hello { font-size: 26px; }
  .ai-cloud { gap: 8px; padding-top: 18px; margin: 0 -20px 14px; }
  .ai-row { gap: 6px; }
  .ai-row:nth-child(1) { transform: translateX(-22px); }
  .ai-row:nth-child(3) { transform: translateX(24px); }
  .ai-chip, .ai-cloud .m-chip { padding: 0 14px 0 12px; font-size: 13px; }
  .ai-a { font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) {
  .ai-face, .ai-status i, .ai-round { transition: none; }
  .ai-aurora::before, .ai-aurora i, .ai-chip, .ai-cloud .m-chip, .ai-dots i, #aiTypingText::after, .ai-card.is-in, .ai-compose.listening .ai-mic, .ai-stage::before { animation: none; }
  .ai-card.is-out { display: none; }
}
[data-motion="reduced"] .ai-aurora::before { animation: none; }
[data-motion="reduced"] :is(.ai-aurora i, .ai-chip, .ai-cloud .m-chip, .ai-dots i, #aiTypingText::after, .ai-card.is-in, .ai-compose.listening .ai-mic, .ai-stage::before) { animation: none; }
[data-motion="reduced"] .ai-card.is-out { display: none; }
[data-motion="reduced"] :is(.ai-face, .ai-status i, .ai-round) { transition: none; }
:root .ai-page section.ai-stage { background: none; border: 0; }
:root .ai-page canvas.ai-face { filter: none; }

/* Device matrix 2026-10-19, touch targets: the guide's round buttons draw at 36px; a 4px halo makes the hit area 44px and moves nothing. */
.ai-round { position: relative; }
.ai-round::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; }

/* Contrast (pixel audit 2026-10-19): over the brightest part of the aurora the chip glass was a light blue
   and its white text fell to 2.5:1. In the dark looks the glass now sits on a deeper base (40% of the
   page colour, deeper where a palette's aurora is brighter) with a faint halo, so the labels hold 4.5:1;
   the light look already passed. */
:root:not([data-theme="light"]) :is(.ai-chip, .ai-cloud .m-chip) {
  background: linear-gradient(color-mix(in srgb, var(--tx) 10%, transparent), color-mix(in srgb, var(--tx) 10%, transparent)), color-mix(in srgb, var(--bg) var(--ai-chip-base, 40%), transparent);
  text-shadow: 0 1px 2px color-mix(in srgb, var(--bg) 55%, transparent);
}
:root:not([data-theme="light"]) .ai-chip:active { background: linear-gradient(color-mix(in srgb, var(--tx) 18%, transparent), color-mix(in srgb, var(--tx) 18%, transparent)), color-mix(in srgb, var(--bg) var(--ai-chip-base, 40%), transparent); }
:root[data-palette="sky"] { --ai-chip-base: 46%; }
:root[data-palette="greyblack"] { --ai-chip-base: 56%; }
