/* memo — Co-Op's look: Silkscreen + Pixelify Sans, nothing curves, 2px
   edges, offset shadows, a colour strip along every box's top, the selected
   tab filled with its own colour, switches as lamps, a press lights up.
   LIGHT is the look (A, 2026-11-23: "lets try light mode"); the dark set is
   kept below — put data-theme="dark" on <html> to go back to it. */
:root {
  --ground: #ffffff;
  --panel: #ffffff;
  --btn-bg: #ffffff;
  --inset: #f4f4f4;
  --cell: #f4f4f4;
  --cell-hi: #e9e9e9;
  --ink: #1a1c2c;
  --muted: #566c86;
  --line: #94b0c2;
  --line-hard: #1a1c2c;
  --edge: #1a1c2c;          /* the plate outline */
  --slate: #1a1c2c;         /* every offset shadow: 1-bit black on white */
  --grid-edge: #94b0c2;
  --lit-bg: #1a1c2c; --lit-ink: #ffffff;
  --tint-ink: #1a1c2c;
  --dither: repeating-conic-gradient(#94b0c2 0% 25%, #ffffff 0% 50%) 50% / 4px 4px;

  /* Sweetie 16, as Co-Op's light look has it, and the ink that reads on each */
  --red: #b13e53; --orange: #ef7d57; --sand: #ffcd75; --lime: #a7f070;
  --green: #38b764; --teal: #257179; --blue: #3b5dc9; --sky: #41a6f6; --plum: #5d275d;
  --red-ink: #ffffff; --orange-ink: #1a1c2c; --sand-ink: #1a1c2c; --lime-ink: #1a1c2c;
  --green-ink: #1a1c2c; --teal-ink: #ffffff; --blue-ink: #ffffff; --sky-ink: #1a1c2c; --plum-ink: #ffffff;

  --f-mono: "Silkscreen", ui-monospace, monospace;
  --f-sans: "Pixelify Sans", "Silkscreen", system-ui, sans-serif;
}
:root[data-theme="dark"] {
  --ground: #0a0a0a; --panel: #181818; --btn-bg: #000000; --inset: #0d0d0d;
  --cell: #1c1c1c; --cell-hi: #282828; --ink: #dcdcdc; --muted: #a0a0a0;
  --line: #3d3d3d; --line-hard: #949494; --edge: #dcdcdc; --slate: #8f8f8f; --grid-edge: #484848;
  --lit-bg: #ffffff; --lit-ink: #0a0a0a; --tint-ink: #0d0d0d;
  --dither: repeating-conic-gradient(#8c8c8c 0% 25%, #0a0a0a 0% 50%) 50% / 4px 4px;
  --red: #ea546f; --orange: #ff9064; --sand: #ffd98a; --lime: #bdf78d;
  --green: #4ad882; --teal: #3ab6c2; --blue: #6180e6; --sky: #5cbcff; --plum: #b45fb4;
  --red-ink: #0d0d0d; --orange-ink: #0d0d0d; --sand-ink: #0d0d0d; --lime-ink: #0d0d0d;
  --green-ink: #0d0d0d; --teal-ink: #0d0d0d; --blue-ink: #0d0d0d; --sky-ink: #0d0d0d; --plum-ink: #0d0d0d;
}
* { box-sizing: border-box; border-radius: 0 !important; letter-spacing: .01em; }
html { background: var(--ground); }
body {
  margin: 0; background: var(--ground); color: var(--ink);
  font: 15px/1.4 var(--f-sans);
  -webkit-font-smoothing: none; -moz-osx-font-smoothing: grayscale; font-smooth: never;
  -webkit-tap-highlight-color: transparent;
}
img, svg { image-rendering: pixelated; }
a { color: inherit; }
.hide { display: none !important; }
button, input, textarea { font: inherit; color: inherit; }

/* ---- buttons: black slab, light edge, grey offset; lit = white ---- */
button, .btn {
  font-family: var(--f-mono); font-weight: 700; font-size: 12px; letter-spacing: .04em; text-transform: uppercase;
  background: var(--btn-bg); color: var(--ink); border: 2px solid var(--line-hard);
  box-shadow: 2px 2px 0 var(--slate); padding: 0 14px; height: 40px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
  text-decoration: none; flex: none; -webkit-user-select: none; user-select: none;
}
button:hover:not(:disabled), .btn:hover { background: var(--cell); }
/* A press lights the button up (ink fill, light letters) for as long as it's held. */
button:active:not(:disabled), .btn:active, .me:active {
  background: var(--lit-bg) !important; color: var(--lit-ink) !important; border-color: var(--lit-bg) !important; box-shadow: none !important;
}
button:disabled { background: var(--ground); color: var(--line); border-color: var(--grid-edge); box-shadow: none; cursor: default; }
button.lit, .btn.lit { background: var(--lit-bg); color: var(--lit-ink); border-color: var(--lit-bg); }
button.plain { background: none; border: 0; box-shadow: none; height: auto; padding: 0; text-decoration: underline; text-underline-offset: 3px; text-decoration-style: dotted; color: var(--muted); }

/* the lamp: off is a dark square, on lights in its colour */
.lamp { width: 10px; height: 10px; background: var(--line); flex: none; }
[aria-pressed="true"] > .lamp { background: var(--lc, var(--green)); }

/* ---- the top: wordmark letters on the page, no slab ---- */
.top {
  position: sticky; top: 0; z-index: 5; background: var(--ground);
  padding-top: env(safe-area-inset-top);
}
.bar { max-width: 640px; margin: 0 auto; display: flex; align-items: center; gap: 8px; padding: 10px 12px 8px; }
.mark { font-family: var(--f-mono); font-weight: 700; font-size: 22px; letter-spacing: .02em; text-transform: uppercase; text-decoration: none; color: var(--ink); line-height: 1.1; }
.sp { flex: 1; }
.top .btn { height: 36px; padding: 0 10px; position: relative; }
.top .btn.add { width: 36px; padding: 0; font-size: 18px; }
.badge {
  position: absolute; top: -8px; right: 4px; pointer-events: none; font-family: var(--f-mono); font-size: 8px; line-height: 1;
  padding: 2px 4px; background: var(--red); color: #fff; border: 1px solid var(--ink); letter-spacing: .08em;
}
.me { width: 36px; height: 36px; flex: none; border: 2px solid var(--line-hard); box-shadow: 2px 2px 0 var(--slate); display: block; overflow: hidden; }

/* ---- tabs: each wears its colour along the top; the one you're on is filled ---- */
.tabs { max-width: 640px; margin: 0 auto; display: flex; gap: 6px; padding: 4px 12px 12px; }
.tabs button {
  flex: 1 1 0; min-width: 0; height: 44px; padding: 0 6px; position: relative;
  white-space: normal; line-height: 1.05; text-align: center;
}
.tabs button[aria-pressed="false"]::before, .seg button[aria-pressed="false"]::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--tabc); }
.tabs button[aria-pressed="true"], .seg button[aria-pressed="true"] { background: var(--tabc); border-color: var(--tabc); color: var(--tabink, var(--tint-ink)); }
@media (max-width: 480px) { .tabs { gap: 4px; } .tabs button { font-size: 10.5px; letter-spacing: 0; padding: 0 2px; } }

