/* Ziggi AI | navbar, forms, admin and dashboard. Builds on site.css tokens. */
:root {
  --ok: #3f7a5c;
  --warn: #b7861f;
  --bad: #ae4b2e;
  --info: #466255;
  --nav-h: 64px;
}

/* ---------- Navbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(237, 240, 231, .86);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}
.nav {
  max-width: 1180px; margin: 0 auto; height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding-left: max(20px, env(safe-area-inset-left)); padding-right: max(20px, env(safe-area-inset-right));
  position: relative;
}
.nav-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--plum); }
.nav-brand img { width: 28px; height: auto; }
.nav-brand span { font: 650 22px/1 var(--display); font-variation-settings: "SOFT" 100; }
.nav-brand em { font-style: italic; color: var(--sage); font-weight: 560; }
.nav-menu { display: flex; align-items: center; gap: 6px; }
.nav-link {
  font: 600 14px/1 var(--label); letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink); text-decoration: none; padding: 12px 14px 10px; border-radius: 999px;
  transition: background .2s, color .2s;
}
.nav-link:hover { background: rgba(75, 21, 45, .07); }
.nav-link.on { color: var(--plum); box-shadow: inset 0 -2px 0 var(--gold); border-radius: 4px; }
.nav-form { margin: 0; }
.nav-toggle {
  display: none; width: 46px; height: 46px; border: 0; border-radius: 12px; cursor: pointer;
  background: var(--paper); box-shadow: inset 0 0 0 1px var(--line);
  flex-direction: column; align-items: center; justify-content: center; gap: 5px;
}
.nav-toggle span { display: block; width: 20px; height: 2px; border-radius: 2px; background: var(--plum); transition: transform .2s, opacity .2s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 760px) {
  .nav-toggle { display: flex; }
  /* Closed menu is display:none, so it can never swallow taps. */
  .nav-menu {
    display: none; position: absolute; top: calc(var(--nav-h) - 4px); right: max(12px, env(safe-area-inset-right));
    left: max(12px, env(safe-area-inset-left));
    flex-direction: column; align-items: stretch; gap: 4px; padding: 10px;
    background: var(--paper); border-radius: 18px;
    box-shadow: inset 0 0 0 1px var(--line), 0 24px 40px -20px rgba(46, 12, 27, .45);
  }
  .nav-menu.open { display: flex; }
  .nav-link { padding: 16px 14px 14px; font-size: 15px; }
  .nav-link.on { box-shadow: inset 3px 0 0 var(--gold); border-radius: 6px; }
  .nav-menu .btn { width: 100%; justify-content: center; padding: 15px; }
  .nav-form { width: 100%; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; border: 0; cursor: pointer; text-decoration: none;
  border-radius: 999px; padding: 11px 20px 9px;
  font: 600 14px/1.2 var(--label); letter-spacing: .1em; text-transform: uppercase;
  transition: background .2s, transform .2s, box-shadow .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn:focus-visible, .nav-link:focus-visible, .nav-toggle:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.btn-plum { background: var(--plum); color: var(--paper); }
.btn-plum:hover { background: var(--plum-deep); }
.btn-sage { background: var(--sage); color: var(--paper); }
.btn-rust { background: var(--rust); color: var(--paper); }
.btn-ghost { background: transparent; color: var(--plum); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-ghost:hover { box-shadow: inset 0 0 0 1.5px var(--plum); }
.btn-wide { width: 100%; justify-content: center; padding: 15px; }

/* ---------- Pages + panels ---------- */
.page.narrow { max-width: 560px; }
.page.wide { max-width: 1280px; }
.panel {
  background: var(--paper); border-radius: 28px 28px 28px 6px;
  padding: clamp(24px, 5vw, 44px);
  box-shadow: inset 0 0 0 1px var(--line), 0 30px 60px -40px rgba(46, 12, 27, .45);
}
.h-page {
  margin: 0 0 18px; font: 650 clamp(32px, 5vw, 46px)/1.05 var(--display);
  font-variation-settings: "SOFT" 100, "opsz" 144; color: var(--plum); text-wrap: balance;
}
.eyebrow .step, .eyebrow .live { letter-spacing: .12em; color: var(--muted); }
.hint { font-size: 14px; color: var(--muted); margin: 0 0 10px; }
code { font: 500 13px/1.3 ui-monospace, "SF Mono", Menlo, monospace; background: rgba(75, 21, 45, .06); padding: 2px 6px; border-radius: 6px; word-break: break-word; }

/* ---------- Forms ---------- */
.form { display: grid; gap: 14px; margin: 0 0 22px; }
.form fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 12px; }
.form legend { font: 600 19px/1.3 var(--display); color: var(--plum); margin-bottom: 6px; padding: 0; }
.form label { display: grid; gap: 6px; font: 600 13px/1.2 var(--label); letter-spacing: .08em; text-transform: uppercase; color: var(--sage); }
.form input:not([type=checkbox]) {
  font: 500 16px var(--body); color: var(--ink); background: #fff;
  border: 0; border-radius: 14px; padding: 14px 16px; box-shadow: inset 0 0 0 1.5px var(--line); width: 100%;
}
.form input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--gold); }
.form label.check { display: flex; align-items: center; gap: 10px; text-transform: none; letter-spacing: 0; font: 500 15px var(--body); color: var(--muted); }
.form label.check input { width: 18px; height: 18px; accent-color: var(--plum); }
.form-note { margin: 0; font-size: 15px; color: var(--muted); }
.form-note a, .panel a:not(.btn) { color: var(--plum); font-weight: 600; }

