/* Dashboard, on top of site.css tokens. Mobile-first: bottom tabs on phones, side nav from 900px. */

body { min-height: 100dvh; }
[tabindex="-1"]:focus { outline: none; }
.shell { min-height: 100dvh; }
.side, .topbar, .tabs { display: none; }
[data-mode="app"] .topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px;
  min-height: 58px; padding: 8px 16px; padding-top: max(8px, env(safe-area-inset-top));
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.topbar b { font: var(--w-ui) 18px/1.2 var(--f-ui); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.credit-chip {
  margin-inline-start: auto; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 6px 14px;
  border-radius: var(--r-pill); background: var(--surface-2); color: var(--ink); text-decoration: none; font: 15px var(--f-num);
}
[data-mode="app"] .tabs {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr);
  padding-bottom: env(safe-area-inset-bottom); background: var(--surface); border-top: 1px solid var(--line);
}
.tabs a {
  position: relative; display: grid; justify-items: center; align-content: center; gap: 4px; min-height: 58px;
  color: var(--ink-soft); text-decoration: none; font: var(--w-ui) 12.5px/1 var(--f-ui);
}
.tabs .i { width: 24px; height: 24px; }
.tabs a[aria-current="page"] { color: var(--ink); }
.tabs a[aria-current="page"] .i { color: var(--accent-text); stroke-width: 2.4; }
.tabs a[aria-current="page"]::before { content: ""; position: absolute; top: 0; inset-inline: 28%; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent); }
.badge {
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--accent); color: var(--accent-ink);
  font: 13px/22px var(--f-num); text-align: center;
}
.tabs .badge { position: absolute; top: 5px; inset-inline-start: calc(50% + 6px); }
body:has(.composer textarea:focus) .tabs { display: none; }

@media (min-width: 900px) {
  [data-mode="app"] .shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); }
  [data-mode="app"] .topbar, [data-mode="app"] .tabs { display: none; }
  [data-mode="app"] .side {
    position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 18px; padding: 22px 14px;
    border-inline-end: 1px solid var(--line); background: var(--surface); overflow-y: auto;
  }
}
.side .brand { padding-inline: 8px; }
.side__agent { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--r-sm); background: var(--surface-2); }
.side__agent b { display: block; font: var(--w-ui) 17px/1.25 var(--f-ui); }
.side__agent small { display: block; font-size: 13.5px; line-height: 1.3; color: var(--ink-soft); }
.nav { list-style: none; display: grid; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 8px 14px; border-radius: var(--r-pill);
  color: var(--ink); text-decoration: none; font: var(--w-ui) 16px/1.2 var(--f-ui);
}
.nav a:hover { background: var(--surface-2); }
.nav a[aria-current="page"] { background: var(--ink); color: var(--bg); }
.nav .badge { margin-inline-start: auto; }
.side__foot { margin-top: auto; display: grid; gap: 4px; padding-top: 14px; border-top: 1px solid var(--line); }
.credits { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 14px; color: var(--ink); text-decoration: none; }
.credits b { font: 18px var(--f-num); }
.linkbtn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 14px; border: 0; background: none;
  color: var(--ink-soft); cursor: pointer; text-decoration: underline; text-underline-offset: .22em; text-align: start;
}
.linkbtn:hover { color: var(--ink); }

/* ── views ── */
.view { width: 100%; max-width: 900px; margin-inline: auto; padding: 28px var(--gutter) calc(96px + env(safe-area-inset-bottom)); }
@media (min-width: 900px) { .view { padding-block: 40px 64px; } }
[data-mode="gate"] .view, [data-mode="boot"] .view { max-width: none; padding: 0; }
.vh { margin-bottom: 22px; }
.vh h1 { font-size: calc(34px * var(--display-scale)); line-height: 1.1; }
.vh p { margin-top: 8px; font-size: 16.5px; color: var(--ink-soft); }
.sh { margin: 32px 0 10px; font: var(--w-ui) 15px/1.2 var(--f-ui); color: var(--ink-soft); }
.hint { font-size: 14.5px; line-height: 1.5; color: var(--ink-soft); }

