/* Pochilo — direction 4, approuvée le 5 décembre 2026.
   L'indigo de Nomi donne le fond ; ses yeux ambrés portent les actions. */
@font-face {
  font-family: "DM Sans";
  src: url("./fonts/dm-sans-latin.woff2") format("woff2");
  font-weight: 100 1000;
  font-style: normal;
  font-display: swap;
}
:root, :root[data-offline] {
  color-scheme: dark;
  --paper: #191925;
  --header: #1e1e2d;
  --surface: #2b2b3d;
  --raised: #353547;
  --selected: #333344;
  --ink: #f7f0e5;
  --muted: #bbb8c5;
  --line: #444454;
  --control: #737183;
  --accent: #f6bf73;
  --on-accent: #291d10;
  --warm: #ffb6ac;
  --warning: #462e36;
  --action-hover: #ffd298;
  --shadow: rgb(7 7 15 / .32);
  --display: "DM Sans", system-ui, sans-serif;
  --sidebar-width: clamp(244px, 20vw, 308px);
  --mobile-nav-height: calc(52px + env(safe-area-inset-bottom, 0px));
  font-family: var(--display);
  background: var(--paper);
}
body, button, input, select, textarea { font-family: var(--display); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
body { min-width: 280px; }
button, a, summary { -webkit-tap-highlight-color: transparent; }
button { transition: background-color 140ms ease-out, border-color 140ms ease-out, color 140ms ease-out; }
a { color: var(--accent); text-underline-offset: .2em; }
* { scrollbar-width: thin; scrollbar-color: var(--control) transparent; }
::selection { color: var(--on-accent); background: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
button:disabled { opacity: .5; }
.action, .quiet { font-weight: 550; border-radius: 10px; }
.primary, .dark { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.icon-button { border-radius: 12px; }
.glyph { stroke-width: 1.65; }
.network, .network.off { border: 0; background: transparent; color: var(--ink); padding: 8px 0 8px 12px; font: 500 .9rem/1.3 var(--display); }
.network::before { width: 8px; height: 8px; background: #a4c6a1; }
.network.off::before { background: transparent; border: 1px solid var(--accent); }
.mast { background: var(--paper); }
.mast-inner { min-height: 76px; max-width: 1352px; padding: 12px clamp(24px, 3.2vw, 52px); }
.mast-left { min-width: 0; gap: 12px; }
.header-wordmark { font-size: 1.4rem; font-weight: 650; letter-spacing: -.025em; }
.header-divider { color: var(--control); }
#workspace-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; color: var(--muted); }
.mast-status { gap: 12px; }
#share-open { display: inline-flex; align-items: center; justify-content: center; flex: none; gap: 8px; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font-size: .85rem; font-weight: 550; white-space: nowrap; }
#share-open:hover, #share-open:focus-visible { background: var(--selected); border-color: var(--control); }
#share-open .glyph { width: 18px; height: 18px; }
body:has(#empty:not([hidden])) #conversation-context,
body:has(#empty:not([hidden])) #workspace-title,
body:has(#empty:not([hidden])) .header-divider { display: none; }
#workspace-sidebar, #mobile-navigation { display: none; }
[data-shell-action="offline"], #offline-menu { position: relative; }
.offline-missing-dot { position: absolute; inset-block-start: 8px; inset-inline-end: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--warm); pointer-events: none; }
[data-shell-action="offline"][data-offline-ready="true"] { color: var(--accent); }
.offline-share-link { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 48px; margin-block-start: 16px; border-top: 1px solid var(--line); border-radius: 0; color: var(--accent); }
#share-pochilo { position: fixed; inset: 0; margin: auto; width: min(480px, calc(100% - 32px)); height: fit-content; max-height: calc(100dvh - 32px); overflow-y: auto; padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--header); overscroll-behavior: contain; }
.share-head { display: flex; align-items: center; gap: 8px; }
.share-head h2 { flex: 1; margin: 0; font-size: 1.4rem; line-height: 1.25; letter-spacing: -.025em; }
.share-head .avatar-slot { flex: 0 0 44px; }
#lan-sharing { margin-block: 24px; padding-block-end: 24px; border-bottom: 1px solid var(--line); }
#lan-sharing h3 { margin: 0 0 12px; font-size: 1.15rem; line-height: 1.4; }
#lan-sharing h4 { margin: 24px 0 12px; font-size: 1.02rem; line-height: 1.4; }
#lan-sharing p { color: var(--muted); font-size: .9rem; line-height: 1.6; margin: 12px 0; }
#lan-sharing > button, #lan-choice > button, #lan-published > button { width: 100%; min-height: 48px; margin-block-start: 16px; }
#lan-sharing label { display: block; font-size: .9rem; line-height: 1.5; }
#lan-sharing .share-pack-list label { display: flex; }
#lan-code-field { margin-block: 20px; }
#lan-native-code, #lan-address, #lan-address-choice { display: block; width: 100%; min-width: 0; min-height: 48px; margin-block: 8px; padding: 12px; border: 1px solid var(--control); border-radius: 9px; color: var(--ink); background: var(--paper); font-size: 1rem; }
#lan-code-field small { display: block; color: var(--muted); font-size: .82rem; line-height: 1.5; }
#lan-sharing .lan-consent { display: flex; align-items: start; gap: 12px; margin-block: 20px; padding-block: 12px; }
.lan-consent input { flex: 0 0 20px; width: 20px; height: 20px; margin: 2px 0 0; }
#lan-progress { margin-block: 24px; }
#lan-progress-meter { width: 100%; height: 8px; accent-color: var(--accent); }
#lan-progress-count { font-variant-numeric: tabular-nums; }
#lan-code-image { width: min(224px, 100%); margin: 24px auto; }
#lan-qr { display: block; width: 100%; height: auto; aspect-ratio: 1; border-radius: 8px; shape-rendering: crispEdges; }
#lan-certificate-links a, #lan-secure-links a { display: block; padding-block: 12px; color: var(--accent); line-height: 1.5; overflow-wrap: anywhere; }
#lan-sharing .lan-fingerprint { overflow-wrap: anywhere; font-size: .8rem; user-select: all; }
.share-peer-title { margin: 24px 0 0; font-size: 1.05rem; line-height: 1.4; }
#share-help { margin: 16px 0 0; color: var(--muted); line-height: 1.55; }
#share-pochilo :is(.share-local-help, .share-privacy) { color: var(--muted); font-size: .88rem; line-height: 1.6; margin: 12px 0 0; }
.share-roles { display: grid; grid-template-columns: 1fr; gap: 12px; margin-block: 24px; }
.share-roles button { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 16px; text-align: start; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); }
.share-roles button[aria-pressed="true"] { border-color: var(--accent); background: var(--selected); }
.share-roles button:hover:not(:disabled) { background: var(--selected); }
.share-roles button:disabled { opacity: .7; }
.share-roles button:disabled[aria-pressed="false"] { display: none; }
.share-roles button[aria-pressed="true"]:disabled { opacity: 1; }
.share-roles .glyph { flex: 0 0 20px; width: 20px; height: 20px; color: var(--accent); }
.share-stage { margin-block: 24px; }
.share-stage h3 { margin: 0 0 16px; font-size: 1.05rem; line-height: 1.4; }
.share-stage > button { width: 100%; min-height: 48px; margin-block-start: 16px; }
.share-code-label { display: block; margin: 16px 0 8px; font-size: .88rem; font-weight: 600; }
#share-pochilo textarea { display: block; width: 100%; min-width: 0; min-height: 88px; resize: vertical; padding: 12px; background: var(--paper); color: var(--ink); border: 1px solid var(--control); border-radius: 9px; font-size: 1rem; line-height: 1.5; overflow-wrap: anywhere; }
.share-photo-label { display: block; margin-block: 16px; font-size: .88rem; line-height: 1.5; }
.share-photo-label input { display: block; max-width: 100%; margin-block-start: 8px; font-size: .85rem; }
.share-pack-list { display: grid; gap: 8px; }
.share-pack-list label { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.share-pack-list label:first-child { padding-top: 0; }
.share-pack-list label > span { min-width: 0; font-size: .94rem; }
.share-pack-list small { display: block; margin-block-start: 4px; color: var(--muted); font-size: .82rem; font-variant-numeric: tabular-nums; }
.share-pack-list input { width: 20px; height: 20px; flex: 0 0 20px; }
#share-code-image { width: min(224px, 100%); margin: 24px auto; }
#share-qr { display: block; width: 100%; height: auto; aspect-ratio: 1; border-radius: 8px; shape-rendering: crispEdges; }
.share-code-details { margin-block: 16px; font-size: .88rem; }
.share-code-details summary { padding-block: 12px; cursor: pointer; }
.share-code-details button { width: 100%; min-height: 48px; margin-block-start: 8px; }
#share-progress-meter { width: 100%; height: 8px; margin-block: 8px; accent-color: var(--accent); }
#share-progress-label { line-height: 1.5; }
#share-progress-count { font-variant-numeric: tabular-nums; }
.share-url-label { display: block; margin-block-start: 20px; margin-block-end: 8px; font-size: .88rem; font-weight: 600; }
#share-url { display: block; width: 100%; min-width: 0; min-height: 48px; padding: 12px; border: 1px solid var(--control); border-radius: 9px; color: var(--ink); background: var(--paper); font-size: 1rem; }
.share-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-block-start: 16px; }
.share-actions button { min-height: 48px; flex: 1 1 auto; }
#share-native { display: flex; align-items: center; justify-content: center; gap: 8px; }
#share-message { margin: 12px 0 0; }
#share-message:empty { display: none; }
#share-first-open, #share-network, #share-address-note { margin: 20px 0 0; font-size: .88rem; line-height: 1.55; color: var(--muted); }
.share-install { margin-block-start: 16px; padding: 12px 0 0; border-top: 1px solid var(--line); font-size: .88rem; }
.share-install summary { padding-block: 12px; cursor: pointer; color: var(--ink); line-height: 1.5; }
.share-install p { color: var(--muted); line-height: 1.55; }
.share-install strong { color: var(--ink); }
#share-downloads { width: 100%; min-height: 48px; margin-block-start: 12px; color: var(--accent); }
#nearby-receive { position: fixed; inset: 0; margin: auto; width: min(460px, calc(100% - 32px)); height: fit-content; max-height: calc(100dvh - 32px); padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--header); overscroll-behavior: contain; }
#nearby-help { margin-block: 20px; color: var(--muted); line-height: 1.55; }
#nearby-packs label { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; padding: 12px 0; border-bottom: 1px solid var(--line); }
#nearby-packs strong, #nearby-packs small { display: block; }
#nearby-packs small { margin-top: 6px; color: var(--muted); }
#nearby-packs input { width: 20px; height: 20px; accent-color: var(--accent); }
#nearby-meter { width: 100%; accent-color: var(--accent); }
#nearby-share { min-height: 48px; margin-block-start: 16px; }
#nearby-internet { min-height: 48px; width: 100%; }
@media (max-width: 560px) {
  #share-pochilo, #nearby-receive { inset: auto 0 0; margin: 0; width: 100%; max-height: calc(100dvh - 16px); padding: 20px 20px max(24px, env(safe-area-inset-bottom)); border-radius: 20px 20px 0 0; }
}
@media (prefers-reduced-motion: no-preference) {
  #share-pochilo[open], #nearby-receive[open] { animation: share-arrive 240ms cubic-bezier(.16, 1, .3, 1); }
  @keyframes share-arrive { from { transform: translateY(12px); } to { transform: translateY(0); } }
}
#app { max-width: 1352px; min-height: calc(100dvh - 76px); padding: 0 clamp(24px, 3.2vw, 52px); }
#app:has(#empty:not([hidden])) {
  display: grid;
  grid-template-areas: "intro" "composer" "starters" "footer";
  grid-template-rows: auto auto 1fr auto;
  align-content: start;
  row-gap: 20px;
  padding-top: clamp(16px, 3vh, 40px);
  padding-bottom: 32px;
}
#photo:has(#empty:not([hidden])), #empty:not([hidden]) { display: contents; }
.welcome-intro { grid-area: intro; display: grid; grid-template-columns: minmax(0, 1fr) 30%; gap: 20px; align-items: center; min-height: clamp(160px, 20vh, 220px); }
.welcome-copy { min-width: 0; }
#welcome-title { text-align: start; font: 600 2.375rem/1.2 var(--display); letter-spacing: -.035em; text-wrap: balance; }
#empty #welcome-help { max-width: 52ch; text-align: start; margin-top: 12px; color: var(--muted); font: 400 1rem/1.5 var(--display); }
.welcome-mark { display: none; }
#empty #personal-greeting { margin-top: 12px; text-align: start; font-size: .95rem; color: var(--accent); }
.companion { display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; min-width: 0; width: 100%; height: auto; margin: 0; background: none; image-rendering: auto; }
#welcome-scene, .companion::before, .companion::after, .companion .avatar-slot::before { display: none; }
.companion .avatar-slot[data-avatar-slot="home"] { --avatar-size: clamp(144px, 17vw, 224px); margin: 0; }
.companion .avatar-slot { max-width: 100%; height: auto; aspect-ratio: 1; }
.companion #pochilo-avatar::before { visibility: hidden; }
.companion #pochilo-avatar > .nomi-portrait { display: block; position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: auto; animation: none; }
/* Nomi keeps its pearl shell in every connection state. */
:root[data-offline] .nomi-shell-online { display: inline; }
:root[data-offline] .nomi-shell-offline { display: none; }
#pochilo-avatar:focus-visible { outline-color: var(--accent); }
#dock { background: var(--paper); padding: 16px 0 20px; }
#app:has(#empty:not([hidden])) #dock { grid-area: composer; position: relative; inset: auto; width: 100%; max-width: none; margin: 0; padding: 0; }
.composer, .composer:focus-within, .composer:has(textarea:focus-visible) { background: var(--surface); border: 1px solid var(--control); border-radius: 20px; padding: 14px 16px 12px; }
.composer:focus-within { border-color: var(--accent); }
.composer:has(textarea:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
.composer textarea { min-height: 104px; max-height: clamp(104px, var(--draft-room, 240px), 240px); padding: 4px; font: 400 16px/24px var(--display); color: var(--ink); caret-color: var(--accent); }
.composer textarea::placeholder { color: var(--muted); }
.composer-row { gap: 12px; padding-top: 8px; }
.composer-right { display: contents; }
#send { margin-inline-start: auto; }
.attach-button, .mic-button { border: 1px solid var(--control); border-radius: 12px; width: 48px; height: 48px; color: var(--ink); font-size: 1rem; }
.send-button { width: 52px; height: 48px; border: 0; border-radius: 14px; color: var(--on-accent); background: var(--accent); }
.send-button .glyph { width: 26px; height: 26px; }
.send-button:disabled { background: var(--accent); color: var(--on-accent); opacity: .5; }
.composer-note { text-align: start; color: var(--muted); font-size: .8rem; }
.starter-actions { grid-area: starters; padding: 20px 0 4px; }
.shortcuts { width: 100%; margin: 0; gap: 0; }
.shortcut, :root[data-offline] .shortcut { min-height: 60px; border: 0; border-radius: 0; background: transparent; padding: 10px 16px; gap: 12px; color: var(--ink); font: 550 .9375rem/1.4 var(--display); }
.shortcut + .shortcut { border-inline-start: 1px solid var(--line); }
.shortcut:first-child { padding-inline-start: 12px; }
.shortcut:hover, .shortcut:focus-visible, :root[data-offline] .shortcut:is(:hover,:focus-visible) { background: var(--header); }
.shortcut .shortcut-glyph { width: 24px; height: 24px; color: var(--accent); }
.shortcut[data-icon] .shortcut-glyph { color: var(--accent); }
.shortcut span { max-width: none; text-wrap: balance; }
.workspace-footnote { grid-area: footer; display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 8px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); text-align: center; font-size: .875rem; }
.workspace-footnote .glyph { width: 20px; height: 20px; }
#welcome-name { margin: 8px 0 0; width: min(100%, 34rem); }
#feed { width: min(100%, 800px); margin-inline: auto; padding-block: 36px 24px; gap: 28px; }
.user-message, :root[data-offline] .user-message { background: var(--selected); color: var(--ink); padding: 12px 18px; border-radius: 18px 18px 6px 18px; }
.speaker-name, .audio-control { color: var(--accent); }
.answer-text { line-height: 1.7; }
#app:not(:has(#empty:not([hidden]))) { max-width: 940px; }
#app:not(:has(#empty:not([hidden]))) .workspace-footnote { border: 0; padding: 0 0 20px; margin: 0; font-size: .75rem; }
.drawer-scroll > .quiet { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; margin: 0; text-align: start; justify-content: start; padding: 10px 12px; color: var(--ink); font-size: 1rem; font-weight: 450; }
.drawer-scroll > .quiet:not(:has(svg)) { padding-inline-start: 46px; }
#new-chat { min-height: 52px; margin-bottom: 20px; justify-content: start; padding-inline: 16px; font-size: 1rem; white-space: nowrap; }
.sidebar-discussions { display: flex; align-items: center; gap: 12px; min-height: 48px; margin-bottom: 8px; padding: 10px 12px; border-radius: 12px; background: var(--selected); color: var(--ink); font-size: 1rem; font-weight: 500; }
#drawer-settings:empty { display: none; }
#history-group { margin: 24px 12px 8px; font-size: .75rem; font-weight: 500; color: var(--muted); }
#history-empty { padding: 4px 12px; font-size: .8rem; }
#history-list li { border: 0; border-radius: 10px; margin-block: 4px; }
#history-list li:has([aria-current="page"]) { background: var(--selected); }
#history-list button { padding: 10px 12px; font-size: .86rem; }
#history-list small { font-size: .73rem; }
#folder-nav { margin-block: 20px 4px; padding-top: 16px; border-top: 1px solid var(--line); }
#folder-nav h3 { font-size: .8rem; font-weight: 500; }
#folder-create { min-width: 44px; min-height: 44px; }
#folder-filters button { min-height: 44px; }
.drawer-footer { padding-top: 12px; margin-top: 16px; }
.drawer-footer #settings-open { min-height: 48px; gap: 12px; font-size: .95rem; font-weight: 450; }
.drawer-scroll .privacy-note { font-size: .75rem; margin-top: 24px; line-height: 1.6; }
dialog::backdrop { background: rgb(8 8 15 / .68); }
#settings-panel { background: var(--header); border-color: var(--line); border-radius: 24px; }
.settings-head { padding: 24px 28px 16px; border-bottom: 1px solid var(--line); }
.settings-head h2 { font-size: 1.7rem; font-weight: 550; }
.settings-body { padding-inline: 28px; }
.settings-section { padding-block: 24px; }
.settings-section > h3, .settings-section > summary { font-weight: 550; }
@media(min-width: 1024px) {
  body { padding-inline-start: var(--sidebar-width); }
  #workspace-sidebar { display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; width: var(--sidebar-width); padding: 28px 16px 24px; background: var(--header); border-inline-end: 1px solid #252536; z-index: 5; }
  .workspace-brand { display: flex; align-items: center; gap: 10px; flex: none; width: 100%; padding: 0 8px; min-height: 64px; border: 0; background: transparent; color: var(--ink); font-size: clamp(1.5rem, 2.4vw, 2rem); font-weight: 650; letter-spacing: -.03em; text-align: start; }
  .brand-avatar { width: 64px; height: 64px; object-fit: contain; }
  #workspace-navigation { display: flex; flex-direction: column; flex: 1; min-height: 0; margin-top: 36px; }
  #workspace-navigation .drawer-scroll { margin: 0; padding: 0 4px 8px; }
  #workspace-navigation .drawer-footer { flex: none; border: 0; margin-top: 8px; }
  .sidebar-offline { flex: none; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
  .sidebar-offline button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 8px; border: 0; border-radius: 10px; background: transparent; text-align: start; font-size: .9rem; }
  .sidebar-offline button:hover { background: var(--selected); }
  .mast .header-wordmark, .mast .header-divider, #history-button { display: none; }
  .mast-left { flex: 1; }
  #workspace-title { max-width: 50ch; }
  #workspace-sidebar .privacy-note { display: none; }
}
@media(max-width: 1023px) {
  .mast-inner { min-height: 60px; padding: max(8px, env(safe-area-inset-top)) 20px 8px; }
  .mast-left { gap: 8px; }
  #history-button { display: none; }
  .header-divider, #workspace-title { display: none; }
  #conversation-context .context-name { display: none; }
  .mast-status { gap: 4px; }
  .share-name-extra { display: none; }
  #app { min-height: calc(100dvh - 60px); padding-inline: clamp(24px, 4vw, 36px); }
  #app:has(#empty:not([hidden])) { padding-top: 20px; padding-bottom: calc(var(--mobile-nav-height) + 24px); row-gap: 20px; }
  .welcome-intro { min-height: 164px; grid-template-columns: minmax(0, 1fr) 25%; gap: 24px; }
  #welcome-title { font-size: 2rem; }
  .companion .avatar-slot[data-avatar-slot="home"] { --avatar-size: clamp(112px, 18vw, 164px); }
  #empty #welcome-help { font-size: 1rem; margin-top: 16px; }
  .welcome-mark { margin-top: 20px; width: 96px; }
  .shortcut { min-height: 60px; padding-inline: 12px; font-size: .9375rem; gap: 12px; }
  .shortcut .shortcut-glyph { width: 26px; height: 26px; }
  .composer-row [data-avatar-slot="composer"] { --avatar-size: 44px; flex: 0 0 44px; width: 44px; height: 44px; margin-inline-start: auto; }
  .composer-row #send { margin: 0; }
  #feed { gap: 36px; }
  .answer-text { font-size: 1rem; line-height: 1.75; }
  .turn { gap: 16px; }
  .message-tools { gap: 8px; padding-top: 4px; }
  .settings-model label { font-size: 1rem; }
  .settings-model select { min-height: 48px; padding: 10px 12px; font-size: 1rem; }
  .settings-packs button { min-height: 48px; padding: 10px 14px; font-size: 1rem; }
  .settings-intro, .settings-extra p, #memory-settings p, #settings-fields p, #settings-comfort .voice-options p { font-size: 1rem; line-height: 1.6; }
  .settings-extra > summary, #memory-settings > summary { min-height: 48px; padding-block: 14px; font-size: 1rem; }
  .settings-choices button { min-height: 48px; padding: 10px 8px; }
  .device-stats > div { gap: 8px; padding-block: 12px; font-size: 1rem; line-height: 1.6; }
  #mobile-navigation { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); position: fixed; inset: auto 0 0; height: var(--mobile-nav-height); padding: 3px max(8px, env(safe-area-inset-right)) calc(3px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left)); background: var(--header); border-top: 1px solid var(--line); z-index: 4; }
  #mobile-navigation button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 44px; padding: 2px 4px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: .7rem; line-height: 1.2; }
  #mobile-navigation button:hover, #mobile-navigation button:focus-visible { color: var(--ink); background: var(--selected); }
  #mobile-navigation .glyph { width: 20px; height: 20px; }
  #mobile-navigation [data-shell-action="new"] { color: var(--accent); }
  #app:not(:has(#empty:not([hidden]))) { padding-bottom: calc(var(--dock-height, 220px) + var(--mobile-nav-height) + var(--active-keyboard-inset, 0px)); }
  #app:not(:has(#empty:not([hidden]))) #dock { position: fixed; inset-inline: 0; bottom: calc(var(--mobile-nav-height) + var(--active-keyboard-inset, 0px)); max-width: 940px; width: 100%; margin-inline: auto; padding: 12px 24px 12px; display: flex; flex-direction: column; max-height: calc(var(--visible-height, 100dvh) - var(--mobile-nav-height)); }
  #app #composer { order: 0; }
  :root[data-keyboard] #mobile-navigation { display: none; }
  :root[data-keyboard] #app { --mobile-nav-height: 0px; --active-keyboard-inset: var(--keyboard-inset, 0px); }
  #app:not(:has(#empty:not([hidden]))) .workspace-footnote { display: none; }
}
@media(max-width: 560px) {
  .mast-inner { padding-inline: 20px; }
  .header-wordmark { font-size: 1.25rem; }
  .network, .network.off { font-size: .8rem; }
  .mast-status .network { gap: 0; min-width: 24px; padding: 8px 4px; }
  .network-label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
  #app { padding-inline: 20px; }
  #app:has(#empty:not([hidden])) { padding-top: 16px; row-gap: 20px; grid-template-rows: auto auto auto auto; }
  .welcome-intro { position: relative; display: flex; flex-direction: column-reverse; gap: 12px; align-items: start; min-height: 0; }
  .companion { height: 96px; justify-items: start; }
  .companion .avatar-slot[data-avatar-slot="home"] { --avatar-size: 96px; margin-inline-start: 0; }
  #welcome-title { font-size: 1.75rem; max-width: 18ch; line-height: 1.2; }
  #empty #welcome-help { font-size: 1rem; line-height: 1.5; max-width: 34ch; margin-top: 10px; }
  .welcome-mark { width: 72px; height: 3px; margin-top: 20px; }
  .composer, .composer:focus-within, .composer:has(textarea:focus-visible) { padding: 12px; border-radius: 18px; }
  .composer textarea { font-size: 16px; }
  .attach-button, .mic-button { width: 48px; height: 48px; border-radius: 10px; }
  .send-button { width: 48px; height: 48px; border-radius: 12px; }
  .starter-actions { padding: 8px 0 0; }
  .shortcuts { display: flex; flex-direction: column; gap: 0; }
  .shortcut, .shortcut:first-child { flex-direction: row; align-items: center; justify-content: start; min-height: 56px; padding: 12px 4px; gap: 12px; font-size: .9375rem; }
  .shortcut + .shortcut { border-inline-start: 0; border-top: 1px solid var(--line); }
  .shortcut span { max-width: none; text-wrap: initial; }
  .shortcut .shortcut-glyph { width: 24px; height: 24px; }
  .workspace-footnote { font-size: .75rem; padding-top: 16px; margin: 0; gap: 8px; text-align: start; align-items: start; }
  .web-privacy-note { display: block; margin-top: 4px; }
  #app:not(:has(#empty:not([hidden]))) #dock { padding-inline: 16px; }
  .settings-head { padding: 20px 20px 16px; }
  .settings-head h2 { font-size: 1.25rem; }
  .settings-body { padding-inline: 20px; }
  .settings-section { padding-block: 24px; }
  .settings-model { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .settings-packs { gap: 10px; margin: 16px 0 20px; }
  .settings-packs button { flex: 1 1 11rem; }
}
@media(prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
  button { transition: none; }
}
@media(forced-colors: active) {
  .composer, .composer:focus-within { background: Canvas; border-color: ButtonText; }
  .network::before { background: CanvasText; }
}

/* Keep writing space when the phone keyboard is visible. */
:root[data-keyboard] #app .composer textarea {min-height:80px;max-height:clamp(80px,var(--draft-room,128px),192px)}
@media(max-width:1023px){
  :root[data-keyboard] #app:has(#empty:not([hidden])):has(#composer:focus-within) {padding-bottom:calc(var(--dock-height,180px) + var(--active-keyboard-inset,0px) + 20px)}
  :root[data-keyboard] #app:has(#empty:not([hidden])):has(#composer:focus-within) #dock {position:fixed;inset:auto 0 var(--active-keyboard-inset,0px);width:100%;margin:0;padding:12px 16px;max-height:var(--visible-height,100dvh);display:flex;flex-direction:column}
}
/* Some phone keyboards shrink the layout viewport instead of visualViewport. */
@media(max-width:1023px) and (max-height:600px){
  #app:has(#empty:not([hidden])):has(#composer:focus-within) {--mobile-nav-height:0px;padding-bottom:calc(var(--dock-height,180px) + 20px)}
  #app:has(#empty:not([hidden])):has(#composer:focus-within) #dock {position:fixed;inset:auto 0 0;width:100%;margin:0;padding:12px 16px;max-height:100dvh;display:flex;flex-direction:column}
  body:has(#composer:focus-within) #mobile-navigation {display:none}
  #app .composer textarea {min-height:80px;max-height:clamp(80px,var(--draft-room,128px),192px)}
}
.local-recovery{margin:12px 0 20px;padding:16px;border:1px solid var(--line);border-radius:16px;background:var(--surface)}
.local-recovery p{margin:8px 0;line-height:1.5}
.local-recovery details{margin:12px 0;font-size:.875rem}
.local-recovery summary{cursor:pointer;padding:8px 0}
.local-recovery pre{overflow:auto;max-height:200px;font-size:.75rem;white-space:pre-wrap}

.local-diagnostic-manual{box-sizing:border-box;width:100%;min-height:144px;margin:12px 0;padding:12px;font:12px/1.5 monospace}
.local-diagnostic-report{max-height:200px;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;font-size:.75rem}
