/* Kenning: neutral styling, white background, black ink, one calm blue for actions, red only for "listening". */
:root {
  --ink: #111418;
  --muted: #5b6470;
  --paper: #ffffff;
  --soft: #f4f6f8;
  --line: #e2e6ea;
  /* warm palette from the logo (ochre red, sun yellow, dark earth); red stays only for "listening" */
  --accent: #160d07;
  --accent-soft: #f8f0e4;
  --ochre: #d63a1e;
  --amber: #f0932b;
  --live: #d6303a;
  --ok: #1d7a46;
  --warn: #9a6200;
  --bad: #b3261e;
  --radius: 14px;
  --tabs-h: 64px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); color: var(--ink); }
body { font: 17px/1.45 -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif; padding-bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom, 0px)); }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.ico { display: inline-flex; width: 1.2em; height: 1.2em; vertical-align: -0.2em; }
.ico svg { width: 100%; height: 100%; }
[data-ico] svg { width: 22px; height: 22px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
h1 { font-size: 24px; margin: 8px 0; }
h2 { font-size: 20px; margin: 18px 0 8px; }
h3 { font-size: 16px; margin: 18px 0 6px; }

/* top bar */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: calc(8px + env(safe-area-inset-top, 0px)) 16px 8px; background: var(--paper); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; font-size: 18px; letter-spacing: 0.1px; display: flex; align-items: center; gap: 7px; color: var(--accent); white-space: nowrap; min-width: 0; }
.brand .mark { width: 28px; height: 28px; display: block; flex: none; }
.yarn { color: var(--ochre); }
.langchip { margin-left: auto; display: inline-flex; gap: 5px; align-items: baseline; border: 1px solid var(--line); background: var(--soft); border-radius: 999px; padding: 6px 10px; max-width: 46vw; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; flex: none; }
.top { gap: 8px; }
@media (max-width: 380px) { .langchip .k { display: none; } .brand { font-size: 16px; } }
.langchip .k { font-size: 12px; color: var(--muted); }
.langchip .v { font-weight: 600; }
.langchip[data-auto="false"] { border-color: var(--accent); background: var(--accent-soft); }
.iconbtn { border: 0; background: transparent; padding: 8px; border-radius: 10px; display: inline-flex; }
.net { font-size: 12px; background: #fff4d6; color: var(--warn); border-radius: 999px; padding: 2px 8px; }

main { padding: 12px 16px 16px; max-width: 760px; margin: 0 auto; }
.tab { min-height: 60vh; }

/* status + meter */
.statusrow { display: flex; align-items: center; gap: 10px; margin: 4px 0 10px; }
.state { font-weight: 600; font-size: 15px; color: var(--muted); }
.state:not([data-state="off"]) { color: var(--live); }
.state:not([data-state="off"])::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--live); margin-right: 8px; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }
.meter { flex: 1; height: 6px; background: var(--soft); border-radius: 3px; overflow: hidden; }
.meter i { display: block; height: 100%; width: 100%; background: var(--amber); transform-origin: left; transform: scaleX(0); transition: transform 0.08s; }