.alert { margin: 0 0 14px; padding: 12px 16px; border-radius: 14px; font-size: 15px; font-weight: 500; }
.alert-err, .alert-bad { background: rgba(174, 75, 46, .12); color: #7d2f19; box-shadow: inset 3px 0 0 var(--bad); }
.alert-ok { background: rgba(63, 122, 92, .12); color: #24543c; box-shadow: inset 3px 0 0 var(--ok); }
.alert-warn { background: rgba(183, 134, 31, .14); color: #6b4c0c; box-shadow: inset 3px 0 0 var(--warn); }
.alert-info { background: rgba(70, 98, 85, .1); color: var(--sage); box-shadow: inset 3px 0 0 var(--info); }

/* ---------- Chips + dots ---------- */
.chip {
  display: inline-flex; align-items: center; padding: 5px 10px 3px; border-radius: 999px; white-space: nowrap;
  font: 600 11.5px/1.2 var(--label); letter-spacing: .08em; text-transform: uppercase;
  background: rgba(90, 95, 87, .12); color: var(--muted);
}
.chip-ok { background: rgba(63, 122, 92, .14); color: #2c6447; }
.chip-warn { background: rgba(183, 134, 31, .16); color: #7a560c; }
.chip-bad, .chip-rust { background: rgba(174, 75, 46, .14); color: #8a3520; }
.chip-plum { background: rgba(75, 21, 45, .1); color: var(--plum); }
.chip-sage { background: rgba(70, 98, 85, .14); color: var(--sage); }
.chip-gold { background: rgba(171, 123, 34, .16); color: #7a560c; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; vertical-align: 1px; }
.dot-ok { background: var(--ok); } .dot-bad { background: var(--bad); }

/* ---------- Admin ---------- */
.people { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.person { background: #fff; border-radius: 20px; padding: 20px; box-shadow: inset 0 0 0 1px var(--line); }
.person header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.person h2 { font-size: 26px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.actions form { margin: 0; }
.codebox { background: rgba(171, 123, 34, .1); border-radius: 18px; padding: 16px 18px; margin-bottom: 16px; box-shadow: inset 0 0 0 1.5px rgba(171, 123, 34, .4); }
.codebox p { margin: 0 0 6px; }
.code { font: 600 clamp(22px, 6vw, 30px)/1.2 ui-monospace, Menlo, monospace; letter-spacing: .08em; color: var(--plum); user-select: all; }
.sync { font-size: 15px; margin: 0 0 16px; }
.sync.ok { color: var(--ok); } .sync.warn { color: #7a560c; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; font-size: 14.5px; }
.kv dt { color: var(--muted); text-transform: capitalize; }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* ---------- Dashboard ---------- */
.dash-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 6px 20px; margin-bottom: 14px; }
.dash-head .h-page { margin-bottom: 4px; }
.updated { margin: 0 0 10px; font-size: 14px; color: var(--muted); }
.live { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 4px; border-radius: 999px; background: rgba(90, 95, 87, .12); }
.live i { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.live b { font-weight: 600; }
.live-ok { background: rgba(63, 122, 92, .14); color: #2c6447 !important; }
.live-ok i { background: var(--ok); animation: blink 2s ease-in-out infinite; }
.live-warn { background: rgba(183, 134, 31, .16); color: #7a560c !important; }
.live-warn i { background: var(--warn); }
.live-bad { background: rgba(174, 75, 46, .14); color: #8a3520 !important; }
.live-bad i { background: var(--bad); }
@keyframes blink { 50% { opacity: .35; } }

.jump {
  position: sticky; top: calc(var(--nav-h) + env(safe-area-inset-top)); z-index: 10;
  display: flex; gap: 6px; overflow-x: auto; padding: 8px 2px; margin: 0 0 8px;
  background: linear-gradient(var(--mist) 75%, transparent); scrollbar-width: none;
}
.jump::-webkit-scrollbar { display: none; }
.jump a {
  flex: none; text-decoration: none; color: var(--plum); background: var(--paper);
  padding: 9px 14px 7px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line);
  font: 600 12.5px/1 var(--label); letter-spacing: .1em; text-transform: uppercase;
}
.block { margin: 0 0 34px; scroll-margin-top: calc(var(--nav-h) + 60px); }
.h-sec { font-size: clamp(24px, 3.4vw, 32px); margin: 0 0 14px; }
.h-sub { margin: 0 0 10px; font: 600 13px/1.2 var(--label); letter-spacing: .14em; text-transform: uppercase; color: var(--sage); }
.sec-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.sec-row .h-sec { margin: 0; }
.filter { font: 600 12px var(--label); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.filter select { font: 500 15px var(--body); padding: 9px 12px; border-radius: 12px; border: 0; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); }
.empty { color: var(--muted); font-size: 15px; list-style: none; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.tile { background: var(--paper); border-radius: 20px 20px 20px 4px; padding: 16px 18px; box-shadow: inset 0 0 0 1px var(--line); position: relative; overflow: hidden; }
.tile::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--muted); }
.tile-ok::before { background: var(--ok); } .tile-warn::before { background: var(--warn); } .tile-bad::before { background: var(--bad); } .tile-plain::before { background: var(--gold); }
.tile-k { margin: 0 0 4px; font: 600 12px/1.2 var(--label); letter-spacing: .14em; text-transform: uppercase; color: var(--sage); }
.tile-v { margin: 0 0 6px; font: 650 24px/1.15 var(--display); color: var(--plum); }
.tile-bad .tile-v { color: var(--bad); }
.tile-l { margin: 0; font-size: 13.5px; color: var(--muted); line-height: 1.45; }
.svc { list-style: none; margin: 4px 0 0; padding: 0; font-size: 14px; display: grid; gap: 4px; }
.svc small { color: var(--muted); }

.devices, #made { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.device { background: var(--paper); border-radius: 22px 22px 22px 6px; padding: 18px 20px; box-shadow: inset 0 0 0 1px var(--line); min-width: 0; }
.device header { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.device h3 { margin: 0; font: 600 21px/1.2 var(--display); color: var(--plum); }
.device .room { font-size: 13px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.now { margin: 0 0 12px; font: 600 16px var(--body); color: var(--sage); }

.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; max-height: 640px; overflow-y: auto; overscroll-behavior: contain; padding-right: 2px; }
.feed.small { max-height: 420px; }
.entry { background: var(--paper); border-radius: 16px; padding: 12px 14px; box-shadow: inset 0 0 0 1px var(--line); min-width: 0; }
.entry.is-fail { box-shadow: inset 0 0 0 1px var(--line), inset 3px 0 0 var(--bad); }
.entry.is-ok { box-shadow: inset 0 0 0 1px var(--line), inset 3px 0 0 var(--ok); }
.entry-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 6px; }
.entry-top time, .entry-top small { font-size: 12.5px; color: var(--muted); }
.entry p { margin: 0 0 4px; font-size: 15px; overflow-wrap: anywhere; }
.entry .said { font: 500 16px/1.4 var(--display); color: var(--plum); }
.entry .reply { color: var(--sage); }
.entry .call { font: 500 12.5px/1.4 ui-monospace, Menlo, monospace; color: var(--ink); }
.entry .src { font-size: 12px; color: var(--muted); }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }

.apis { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.api { display: flex; align-items: center; gap: 8px; background: var(--paper); padding: 8px 12px; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line); font-size: 14px; }
.api small { color: var(--muted); }
.tools { display: grid; gap: 10px; }
.tool-group { background: var(--paper); border-radius: 18px; box-shadow: inset 0 0 0 1px var(--line); }
.tool-group summary { cursor: pointer; padding: 14px 18px; display: flex; justify-content: space-between; align-items: center; font: 600 18px var(--display); color: var(--plum); text-transform: capitalize; }
.tool-group summary small { font: 500 13px var(--body); color: var(--muted); text-transform: none; }
.tool-list { list-style: none; margin: 0; padding: 0 18px 12px; display: grid; gap: 10px; }
.tool-list li { border-top: 1px solid var(--line); padding-top: 10px; }
.tool-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 4px; }
.tool-list p { margin: 0; font-size: 14px; color: var(--muted); }

/* Old data: the Pi isn't reporting, so dim what's on screen. */
body.is-stale #s-devices, body.is-stale #s-heard, body.is-stale #s-actions, body.is-stale #s-tools, body.is-stale #s-made { opacity: .55; filter: grayscale(.4); transition: opacity .3s; }

@media (max-width: 520px) {
  .tiles { grid-template-columns: 1fr 1fr; }
  .tile { padding: 14px; }
  .tile-v { font-size: 20px; }
  .devices, #made, .people { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 8px; }
}
@media (max-width: 360px) { .tiles { grid-template-columns: 1fr; } }

/* Quieter background on the private pages so the circuits never sit behind text. */
body.dash .circuits, body.private .circuits { opacity: .16; }
.nav-toggle, .nav-link, .btn, .jump a { -webkit-tap-highlight-color: transparent; }
.svc li { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.svc li span:nth-child(2) { flex: 1; }

/* ---------- Talk (push-to-talk) ---------- */
body.talkpage .foot { display: none; }
body.talkpage .circuits { opacity: .14; }
.talk {
  position: relative; z-index: 1; max-width: 680px; margin: 0 auto;
  min-height: calc(100dvh - var(--nav-h) - env(safe-area-inset-top));
  display: flex; flex-direction: column;
  padding: 12px max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
}
.talk-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.room-pick { display: flex; align-items: center; gap: 8px; font: 600 12px var(--label); letter-spacing: .12em; text-transform: uppercase; color: var(--sage); }
.room-pick select { font: 600 15px var(--body); color: var(--plum); padding: 10px 12px; border: 0; border-radius: 12px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); max-width: 54vw; }
.talk .live { font: 600 12px/1 var(--label); letter-spacing: .1em; text-transform: uppercase; }
.convo { list-style: none; margin: 0; padding: 6px 0 16px; flex: 1; display: flex; flex-direction: column; gap: 10px; }
.hello { background: var(--paper); border-radius: 22px 22px 22px 6px; padding: 18px 20px; box-shadow: inset 0 0 0 1px var(--line); }
.hello p { margin: 0 0 8px; }
.h-hello { font: 650 26px/1.15 var(--display); color: var(--plum); }
.msg { max-width: 86%; padding: 12px 15px; border-radius: 20px; font-size: 16px; line-height: 1.45; overflow-wrap: anywhere; }
.msg p { margin: 0; }
.msg.me { align-self: flex-end; background: var(--plum); color: var(--paper); border-bottom-right-radius: 6px; }
.msg.me small { display: block; margin-top: 4px; font-size: 12px; opacity: .75; }
.msg.me.pending p { opacity: .7; }
.msg.zig { align-self: flex-start; background: var(--paper); color: var(--ink); border-bottom-left-radius: 6px; box-shadow: inset 0 0 0 1px var(--line); }
.msg.zig.failed { box-shadow: inset 0 0 0 1px var(--line), inset 3px 0 0 var(--bad); }
.msg.old { opacity: .55; }
.msg .lines { display: flex; flex-direction: column; gap: 4px; }
.msg .progress { color: var(--muted); font-style: italic; font-size: 14.5px; }
.msg .reply { color: var(--ink); }
.msg .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.msg .meta small { color: var(--muted); font-size: 12px; }
.replay { border: 0; cursor: pointer; border-radius: 999px; padding: 6px 12px 5px; background: var(--sage); color: var(--paper); font: 600 12px var(--label); letter-spacing: .08em; }
.dots { display: flex; gap: 5px; padding: 6px 0 2px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); animation: bob 1.1s ease-in-out infinite; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes bob { 0%, 100% { transform: translateY(0); opacity: .5; } 50% { transform: translateY(-5px); opacity: 1; } }
.sep { align-self: center; font: 600 11px var(--label); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); list-style: none; }

.dock {
  position: sticky; bottom: 0; z-index: 5;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 14px 0 max(14px, env(safe-area-inset-bottom));
  background: linear-gradient(transparent, var(--mist) 22%);
}
.dock-hint { margin: 0; font: 600 13px var(--label); letter-spacing: .12em; text-transform: uppercase; color: var(--sage); min-height: 1.2em; text-align: center; }
.ptt {
  position: relative; width: 132px; height: 132px; border-radius: 50%; border: 0; cursor: pointer;
  background: radial-gradient(circle at 35% 30%, #6d2445, var(--plum) 60%, var(--plum-deep));
  color: var(--paper); display: grid; place-items: center;
  box-shadow: 0 18px 36px -14px rgba(46, 12, 27, .65), inset 0 0 0 3px rgba(171, 123, 34, .55);
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent; transition: transform .15s;
}
.ptt svg { width: 46px; height: 46px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; }
.ptt:disabled { filter: grayscale(.8); opacity: .5; cursor: not-allowed; }
.ptt:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; }
.ptt-ring { position: absolute; inset: -10px; border-radius: 50%; border: 3px solid var(--gold); opacity: 0; pointer-events: none; }
.ptt.arming { transform: scale(.96); }
.ptt.rec { transform: scale(1.06); background: radial-gradient(circle at 35% 30%, #d06a49, var(--rust) 60%, #7d2f19); }
.ptt.rec .ptt-ring { opacity: 1; animation: ring 1.2s ease-out infinite; }
@keyframes ring { from { transform: scale(.92); opacity: .9; } to { transform: scale(1.25); opacity: 0; } }
.ptt-time { position: absolute; bottom: 18px; font: 600 12px var(--label); letter-spacing: .1em; }
.ptt.unsupported { display: none; }
.typebox { display: flex; gap: 8px; width: 100%; }
.typebox input { flex: 1; min-width: 0; font: 500 16px var(--body); color: var(--ink); padding: 13px 16px; border: 0; border-radius: 999px; background: var(--paper); box-shadow: inset 0 0 0 1.5px var(--line); }
.typebox input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--gold); }
.typebox .btn { padding: 12px 18px 10px; }
.typebox .btn:disabled { opacity: .5; }
@media (min-width: 761px) { .ptt { width: 150px; height: 150px; } }

/* ---------- Dashboard controls + tool runner ---------- */
.ops { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.op { background: var(--paper); border-radius: 20px 20px 20px 4px; padding: 16px 18px; box-shadow: inset 0 0 0 1px var(--line); }
.op .hint { min-height: 2.8em; }
.op-row { display: flex; gap: 8px; flex-wrap: wrap; }
.op-row select { flex: 1; min-width: 0; font: 500 15px var(--body); padding: 10px 12px; border: 0; border-radius: 12px; background: #fff; box-shadow: inset 0 0 0 1px var(--line); }
.op-out { margin-top: 12px; }
.op-out:empty { display: none; }
.op-out .op-say { margin: 0 0 6px; font-weight: 600; }
.op-out.is-ok .op-say { color: var(--ok); } .op-out.is-fail .op-say { color: var(--bad); }
.op-out pre { margin: 6px 0 0; padding: 10px 12px; background: #fff; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); font: 12.5px/1.45 ui-monospace, Menlo, monospace; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 300px; overflow: auto; }
.op-out summary { cursor: pointer; color: var(--sage); font-weight: 600; font-size: 14px; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.btn-q, .btn-run {
  border: 0; cursor: pointer; border-radius: 999px; padding: 8px 12px 6px;
  font: 600 12px/1.2 var(--label); letter-spacing: .08em; text-transform: uppercase;
  background: rgba(75, 21, 45, .08); color: var(--plum); -webkit-tap-highlight-color: transparent;
}
.btn-q:hover, .btn-run:hover { background: rgba(75, 21, 45, .16); }
.btn-run { margin-left: auto; background: var(--plum); color: var(--paper); }
.btn-run:hover { background: var(--plum-deep); }
.runner {
  width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow: auto;
  border: 0; border-radius: 24px; padding: 22px; background: var(--paper); color: var(--ink);
  box-shadow: 0 30px 80px -20px rgba(46, 12, 27, .6);
}
.runner::backdrop { background: rgba(46, 12, 27, .45); }
.runner h2 { margin: 0 0 6px; font-size: 22px; }
.runner-x { position: absolute; top: 14px; right: 14px; margin: 0; }
.runner-x .btn { padding: 8px 14px 6px; }
.runner .form { margin: 14px 0 0; }
.runner textarea, .runner select { font: 500 16px var(--body); color: var(--ink); background: #fff; border: 0; border-radius: 14px; padding: 12px 14px; box-shadow: inset 0 0 0 1.5px var(--line); width: 100%; }
.runner small.hint { text-transform: none; letter-spacing: 0; font: 400 13px var(--body); margin: 0; }
@media (max-width: 520px) {
  .runner { padding: 18px 16px; border-radius: 20px; }
  .ops { grid-template-columns: 1fr; }
}
[hidden] { display: none !important; }
.code-view summary { cursor: pointer; color: var(--sage); font-weight: 600; font-size: 14px; margin-top: 10px; }
.code-view pre { margin: 8px 0 0; padding: 10px 12px; background: #fff; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); font: 12px/1.45 ui-monospace, Menlo, monospace; white-space: pre; overflow: auto; max-height: 360px; }
.muted-card { opacity: .7; }
.talk-right { display: flex; align-items: center; gap: 6px; }
.sound { border: 0; cursor: pointer; border-radius: 999px; padding: 7px 11px 5px; font: 600 11.5px/1 var(--label); letter-spacing: .1em; text-transform: uppercase; background: rgba(70, 98, 85, .14); color: var(--sage); -webkit-tap-highlight-color: transparent; }
.sound.off { background: rgba(90, 95, 87, .14); color: var(--muted); text-decoration: line-through; }
.msg.zig.followup { box-shadow: inset 0 0 0 1px var(--line), inset 3px 0 0 var(--gold); }
@media (max-width: 380px) { .room-pick span { display: none; } }
.data-access { margin-top: 18px; }
.data-access .src { background: #fff; border-radius: 16px; box-shadow: inset 0 0 0 1px var(--line); margin: 0 0 10px; }
.data-access summary { cursor: pointer; padding: 12px 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.data-access summary small { color: var(--muted); }
.data-access .tbl { padding: 8px 14px; border-top: 1px solid var(--line); }
.data-access .tbl p { margin: 0 0 4px; font-size: 14px; overflow-wrap: anywhere; }
.data-access .cols { color: var(--ink); }
.codebox .setup-link { font-size: 14px; letter-spacing: 0; overflow-wrap: anywhere; }

/* Long messages (2026-11-10): line breaks show, long ones fold up with Show more */
.msg.me p { white-space: pre-wrap; }
.msg.me.long.folded p { max-height: 9.5em; overflow: hidden;
  -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent); }
.msg.me .more { display: block; margin-top: 6px; padding: 0; border: 0; background: none; color: inherit;
  font: 600 13px var(--body); text-decoration: underline; opacity: .85; cursor: pointer; }
.type-count.near { color: var(--bad, #b3261e); font-weight: 600; }
/* A tall typing box uses the full width; the paperclip and Send sit under it */
.typebox.tall { flex-wrap: wrap; }
.typebox.tall textarea { flex: 1 1 100%; order: -1; }
.typebox.tall #send { margin-left: auto; }
.talk.typing-long .dock-hint, .talk.typing-long .ptt-holder { display: none; }

/* 2026-11-10: a message Ziggi left in this chat for this person ("From Rishi via Ziggi") */
.msg.zig.note { box-shadow: inset 0 0 0 1px var(--gold), inset 3px 0 0 var(--gold); }
.msg.zig.note .note-tag { display: block; font-size: .78em; font-weight: 600; letter-spacing: .02em; color: var(--gold); margin-bottom: .25em; }