.list { list-style: none; border-top: 1px solid var(--line); }
.row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px 14px; padding: 12px 2px; border-bottom: 1px solid var(--line); }
.row__icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--surface-2); color: var(--ink); }
.row__icon.ava { background: var(--accent); color: var(--accent-ink); width: 44px; height: 44px; }
.row__title { font: var(--w-ui) 16.5px/1.3 var(--f-ui); overflow-wrap: anywhere; }
.row__meta { margin-top: 3px; font-size: 14.5px; line-height: 1.4; color: var(--ink-soft); overflow-wrap: anywhere; }
.row__meta--warn { color: var(--warn); }
.row__acts { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; }
.row.is-paused .row__title { color: var(--ink-soft); text-decoration: line-through; text-decoration-thickness: 1px; }
.row__edit { grid-column: 1 / -1; padding: 6px 0 8px; }
@media (max-width: 600px) { .row--app .row__acts { grid-column: 2 / -1; justify-content: flex-start; } }
.iconbtn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none; border: 0; border-radius: 50%;
  background: none; color: var(--ink); cursor: pointer;
}
.iconbtn:hover { background: var(--surface-2); }
.iconbtn .i { width: 22px; height: 22px; }
.done { margin-top: 26px; }
.done > summary { display: inline-flex; align-items: center; min-height: 44px; cursor: pointer; font: var(--w-ui) 15px var(--f-ui); color: var(--ink-soft); }

.empty { display: grid; justify-items: center; gap: 10px; padding: 40px 20px; border: 1.5px dashed var(--line-strong); border-radius: var(--r); text-align: center; }
.empty__icon { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); }
.empty__icon .i { width: 30px; height: 30px; }
.empty__title { font: var(--w-ui) 19px/1.3 var(--f-ui); }
.empty p:not(.empty__title) { max-width: 36ch; color: var(--ink-soft); }
.empty .btn { margin-top: 6px; }
.empty-line { padding: 14px 2px; color: var(--ink-soft); }

.loading { display: grid; gap: 12px; padding-top: 6px; }
.sk { display: block; height: 66px; border-radius: var(--r-sm); background: var(--surface-2); }
.sk:first-of-type { width: 48%; height: 40px; }