/* ---- plates: light outline, 4px grey offset, colour strip along the top ---- */
.wrap { max-width: 640px; margin: 0 auto; padding: 0 12px 80px; }
.panel, .card {
  position: relative; background: var(--panel); border: 2px solid var(--edge);
  box-shadow: 4px 4px 0 var(--slate); padding: 15px 12px 12px; min-width: 0;
}
.panel::after, .card::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 5px; background: var(--secc, var(--edge)); pointer-events: none;
}
.panel { margin-top: 16px; }
.panel h2, .sub, .lab {
  font-family: var(--f-mono); font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--muted);
}
.panel h2 { margin: 0 0 12px; display: flex; align-items: center; }
.panel h2::before { content: ""; display: inline-block; width: 14px; height: 5px; margin-right: 8px; background: var(--secc, var(--edge)); }

/* ---- people ---- */
.av { width: 36px; height: 36px; flex: none; overflow: hidden; border: 2px solid var(--line-hard); display: block; }
.pfp { display: block; width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; background: var(--cell); }
.pfp.none { display: flex; align-items: center; justify-content: center; font-family: var(--f-mono); font-weight: 700; color: var(--tint-ink); text-transform: uppercase; font-size: 15px; }
.me .pfp.none { font-size: 14px; }

/* ---- posts ---- */
.feed { display: flex; flex-direction: column; gap: 16px; padding-top: 4px; }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who .nm { font-family: var(--f-mono); font-weight: 700; font-size: 13px; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.who .ago { font-family: var(--f-mono); color: var(--muted); font-size: 11px; white-space: nowrap; }
.who .new { width: 10px; height: 10px; background: var(--secc); flex: none; }
.blurb { font-size: 17px; line-height: 1.3; margin: 12px 0 0; overflow-wrap: anywhere; -webkit-user-select: text; user-select: text; }
.player { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.play { width: 44px; height: 44px; padding: 0; }
.play svg { width: 16px; height: 16px; fill: currentColor; }
.play.on { background: var(--green); border-color: var(--green); color: var(--green-ink); }
.track { flex: 1; min-width: 0; }
.prog { height: 12px; background: var(--inset); box-shadow: inset 0 0 0 2px var(--line); overflow: hidden; }
.prog i { display: block; height: 100%; width: 0; background: var(--secc); }
.meta { display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; font-family: var(--f-mono); font-size: 10px; color: var(--muted); text-transform: uppercase; min-width: 0; }
.meta .src { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.meta .tm { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--ink); }
.embed { margin-top: 10px; background: #000; border: 2px solid var(--line); overflow: hidden; }
.embed iframe, .embed > div { display: block; width: 100%; border: 0; }
.embed.yt { aspect-ratio: 16 / 9; min-height: 200px; }
.embed.yt iframe, .embed.yt > div { height: 100%; }
.full { display: inline-block; margin-top: 10px; font-family: var(--f-mono); font-size: 11px; text-transform: uppercase; color: var(--ink); text-underline-offset: 3px; text-decoration-style: dotted; }
.foot { display: flex; align-items: center; gap: 8px; margin-top: 12px; min-width: 0; }
.reacts { display: flex; gap: 8px; }
.del { height: 36px; padding: 0 10px; margin-left: auto; }
.rx { height: 36px; padding: 0 10px; position: relative; font-size: 15px; gap: 6px; }
.rx span { font-family: var(--f-mono); font-size: 11px; font-variant-numeric: tabular-nums; }
.rx:not(.on)::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--rc); }
.rx.on { background: var(--rc); border-color: var(--rc); color: var(--rcink, var(--tint-ink)); }
.more { display: flex; margin: 18px auto 0; }
.empty { font-family: var(--f-mono); font-size: 12px; text-transform: uppercase; color: var(--muted); text-align: center; padding: 40px 10px; }

/* ---- fields ---- */
.field {
  width: 100%; height: 40px; background: var(--inset); color: var(--ink); border: 2px solid var(--line-hard);
  padding: 0 10px; outline: none; min-width: 0; font-family: var(--f-mono); font-size: 13px; caret-color: var(--ink);
  -webkit-user-select: text; user-select: text;
}
.field::placeholder { color: var(--muted); }
.field:focus { border-color: var(--ink); }
textarea.field { height: 76px; padding: 8px 10px; resize: none; font-family: var(--f-sans); font-size: 16px; line-height: 1.3; }
.row { display: flex; gap: 8px; align-items: center; min-width: 0; }
.err { font-family: var(--f-mono); color: var(--red); font-size: 11px; text-transform: uppercase; min-height: 16px; margin-top: 8px; }
.count { text-align: right; font-family: var(--f-mono); font-size: 10px; color: var(--muted); margin-top: 6px; font-variant-numeric: tabular-nums; }
.count.over { color: var(--red); }
.seg { display: flex; gap: 6px; margin-bottom: 14px; }
.seg button { flex: 1 1 0; position: relative; }
.lab { margin: 14px 0 8px; display: flex; justify-content: space-between; gap: 8px; }
.lab b { color: var(--ink); font-variant-numeric: tabular-nums; }
.note { font-family: var(--f-mono); font-size: 11px; color: var(--muted); text-transform: uppercase; margin-top: 8px; }
.drop {
  display: flex; align-items: center; justify-content: center; text-align: center; min-height: 80px; padding: 8px 12px;
  background: var(--dither); box-shadow: inset 0 0 0 2px var(--line-hard); cursor: pointer; overflow: hidden;
}
.drop span { background: var(--btn-bg); border: 2px solid var(--line-hard); box-shadow: 2px 2px 0 var(--slate); padding: 9px 12px; font-family: var(--f-mono); font-weight: 700; font-size: 12px; text-transform: uppercase; overflow-wrap: anywhere; }
.drop input { display: none; }
.found { display: flex; gap: 10px; align-items: center; margin-top: 12px; min-width: 0; }
.found img { width: 56px; height: 56px; object-fit: cover; flex: none; background: var(--cell); border: 2px solid var(--line-hard); }
.found > div { min-width: 0; }
.found .t { font-size: 15px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.found .s { font-family: var(--f-mono); font-size: 10px; text-transform: uppercase; color: var(--muted); margin-top: 2px; }
.bar2 { height: 12px; background: var(--inset); box-shadow: inset 0 0 0 2px var(--line); overflow: hidden; margin-top: 12px; }
.bar2 i { display: block; height: 100%; width: 0; background: var(--green); }
.sw { margin-top: 14px; }

/* sliders as little sprite faders */
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 24px; background: transparent; margin: 0; min-width: 0; }
input[type=range]::-webkit-slider-runnable-track { height: 8px; background: var(--dither); box-shadow: inset 0 0 0 2px var(--line-hard); }
input[type=range]::-moz-range-track { height: 8px; background: var(--inset); box-shadow: inset 0 0 0 2px var(--line-hard); }
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 14px; height: 22px; margin-top: -7px;
  background: var(--ink); border: 2px solid var(--ground); box-shadow: 2px 2px 0 var(--slate);
}
input[type=range]::-moz-range-thumb { width: 12px; height: 20px; background: var(--ink); border: 2px solid var(--ground); border-radius: 0; box-shadow: 2px 2px 0 var(--slate); }
input[type=range]:disabled { opacity: .4; }