/* the newest line, big */
.bigcard { border-radius: var(--radius); padding: 16px 18px; margin-bottom: 12px; background: var(--accent-soft); border: 1px solid #ecdcc4; }
.bigcard[data-who="them"] { background: var(--soft); border-color: var(--line); }
.bc-label { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.bc-text { font-size: 30px; line-height: 1.25; font-weight: 600; word-wrap: break-word; }

/* conversation */
.convo { display: flex; flex-direction: column; gap: 8px; margin-bottom: 200px; }
.empty { text-align: center; padding: 24px 8px; }
.bub { border-radius: var(--radius); padding: 10px 14px; max-width: 92%; border: 1px solid var(--line); }
.bub.me { align-self: flex-end; background: var(--accent-soft); border-color: #ecdcc4; }
.bub.them { align-self: flex-start; background: var(--soft); }
.bub .said { font-size: 14px; color: var(--muted); }
.bub .out { font-size: 20px; font-weight: 600; margin-top: 2px; }
.bub .out.pending { font-weight: 400; color: var(--muted); font-size: 15px; display: flex; gap: 8px; align-items: center; }
.bub .err { color: var(--bad); font-size: 15px; }
.bub .need { font-size: 15px; color: var(--warn); }
.minirow { display: flex; gap: 6px; margin-top: 6px; align-items: center; }
.mini { border: 1px solid var(--line); background: var(--paper); border-radius: 10px; padding: 6px 9px; display: inline-flex; }
.fb { font-size: 12px; color: var(--warn); }
.note { background: #fff8e6; border: 1px solid #f1dca6; border-radius: 12px; padding: 10px 12px; font-size: 14px; }

/* bottom dock with the big on/off */
.dock { position: fixed; left: 0; right: 0; bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom, 0px)); background: linear-gradient(to top, var(--paper) 78%, rgba(255, 255, 255, 0)); padding: 18px 16px 10px; z-index: 10; }
.dock > * { max-width: 728px; margin-left: auto; margin-right: auto; }
.dockrow { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; }
.pill { border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: 7px 12px; white-space: nowrap; font-size: 15px; }
.startbtn { width: 100%; display: flex; justify-content: center; align-items: center; gap: 10px; border: 0; border-radius: 18px; padding: 18px; font-size: 22px; font-weight: 700; background: var(--accent); color: #fff; }
.startbtn .dot { width: 14px; height: 14px; border-radius: 50%; background: #fff; opacity: 0.85; }
.startbtn[data-on="true"] { background: var(--live); }
.startbtn[data-on="true"] .dot { border-radius: 3px; }
.docknote { font-size: 13px; color: var(--muted); text-align: center; margin: 6px 0 0; }
.typeform { display: grid; gap: 8px; margin: 0 0 200px; }
.typeform textarea { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 10px; }

/* buttons */
.btn { border: 0; background: var(--accent); color: #fff; border-radius: 12px; padding: 10px 16px; font-weight: 600; display: inline-flex; gap: 8px; align-items: center; justify-content: center; text-decoration: none; }
.btn.small { padding: 7px 12px; font-size: 15px; }
.btn.big { padding: 14px 20px; font-size: 19px; }
.btn.ghost { background: var(--paper); color: var(--ink); border: 1px solid var(--line); }
.spin { width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--ochre); border-radius: 50%; animation: spin 0.8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: flex; gap: 10px; align-items: center; color: var(--muted); padding: 12px 0; }

/* tabs */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; background: var(--paper); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); }
.tabs button { flex: 1; height: var(--tabs-h); border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 13px; color: var(--muted); }
.tabs button[aria-current="true"] { color: var(--ochre); font-weight: 700; }
.tabs .ico { width: 24px; height: 24px; }
body.listening .tabs button[aria-current="true"] { color: var(--live); }

/* overlays */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(17, 20, 24, 0.35); display: flex; align-items: flex-end; justify-content: center; }
.overin { background: var(--paper); width: 100%; max-width: 760px; max-height: 92vh; overflow-y: auto; border-radius: 18px 18px 0 0; padding: 16px 16px calc(20px + env(safe-area-inset-bottom, 0px)); }
.overin label { display: grid; gap: 4px; margin: 10px 0; font-size: 15px; }
.overin label.row { display: flex; gap: 10px; align-items: center; }
.overin input:not([type="checkbox"]), .overin select, .overin textarea { border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; width: 100%; background: var(--paper); }
.vtop { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.pickgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-top: 10px; }
.pick { border: 1px solid var(--line); background: var(--paper); border-radius: 12px; padding: 12px 10px; text-align: left; display: grid; gap: 2px; }
.pick b { font-size: 20px; }
.pick small { color: var(--muted); }
.pick.on { border-color: var(--accent); background: var(--accent-soft); }
.pick.auto { grid-column: 1 / -1; }

.viewer { position: fixed; inset: 0; z-index: 60; background: var(--paper); display: flex; flex-direction: column; padding: calc(12px + env(safe-area-inset-top, 0px)) 16px calc(16px + env(safe-area-inset-bottom, 0px)); }
.vlabel { font-size: 14px; color: var(--muted); }
.vbox { flex: 1; display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 10px 0; }
.vbig { font-weight: 700; line-height: 1.25; text-align: center; white-space: pre-wrap; word-wrap: break-word; max-width: 100%; }
.vfoot { display: grid; gap: 10px; }
.vsmall { color: var(--muted); font-size: 16px; text-align: center; }
.vsay { color: var(--muted); font-size: 15px; text-align: center; font-style: italic; }

.idle { position: fixed; inset: 0; z-index: 70; background: rgba(17, 20, 24, 0.55); display: flex; align-items: center; justify-content: center; padding: 16px; }
.idlein { background: var(--paper); border-radius: 18px; padding: 22px; display: grid; gap: 12px; max-width: 420px; width: 100%; text-align: center; }
.idlein strong { font-size: 22px; }

.toast { position: fixed; left: 16px; right: 16px; bottom: calc(var(--tabs-h) + 120px + env(safe-area-inset-bottom, 0px)); z-index: 80; background: var(--ink); color: #fff; border-radius: 12px; padding: 12px 14px; font-size: 15px; max-width: 728px; margin: 0 auto; }

/* chips, lists, phrases */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 8px; }
.chips.wrap { flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: 7px 12px; white-space: nowrap; font-size: 15px; }
.chip.on { border-color: var(--ochre); background: var(--accent-soft); color: var(--ochre); font-weight: 600; }
.list { display: grid; gap: 8px; }
.phrhead { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.phrase { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; background: var(--paper); }
.phrase .pen { font-size: 16px; }
.phrase .ptr { font-size: 21px; font-weight: 600; margin-top: 6px; }
.phrase .psay { font-size: 14px; color: var(--muted); font-style: italic; }

/* look */
.camstarting { text-align: center; padding: 20px; }
.camwrap { position: relative; border-radius: 18px; overflow: hidden; background: #000; aspect-ratio: 3 / 4; max-height: 62vh; width: 100%; }
.camwrap video { width: 100%; height: 100%; object-fit: cover; display: block; }
.camtop { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; justify-content: center; }
.camhint { background: rgba(0, 0, 0, 0.55); color: #fff; font-size: 14px; border-radius: 999px; padding: 5px 12px; }
.camcontrols { position: absolute; left: 0; right: 0; bottom: 14px; display: flex; align-items: center; justify-content: space-around; }
.camside, .camside2 { display: flex; flex-direction: column; align-items: center; color: #fff; background: transparent; border: 0; font-size: 12px; gap: 2px; }
.camside2 { flex-direction: row; gap: 14px; }
.camside .ico { width: 28px; height: 28px; }
.camside.on, .camside[aria-pressed="true"] { color: #ffd34d; }
.shutter { width: 84px; height: 84px; border-radius: 50%; border: 5px solid #fff; background: rgba(255, 255, 255, 0.25); color: #fff; font-weight: 700; font-size: 17px; }
.shutter.busy { opacity: 0.5; }
.camoff { text-align: center; padding: 18px 0; }
.twobtn { display: flex; gap: 10px; justify-content: center; margin: 12px 0; flex-wrap: wrap; }
.bigbtn { display: inline-flex; gap: 8px; align-items: center; border-radius: 14px; padding: 14px 16px; background: var(--accent); color: #fff; font-weight: 600; }
.bigbtn.alt { background: var(--paper); color: var(--ink); border: 1px solid var(--line); }
.readnote { margin: 10px 0; }
.result .thumb { width: 100%; max-height: 260px; object-fit: cover; border-radius: 14px; }
.result h2 { margin-top: 12px; }
.sum { font-size: 17px; }
.thing { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin: 12px 0; }
.thead { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tname { font-size: 24px; font-weight: 700; }
.tsure { font-size: 12px; border-radius: 999px; padding: 2px 8px; background: #fff4d6; color: var(--warn); }
.tproper { font-style: italic; color: var(--muted); }
.tlocal { color: var(--muted); }
.trow { display: grid; grid-template-columns: 110px 1fr; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); }
.tlab { font-size: 13px; color: var(--muted); }
.trow.safe.no .ttxt { color: var(--bad); font-weight: 600; }
.trow.safe.careful .ttxt { color: var(--warn); font-weight: 600; }
.trow.safe.yes .ttxt { color: var(--ok); }
.tbtns { margin-top: 10px; }
.nearby { background: #fde8e7; color: var(--bad); border-radius: 12px; padding: 10px 12px; font-weight: 600; margin: 10px 0; }
.line { border-top: 1px solid var(--line); padding: 10px 0; display: grid; gap: 2px; }
.line .en { font-size: 18px; font-weight: 600; }
.line .orig { color: var(--muted); }
.line .means { font-size: 15px; }
.line .price { font-weight: 700; }
.flags { display: flex; gap: 6px; flex-wrap: wrap; }
.flag { font-size: 12px; border-radius: 999px; padding: 2px 8px; background: var(--soft); }
.tips { background: var(--accent-soft); border-radius: 12px; padding: 4px 12px; }
.warn { background: #fff8e6; border-radius: 12px; padding: 2px 12px; }
.totalrow { display: flex; justify-content: space-between; font-weight: 700; border-top: 2px solid var(--ink); padding-top: 8px; margin-top: 6px; }
.via { font-size: 13px; color: var(--muted); margin-top: 12px; }
.via.fallback { color: var(--warn); }
.closer { display: flex; gap: 10px; align-items: center; color: var(--accent); padding: 6px 0; }
.bad { background: #fde8e7; color: var(--bad); border-radius: 12px; padding: 10px 12px; }
.askbox { margin-top: 16px; }
.askform { display: flex; gap: 8px; }
.askform input { flex: 1; border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.answer { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-top: 10px; }
.answer .q { font-weight: 600; }
.histitem { display: flex; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 8px; }
.histitem img { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; }
.histitem .d { font-size: 13px; color: var(--muted); }
#tab-look { padding-bottom: 20px; }
@media (min-width: 700px) { .bc-text { font-size: 36px; } }
.dockrow, .chips { scrollbar-width: none; }
.dockrow::-webkit-scrollbar, .chips::-webkit-scrollbar { display: none; }
.bub .slang { font-size: 14px; margin-top: 6px; padding: 6px 9px; border-radius: 9px; background: #fff8e6; border: 1px solid #f1dca6; }
.tabs button { font-size: 12px; }
.ctxin { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 9px 10px; margin: 8px 0; }
.tone { font-size: 12px; border-radius: 999px; padding: 2px 8px; background: var(--soft); }
.tone.t-polite, .tone.t-neutral { background: #e7f5ec; color: var(--ok); }
.tone.t-casual { background: var(--accent-soft); color: var(--accent); }
.tone.t-rude, .tone.t-offensive { background: #fde8e7; color: var(--bad); }
.trow.ex .ttxt { font-style: italic; }
.trow.respect .ttxt { color: var(--accent); }
#meanMic.on { color: var(--live); }
.tagline { text-align: center; font-size: 20px; font-weight: 600; margin: 28px 8px 0; color: var(--accent); }