/* ── toasts ── */
.toasts {
  position: fixed; z-index: 60; inset-inline: 16px; bottom: calc(74px + env(safe-area-inset-bottom));
  display: grid; justify-items: center; gap: 8px; pointer-events: none;
}
@media (min-width: 900px) { .toasts { bottom: 24px; inset-inline-start: 280px; } }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 4px; width: fit-content; max-width: min(540px, 100%);
  padding: 4px; padding-inline-start: 16px; border-radius: var(--r-sm); background: var(--ink); color: var(--bg);
  box-shadow: var(--shadow-soft); font-size: 15.5px; line-height: 1.4;
}
.toast p { flex: 1; padding-block: 9px; }
.toast--error { background: var(--warn); color: #fff; }
.toast--ok p::before { content: "✓ "; }
.toast :focus-visible { outline-color: currentColor; outline-offset: 1px; }
.toast__act {
  min-height: 44px; padding: 6px 14px; border: 1.5px solid currentColor; border-radius: var(--r-pill);
  background: none; color: inherit; font: var(--w-ui) 15px var(--f-ui); cursor: pointer;
}
.toast__x { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border: 0; border-radius: 50%; background: none; color: inherit; cursor: pointer; }

/* ── chat ── */
.view[data-view="chat"] { max-width: 820px; padding-block: 0; }
.chatv { display: flex; flex-direction: column; height: calc(100dvh - 58px - 58px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
body:has(.composer textarea:focus) .chatv { height: calc(100dvh - 58px - env(safe-area-inset-top)); }
@media (min-width: 900px) { .chatv { height: 100dvh; } }
.msgs { flex: 1; min-height: 0; overflow-y: auto; list-style: none; display: flex; flex-direction: column; gap: 10px; padding: 22px 2px 12px; overscroll-behavior: contain; }
.msgs > :first-child { margin-top: auto; }
.msgs:empty { display: none; }
.m { max-width: min(84%, 580px); }
.m--in { align-self: flex-end; }
.m--out { align-self: flex-start; }
.m__text { padding: 10px 14px; border-radius: 18px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.m--in .m__text { background: var(--me); color: var(--me-ink); border-end-end-radius: 5px; }
.m--out .m__text { background: var(--surface-2); border-end-start-radius: 5px; }
.m__text a { color: inherit; }
.m__at { display: block; margin-top: 3px; padding-inline: 6px; font-size: 12.5px; color: var(--ink-soft); }
.m--in .m__at { text-align: end; }
.m__files { list-style: none; display: grid; gap: 6px; margin-top: 6px; }
.m__files a {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 14px; border: 1.5px solid var(--line-strong);
  border-radius: var(--r-sm); background: var(--surface); color: var(--ink); text-decoration: none; overflow-wrap: anywhere;
}
.m--typing { display: flex; align-items: center; gap: 10px; }
.m__status { font-size: 14px; color: var(--ink-soft); }
.m--failed .m__text { opacity: .65; }
.m__fail { margin-top: 3px; font-size: 13.5px; color: var(--warn); text-align: end; }
.chat-empty { flex: 1; display: grid; place-content: center; justify-items: center; gap: 14px; padding: 20px 0; text-align: center; }
.chat-empty .ava { width: 64px; height: 64px; font-size: 30px; }
.chat-empty h1 { font-size: calc(28px * var(--display-scale)); }
.chat-empty .chips { justify-content: center; }
.composer { display: flex; align-items: flex-end; gap: 10px; padding: 10px 0 14px; background: var(--bg); }
.composer textarea {
  flex: 1; min-height: 52px; max-height: 160px; padding: 13px 18px; border: var(--bw) solid var(--ink); border-radius: 26px;
  background: var(--surface); color: var(--ink); font-size: 16px; line-height: 1.45; resize: none;
}
.send { flex: none; display: grid; place-items: center; width: 52px; height: 52px; border: 0; border-radius: 50%; background: var(--accent); color: var(--accent-ink); cursor: pointer; }
.send[disabled] { opacity: .5; cursor: default; }
.send .i { width: 24px; height: 24px; }

/* ── forms ── */
.form { display: grid; gap: 18px; }
.field { display: grid; gap: 7px; }
.field > label, .fset > legend { font: var(--w-ui) 15.5px/1.25 var(--f-ui); }
.field input, .field select, .field textarea {
  width: 100%; min-height: 48px; padding: 11px 14px; border: 1.5px solid var(--ink-soft); border-radius: var(--r-xs);
  background: var(--surface); color: var(--ink); font-size: 16px;
}
.field textarea { min-height: 112px; line-height: 1.5; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--ink); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }
.fset { display: grid; gap: 8px; margin: 0; padding: 0; border: 0; }
.fset > legend { margin-bottom: 8px; padding: 0; }
.choice {
  display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 10px 14px; border: 1.5px solid var(--line-strong);
  border-radius: var(--r-sm); background: var(--surface); cursor: pointer;
}
.choice input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--accent); }
.choice:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.choice small, .switch small { display: block; font-size: 14px; line-height: 1.4; color: var(--ink-soft); }
.switch { display: flex; align-items: center; gap: 14px; min-height: 52px; cursor: pointer; }
.switch b { display: block; font: var(--w-ui) 16px/1.3 var(--f-ui); }
.switch input {
  appearance: none; -webkit-appearance: none; position: relative; flex: none; width: 52px; height: 30px; margin: 0;
  border-radius: 15px; background: var(--ink-soft); cursor: pointer;
}
.switch input::before {
  content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 24px; height: 24px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
}
.switch input:checked { background: var(--accent); }
.switch input:checked::before { inset-inline-start: 25px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 0; accent-color: var(--accent); }
.dep { display: grid; gap: 14px; padding-inline-start: 66px; }
@media (max-width: 560px) { .dep { padding-inline-start: 0; } }
.form__acts { display: flex; flex-wrap: wrap; gap: 10px; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: var(--r-pill); background: var(--surface-2); }
.seg button {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 16px; border: 0; border-radius: var(--r-pill);
  background: none; color: var(--ink); font: var(--w-ui) 15px/1.1 var(--f-ui); cursor: pointer;
}
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.seg--sm button { padding-inline: 12px; font-size: 14px; }
.seg em { font-style: normal; color: var(--accent-text); }
.seg button[aria-pressed="true"] em { color: inherit; }
.card { display: grid; gap: 16px; padding: 20px; border: 1.5px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); }
.card > h2 { font: var(--w-ui) 18px/1.2 var(--f-ui); }
.stack { display: grid; gap: 18px; }
.savebar {
  position: sticky; bottom: calc(70px + env(safe-area-inset-bottom)); z-index: 10; display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin-top: 22px; padding: 10px; padding-inline-start: 18px; border-radius: var(--r-sm); background: var(--ink); color: var(--bg); box-shadow: var(--shadow-soft);
}
@media (min-width: 900px) { .savebar { bottom: 16px; } }
.savebar p { flex: 1; min-width: 12ch; }
.savebar .btn { box-shadow: none; }
.savebar .btn--ghost { color: var(--bg); border-color: currentColor; }
.savebar :focus-visible { outline-color: var(--bg); }
.add { margin-bottom: 22px; }
.add > summary { list-style: none; width: fit-content; }
.add > summary::-webkit-details-marker { display: none; }
.add[open] > summary { margin-bottom: 14px; }
.add > .form { padding: 18px; border: 1.5px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); }