/* ---- lists of people ---- */
.people { display: flex; flex-direction: column; gap: 10px; }
.person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.person a.nm { font-family: var(--f-mono); font-weight: 700; font-size: 13px; text-decoration: none; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person .btn, .person button { height: 34px; padding: 0 12px; }
.sub { margin: 18px 0 10px; }
.sub:first-child { margin-top: 0; }

.head { display: flex; align-items: center; gap: 14px; margin: 6px 0 16px; min-width: 0; }
.head .av { width: 72px; height: 72px; box-shadow: 4px 4px 0 var(--slate); border-color: var(--edge); }
.head .av .pfp.none { font-size: 28px; }
.head h1 { margin: 0; font-family: var(--f-mono); font-weight: 700; font-size: 20px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.head .grow { flex: 1; min-width: 0; }

.code { font-family: var(--f-mono); font-weight: 700; font-size: 32px; letter-spacing: .12em; text-align: center; padding: 16px 0 4px; -webkit-user-select: text; user-select: text; }
.crush { display: flex; align-items: center; gap: 14px; }
.crush .av { width: 96px; height: 96px; box-shadow: 4px 4px 0 var(--slate); border-color: var(--edge); }
.crush .av .pfp.none { font-size: 36px; }

/* ---- join ---- */
.join { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; max-width: 400px; margin: 0 auto; padding: 24px 16px; }
.join .mark { font-size: 40px; text-align: center; margin-bottom: 22px; }
.join .alt { text-align: center; margin-top: 18px; }
.pfpbox { width: 100%; height: 100%; }

/* recording: the button's lamp lights red while the mic is on */
.recrow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; min-height: 80px; padding: 8px 12px; background: var(--dither); box-shadow: inset 0 0 0 2px var(--line-hard); }
.recbtn { height: 44px; min-width: 112px; }
.rectime { font-family: var(--f-mono); font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; background: var(--btn-bg); border: 2px solid var(--line-hard); padding: 9px 10px; white-space: nowrap; }
/* narrow phones: the three reactions and Delete share one row */
@media (max-width: 360px) { .foot, .reacts { gap: 6px; } .rx { padding: 0 8px; } .del { padding: 0 8px; } }

/* comments */
.crow { margin-top: 10px; }
.cbtn { height: 36px; padding: 0 10px; }
.cbox { margin-top: 12px; padding-top: 12px; border-top: 2px solid var(--line); }
.cmts { display: flex; flex-direction: column; gap: 10px; }
.cmt { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cmt .av { width: 28px; height: 28px; }
.cmt .av .pfp.none { font-size: 12px; }
.cmt .player { margin-top: 0; flex: 1; min-width: 0; gap: 8px; }
.cmt .play { width: 36px; height: 36px; }
.cmt .play svg { width: 13px; height: 13px; }
.cmt .del { margin-left: 0; height: 32px; padding: 0 8px; font-size: 10px; }
.composer { margin-top: 12px; }
.composer .seg { margin-bottom: 10px; }
.composer .seg button { height: 36px; }
.composer .recrow { min-height: 64px; }
.composer > .btn { width: 100%; margin-top: 10px; }
.composer textarea.field { height: 60px; }
