/* Ziggi AI | UI layer (2026-10-28): tabs, accordions, bottom tab bar, motion.
   Loads after app.css and only restyles; brand tokens come from site.css. */
:root {
  --tabbar-h: 64px;
  --ease: cubic-bezier(.2, .8, .25, 1);
  --spring: cubic-bezier(.34, 1.4, .5, 1);
  --card: rgba(251, 250, 245, .92);
  --shadow-1: 0 1px 2px rgba(46, 12, 27, .06), 0 8px 24px -16px rgba(46, 12, 27, .35);
  --shadow-2: 0 2px 6px rgba(46, 12, 27, .08), 0 22px 40px -22px rgba(46, 12, 27, .5);
}

/* ---------- Motion basics ---------- */
@keyframes zrise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes zfade { from { opacity: 0; } to { opacity: 1; } }
@keyframes zin-r { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
@keyframes zin-l { from { opacity: 0; transform: translateX(-18px); } to { opacity: 1; transform: none; } }
@keyframes zdrop { from { opacity: 0; transform: translateY(-8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes zpop { 0% { transform: scale(.4); } 60% { transform: scale(1.18); } 100% { transform: scale(1); } }
@keyframes zsheet { from { transform: translateY(100%); } to { transform: none; } }
@keyframes zzoom { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes zshimmer { from { background-position: -320px 0; } to { background-position: 320px 0; } }
@keyframes zhalo { 0% { box-shadow: 0 0 0 0 currentColor; } 70%, 100% { box-shadow: 0 0 0 7px transparent; } }

main.page > *, main.talk > .talk-top { animation: zrise .55s var(--ease) both; }
main.page > *:nth-child(2) { animation-delay: .05s; }
main.page > *:nth-child(3) { animation-delay: .1s; }
main.page > *:nth-child(n+4) { animation-delay: .15s; }

.btn, .btn-q, .btn-run, .tabs [data-tab], .tabbar-i, .att, .nav-toggle, .sound, .replay {
  transition: transform .18s var(--ease), background-color .2s, box-shadow .2s, color .2s, opacity .2s;
}
.btn:active, .btn-q:active, .btn-run:active, .att:active, .tabs [data-tab]:active, .tabbar-i:active, .sound:active, .replay:active { transform: scale(.96); }
.btn[disabled], .btn-q[disabled], .btn-run[disabled] { opacity: .55; cursor: progress; transform: none; }
.btn-q:focus-visible, .btn-run:focus-visible, .tabs [data-tab]:focus-visible, .tabbar-i:focus-visible, .att:focus-visible, summary:focus-visible {
  outline: 3px solid var(--gold); outline-offset: 2px;
}

/* ---------- Top bar ---------- */
.topbar { background: rgba(237, 240, 231, .78); -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px); }
.nav-menu.open { animation: zdrop .22s var(--ease); }
@media (max-width: 760px) {
  /* The bottom tab bar covers the app pages; the top menu keeps Home + Log out. */
  body.has-tabbar .nav-menu .nav-link[href="/talk"],
  body.has-tabbar .nav-menu .nav-link[href="/dashboard"],
  body.has-tabbar .nav-menu .nav-link[href="/admin"],
  body.has-tabbar .nav-menu .nav-link[href="/account"] { display: none; }
}

/* ---------- Bottom tab bar (phones, signed in) ---------- */
.tabbar { display: none; }
@media (max-width: 760px) {
  body.has-tabbar { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    display: flex; justify-content: space-around; align-items: stretch;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
    padding: 6px max(8px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(8px, env(safe-area-inset-left));
    background: rgba(251, 250, 245, .86);
    -webkit-backdrop-filter: saturate(1.4) blur(16px); backdrop-filter: saturate(1.4) blur(16px);
    border-top: 1px solid var(--line);
    box-shadow: 0 -10px 30px -20px rgba(46, 12, 27, .4);
    animation: zfade .4s ease both;
  }
  .tabbar-i {
    flex: 1; max-width: 120px; position: relative;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    text-decoration: none; color: var(--muted); border-radius: 16px;
    font: 600 10.5px/1 var(--label); letter-spacing: .1em; text-transform: uppercase;
    -webkit-tap-highlight-color: transparent;
  }
  .tabbar-i svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s var(--spring); }
  .tabbar-i::before {
    content: ""; position: absolute; top: 2px; left: 50%; width: 56px; height: 32px; margin-left: -28px;
    border-radius: 999px; background: rgba(75, 21, 45, .1); transform: scale(.4); opacity: 0;
    transition: transform .3s var(--spring), opacity .2s;
  }
  .tabbar-i.on { color: var(--plum); }
  .tabbar-i.on::before { transform: scale(1); opacity: 1; }
  .tabbar-i.on svg { transform: translateY(-1px); }
  body.has-tabbar .foot { padding-bottom: 20px; }
}

/* ---------- Tabs ---------- */
.tabs {
  position: relative; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none;
  -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs [data-tab] {
  position: relative; z-index: 1; flex: none; border: 0; cursor: pointer; background: transparent;
  display: inline-flex; align-items: center; gap: 7px;
  font: 600 13px/1 var(--label); letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
  padding: 11px 14px 9px; border-radius: 999px; -webkit-tap-highlight-color: transparent; white-space: nowrap;
}
.tabs [data-tab]:hover { color: var(--plum); }
.tabs [data-tab][aria-selected="true"] { color: var(--paper); }
.tabs [data-tab] svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; margin-top: -2px; }
.tab-ink {
  position: absolute; z-index: 0; left: 0; top: 4px; bottom: 4px; width: 0; border-radius: 999px;
  background: linear-gradient(135deg, #5e1d3a, var(--plum));
  box-shadow: 0 6px 16px -8px rgba(46, 12, 27, .7);
  transition: transform .38s var(--spring), width .38s var(--spring);
}
.tabs-main {
  position: sticky; top: calc(var(--nav-h) + env(safe-area-inset-top)); z-index: 20;
  margin: 0 -6px 18px; padding: 4px;
  background: rgba(251, 250, 245, .82); border-radius: 999px;
  -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
  box-shadow: inset 0 0 0 1px var(--line), var(--shadow-1);
}
.tabs-seg { margin: 0 0 16px; padding: 4px; background: rgba(75, 21, 45, .05); border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line); width: max-content; max-width: 100%; }
.tabs-seg [data-tab] { font-size: 12px; padding: 9px 13px 7px; }
.tabs-seg .tab-ink { background: var(--paper); box-shadow: 0 1px 2px rgba(46, 12, 27, .12), 0 4px 12px -6px rgba(46, 12, 27, .35); }
.tabs-seg [data-tab][aria-selected="true"] { color: var(--plum); }

.badge {
  display: none; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px;
  font: 700 11px/19px var(--body); letter-spacing: 0; text-align: center; color: #fff; margin-top: -2px;
}
.badge.on { display: inline-block; }
.badge-bad { background: var(--bad); } .badge-warn { background: var(--warn); } .badge-info { background: var(--sage); }
.badge.pop { animation: zpop .45s var(--spring); }
.count { font: 600 11px var(--body); letter-spacing: 0; opacity: .6; }
.count:empty { display: none; }

.tab-panel.enter-r { animation: zin-r .32s var(--ease); }
.tab-panel.enter-l { animation: zin-l .32s var(--ease); }
.tab-panel > .block:last-child { margin-bottom: 0; }

/* ---------- "Needs you" summary ---------- */
.attention { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; margin: 0 0 26px; }
.att {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: 0; font: inherit; color: inherit;
  background: var(--card); border-radius: 18px; padding: 14px 16px; box-shadow: inset 0 0 0 1px var(--line), var(--shadow-1);
  animation: zrise .45s var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms);
}
body.is-drawn .att { animation: none; }
button.att { cursor: pointer; }
button.att:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1px var(--line), var(--shadow-2); }
.att-dot { flex: none; width: 11px; height: 11px; border-radius: 50%; background: var(--muted); color: var(--muted); animation: zhalo 2.2s ease-out infinite; }
.att-ok .att-dot { background: var(--ok); color: rgba(63, 122, 92, .45); }
.att-warn .att-dot { background: var(--warn); color: rgba(183, 134, 31, .5); }
.att-bad .att-dot { background: var(--bad); color: rgba(174, 75, 46, .5); }
.att-info .att-dot { background: var(--sage); color: rgba(70, 98, 85, .45); animation: none; }
.att-ok .att-dot { animation: none; }
.att-txt { flex: 1; min-width: 0; display: grid; gap: 2px; }
.att-txt b { font: 600 16px/1.25 var(--display); color: var(--plum); }
.att-txt small { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-go { font: 400 26px/1 var(--display); color: var(--gold); transition: transform .2s var(--ease); }
button.att:hover .att-go { transform: translateX(3px); }

/* ---------- Skeleton loaders ---------- */
.skel {
  border-radius: 18px; min-height: 64px;
  background: linear-gradient(90deg, rgba(75, 21, 45, .05) 0, rgba(75, 21, 45, .1) 160px, rgba(75, 21, 45, .05) 320px) 0 0 / 640px 100%;
  animation: zshimmer 1.3s linear infinite;
}
.skel-tile { min-height: 118px; border-radius: 20px 20px 20px 4px; }
.skel-card { min-height: 220px; border-radius: 22px 22px 22px 6px; }
.skel-row { min-height: 54px; }
.tools .skel-row + .skel-row { margin-top: 10px; }

/* ---------- Cards: one consistent surface ---------- */
.tile, .device, .op, .entry, .tool-group, .person, .hello, .acc { background: var(--card); box-shadow: inset 0 0 0 1px var(--line), var(--shadow-1); }
.tile, .device, .person { transition: transform .25s var(--ease), box-shadow .25s; }
@media (hover: hover) {
  .tile:hover, .device:hover, .person:hover { transform: translateY(-3px); box-shadow: inset 0 0 0 1px var(--line), var(--shadow-2); }
}
.tile::before { width: 100%; height: 3px; inset: 0 0 auto 0; opacity: .9; }
.tile { padding-top: 18px; }
.device.needs-you { box-shadow: inset 0 0 0 1.5px rgba(183, 134, 31, .55), var(--shadow-1); }
.device .alert { margin: 0 0 10px; font-size: 14px; }

/* ---------- Accordions (all <details>) ---------- */
details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details { overflow: hidden; }
.acc, .tool-group, .data-access .src, .more, .code-view { position: relative; }
.acc > summary, .tool-group > summary, .data-access .src > summary, .more > summary, .code-view > summary { cursor: pointer; padding-right: 44px; position: relative; -webkit-tap-highlight-color: transparent; }
.acc > summary::after, .tool-group > summary::after, .data-access .src > summary::after, .more > summary::after {
  content: ""; position: absolute; right: 18px; top: 50%; width: 9px; height: 9px; margin-top: -7px;
  border-right: 2px solid var(--gold); border-bottom: 2px solid var(--gold); transform: rotate(45deg);
  transition: transform .28s var(--spring);
}
details[open]:not(.closing) > summary::after { transform: translateY(4px) rotate(-135deg); }
.acc { border-radius: 18px; margin: 0 0 12px; }
.acc > summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 44px 14px 18px; font: 600 17px var(--display); color: var(--plum); }
.acc > summary small { font: 500 13px var(--body); color: var(--muted); }
.acc-body { padding: 0 18px 16px; }
.acc-soft { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.acc-soft > summary { font: 600 13px var(--label); letter-spacing: .1em; text-transform: uppercase; color: var(--sage); padding: 11px 44px 9px 16px; }
.acc-soft .hint { margin: 0; }
.more { margin-top: 12px; border-top: 1px solid var(--line); }
.more > summary { padding: 12px 40px 4px 0; font: 600 12.5px/1.2 var(--label); letter-spacing: .1em; text-transform: uppercase; color: var(--sage); display: flex; gap: 8px; align-items: baseline; }
.more > summary::after { right: 6px; margin-top: -3px; width: 8px; height: 8px; }
.more > summary small { font: 500 12px var(--body); letter-spacing: 0; text-transform: none; color: var(--muted); }
.more > .kv, .more > .svc { margin-top: 8px; }
.tile .more { margin-top: 8px; }
.code-view.more > summary { font-size: 12px; }
.tool-group > summary { padding-right: 48px; }
.tool-group > summary small { margin-right: 4px; }

/* ---------- Dashboard layout ---------- */
.dash-head { align-items: center; }
.dash-head .h-page { margin-bottom: 0; }
#banners .alert { animation: zrise .4s var(--ease) both; }
.live-ok i { color: rgba(63, 122, 92, .5); animation: zhalo 2s ease-out infinite; }

.ops-list { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.ops-list .op { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 4px 14px; border-radius: 20px; }
.ops-list .op .hint { min-height: 0; margin: 0; }
.ops-list .op .h-sub { margin: 0 0 3px; }
.ops-list .op-wide { grid-template-columns: auto 1fr; }
.ops-list .op-wide .op-row { grid-column: 1 / -1; margin-top: 8px; }
.op-ic { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; }
.op-ic svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.op-ic-rust { background: rgba(174, 75, 46, .12); color: var(--rust); }
.op-ic-sage { background: rgba(70, 98, 85, .14); color: var(--sage); }
.op-ic-plum { background: rgba(75, 21, 45, .09); color: var(--plum); }
.op-out:not(:empty) { animation: zrise .3s var(--ease); }
.op-out.is-ok, .op-out.is-fail { padding: 12px 14px; border-radius: 14px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }

.quick { border-top: 0; padding-top: 0; margin-top: 12px; }
.btn-q { background: rgba(75, 21, 45, .07); box-shadow: inset 0 0 0 1px rgba(75, 21, 45, .08); padding: 10px 14px 8px; }
.btn-q:hover { background: rgba(75, 21, 45, .14); }
.device header { align-items: center; }
.device .room { background: rgba(70, 98, 85, .1); color: var(--sage); padding: 4px 10px 3px; border-radius: 999px; font: 600 11px/1.2 var(--label); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.now { display: flex; align-items: center; gap: 8px; }
.now::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--sage); flex: none; }

.sec-row { margin-bottom: 12px; }
.sec-row .h-sec { margin: 0; }
.search {
  display: flex; align-items: center; gap: 8px; padding: 0 14px; border-radius: 999px; min-width: 0;
  background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .2s;
}
.search:focus-within { box-shadow: inset 0 0 0 2px var(--gold); }
.search svg { width: 17px; height: 17px; flex: none; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.search input { border: 0; background: transparent; font: 500 15px var(--body); color: var(--ink); padding: 10px 0; width: 190px; min-width: 0; }
.search input:focus { outline: none; }
.filtered-out { display: none !important; }

.feed { gap: 8px; }
.entry { border-radius: 16px; }
.cols { display: block; }
.apis { margin: 0; }
.tools { margin-top: 12px; }

/* Bottom-sheet tool runner on phones, a zoom-in card on bigger screens */
.runner[open] { animation: zzoom .28s var(--ease); }
.runner[open]::backdrop { animation: zfade .25s ease; -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.sheet-grip { display: none; }
@media (max-width: 520px) {
  .runner {
    margin: auto 0 0; width: 100%; max-width: 100%; max-height: 88dvh;
    border-radius: 26px 26px 0 0; padding: 26px 18px max(18px, env(safe-area-inset-bottom));
  }
  .runner[open] { animation: zsheet .34s var(--ease); }
  .sheet-grip { display: block; position: absolute; top: 9px; left: 50%; width: 42px; height: 5px; margin-left: -21px; border-radius: 99px; background: rgba(75, 21, 45, .18); }
}

/* ---------- Phones ---------- */
@media (max-width: 760px) {
  .page.wide { padding-top: 18px; }
  .tabs-main { margin: 0 -8px 16px; top: calc(var(--nav-h) + env(safe-area-inset-top) + 6px); }
  .tabs-main [data-tab] { padding: 11px 13px 9px; }
  .feed, .feed.small { max-height: none; overflow: visible; }
  .sec-row { flex-direction: column; align-items: stretch; }
  .search input { width: 100%; }
  .filter { justify-content: space-between; }
  .filter select { flex: 1; }
  .tabs-seg { width: auto; margin-left: -2px; margin-right: -2px; }
}
@media (max-width: 520px) {
  .attention { grid-template-columns: 1fr; }
  .ops-list { grid-template-columns: 1fr; }
  .ops-list .op { grid-template-columns: auto 1fr; }
  .ops-list .op > .btn { grid-column: 1 / -1; justify-content: center; margin-top: 10px; padding: 13px; }
  .dash-head { gap: 2px; }
  .h-sec { font-size: 24px; }
}

/* ---------- Admin ---------- */
.admin-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; margin-bottom: 14px; }
.admin-head .h-page { margin: 0; }
.sync { display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 7px 14px 6px; border-radius: 999px; font-size: 14px; font-weight: 500; }
.sync::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.sync.ok { background: rgba(63, 122, 92, .12); }
.sync.warn { background: rgba(183, 134, 31, .14); }
.sync.warn::before { animation: zhalo 1.6s ease-out infinite; }
.person { border-radius: 22px 22px 22px 6px; padding: 20px; display: grid; gap: 14px; }
.person header { margin: 0; justify-content: flex-start; gap: 14px; }
.person header .chip { margin-left: auto; }
.avatar {
  width: 48px; height: 48px; flex: none; border-radius: 16px; display: grid; place-items: center;
  font: 650 22px/1 var(--display); color: var(--paper);
  background: linear-gradient(135deg, var(--rust), var(--plum));
  box-shadow: 0 8px 18px -10px rgba(46, 12, 27, .7);
}
.avatar.av-sage { background: linear-gradient(135deg, var(--gold), var(--sage)); }
.person h2 { font-size: 24px; margin: 0; }
.person h2 small { display: block; font: 500 13px var(--body); color: var(--muted); margin-top: 2px; }
.stat-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.stat-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
.stat-list li:first-child { border-top: 0; }
.stat-list span { color: var(--muted); }
.stat-list b { font-weight: 600; text-align: right; }
.actions { margin: 0; }
.actions .btn { flex: 1; justify-content: center; }
.actions form { flex: 1 1 140px; display: flex; }
.codebox { animation: zzoom .4s var(--ease) both; display: grid; gap: 8px; }
.codebox .code-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.codebox .code-row .code { flex: 1 1 auto; min-width: 0; margin: 0; }
.btn-xs { padding: 8px 14px 6px; font-size: 12px; }
.btn.copied { background: var(--ok); color: #fff; box-shadow: none; }
.legend { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.data-access { margin-top: 0; }
.data-access .src { background: var(--card); box-shadow: inset 0 0 0 1px var(--line), var(--shadow-1); }
.data-access .src > summary { padding: 14px 44px 14px 16px; }
.data-access .src > summary b { font: 600 17px var(--display); color: var(--plum); }
.data-access .tbl { padding: 10px 16px; }
.data-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 14px; }
@media (max-width: 760px) {
  .data-tools { flex-direction: column; align-items: stretch; }
  .people { grid-template-columns: 1fr; }
}

/* ---------- Account ---------- */
.panel .tabs-seg { margin-bottom: 20px; }
.panel .tab-panel .form { margin-bottom: 0; }

/* ---------- Forms: softer, livelier inputs everywhere ---------- */
.form input:not([type=checkbox]), .runner textarea, .runner select, .typebox input {
  transition: box-shadow .2s, background-color .2s;
}
.form input:not([type=checkbox]):focus, .runner textarea:focus, .runner select:focus { box-shadow: inset 0 0 0 2px var(--gold), 0 0 0 4px rgba(171, 123, 34, .12); outline: none; }
.panel { box-shadow: inset 0 0 0 1px var(--line), var(--shadow-2); }
.auth-card { animation: zzoom .5s var(--ease) both; }
.alert { animation: zrise .35s var(--ease) both; }

/* ---------- Talk page ---------- */
.msg { animation: zzoom .3s var(--ease) both; }
.msg.me { transform-origin: 100% 100%; }
.msg.zig { transform-origin: 0 100%; }
.ptt { transition: transform .2s var(--spring), box-shadow .2s; }
.ptt:not(:disabled):hover { box-shadow: 0 22px 40px -14px rgba(46, 12, 27, .7), inset 0 0 0 3px rgba(171, 123, 34, .8); }
@media (max-width: 760px) {
  body.talkpage.has-tabbar .talk { min-height: calc(100dvh - var(--nav-h) - var(--tabbar-h) - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
  body.talkpage.has-tabbar .dock { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .tab-ink { transition: none; }
}

/* ---------- Fixes after the first screenshot pass ---------- */
.lbl-short { display: none; }
/* Phones: all five main tabs fit, icon over label, no sideways scrolling. */
@media (max-width: 760px) {
  .tabs-main { border-radius: 20px; padding: 4px; }
  .tabs-main [data-tab] {
    flex: 1 1 0; min-width: 0; flex-direction: column; justify-content: center; gap: 5px;
    padding: 9px 2px 7px; border-radius: 16px; font-size: 10px; letter-spacing: .07em;
  }
  .tabs-main [data-tab] svg { width: 20px; height: 20px; margin: 0; }
  .tabs-main .tab-ink { border-radius: 16px; }
  .tabs-main .lbl-long { display: none; }
  .tabs-main .lbl-short { display: inline; }
  .tabs-main .badge { position: absolute; top: 4px; left: 50%; margin: 0 0 0 8px; min-width: 17px; height: 17px; font-size: 10px; line-height: 17px; box-shadow: 0 0 0 2px var(--paper); }
  .tabs-main .count { display: none; }
}
/* Made-by-Ziggi description reads as plain text, not a device status line. */
.made-card .now { font-weight: 500; font-size: 15px; color: var(--ink); display: block; }
.made-card .now::before { display: none; }
/* Tool runner: room between a field's hint and the next label. */
.runner #runner-fields { display: grid; gap: 14px; margin-bottom: 14px; }
.runner small.hint { display: block; margin-top: 2px; }

/* =====================================================================
   Pass 2 (2026-10-28): floating action button, sign-in pages, home, talk
   ===================================================================== */

/* ---------- Floating action button (speed dial) ---------- */
.fab { position: fixed; z-index: 70; right: max(20px, env(safe-area-inset-right)); bottom: max(24px, env(safe-area-inset-bottom)); }
.fab-btn {
  position: relative; z-index: 2; width: 60px; height: 60px; border: 0; border-radius: 22px; cursor: pointer;
  display: grid; place-items: center; color: var(--paper);
  background: radial-gradient(circle at 30% 25%, #7a2a4d, var(--plum) 58%, var(--plum-deep));
  box-shadow: 0 16px 30px -12px rgba(46, 12, 27, .7), inset 0 0 0 2px rgba(171, 123, 34, .55);
  transition: transform .35s var(--spring), border-radius .35s var(--spring), box-shadow .25s;
  -webkit-tap-highlight-color: transparent; animation: zpop .5s var(--spring) .35s both;
}
.fab-btn::after { content: ""; position: absolute; inset: -5px; border-radius: 26px; border: 1.5px solid rgba(171, 123, 34, .45); opacity: 0; transition: opacity .25s; }
.fab-btn svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; transition: transform .35s var(--spring); }
.fab-btn:hover { box-shadow: 0 20px 36px -12px rgba(46, 12, 27, .8), inset 0 0 0 2px rgba(171, 123, 34, .9); }
.fab-btn:hover::after { opacity: 1; }
.fab-btn:active { transform: scale(.92); }
.fab-btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.fab.open .fab-btn { border-radius: 50%; background: radial-gradient(circle at 30% 25%, #d06a49, var(--rust) 60%, #7d2f19); }
.fab.open .fab-btn svg { transform: rotate(135deg); }
.fab.tucked .fab-btn { transform: translateY(calc(100% + 40px)) scale(.8); }

/* Closed menu is visibility:hidden (not just transparent) so it can never swallow taps. */
.fab-menu {
  position: absolute; z-index: 2; right: 4px; bottom: 74px; display: flex; flex-direction: column; align-items: flex-end; gap: 10px;
  visibility: hidden; pointer-events: none; transition: visibility 0s linear .25s;
}
.fab.open .fab-menu { visibility: visible; pointer-events: auto; transition: none; }
.fab-item {
  display: flex; align-items: center; gap: 12px; border: 0; background: none; padding: 0; cursor: pointer;
  text-decoration: none; font: inherit; color: inherit; -webkit-tap-highlight-color: transparent;
  opacity: 0; transform: translateY(14px) scale(.9); transform-origin: 100% 100%;
  transition: opacity .18s, transform .3s var(--spring);
  transition-delay: calc((3 - var(--i, 0)) * 25ms);
}
.fab.open .fab-item { opacity: 1; transform: none; transition-delay: calc(var(--i, 0) * 45ms); }
.fab-item span {
  font: 600 12.5px/1 var(--label); letter-spacing: .1em; text-transform: uppercase; color: var(--plum);
  background: var(--paper); padding: 10px 14px 8px; border-radius: 999px; white-space: nowrap;
  box-shadow: inset 0 0 0 1px var(--line), var(--shadow-1);
}
.fab-ic { width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; color: #fff; box-shadow: 0 10px 20px -10px rgba(46, 12, 27, .7); transition: transform .2s var(--spring); }
.fab-ic svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.fi-plum { background: linear-gradient(135deg, #6d2445, var(--plum)); }
.fi-sage { background: linear-gradient(135deg, #5c7d6c, var(--sage)); }
.fi-gold { background: linear-gradient(135deg, #c7953a, var(--gold)); }
.fi-rust { background: linear-gradient(135deg, #c9623f, var(--rust)); }
.fab-item:hover .fab-ic, .fab-item:focus-visible .fab-ic { transform: scale(1.08); }
.fab-item:focus-visible { outline: none; }
.fab-item:focus-visible span { box-shadow: inset 0 0 0 2px var(--gold); }
.fab-item:active .fab-ic { transform: scale(.92); }
.fab-scrim {
  position: fixed; inset: 0; z-index: 1; background: rgba(237, 240, 231, .6);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .25s, visibility 0s linear .25s;
}
.fab.open .fab-scrim { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity .25s; }
body.has-fab main { padding-bottom: 100px; }
@media (max-width: 760px) {
  .fab { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 16px); right: max(16px, env(safe-area-inset-right)); }
  .fab-btn { width: 56px; height: 56px; border-radius: 20px; }
  .fab.tucked .fab-btn { transform: translateY(calc(100% + var(--tabbar-h) + 40px)) scale(.8); }
}

/* ---------- Toast ---------- */
.toast {
  position: fixed; z-index: 80; left: 50%; bottom: max(24px, env(safe-area-inset-bottom));
  max-width: min(440px, calc(100vw - 32px)); padding: 13px 18px; border-radius: 16px;
  font: 500 15px/1.35 var(--body); color: var(--paper); background: var(--plum-deep);
  box-shadow: 0 18px 40px -16px rgba(46, 12, 27, .7);
  transform: translate(-50%, 20px); opacity: 0; transition: transform .35s var(--spring), opacity .25s;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast-ok { background: #2c5a42; } .toast-bad { background: #7d2f19; }
@media (max-width: 760px) { .toast { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 14px); } }

/* ---------- Sign-in, setup, message, paused ---------- */
.auth-card { position: relative; overflow: hidden; padding-top: clamp(30px, 6vw, 46px); }
.auth-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 5px;
  background: linear-gradient(90deg, var(--plum), var(--rust), var(--gold), var(--sage));
}
.auth-badge { position: relative; width: 74px; height: 74px; margin: 0 0 18px; display: grid; place-items: center; }
.auth-badge img { position: relative; width: 34px; height: auto; animation: zfloat 4s ease-in-out infinite; }
.auth-badge .arcs i {
  position: absolute; inset: calc(var(--k) * 7px); border: 2.5px solid var(--c); border-bottom-color: transparent;
  border-radius: 50%; transform: rotate(-45deg); animation: zspin-in .9s var(--ease) both; animation-delay: calc(var(--k) * 120ms);
}
.auth-badge .arcs i:nth-child(1) { --k: 0; --c: var(--rust); }
.auth-badge .arcs i:nth-child(2) { --k: 1; --c: var(--gold); }
.auth-badge .arcs i:nth-child(3) { --k: 2; --c: var(--sage); }
@keyframes zfloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes zspin-in { from { opacity: 0; transform: rotate(-200deg) scale(.7); } to { opacity: 1; transform: rotate(-45deg); } }
.steps { display: flex; gap: 6px; margin: -6px 0 20px; }
.steps i { flex: 1; height: 5px; border-radius: 99px; background: rgba(75, 21, 45, .1); position: relative; overflow: hidden; }
.steps i.on::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(90deg, var(--plum), var(--rust)); animation: zgrow .7s var(--ease) both; transform-origin: 0 50%; }
.steps i:nth-child(2).on::after { animation-delay: .25s; }
@keyframes zgrow { from { transform: scaleX(0); } to { transform: none; } }
.auth-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 0; }
.form fieldset { padding: 18px; border-radius: 20px; background: rgba(75, 21, 45, .03); box-shadow: inset 0 0 0 1px var(--line); }
.form .btn-wide { margin-top: 4px; }
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 52px !important; }
.pw-eye {
  position: absolute; top: 50%; right: 6px; width: 40px; height: 40px; margin-top: -20px; border: 0; border-radius: 12px;
  background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; -webkit-tap-highlight-color: transparent;
  transition: background-color .2s, color .2s;
}
.pw-eye:hover { background: rgba(75, 21, 45, .06); color: var(--plum); }
.pw-eye:focus-visible { outline: 3px solid var(--gold); outline-offset: 0; }
.pw-eye svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; }
.pw-eye .slash { stroke-dasharray: 23; stroke-dashoffset: 0; transition: stroke-dashoffset .25s var(--ease); }
.pw-eye[aria-pressed="true"] .slash { stroke-dashoffset: 23; }
.pw-eye[aria-pressed="true"] { color: var(--plum); }

/* ---------- Home (coming soon) ---------- */
.rainbow i { animation: zarc .9s var(--ease) both; animation-delay: calc(.15s + var(--k) * .12s); transform-origin: 50% 100%; }
@keyframes zarc { from { opacity: 0; transform: scale(.9) translateY(10px); } to { opacity: 1; transform: none; } }
.arch { animation: zfloat 6s ease-in-out 1.2s infinite; }
.arch::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, .55) 50%, transparent 65%) -150% 0 / 250% 100% no-repeat;
  animation: zsheen 7s ease-in-out 1.5s infinite;
}
@keyframes zsheen { 0%, 70% { background-position: -150% 0; } 100% { background-position: 150% 0; } }
h1 em {
  background: linear-gradient(90deg, var(--sage), var(--gold), var(--rust), var(--sage)) 0 0 / 300% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: zhue 9s ease-in-out infinite alternate;
}
@keyframes zhue { to { background-position: 100% 0; } }
.notify { transition: box-shadow .25s, transform .25s var(--ease); }
.notify:focus-within { transform: translateY(-2px); }
.notify button { position: relative; overflow: hidden; }
.notify button::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-120%);
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .3) 50%, transparent 70%);
  transition: transform .6s var(--ease);
}
.notify button:hover::after { transform: translateX(120%); }
.form-msg.ok { animation: zrise .35s var(--ease) both; }
.card { background: var(--card); box-shadow: inset 0 0 0 1px var(--line), var(--shadow-1); position: relative; overflow: hidden; }
.card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--c); transform: scaleX(0); transform-origin: 0 50%; transition: transform .45s var(--ease); }
.card:hover::before { transform: none; }
.card svg { transition: transform .45s var(--spring); }
.card:hover svg { transform: rotate(-6deg) scale(1.08); }
.js-reveal [data-reveal-group] > * { opacity: 0; transform: translateY(22px); }
.js-reveal [data-reveal-group].revealed > * { animation: zrise .6s var(--ease) both; }
.js-reveal [data-reveal-group].revealed > :nth-child(2) { animation-delay: .08s; }
.js-reveal [data-reveal-group].revealed > :nth-child(3) { animation-delay: .16s; }
.js-reveal [data-reveal-group].revealed > :nth-child(4) { animation-delay: .24s; }

/* ---------- Talk ---------- */
.talk-top {
  position: sticky; top: calc(var(--nav-h) + env(safe-area-inset-top)); z-index: 4;
  margin: 0 calc(-1 * max(16px, env(safe-area-inset-left))) 8px; padding: 10px max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left));
  background: linear-gradient(var(--mist) 70%, rgba(237, 240, 231, 0));
}
.room-pick select, .sound { box-shadow: inset 0 0 0 1px var(--line), var(--shadow-1); }
.hello { position: relative; padding-top: 20px; border-radius: 24px 24px 24px 6px; animation: zzoom .45s var(--ease) both; }
.hello-ic { width: 34px; height: auto; margin-bottom: 10px; animation: zfloat 4s ease-in-out infinite; }
.msg { box-shadow: var(--shadow-1); }
.msg.me { background: linear-gradient(135deg, #6a2244, var(--plum)); }
.msg.zig { position: relative; margin-left: 38px; max-width: calc(86% - 38px); background: var(--card); box-shadow: inset 0 0 0 1px var(--line), var(--shadow-1); }
.msg.zig::before {
  content: ""; position: absolute; left: -38px; bottom: 2px; width: 30px; height: 30px; border-radius: 11px;
  background: var(--paper) url("/static/brand/ziggi_icon.svg") center / 17px auto no-repeat;
  box-shadow: inset 0 0 0 1px var(--line), var(--shadow-1);
}
.msg.zig.working::before { animation: zfloat 1.4s ease-in-out infinite; }
.msg.old { animation: none; }
.dock { gap: 12px; }
.ptt { box-shadow: 0 20px 40px -14px rgba(46, 12, 27, .65), inset 0 0 0 3px rgba(171, 123, 34, .55), 0 0 0 10px rgba(75, 21, 45, .05); }
.ptt:not(:disabled) { animation: zbreathe 3.2s ease-in-out infinite; }
@keyframes zbreathe { 50% { box-shadow: 0 20px 40px -14px rgba(46, 12, 27, .65), inset 0 0 0 3px rgba(171, 123, 34, .7), 0 0 0 16px rgba(75, 21, 45, .04); } }
.ptt.rec, .ptt.arming { animation: none; }
.ptt-ring.r2 { inset: -10px; }
.ptt.rec .ptt-ring.r2 { animation-delay: .6s; }
.ptt-wave { position: absolute; top: 50%; left: 50%; display: flex; align-items: center; gap: 4px; height: 40px; transform: translate(-50%, -50%); opacity: 0; transition: opacity .2s; }
.ptt-wave i { width: 4px; height: 100%; border-radius: 4px; background: var(--paper); transform: scaleY(.25); }
.ptt.rec svg { opacity: 0; transform: scale(.6); }
.ptt svg { transition: opacity .2s, transform .25s var(--spring); }
.ptt.rec .ptt-wave { opacity: 1; }
.ptt.rec .ptt-wave i { animation: zwave .9s ease-in-out infinite; }
.ptt.rec .ptt-wave i:nth-child(2) { animation-delay: .15s; } .ptt.rec .ptt-wave i:nth-child(3) { animation-delay: .3s; }
.ptt.rec .ptt-wave i:nth-child(4) { animation-delay: .45s; } .ptt.rec .ptt-wave i:nth-child(5) { animation-delay: .6s; }
@keyframes zwave { 0%, 100% { transform: scaleY(.25); } 50% { transform: scaleY(1); } }
.dock-hint { transition: color .2s; }
.ptt.rec ~ .dock-hint, .dock:has(.ptt.rec) .dock-hint { color: var(--rust); }
/* slide down to cancel (2026-10-29) */
.ptt.cancel { background: var(--rust); box-shadow: 0 14px 30px -14px rgba(46, 12, 27, .6), inset 0 0 0 3px rgba(255, 255, 255, .35); }
.ptt.cancel .ptt-wave i { animation: none; transform: scaleY(.2); }
.ptt.rec:not(.cancel) { transition: transform .12s ease-out, box-shadow .2s; }
.dock:has(.ptt.cancel) .dock-hint { color: var(--rust); font-weight: 700; }
.typebox { padding: 5px; border-radius: 999px; background: var(--paper); box-shadow: inset 0 0 0 1.5px var(--line), var(--shadow-1); transition: box-shadow .2s; }
.typebox:focus-within { box-shadow: inset 0 0 0 2px var(--gold), var(--shadow-1); }
.typebox input, .typebox input:focus { box-shadow: none; background: transparent; padding: 11px 12px; }
/* Typed messages up to 2000 characters (2026-10-29): a box that grows to ~5 lines, then scrolls. */
.typebox { position: relative; align-items: flex-end; }
.typebox.tall { border-radius: 24px; }
.typebox textarea { flex: 1; min-width: 0; resize: none; border: 0; outline: none; background: transparent; box-shadow: none;
  font: 500 16px/1.4 var(--body); color: var(--ink); padding: 11px 12px; max-height: 45vh; overflow-y: auto; }  /* 2026-11-10: was 150px */
.type-count { position: absolute; right: 96px; top: -20px; font-size: 12px; color: var(--muted); pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
  .fab-item, .fab-btn, .toast, .fab-scrim { transition: none !important; }
  .js-reveal [data-reveal-group] > * { opacity: 1; transform: none; }
}
/* Feeds live in their own tab now, so they scroll with the page (no box-in-a-box scrolling). */
.feed, .feed.small { max-height: none; overflow: visible; }
/* Pass 2 fixes after screenshots */
.auth-card .eyebrow { justify-content: flex-start; }
.arch { animation: none; }
.talk-top .sound, .talk-top .live { white-space: nowrap; }
@media (max-width: 440px) {
  .room-pick > span { display: none; }
  .room-pick select { max-width: 46vw; }
}
.talk-top .room-pick { flex: 1; min-width: 0; }
.talk-top .room-pick select { width: 100%; min-width: 0; max-width: 260px; }
.talk-right { flex: none; }
@media (max-width: 440px) {
  .talk-top .sound, .talk-top .live { padding: 7px 10px 5px; font-size: 10.5px; letter-spacing: .08em; }
}

/* Files Ziggi made (2026-10-29) */
.file-grid { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.file-card { background: var(--paper); border-radius: 18px; box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.file-shot { display: grid; place-items: center; aspect-ratio: 1 / 1; background: linear-gradient(160deg, #f6f7f1, #e6eadf); }
.file-shot img { width: 86%; height: 86%; object-fit: contain; }
.file-ext { font-family: "Josefin Sans", sans-serif; letter-spacing: .14em; color: var(--muted); font-size: 22px; }
.file-meta { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.file-name { margin: 0; font-weight: 600; color: var(--plum); overflow-wrap: anywhere; }
.file-sub { margin: 0; font-size: 13px; color: var(--muted); }
.file-dl { align-self: flex-start; margin-top: 8px; }
.file-empty { color: var(--muted); margin: 14px 0 0; }
.file-pub { font-size: 13px; color: var(--sage); margin-top: 6px; text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 520px) { .file-grid { grid-template-columns: 1fr 1fr; gap: 10px; } .file-meta { padding: 10px; } }

/* Ziggi's links in Talk (2026-10-29) */
.msg .reply a.zlink { color: var(--sage); text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; font-weight: 600; }