/* ── login, onboarding, channel picker ── */
.gate { min-height: 100dvh; display: grid; place-items: center; padding: 28px 16px; }
.gate__card {
  width: min(480px, 100%); display: grid; gap: 18px; padding: 30px clamp(18px, 5vw, 34px);
  border: var(--bw) solid var(--ink); border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow);
}
.gate__card--wide { width: min(580px, 100%); }
.gate__card h1 { font-size: calc(30px * var(--display-scale)); line-height: 1.15; }
.gate__lead { color: var(--ink-soft); }
.gate__step { font: var(--w-ui) 14px var(--f-ui); color: var(--accent-text); }
.or { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--ink-soft); }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-btn {
  min-height: 44px; padding: 8px 16px; border: 1.5px solid var(--ink); border-radius: var(--r-pill);
  background: var(--surface); color: var(--ink); font: var(--w-ui) 15px/1.2 var(--f-ui); cursor: pointer; text-align: start;
}
.chip-btn:hover { background: var(--surface-2); }
.opts { display: grid; gap: 10px; }
.opt {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; width: 100%; min-height: 66px; padding: 12px 14px;
  border: 1.5px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); text-align: start; cursor: pointer;
}
.opt:hover { border-color: var(--ink); }
.opt[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); background: var(--surface-2); }
.opt__icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); }
.opt__text b { display: block; font: var(--w-ui) 16.5px/1.25 var(--f-ui); }
.opt__text small { display: block; margin-top: 2px; font-size: 14px; line-height: 1.35; color: var(--ink-soft); }
.opt__tag { padding: 3px 10px; border-radius: var(--r-pill); background: var(--accent); color: var(--accent-ink); font: var(--w-ui) 12.5px/1.3 var(--f-ui); }
.pane { display: grid; gap: 16px; margin-top: 18px; }
.pane:empty { display: none; }
.pane__title { font: var(--w-ui) 19px/1.25 var(--f-ui); }
.qr { justify-self: center; padding: 14px; border: 1.5px solid var(--line-strong); border-radius: 14px; background: #fff; }
.qr img { display: block; width: min(256px, 62vw); height: auto; aspect-ratio: 1; image-rendering: pixelated; }
.pair {
  justify-self: center; padding: 14px 22px; border: var(--bw) dashed var(--ink); border-radius: var(--r-sm);
  font: clamp(28px, 8vw, 38px)/1 var(--f-num); letter-spacing: .12em; user-select: all;
}
.mini-steps { list-style: none; display: grid; gap: 8px; counter-reset: s; }
.mini-steps li { counter-increment: s; display: flex; align-items: center; gap: 10px; font-size: 15.5px; line-height: 1.4; }
.mini-steps li::before {
  content: counter(s); flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--ink); color: var(--bg); font: 14px/1 var(--f-num);
}
.wait { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--ink-soft); }
.wait--err { color: var(--warn); }
.view > .wait { justify-content: center; min-height: 60vh; }
.spin { flex: none; width: 16px; height: 16px; border: 2.5px solid var(--line-strong); border-top-color: var(--accent-text); border-radius: 50%; }
.ok-box { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: var(--r-sm); background: var(--accent-soft); }
.ok-box__icon { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 50%; background: var(--accent); color: var(--accent-ink); }

