@font-face { font-family: "NIMO Serif"; src: url(../vendor/fonts/source-serif-4-latin-700-normal.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "NIMO Serif"; src: url(../vendor/fonts/source-serif-4-latin-600-normal.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "NIMO Sans"; src: url(../vendor/fonts/inter-latin-300-normal.woff2) format("woff2"); font-weight: 300; font-display: swap; }
@font-face { font-family: "NIMO Sans"; src: url(../vendor/fonts/inter-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "NIMO Sans"; src: url(../vendor/fonts/inter-latin-500-normal.woff2) format("woff2"); font-weight: 500; font-display: swap; }
:root {
  --ink: #1f1a15;
  --ink-2: #5b5046;
  --cream: #f4ece1;
  --glass: rgba(250, 245, 238, 0.72);
  --line: rgba(60, 45, 30, 0.12);
  --sage: #8fa08a;
  --amber: #e9973a;
  --danger: #b2432f;
  --serif: "NIMO Serif", "Iowan Old Style", Georgia, serif;
  --sans: "NIMO Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
/* 1.71: NIMO is an app-sized page, never a scrolling one. On iPhone and iPad (above all from the Home Screen)
   WebKit widened the page to include anything placed off-screen, such as the closed developer panel, then
   zoomed out and let it scroll, so NIMO looked like a desktop site. Now nothing is laid out past the screen,
   the page can't pan or bounce, and text keeps its size when the phone turns. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { position: fixed; inset: 0; width: 100%; overflow: clip; overscroll-behavior: none; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #eadccb; color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
/* NIMO full screen: the stage fills the viewport; controls float over the room. */
#scene { position: fixed; inset: 0; overflow: hidden; background: #e6d8c6; }
.stage { position: absolute; inset: 0; background-color: #e6d8c6; touch-action: manipulation; }
.stage canvas:not(.nimo-live) { width: 100% !important; height: 100% !important; display: block; }
/* In the dark the screen itself becomes a soft, warm fill light for the camera. */
.glow { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 1.2s ease;
  /* 1.29: a soft warm frame at the very edges only; it used to wash over NIMO's cradle and the table */
  box-shadow: inset 0 0 7vmin 1.5vmin rgba(255, 246, 230, .6); background: none; }
.glow.on { opacity: 1; }
.hidden { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }

.topright { position: fixed; top: calc(16px + env(safe-area-inset-top, 0px)); right: calc(16px + env(safe-area-inset-right, 0px)); display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.status { display: flex; align-items: center; gap: 8px; padding: 7px 13px; border-radius: 99px; background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); font-size: 13px; color: var(--ink-2); border: 1px solid var(--line); }
.status .dot { width: 8px; height: 8px; border-radius: 50%; background: #b9ab98; transition: background .3s; }
.status.listening .dot { background: #5aa36b; animation: pulse 1.4s infinite; }
.status.thinking .dot { background: var(--amber); animation: pulse .9s infinite; }
.status.speaking .dot { background: #6b8fd1; }
.status.offline .dot { background: var(--danger); }
@keyframes pulse { 50% { transform: scale(1.5); opacity: .6; } }
.selfview { width: clamp(110px, 16vw, 200px); aspect-ratio: 4/3; object-fit: cover; border-radius: 16px; transform: scaleX(-1); border: 2px solid rgba(255,255,255,.7); box-shadow: 0 8px 30px rgba(60,40,20,.18); background: #222; }

.icon-btn { width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line); background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); display: grid; place-items: center; transition: transform .15s, background .2s; }
.icon-btn:hover { transform: translateY(-1px); background: rgba(255,255,255,.85); }
.icon-btn.on { background: var(--ink); color: var(--cream); }
.icon-btn svg, .mic svg, .textbox svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.captions { position: fixed; left: 50%; bottom: calc(clamp(52px, 7vh, 76px) + 92px + var(--safe-b)); transform: translateX(-50%); width: min(620px, 92vw); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.you { font-size: 15px; color: var(--ink-2); font-style: italic; min-height: 1.2em; text-align: center; opacity: .85; }
.bubble { background: var(--glass); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid var(--line); padding: 12px 18px; border-radius: 20px; font-size: clamp(16px, 2vw, 20px); line-height: 1.4; box-shadow: 0 10px 40px rgba(60,40,20,.10); text-align: center; animation: rise .35s ease; }
.bubble .who { font-family: var(--serif); font-weight: 700; margin-right: 8px; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

.dock { position: fixed; left: 50%; bottom: calc(clamp(52px, 7vh, 76px) + var(--safe-b)); transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 99px; background: var(--glass); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border: 1px solid var(--line); box-shadow: 0 12px 40px rgba(60,40,20,.14); max-width: 96vw; }
.switch { display: flex; background: rgba(0,0,0,.05); border-radius: 99px; padding: 3px; }
.switch button { border: 0; background: transparent; padding: 9px 13px; border-radius: 99px; font-family: var(--serif); font-weight: 700; letter-spacing: .04em; font-size: 14px; color: var(--ink-2); }
.switch button.on { background: #fff; color: var(--ink); box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.mic { position: relative; width: 64px; height: 64px; border-radius: 50%; border: 0; background: var(--ink); color: var(--cream); display: grid; place-items: center; transition: transform .15s, background .25s; }
.mic:hover { transform: scale(1.04); }
.mic.live { background: #2f6b45; }
.mic .ring { position: absolute; inset: -6px; border-radius: 50%; border: 3px solid rgba(47,107,69,.5); transform: scale(1); opacity: 0; transition: transform .08s linear, opacity .3s; pointer-events: none; }
.mic.live .ring { opacity: 1; }
.textbox { display: flex; align-items: center; background: rgba(255,255,255,.75); border-radius: 99px; padding: 4px 4px 4px 16px; border: 1px solid var(--line); }
.textbox input { border: 0; outline: 0; background: transparent; font: inherit; font-size: 15px; width: clamp(120px, 22vw, 280px); color: var(--ink); }
.textbox button { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--ink); color: var(--cream); display: grid; place-items: center; }
.textbox button svg { width: 18px; height: 18px; }
.typebtn { display: none; }
/* 1.54: phones, foldable cover screens, HomeView and short landscape screens. The controls stay
   one row (the text box folds into a keyboard button and opens above them), so NIMO and his
   words are never hidden behind a two-row bar. */
@media (max-width: 640px), (max-height: 500px) {
  .dock { flex-wrap: nowrap; justify-content: center; gap: 8px; padding: 8px; }
  .typebtn { display: grid; }
  .textbox { display: none; }
  html.typing .textbox { display: flex; position: fixed; left: 50%; transform: translateX(-50%); width: min(560px, 92vw);
    bottom: calc(clamp(52px, 7vh, 76px) + 84px + var(--safe-b)); background: rgba(255,255,255,.95); box-shadow: 0 10px 30px rgba(60,40,20,.16); z-index: 4; }
  html.typing .textbox input { width: 100%; font-size: 16px; }   /* 16px: iOS won't zoom the page */
  html.typing .captions { opacity: 0; }
  .captions { bottom: calc(clamp(52px, 7vh, 76px) + 84px + var(--safe-b)); }
}
@media (max-width: 400px) {
  .dock { gap: 5px; padding: 6px; }
  .mic { width: 56px; height: 56px; }
}
@media (max-height: 500px) {
  .dock { bottom: calc(10px + var(--safe-b)); }
  .captions { bottom: calc(10px + 80px + var(--safe-b)); }
  html.typing .textbox { bottom: calc(10px + 80px + var(--safe-b)); }
  .topright { flex-direction: row; flex-wrap: nowrap; justify-content: flex-end; top: calc(10px + env(safe-area-inset-top, 0px)); right: calc(10px + env(safe-area-inset-right, 0px)); gap: 6px; }
  .topright .senses { display: none; }   /* the status already says listening / speaking / thinking */
  .topright .icon-btn { width: 44px; height: 44px; }
  .status { padding-block: 6px; font-size: 13px; }
  .bubble { padding: 8px 14px; font-size: 15px; }
}
/* touch screens: every control at least 44 px (Apple HIG 44 pt, Material 48 dp) */
@media (pointer: coarse) {
  .textbox button { width: 44px; height: 44px; }
}

.sheet { border: 0; border-radius: 24px; padding: 0; width: min(620px, 94vw); max-height: 92vh; background: #fbf7f1; color: var(--ink); box-shadow: 0 30px 90px rgba(40,25,10,.35); }
.sheet::backdrop { background: rgba(60,45,30,.35); backdrop-filter: blur(4px); }
.sheet form { padding: 26px 28px; display: flex; flex-direction: column; gap: 14px; }
.sheet.side { margin-right: 16px; }
.sheet h2 { font-family: var(--serif); font-size: 28px; margin: 0; }
.lead { margin: 0; color: var(--ink-2); line-height: 1.5; }
fieldset { border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; margin: 0; display: flex; flex-direction: column; gap: 10px; }
legend { font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); padding: 0 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips label { border: 1px solid var(--line); border-radius: 99px; padding: 8px 12px; cursor: pointer; font-size: 14px; background: #fff; }
.chips label:has(input:checked) { background: var(--ink); color: var(--cream); }
.chips input { display: none; }
.toggles label, .guardian { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.45; }
.toggles input, .guardian input { margin-top: 3px; accent-color: #2f6b45; width: 18px; height: 18px; flex: none; }
.fine { font-size: 12.5px; color: var(--ink-2); margin: 0; line-height: 1.5; }
.fine a { color: inherit; }
.actions { display: flex; justify-content: flex-end; gap: 10px; }
.primary { border: 0; background: var(--ink); color: var(--cream); padding: 12px 22px; border-radius: 99px; font-weight: 600; }
.row { display: flex; flex-wrap: wrap; gap: 10px; }
.row label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--ink-2); flex: 1 1 150px; }
select { font: inherit; padding: 9px 10px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--ink); }
.row button { border: 1px solid var(--line); background: #fff; padding: 10px 14px; border-radius: 12px; }
.row button.danger { color: var(--danger); border-color: rgba(178,67,47,.35); }
.row button.primary { background: var(--ink); color: var(--cream); border-color: var(--ink); font-weight: 600; }
.skills { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.skills label { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; border: 1px solid var(--line); border-radius: 12px; padding: 9px 10px; background: #fff; }
.skills label small { display: block; color: var(--ink-2); font-size: 12px; }
.skills label.disabled { opacity: .45; }
.toast { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--cream); padding: 10px 16px; border-radius: 12px; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.2); z-index: 10; max-width: 90vw; }
.toast a { color: #ffd59a; }
@media (prefers-reduced-motion: reduce) { .bubble { animation: none; } }

/* The companion switch lives in Settings. */
.dock .switch { display: none; }
.textbox input { width: clamp(120px, 16vw, 220px); }
body.clean .dock, body.clean .captions, body.clean .topright { display: none !important; }

/* what NIMO can do right now: hearing, voice, seeing, thinking */
.senses { display: flex; gap: 4px; padding: 4px 6px; border-radius: 99px; background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid var(--line); font-size: 14px; }
.senses span { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; filter: grayscale(1); opacity: .35; transition: all .3s; }
.senses span.ok { filter: none; opacity: 1; background: rgba(90,163,107,.16); }
.senses span.bad { filter: none; opacity: 1; background: rgba(178,67,47,.18); }

/* tap to wake */
.wake { position: fixed; inset: 0; display: grid; place-items: end center; padding-bottom: calc(14vh + var(--safe-b)); background: linear-gradient(to top, rgba(40,28,16,.35), rgba(40,28,16,0) 55%); z-index: 5; }
.wakeBtn { border: 0; border-radius: 28px; padding: 20px 34px; background: rgba(251,247,241,.92); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: 0 18px 60px rgba(40,25,10,.3); display: flex; flex-direction: column; gap: 6px; align-items: center; animation: breathe 2.6s ease-in-out infinite; }
.wakeTitle { font-family: var(--serif); font-weight: 700; font-size: clamp(22px, 3.2vw, 30px); }
.wakeSub { font-size: 14px; color: var(--ink-2); }
@keyframes breathe { 50% { transform: scale(1.03); } }

/* dialogs: a clear way out (× button, tap outside, Esc) and scrolling on small screens */
.sheet form { position: relative; max-height: 92vh; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.sheet .close { position: sticky; top: 0; margin: -10px -12px -38px auto; align-self: flex-end; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: #fff; font-size: 24px; line-height: 1; display: grid; place-items: center; z-index: 2; box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 12px; line-height: 1.5; }
.steps .primary { display: inline-block; text-decoration: none; padding: 9px 16px; }

/* voice switch in the dock */
.icon-btn.voice { flex-direction: column; gap: 0; width: auto; min-width: 46px; padding: 0 8px; font-weight: 700; line-height: 1; }
.icon-btn.voice small { font-size: 9px; font-weight: 600; opacity: .7; letter-spacing: .02em; }
/* camera element stays rendered (iOS stops delivering frames to display:none videos) */
.selfview.offstage { position: fixed !important; left: 0; top: 0; width: 2px !important; height: 2px !important; opacity: 0.01; pointer-events: none; }

/* device check */
.sheet.wide { width: min(940px, 96vw); }
.sheet.wide form { box-sizing: border-box; width: 100%; }
.checkgrid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 720px) { .checkgrid { grid-template-columns: 1fr; } }
.camwrap { position: relative; border-radius: 16px; overflow: hidden; background: #1d1a17; aspect-ratio: 4 / 3; }
.camwrap video, .camwrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.camnote { position: absolute; left: 10px; bottom: 10px; padding: 4px 10px; border-radius: 99px; background: rgba(0,0,0,.55); color: #fff; font-size: 13px; }
.meter { display: grid; grid-template-columns: 92px 1fr; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 14px; }
.bar { height: 10px; border-radius: 99px; background: rgba(0,0,0,.08); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--ok, #5aa36b); transition: width .08s linear; }
.seen { display: grid; grid-template-columns: 92px 1fr; gap: 4px 8px; margin: 10px 0 14px; font-size: 14px; }
.seen dt { color: var(--ink-2); }
.seen dd { margin: 0; font-weight: 600; }
.results { margin: 14px 0 0; padding-left: 22px; display: grid; gap: 6px; font-size: 14px; }
.results li.ok::marker { content: '✓  '; color: #3f8a52; }
.results li.bad::marker { content: '✗  '; color: #b2432f; }
.results li.run::marker { content: '…  '; }
.results li small { display: block; color: var(--ink-2); font-weight: 400; }
label.inline { display: flex; gap: 8px; align-items: center; font-size: 14px; margin-top: 10px; }

.passage { margin: .4rem 0; padding: .5rem .75rem; border-left: 3px solid var(--accent, #e9a23b); font-style: italic; opacity: .9; }
.row.hv { align-items: center; gap: .5rem; }
.hvname { min-width: 9.5rem; }
.hvname small { display: block; opacity: .7; }
.filebtn { cursor: pointer; padding: .45rem .8rem; border-radius: .6rem; border: 1px solid currentColor; opacity: .9; }
button.recording { background: #c0392b; color: #fff; }
.row.hv label.filebtn { flex: 0 0 auto; width: auto; display: inline-flex; align-items: center; padding: .6rem 1rem; border-radius: .8rem;
  background: #fff; border: 1px solid rgba(0,0,0,.12); font-size: 1rem; opacity: 1; color: var(--ink, #2b2724); }
.row.hv .hvname { flex: 1 1 auto; }

/* ---- Debug console (right-hand vertical panel) ---- */
#debugBtn svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; width: 22px; height: 22px; }
.dbg { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 94vw); z-index: 60; display: flex; flex-direction: column;
  background: rgba(252, 249, 244, .96); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-left: 1px solid var(--line); box-shadow: -12px 0 40px rgba(40, 28, 18, .14);
  transform: translateX(105%); transition: transform .25s ease; font: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--ink); }
.dbg.open { transform: none; }
.dbg:not(.open) { visibility: hidden; transition: transform .25s ease, visibility 0s linear .25s; }
body.debugging .topright { right: calc(min(420px, 94vw) + 16px); }
.dbg header { display: flex; align-items: center; gap: 10px; padding: 14px 14px 8px; font-family: var(--sans); }
.dbg header strong { font-size: 15px; }
.dbg-legend { color: var(--ink-2); font-size: 11px; flex: 1; }
.dbg-close { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: #fff; font-size: 20px; line-height: 1; }
.dbg-status { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 14px 8px; }
.dbg-status .pill { padding: 2px 7px; border-radius: 10px; background: #eee6da; color: var(--ink-2); font-size: 11px; }
.dbg-status .pill.ok { background: #dcebdc; color: #24583a; }
.dbg-status .pill.bad { background: #f6dcd3; color: #8c2f1f; }
.dbg-filters { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 14px 8px; border-bottom: 1px solid var(--line); }
.dbg-filters button { border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 3px 9px; font: 11px var(--sans); color: var(--ink-2); }
.dbg-filters button.on { background: var(--ink); color: var(--cream); }
.dbg-list { list-style: none; margin: 0; padding: 6px 0; overflow-y: auto; flex: 1; -webkit-overflow-scrolling: touch; }
.dbg-list li { display: flex; flex-wrap: wrap; gap: 6px; padding: 3px 14px; border-bottom: 1px solid rgba(60,45,30,.05); }
.dbg-list li.dbg-error { background: rgba(178, 67, 47, .08); }
.dbg-list li.dbg-warn { background: rgba(233, 151, 58, .09); }
.dbg-t { color: #9a8f84; }
.dbg-src { color: #fff; background: #9a8f84; border-radius: 3px; padding: 0 4px; font-size: 10px; }
.dbg-c { font-weight: 600; min-width: 52px; }
.dbg-ms { color: #6b6b6b; }
.dbg-ms.slow { color: var(--danger); font-weight: 600; }
.dbg-m { flex-basis: 100%; white-space: pre-wrap; word-break: break-word; padding-left: 2px; }
.dbg footer { display: flex; gap: 6px; padding: 10px 14px calc(10px + var(--safe-b)); border-top: 1px solid var(--line); }
.dbg footer button { flex: 1; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 8px; font: 13px var(--sans); }
.face-fail { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); background: var(--glass); backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px); padding: 18px 22px; border-radius: 18px; text-align: center; font-family: var(--sans); max-width: 80vw; }
.face-fail button { margin-top: 10px; border: 0; background: var(--ink); color: var(--cream); border-radius: 12px; padding: 10px 18px; font-size: 15px; }
/* on wide screens NIMO moves left of the console instead of hiding behind it */
@media (min-width: 820px) {
  body.debugging #scene { right: min(420px, 94vw); transition: right .25s ease; }
  body.debugging .dock, body.debugging .captions { left: calc((100vw - min(420px, 94vw)) / 2); max-width: calc(100vw - min(420px, 94vw) - 24px); }
}

/* ---- Settings tabs (1.12) ---- */
.sheet.wide-tabs { width: min(760px, 96vw); }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 14px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.tabs button { border: 0; background: transparent; padding: 8px 12px; border-radius: 10px; font: 600 14px var(--sans); color: var(--ink-2); }
.tabs button.on { background: var(--ink); color: var(--cream); }
.tab { display: none; }
.tab.on { display: block; }
.stars { display: flex; gap: 4px; margin: 6px 0 10px; }
.stars button { border: 0; background: transparent; font-size: 30px; line-height: 1; color: #d9cfc2; padding: 2px; }
.stars button.on { color: var(--amber); }
#fbText { width: 100%; box-sizing: border-box; border: 1px solid var(--line); border-radius: 12px; padding: 10px; font: 15px var(--sans); margin: 8px 0; background: #fff; }
.fblist { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.fblist li { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; font-size: 14px; }
.fblist li small { color: var(--ink-2); display: block; margin-bottom: 2px; }
.cost-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin: 6px 0 10px; }
.cost-cards .card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.cost-cards .card span { display: block; font-size: 12px; color: var(--ink-2); }
.cost-cards .card b { font-size: 20px; font-variant-numeric: tabular-nums; }
table.costs { width: 100%; border-collapse: collapse; font-size: 13px; margin: 6px 0; }
table.costs th, table.costs td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.costs td.num, table.costs th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.costs button { padding: 4px 8px; font-size: 12px; }
.costchip { background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid var(--line);
  border-radius: 99px; padding: 6px 12px; font: 600 13px var(--sans); font-variant-numeric: tabular-nums; color: var(--ink-2); }
.costchip.tick { animation: costtick .6s ease; }
@keyframes costtick { from { background: #fbe6c9; } to { background: var(--glass); } }
.pilot { margin: 8px 0; padding: 8px 10px; border-radius: 12px; background: #f6efe4; }
#invNew a { word-break: break-all; }

/* Settings > FinOps charts */
#settings h4 { margin: 18px 0 6px; font-size: 14px; font-weight: 600; }
.viz { width: 100%; overflow: hidden; background: #fcfcfb; border-radius: 10px; padding: 6px 4px; color: #1f2328; }
.viz .fine { padding: 12px; margin: 0; }
.viz-grid { stroke: #e6e6e3; stroke-width: 1; }
.viz-base { stroke: #b9b9b4; stroke-width: 1; }
.viz-axis { fill: #6b6f76; font-size: 11px; font-variant-numeric: tabular-nums; }
.viz-label { fill: #1f2328; font-size: 12px; }
.viz-value { fill: #3d4148; font-size: 12px; font-variant-numeric: tabular-nums; }
.viz-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; margin: 0 0 6px; }
.viz-key { display: inline-flex; align-items: center; gap: 6px; }
.viz-key i, .sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.viz-tip { position: fixed; z-index: 1000; pointer-events: none; background: #1f2328; color: #fff; font-size: 12px; line-height: 1.5; padding: 7px 10px; border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,.25); max-width: 280px; font-variant-numeric: tabular-nums; }
.costs td.num { text-align: right; font-variant-numeric: tabular-nums; }
.costs tr.gone td { opacity: .5; }
.card small { display: block; font-size: 11px; opacity: .7; margin-top: 2px; }
.card .st-icon { font-style: normal; margin-right: 6px; font-size: 12px; }
.card.st-good .st-icon { color: #0f8a5f; } .card.st-warning .st-icon { color: #b07800; }
.card.st-serious .st-icon { color: #d4570f; } .card.st-critical .st-icon { color: #c9302c; }
#finSync .ok { color: #0f8a5f; } #finSync .bad { color: #c9302c; }

/* 1.23: your camera and what NIMO sees (draggable, resizable) */
.selfpanel { position: fixed; z-index: 40; border-radius: 16px; overflow: hidden; background: rgba(24,22,20,.92); color: #f6efe6; box-shadow: 0 14px 40px rgba(40,25,10,.35); touch-action: none; user-select: none; -webkit-user-select: none; }
.selfpanel.dragging { opacity: .92; cursor: grabbing; }
.selfpanel.offstage { left: 0 !important; top: 0 !important; width: 2px !important; height: 2px !important; opacity: 0.01; pointer-events: none; }
.selfpanel .sp-bar { display: flex; align-items: center; gap: 6px; padding: 6px 8px 6px 12px; font: 600 12px system-ui, -apple-system, sans-serif; cursor: grab; }
.selfpanel .sp-title { flex: 1; letter-spacing: .02em; }
.selfpanel .sp-btn { width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(255,255,255,.12); color: #fff; font-size: 15px; line-height: 26px; padding: 0; }
.selfpanel .sp-view { position: relative; aspect-ratio: 4/3; background: #111; }
.selfpanel .sp-video, .selfpanel .sp-canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.selfpanel .sp-caption { padding: 7px 12px 9px; font: 12px/1.35 system-ui, -apple-system, sans-serif; color: #e9dfd2; min-height: 2.7em; }
.selfpanel .sp-resize { position: absolute; right: 0; bottom: 0; width: 22px; height: 22px; cursor: nwse-resize; background: linear-gradient(135deg, transparent 50%, rgba(255,255,255,.35) 50% 58%, transparent 58% 70%, rgba(255,255,255,.35) 70% 78%, transparent 78%); }

/* NIMO live stage HUD (layout.json nameRect / statusRect, sized with the stage) */
.nimo-hud { position: absolute; pointer-events: none; color: #3c3530; font-family: "NIMO Sans", system-ui, sans-serif; line-height: 1; }
.nimo-hud .nimo-name { font: 700 1.6em/1.1 "NIMO Serif", Georgia, serif; letter-spacing: .02em; }
.nimo-hud .nimo-state { margin-top: .45em; font-size: .9em; font-weight: 500; display: flex; align-items: center; gap: .45em; color: #5a4f46; }
.nimo-hud .nimo-state i { width: .55em; height: .55em; border-radius: 50%; background: #858976; transition: background .3s; }
.nimo-hud[data-state="speaking"] .nimo-state i { background: #ffbc69; }
.nimo-hud[data-state="thinking"] .nimo-state i { background: #c9aa87; }
.nimo-hud[data-state="resting"] .nimo-state i { background: #b9ab9b; }

/* NIMO D1 physical robot: the visor display shows only the face (no chrome, no cursor) */
html.robot-body, html.robot-body body { background: #000; cursor: none; }
/* D1 rev B: the visor glass of the approved image (about 30/255) becomes true black on the panel, so behind the
   smoked, dead-front visor only the glowing face shows (no visible display rectangle) */
html.robot-body canvas.nimo-live { filter: contrast(1.25); }
html.robot-body #dock, html.robot-body .toast, html.robot-body .topright, html.robot-body .wake, html.robot-body .status, html.robot-body .topbar, html.robot-body .bubble,
html.robot-body .nimo-hud, html.robot-body #selfBtn, html.robot-body .dock { display: none !important; }

/* ---- 1.28: pictures NIMO shows (cards.js) ---------------------------------------- */
.card-overlay { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 4vmin;
  background: rgba(18, 12, 9, 0.38); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; transition: opacity 0.22s ease; }
.card-overlay.in { opacity: 1; }
.pic-card { margin: 0; max-width: min(92vw, 1100px); max-height: 88vh; background: #fbf5ee; border-radius: 22px; padding: 12px;
  box-shadow: 0 18px 60px rgba(30, 18, 10, 0.35); display: flex; flex-direction: column; gap: 8px;
  transform: translateY(14px) scale(0.98); transition: transform 0.22s ease; }
.card-overlay.in .pic-card { transform: none; }
.pic-card canvas { width: 100%; height: auto; max-height: 70vh; object-fit: contain; border-radius: 14px; display: block; background: #1a120e; }
.pic-card.person { max-width: min(80vw, 560px); }
.pic-card figcaption { font: 600 1rem/1.3 system-ui, -apple-system, sans-serif; color: #4a3a2e; text-align: center; min-height: 1.3em; }
.pic-bar { display: flex; justify-content: center; gap: 12px; }
.pic-bar button { min-width: 48px; height: 48px; border-radius: 24px; border: 0; background: #efe3d4; color: #3d2f25;
  font: 600 1.15rem system-ui, -apple-system, sans-serif; cursor: pointer; }
.pic-bar button:hover, .pic-bar button:focus-visible { background: #e4d2bd; outline: 2px solid #c98a3b; outline-offset: 2px; }
#glow.flash { opacity: 1 !important; background: #fff !important; transition: none; }

/* ---- 1.28: controls out of the way on touch devices (controls.js) ------------------ */
html.controls-hidden #dock, html.controls-hidden .dock, html.controls-hidden .topright, html.controls-hidden .topbar,
html.controls-hidden .status, html.controls-hidden #selfBtn, html.controls-hidden .nimo-hud { opacity: 0; pointer-events: none; transition: opacity 0.3s ease; }
#dock, .dock, .topright, .topbar, .status { transition: opacity 0.3s ease; }
.hold-ring { position: fixed; z-index: 70; width: 92px; height: 92px; margin: -46px 0 0 -46px; pointer-events: none;
  opacity: 0; transform: scale(0.85); transition: opacity 0.18s ease, transform 0.18s ease; display: grid; place-items: center; }
.hold-ring.on { opacity: 1; transform: none; }
.hold-ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.hold-ring circle { fill: none; stroke-width: 6; }
.hold-ring .track { stroke: rgba(255, 244, 230, 0.35); }
.hold-ring .fill { stroke: #f3c37a; stroke-linecap: round; }
.hold-ring span { font: 700 1.4rem system-ui, -apple-system, sans-serif; color: #fff4e6; text-shadow: 0 1px 4px rgba(0,0,0,0.5); }

/* ---- 1.28: Settings > Your data / Knowledge -------------------------------------- */
.data-summary { margin: 0.2rem 0 0.8rem; }
.data-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 0.35rem 1rem; margin-bottom: 0.6rem; }
.data-groups label, .data-items label { display: flex; gap: 0.5rem; align-items: flex-start; }
.data-groups small, .data-items small { opacity: 0.65; }
.data-items { list-style: none; margin: 0.4rem 0; padding: 0; max-height: 16rem; overflow: auto; display: grid; gap: 0.3rem; }
.data-items li small { text-transform: capitalize; margin-right: 0.3rem; }
.reset-box { border-color: rgba(220, 90, 70, 0.45); }
.reset-box input[type=text] { width: 7rem; letter-spacing: 0.15em; text-transform: uppercase; }
.kn-spaces { display: grid; gap: 0.7rem; margin-bottom: 0.7rem; }
.kn-space { border: 1px solid rgba(127,127,127,0.3); border-radius: 12px; padding: 0.6rem 0.8rem; }
.kn-head { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.kn-add { flex-wrap: wrap; gap: 0.4rem; margin-top: 0.4rem; }
.kn-add input[type=url] { flex: 1 1 12rem; min-width: 0; }
.kn-docs { list-style: none; padding: 0; margin: 0.4rem 0 0; display: grid; gap: 0.25rem; }
.kn-docs button { padding: 0 0.45rem; }
#knNew label { display: block; margin: 0.35rem 0; }
#knNew input, #knNew textarea { width: 100%; }

/* ---- 1.29: a card tucked into the corner ("hide it"), and the sources card -------- */
.card-overlay { transition: opacity 0.25s ease, background 0.3s ease; }
.card-overlay.mini { background: transparent !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important;
  pointer-events: none; place-items: end end; padding: max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-right)); }
.card-overlay.mini .pic-card { pointer-events: auto; cursor: pointer; width: 132px; max-width: 132px; padding: 5px; border-radius: 14px;
  transform: none; box-shadow: 0 6px 22px rgba(0,0,0,0.35); transition: width 0.3s ease, max-width 0.3s ease; }
.card-overlay.mini .pic-card canvas { border-radius: 10px; max-height: 110px; }
.card-overlay.mini .pic-bar, .card-overlay.mini figcaption, .card-overlay.mini .pic-card h3, .card-overlay.mini .pic-card ol small { display: none; }
.card-overlay.mini .pic-card.sources ol { font-size: 0.7rem; max-height: 90px; overflow: hidden; margin: 0; padding-left: 1.1rem; }
.pic-card.sources { width: min(92vw, 640px); padding: 18px 20px 12px; color: #3b2c22; }
.pic-card.sources h3 { margin: 0 0 0.6rem; font: 700 1.1rem/1.3 system-ui, -apple-system, sans-serif; }
.pic-card.sources ol { margin: 0 0 0.6rem; padding-left: 1.3rem; display: grid; gap: 0.5rem; max-height: 55vh; overflow: auto; }
.pic-card.sources a { color: #8a4b12; font-weight: 600; text-decoration: none; }
.pic-card.sources a:hover { text-decoration: underline; }
.pic-card.sources small { color: #7b6a5d; }

/* ---- 1.29: no microphone, no NIMO: the permission screen (permgate.js) ------------- */
html.perm-blocked #stage, html.perm-blocked .stage, html.perm-blocked #dock, html.perm-blocked .dock, html.perm-blocked .topright,
html.perm-blocked .nimo-hud, html.perm-blocked #wake, html.perm-blocked .card-overlay { visibility: hidden !important; }
.perm-gate { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: max(20px, env(safe-area-inset-top)) 20px max(20px, env(safe-area-inset-bottom));
  background: radial-gradient(120% 90% at 50% 20%, #f7eee4 0%, #ead9c6 100%); overflow: auto; }
.perm-card { width: min(560px, 100%); background: #fffaf4; color: #3b2c22; border-radius: 24px; padding: 28px 26px 20px;
  box-shadow: 0 18px 50px rgba(80, 50, 20, 0.18); font: 400 1.02rem/1.5 system-ui, -apple-system, sans-serif; }
.perm-card h2 { margin: 0.2rem 0 0.6rem; font-size: 1.5rem; line-height: 1.2; }
.perm-card ol { margin: 0.4rem 0 0.6rem; padding-left: 1.3rem; display: grid; gap: 0.35rem; }
.perm-icon { font-size: 2.6rem; }
.perm-warn { background: #fdecd9; border-radius: 12px; padding: 0.6rem 0.8rem; margin: 0.6rem 0; }
.perm-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 1rem; }
.perm-actions button { font: 600 1.05rem system-ui, -apple-system, sans-serif; border-radius: 999px; padding: 0.75rem 1.4rem; border: 1px solid #d8c3ad; background: #fff; color: #3b2c22; min-height: 48px; }
.perm-actions button.primary { background: #c8742b; border-color: #c8742b; color: #fff; }
.perm-status { min-height: 1.3em; margin: 0.6rem 0 0; }
.perm-note { position: fixed; z-index: 80; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(520px, calc(100% - 24px)); }
.perm-note .perm-card { padding: 16px 18px 12px; font-size: 0.95rem; }
.perm-note .perm-icon { display: none; }
.perm-note h2 { font-size: 1.1rem; }

/* 1.29: with the controls hidden, your own words don't float over NIMO's speaker grille */
html.controls-hidden .you { display: none; }
.you { transition: opacity .6s ease; }
.you.faded { opacity: 0; }

/* ---- 1.33: Settings > Where NIMO is ------------------------------------------------ */
.env-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; margin: 0.6rem 0 0.8rem; }
.env-grid button { display: grid; gap: 4px; padding: 6px; border-radius: 14px; border: 2px solid transparent; background: rgba(127,127,127,0.08); color: inherit; font: 600 0.82rem system-ui, -apple-system, sans-serif; cursor: pointer; }
.env-grid button.on { border-color: #c8742b; }
.env-grid canvas, .env-grid .env-own { width: 100%; aspect-ratio: 160 / 114; border-radius: 9px; display: block; object-fit: cover; }
.env-grid .env-own { background: linear-gradient(180deg, #efe2d2 0%, #e7d2bb 62%, #c9a37c 100%); }

/* ---- 1.35: Settings > NIMO's colours ---------------------------------------------- */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; margin: 0.6rem 0 0.8rem; }
.theme-grid button { display: grid; gap: 6px; padding: 8px; border-radius: 14px; border: 2px solid transparent; background: rgba(127,127,127,0.08); color: inherit; font: 600 0.82rem system-ui, -apple-system, sans-serif; cursor: pointer; }
.theme-grid button.on { border-color: #c8742b; }
.theme-grid .sw { display: flex; gap: 3px; justify-content: center; }
.theme-grid .sw i { width: 18px; height: 18px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.15); }
.theme-parts { flex-wrap: wrap; gap: 0.8rem; }
.theme-parts input[type=color] { width: 42px; height: 30px; border: 0; padding: 0; background: none; vertical-align: middle; }

/* ---- Settings: one fixed frame for every tab (1.39) ----
   The dialog keeps the same size whichever tab is open: the title and the tab row stay put,
   and only the open tab's content scrolls. The tabs are one row that scrolls sideways, so
   adding a tab never changes the height either. */
#settings { width: min(860px, 96vw); height: min(760px, 92vh); max-height: 92vh; }
#settings[open] { display: flex; }
#settings > form { flex: 1 1 auto; height: 100%; max-height: none; overflow: hidden; box-sizing: border-box;
  display: flex; flex-direction: column; gap: 10px; }
#settings > form > h2 { flex: 0 0 auto; }
#settings .tabs { flex: 0 0 auto; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin;
  -webkit-overflow-scrolling: touch; margin-bottom: 0; }
#settings .tabs button { flex: 0 0 auto; white-space: nowrap; }
#settings .tab.on { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding-right: 6px; scrollbar-gutter: stable; }
#settings .close { position: absolute; top: 18px; right: 18px; margin: 0; }
@media (max-width: 640px) { #settings { width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; } }
/* 1.39: NIMO's medium frame: the picture alongside the conversation, NIMO still in view */
.pic-card.medium { max-width: min(58vw, 640px); }
.pic-card.medium canvas { max-height: 46vh; }
.card-overlay:has(.pic-card.medium) { place-items: center end; padding-right: 5vmin; background: rgba(40,28,20,.18); }
/* Settings › Commands (1.39) */
.cmdsearch { width: 100%; box-sizing: border-box; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font: 15px var(--sans); background: #fff; margin: 4px 0 6px; }
ul.cmds { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
ul.cmds li { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
ul.cmds li p { margin: 6px 0 0; font-size: 14px; color: var(--ink-2); }
ul.cmds .says { display: flex; flex-wrap: wrap; gap: 6px; }
ul.cmds button.say { border: 1px solid var(--line); background: #f6efe4; border-radius: 99px; padding: 4px 10px; font: 500 13px var(--sans); color: var(--ink); cursor: pointer; }
ul.cmds button.say:hover { background: #efe3d1; }
/* 1.39: a link refused on this device */
.refused { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: rgba(40,28,20,.55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); padding: 6vmin; }
.refused-card { background: #fbf7f1; color: var(--ink); border-radius: 24px; padding: 28px 30px; max-width: 520px; box-shadow: 0 30px 90px rgba(40,25,10,.35); }
.refused-card h2 { font-family: var(--serif); margin: 0 0 10px; font-size: 26px; }
.refused-card p { margin: 8px 0; line-height: 1.5; }
/* Settings › Testers: the invite form (1.39) */
.invform { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; margin: 8px 0; }
.invform summary { cursor: pointer; padding: 4px 0; }
.invform label.block { display: block; margin: 8px 0; }
.invform label.block small { display: block; color: var(--ink-2); margin: 2px 0 4px; }
.invform textarea { width: 100%; box-sizing: border-box; border: 1px solid var(--line); border-radius: 10px; padding: 8px; font: 14px var(--sans); }
.invform label.check { display: flex; gap: 8px; align-items: center; }

/* 1.40: Settings › Admin: the link to the admin console */
a.btnlink { display: inline-block; padding: 10px 16px; border-radius: 10px; text-decoration: none; font-weight: 600; }
a.btnlink.primary { background: var(--accent, #2a5bd7); color: #fff; }

/* 1.41: a link's allowance (above the microphone screen: nothing to hear while it shows) */
#limit { z-index: 95; overflow-y: auto; align-items: safe center; }
.limit-card { position: relative; display: grid; gap: 10px; }
.limit-card label { display: grid; gap: 4px; font-size: 14px; color: var(--ink); }
.limit-card select, .limit-card textarea { font: inherit; padding: 9px 10px; border-radius: 10px; border: 1px solid rgba(60,40,20,.2); background: #fff; color: #2a211b; }
.limit-card .row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.limit-card button { font: inherit; padding: 10px 18px; border-radius: 12px; border: 1px solid rgba(60,40,20,.2); background: #fff; color: #2a211b; cursor: pointer; }
.limit-card button.primary { background: #c8752f; border-color: #c8752f; color: #fff; font-weight: 600; }
.limit-card button.link { border: 0; background: none; color: #8a4f1c; padding: 10px 4px; }
.limit-card .sent { color: #2f6b3a; font-weight: 600; }
.limit-card .decision { background: #f3ebe0; border-radius: 10px; padding: 10px 12px; }
.limit-close { position: absolute; top: 10px; right: 12px; border: 0 !important; background: none !important; font-size: 26px !important; padding: 2px 8px !important; line-height: 1; }
.linkbox { border: 1px solid rgba(127,127,127,.25); border-radius: 12px; padding: 10px 12px; margin: 10px 0; }
.linkbox p { margin: 4px 0 8px; }

/* 1.54: foldables half-folded or spanning two screens (Viewport Segments). NIMO stands on one
   screen (nimo-live.js foldRegion); the controls and his words go on the other, never on the hinge. */
@media (vertical-viewport-segments: 2) {      /* tabletop: upper screen NIMO, lower screen controls */
  .captions { bottom: auto; top: calc(env(viewport-segment-top 0 1, 50vh) + 16px); }
  .dock { bottom: calc(24px + var(--safe-b)); }
}
@media (horizontal-viewport-segments: 2) {    /* book: left screen NIMO, right screen controls */
  .dock, .captions, html.typing .textbox { left: calc(env(viewport-segment-left 1 0, 50vw) + env(viewport-segment-width 1 0, 50vw) / 2); max-width: calc(env(viewport-segment-width 1 0, 50vw) - 24px); }
  .captions { bottom: auto; top: 40%; }
}

/* 1.55: touching NIMO (touch.js): strokes and rubs on him must reach the page, not scroll or zoom it */
#stage { touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }

/* 1.63: accessibility button (subtitles). Off: outline; on: filled, with the CC badge. */
#a11yBtn { position: relative; }
#a11yBtn .cc-badge { position: absolute; right: -3px; bottom: -3px; font: 700 8px/1 system-ui, -apple-system, sans-serif; padding: 2px 3px; border-radius: 3px; background: #6b5a4a; color: #fff; opacity: .55; }
#a11yBtn.on { background: #f2b544; }
#a11yBtn.on .cc-badge { opacity: 1; background: #3a2a1e; }
#a11yBtn:focus-visible { outline: 3px solid #1f6feb; outline-offset: 2px; }
body.captions-on .captions .bubble, body.captions-on .captions .you { font-size: 1.08em; }

/* ---- 1.66: the platform's own dialogs and the expiry picker (ui.js) ---------------------------------------- */
.ui-dialog { border: 0; padding: 0; border-radius: 16px; width: min(460px, calc(100vw - 32px)); background: var(--panel, #fff); color: var(--ink, #18202e);
  box-shadow: 0 24px 60px rgba(15, 25, 40, .28); font-family: var(--font, system-ui, -apple-system, "Segoe UI", sans-serif); }
.ui-dialog::backdrop { background: rgba(15, 25, 40, .45); backdrop-filter: blur(2px); }
.ui-dialog[open] { animation: ui-in .16s ease-out; }
@keyframes ui-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .ui-dialog[open] { animation: none; } }
.ui-dialog-f > header { display: flex; align-items: center; gap: 12px; padding: 20px 22px 4px; }
.ui-dialog-f h2 { margin: 0; font-size: 17px; line-height: 1.3; }
.ui-dialog-ic { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 15px;
  background: var(--info-bg, #e6effa); color: var(--info, #1f5fa8); }
.ui-dialog-ic.danger { background: var(--crit-bg, #fbe3e3); color: var(--crit, #b42828); }
.ui-dialog-b { padding: 6px 22px 4px 66px; color: var(--ink-2, #3d4757); font-size: 14px; line-height: 1.5; }
.ui-dialog-b p { margin: 0 0 12px; }
.ui-field { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink, #18202e); margin-bottom: 8px; }
.ui-field input, .ui-field select, .ui-field textarea, .ui-copy { font: 14px var(--font, system-ui); padding: 9px 11px; border: 1px solid var(--line, #d9d3ca);
  border-radius: 10px; background: var(--panel, #fff); color: inherit; width: 100%; box-sizing: border-box; }
.ui-field input:focus, .ui-field select:focus, .ui-field textarea:focus, .ui-copy:focus { outline: 2px solid var(--focus, #2a78d6); outline-offset: 1px; }
.ui-dialog-err { color: var(--crit, #b42828); font-size: 13px; font-weight: 600; }
.ui-dialog-f > footer { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px 20px; }
.ui-dialog .btn.danger { background: var(--crit, #b42828); color: #fff; border-color: var(--crit, #b42828); }
.ui-expiry .ui-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ui-expiry .ui-chips button { height: 30px; padding: 0 12px; border-radius: 15px; border: 1px solid var(--line, #d9d3ca); background: var(--panel, #fff);
  color: var(--ink-2, #3d4757); font: 600 12.5px var(--font, system-ui); cursor: pointer; }
.ui-expiry .ui-chips button.on { background: var(--brand, #14304a); border-color: var(--brand, #14304a); color: #fff; }
.ui-expiry .ui-chips button:focus-visible { outline: 2px solid var(--focus, #2a78d6); outline-offset: 2px; }
.ui-expiry .ui-custom { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.ui-expiry .ui-custom[hidden] { display: none; }
.ui-expiry .ui-custom input { height: 36px; padding: 0 10px; border: 1px solid var(--line, #d9d3ca); border-radius: 10px; font: 14px var(--font, system-ui); background: var(--panel, #fff); color: inherit; }
.ui-expiry .ui-custom small { color: var(--muted, #677283); }
.ui-expiry-note { margin: 8px 0 0; font-size: 12.5px; color: var(--muted, #677283); }
.ui-expiry-note.bad { color: var(--crit, #b42828); font-weight: 600; }
.ui-dialog .btn { height: 38px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line, #d9d3ca); background: #fff; color: #18202e; font: 600 14px system-ui, -apple-system, sans-serif; cursor: pointer; }
.ui-dialog .btn.primary { background: #14304a; border-color: #14304a; color: #fff; }
.ui-dialog .btn:focus-visible { outline: 2px solid #2a78d6; outline-offset: 2px; }
.ui-dialog-p { margin: 0 0 12px; }

/* 1.71: "Keep NIMO on your Home Screen" (iPhone and iPad) */
.a2hs { position: fixed; z-index: 70; left: 50%; bottom: calc(14px + var(--safe-b)); transform: translate(-50%, 140%); transition: transform .3s cubic-bezier(.2,.8,.2,1);
  width: min(460px, calc(100% - 24px)); box-sizing: border-box; display: flex; gap: 14px; align-items: flex-start; padding: 16px;
  background: #fbf7f1; color: var(--ink); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 18px 50px rgba(60,40,20,.22); font-family: var(--sans); }
.a2hs.in { transform: translate(-50%, 0); }
.a2hs img { border-radius: 12px; flex: 0 0 auto; }
.a2hs h2 { margin: 2px 0 4px; font-size: 16px; }
.a2hs p { margin: 0 0 10px; font-size: 14px; color: var(--ink-2); line-height: 1.4; }
.a2hs-steps { margin: 0 0 10px; padding-left: 1.2rem; font-size: 14px; line-height: 1.5; display: grid; gap: 4px; }
.a2hs-steps svg { width: 18px; height: 18px; vertical-align: -3px; fill: none; stroke: #0a66d8; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.a2hs-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.a2hs-actions button { min-height: 40px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line); background: #fff; color: var(--ink); font: 600 14px var(--sans); }
.a2hs-actions .primary { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.a2hs-actions .link { border: 0; background: none; color: var(--ink-2); text-decoration: underline; padding: 0 6px; }
@media (prefers-reduced-motion: reduce) { .a2hs { transition: none; } }

/* 1.71: Powered by Orvox Labs */
.powered { display: block; text-align: center; margin: 14px 0 0; font: 12px/1.4 var(--sans); color: var(--ink-2); text-decoration: none; opacity: .8; }
.powered b { font-weight: 650; color: var(--ink); }
.powered:hover, .powered:focus-visible { opacity: 1; text-decoration: underline; }
.powered.corner { position: fixed; z-index: 5; margin: 0; left: calc(14px + env(safe-area-inset-left, 0px)); bottom: calc(10px + var(--safe-b));
  font-size: 11px; opacity: .55; padding: 4px 8px; border-radius: 99px; }
.powered.corner:hover { opacity: .9; background: var(--glass); }
@media (max-width: 560px) { .powered.corner { left: 50%; transform: translateX(-50%); bottom: calc(4px + var(--safe-b)); font-size: 10.5px; } }
body.clean .powered.corner, html.robot-body .powered.corner, html.controls-hidden .powered.corner, html.perm-blocked .powered.corner { display: none; }
.status.hushed .dot { background: #8a7c6c; }
.a2hs-steps[hidden] { display: none; }