/* ── apps ── */
.search { position: relative; margin-bottom: 14px; }
.search .i { position: absolute; top: 50%; inset-inline-start: 16px; translate: 0 -50%; color: var(--ink-soft); pointer-events: none; }
.search input {
  width: 100%; min-height: 50px; padding: 12px 18px; padding-inline-start: 46px; border: 1.5px solid var(--ink-soft);
  border-radius: var(--r-pill); background: var(--surface); color: var(--ink); font-size: 16px;
}
.tiles { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)); gap: 12px; }
.tile-app { display: grid; grid-template-rows: auto auto 1fr auto; gap: 6px; padding: 16px; border: 1.5px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); }
.tile-app__icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--surface-2); }
.tile-app__name { font: var(--w-ui) 16.5px/1.25 var(--f-ui); }
.tile-app__desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 14px; line-height: 1.45; color: var(--ink-soft); }
.tile-app .btn { justify-self: start; margin-top: 6px; }

/* ── memory ── */
.notes { list-style: none; display: grid; gap: 16px; }
.note { padding: 18px; border: 1.5px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); }
.note__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; margin-bottom: 10px; }
.note__head h2 { font: var(--w-ui) 18px/1.25 var(--f-ui); }
.note__at { font-size: 13.5px; color: var(--ink-soft); }
.note__text {
  width: 100%; min-height: 96px; padding: 12px 14px; border: 1.5px solid var(--line-strong); border-radius: var(--r-xs);
  background: var(--bg); color: var(--ink); font-size: 16px; line-height: 1.55; resize: vertical;
}
.note__text:focus { border-color: var(--ink); }
.note__acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

/* ── approvals ── */
.aps { list-style: none; display: grid; gap: 14px; }
.ap { padding: 18px; border: var(--bw) solid var(--ink); border-radius: var(--r-sm); background: var(--surface); box-shadow: var(--shadow); }
.ap__summary { font-size: 17px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.ap__at { margin-top: 6px; font-size: 13.5px; color: var(--ink-soft); }
.ap__acts { display: flex; gap: 10px; margin-top: 14px; }
.ap__acts .btn { flex: 1; }
.ap__done { display: flex; align-items: center; gap: 8px; margin-top: 12px; font: var(--w-ui) 15.5px/1.4 var(--f-ui); color: var(--accent-text); }
.ap__done--no { color: var(--ink-soft); }

/* ── billing ── */
.bal {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 22px 24px;
  border: var(--bw) solid var(--ink); border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow);
}
.bal__num { font: var(--w-ui) 18px var(--f-ui); }
.bal__num b { margin-inline-end: 6px; font: calc(46px * var(--display-scale))/1 var(--f-num); }
.bal__plan { margin-inline-start: auto; padding: 5px 14px; border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent-text); font: var(--w-ui) 14.5px var(--f-ui); }
.bars { list-style: none; display: grid; gap: 12px; margin-top: 12px; }
.bars li { display: grid; grid-template-columns: 84px minmax(0, 1fr) 64px; align-items: center; gap: 12px; }
.bars__track { height: 12px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.bars__track i { display: block; width: var(--w, 0%); height: 100%; border-radius: inherit; background: var(--accent); box-shadow: inset 0 0 0 1.5px var(--ink); }
.bars__num { text-align: end; font: 15px var(--f-num); }
.days { display: flex; align-items: flex-end; gap: 3px; height: 92px; margin-top: 24px; border-bottom: 1.5px solid var(--line-strong); }
.days i { flex: 1; min-height: 2px; height: var(--h, 0%); border-radius: 3px 3px 0 0; background: var(--ink); }
.days__ends { display: flex; justify-content: space-between; margin-top: 6px; font-size: 13px; color: var(--ink-soft); }
.view .plans { margin-top: 16px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.view .plan__price { flex-wrap: wrap; }
.view .plan__price b { font-size: 44px; }
.topups { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }

/* ── more (phone menu) ── */
.menu { list-style: none; border-top: 1px solid var(--line); }
.menu a, .menu button {
  display: flex; align-items: center; gap: 14px; width: 100%; min-height: 58px; padding: 10px 4px; border: 0; border-bottom: 1px solid var(--line);
  background: none; color: var(--ink); font: var(--w-ui) 17px/1.2 var(--f-ui); text-decoration: none; text-align: start; cursor: pointer;
}
.menu .i:last-child { margin-inline-start: auto; color: var(--ink-soft); }

@media (prefers-reduced-motion: no-preference) {
  .sk { animation: sk 1.1s ease-in-out infinite alternate; }
  .spin { animation: spin .8s linear infinite; }
  .switch input, .switch input::before { transition: background-color .15s ease, inset-inline-start .15s ease; }
  .toast { animation: pop .25s cubic-bezier(.2, .8, .3, 1.2) both; }
}
@keyframes sk { to { opacity: .45; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* עונים לי structure (26.10.2026): one masthead on every width, rooms under it, and the tab bar as in ~/maane/site/assets/app.css —
   at the bottom on phones, a floating pill under the masthead from 900px. Cards carry their title as a yellow tab. */
[data-mode="app"] .side { display: none !important; }
[data-mode="app"] .shell { display: flex; flex-direction: column; }
[data-mode="app"] .tabs { order: 1; }
[data-mode="app"] .view { order: 2; }
[data-mode="app"] .topbar { display: flex; gap: 14px; min-height: 66px; background: rgba(251, 249, 243, 0.97); border-bottom: 1px solid var(--line); }
.topbar .brand { flex: none; }
.topbar__agent { display: inline-flex; align-items: center; gap: 8px; min-width: 0; margin-inline-start: auto; }
.topbar__agent b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: var(--w-ui) 16px/1.2 var(--f-ui); }
.topbar .credit-chip { margin-inline-start: 0; border: 2px solid var(--ink); background: var(--accent); color: var(--accent-ink); }
@media (max-width: 520px) { .topbar__agent, .topbar .brand__channel { display: none; } .topbar .credit-chip { margin-inline-start: auto; } }

[data-mode="app"] .tabs { display: grid; gap: 2px; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); border-top: 2px solid var(--ink); }
.tabs a { gap: 3px; min-height: 58px; font-size: 13px; }
.tabs a::before { display: none; }
.tabs .i { box-sizing: content-box; width: 22px; height: 22px; padding: 3px 13px; border: 2px solid transparent; border-radius: 999px; }
.tabs a[aria-current="page"] .i { color: var(--ink); background: var(--accent); border-color: var(--ink); box-shadow: 2px 3px 0 rgba(27, 26, 23, 0.86); }
@media (min-width: 900px) {
  [data-mode="app"] .tabs {
    position: sticky; top: 78px; bottom: auto; inset-inline: auto; width: fit-content; margin: 22px auto 0;
    grid-template-columns: repeat(5, auto); gap: 6px; padding: 6px; border: 2px solid var(--ink); border-radius: var(--r); box-shadow: var(--shadow);
  }
  .tabs a { grid-auto-flow: column; align-items: center; gap: 8px; min-height: 48px; padding: 8px 18px; border-radius: 14px; font-size: 16px; }
  .tabs .i { padding: 0; border: 0; }
  .tabs a[aria-current="page"] { background: var(--accent); box-shadow: 2px 3px 0 rgba(27, 26, 23, 0.86); }
  .tabs a[aria-current="page"] .i { background: none; box-shadow: none; }
  .tabs .badge { position: static; }
  .view { padding-top: 30px; }
  .view[data-view="chat"] .chatv { height: calc(100dvh - 160px); }
  .toasts { inset-inline-start: 24px; }
}

.card { position: relative; margin-top: 18px; border: 2px solid var(--ink); border-radius: var(--r); box-shadow: var(--shadow); }
.card > h2:first-child {
  position: absolute; bottom: 100%; inset-inline-start: 24px; margin-bottom: -2px; padding: 6px 14px 5px;
  background: var(--accent); border: 2px solid var(--ink); border-bottom: 0; border-radius: 10px 10px 0 0;
  font: var(--w-ui) 14px/1.3 var(--f-ui); color: var(--accent-ink); white-space: nowrap;
}
