/* FriendFinder V1 - Valentine school-postcard look. Cream paper, red and pink hearts,
   hand-written accents. Mobile first: one column, then wider layouts at 760px. */
:root {
  --paper: #fffaf2;
  --paper-2: #fdeee5;
  --paper-3: #f7e2d6;
  --card: #fffdf9;
  --ink: #3c2a2b;
  --ink-soft: #73605e;
  --ink-faint: #9c8a86;
  --red: #d8324c;
  --red-deep: #ab1e36;
  --pink: #ff87a8;
  --pink-soft: #ffdbe6;
  --mint: #2f8b6a;
  --mint-soft: #d8f1e5;
  --amber: #b5772a;
  --amber-soft: #fdeecd;
  --line: rgba(120, 70, 60, .16);
  --shadow: 0 2px 0 rgba(120, 40, 50, .10), 0 10px 24px -14px rgba(80, 20, 30, .55);
  --hand: "Comic Sans MS", "Segoe Print", "Bradley Hand", "Chalkboard SE", "Comic Neue", cursive;
  --body: "Trebuchet MS", "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
  --r: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--body);
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 12% 8%, rgba(255, 135, 168, .16), transparent 45%),
    radial-gradient(circle at 88% 2%, rgba(255, 190, 120, .13), transparent 40%),
    repeating-linear-gradient(0deg, transparent 0 27px, rgba(120, 70, 60, .045) 27px 28px);
  font-size: 17px;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
  min-height: 100vh;
}
h1, h2, h3 { font-family: var(--hand); line-height: 1.2; margin: 0 0 .4em; letter-spacing: .2px; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.28rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .8em; }
a { color: var(--red-deep); text-decoration-color: rgba(216, 50, 76, .35); }
a:hover { text-decoration-color: var(--red); }
em { font-style: italic; }
table { border-collapse: collapse; }
:focus-visible { outline: 3px solid var(--pink); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -999px; top: 0; background: var(--card); padding: 10px 14px;
  border-radius: 0 0 10px 0; z-index: 60; }
.skip:focus { left: 0; }
.hide { display: none !important; }

/* ---------------- shell ---------------- */
.wrap { max-width: 1060px; margin: 0 auto; padding: 14px 14px 60px; }
.top {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 12px 16px; background: var(--card);
  border-bottom: 2px dashed var(--line);
  box-shadow: var(--shadow);
}
.brand { display: inline-flex; align-items: center; gap: 8px; font-family: var(--hand);
  font-size: 1.3rem; font-weight: 700; color: var(--red-deep); text-decoration: none; }
.brand-heart { width: 26px; height: 26px; fill: var(--red); transform: rotate(-8deg); }
.mainnav { display: flex; flex: 1 1 100%; order: 3; gap: 4px; overflow-x: auto; }
.nav-link {
  position: relative; display: inline-block; padding: 8px 13px; border-radius: 999px;
  font-size: .95rem; color: var(--ink-soft); text-decoration: none; white-space: nowrap;
  border: 1px solid transparent;
}
.nav-link:hover { background: var(--pink-soft); color: var(--red-deep); }
.nav-link.on { background: var(--red); color: #fff; box-shadow: inset 0 -2px 0 rgba(0,0,0,.12); }
.nav-badge { display: inline-block; min-width: 20px; margin-left: 6px; padding: 0 6px;
  border-radius: 999px; background: var(--red); color: #fff; font-size: .78rem; font-weight: 700; }
.nav-link.on .nav-badge { background: #fff; color: var(--red-deep); }
.who { display: flex; align-items: center; gap: 8px; margin-left: auto; font-size: .9rem; }
.who-name { font-family: var(--hand); font-weight: 700; color: var(--red-deep); }
.role-chip, .state-chip, .mini-chip, .win, .kind-chip {
  display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .74rem;
  font-weight: 700; letter-spacing: .3px; text-transform: uppercase;
  background: var(--paper-3); color: var(--ink-soft);
}
.role-chip { background: var(--pink-soft); color: var(--red-deep); }
.chip-on, .mini-chip.ok { background: var(--mint-soft); color: var(--mint); }
.chip-off, .mini-chip.warn, .state-chip.warn { background: var(--amber-soft); color: var(--amber); }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--red-deep);
  cursor: pointer; text-decoration: underline; }
.status-strip {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px;
  padding: 8px 16px; font-size: .82rem; color: var(--ink-soft);
  background: linear-gradient(0deg, rgba(255,219,230,.5), rgba(255,219,230,.15));
  border-bottom: 1px solid var(--line);
}
.dot-sep { color: var(--pink); }
.win-open { background: var(--mint-soft); color: var(--mint); }
.win-closed { background: var(--amber-soft); color: var(--amber); }
.subnav { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; }
.foot-note { text-align: center; color: var(--ink-faint); font-size: .86rem; margin-top: 18px; }

/* ---------------- cards & text ---------------- */
.cols { display: grid; gap: 16px; }
.cols.narrow { max-width: 640px; margin: 0 auto; width: 100%; }
.card {
  position: relative; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); padding: 20px 18px; box-shadow: var(--shadow);
  background-image: linear-gradient(180deg, rgba(255,255,255,.9), rgba(255,246,238,.6));
}
.card h2:first-child { margin-top: 0; }
.lede { font-size: 1.02rem; color: var(--ink); }
.fine { font-size: .85rem; color: var(--ink-soft); margin: .3em 0 .9em; }
.ok { color: var(--mint); font-size: .9rem; }
.warn-text { color: var(--amber); }
.ok-text { color: var(--mint); }
.hint { font-size: .86rem; min-height: 1.2em; margin: 6px 0; }
.hint .ok { display: inline-flex; align-items: center; gap: 6px; }
.back-link { display: inline-block; font-size: .9rem; color: var(--ink-soft); text-decoration: none; }
.back-link:hover { color: var(--red-deep); }
.loading { text-align: center; color: var(--ink-faint); padding: 40px 0; font-family: var(--hand); }
.loading .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%;
  background: var(--pink); animation: pulse 1s infinite ease-in-out; }
@keyframes pulse { 0%,100% { transform: scale(.7); opacity: .5; } 50% { transform: scale(1.3); opacity: 1; } }

/* ---------------- buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 999px; border: 2px solid var(--red-deep);
  font-family: var(--hand); font-size: 1rem; letter-spacing: .3px; cursor: pointer;
  background: var(--red); color: #fff; text-decoration: none;
  box-shadow: 0 3px 0 rgba(120, 20, 40, .25); transition: transform .08s ease, box-shadow .08s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 5px 0 rgba(120, 20, 40, .22); color: #fff; }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(120, 20, 40, .3); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; transform: none;
  box-shadow: none; }
.btn-primary { background: var(--red); border-color: var(--red-deep); }
.btn-ghost { background: #fff; color: var(--red-deep); border-color: rgba(171, 30, 54, .35);
  box-shadow: 0 3px 0 rgba(120, 20, 40, .12); }
.btn-ghost:hover { background: var(--pink-soft); }
.btn-big { width: 100%; padding: 14px 20px; font-size: 1.1rem; margin-top: 6px; }
.btn-off { background: var(--paper-3); color: var(--ink-faint); border-color: var(--line);
  box-shadow: none; cursor: not-allowed; }
.mc-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; }
.price-note { font-size: .84rem; color: var(--ink-soft); }
.row2 { display: grid; gap: 12px; }
.row-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0; }

/* ---------------- forms ---------------- */
label { display: block; font-size: .9rem; font-weight: 700; margin: 12px 0 4px; color: var(--ink); }
input[type=email], input[type=text], input[type=search], input[type=number], input[type=date],
input[type=password], select, textarea {
  width: 100%; padding: 11px 12px; font: inherit; color: var(--ink);
  background: #fff; border: 1.5px solid rgba(120, 70, 60, .3); border-radius: 10px;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--pink); outline: none;
  box-shadow: 0 0 0 3px rgba(255, 135, 168, .28); }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--red) 50%),
  linear-gradient(135deg, var(--red) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.row-inline input, .row-inline select { width: auto; flex: 0 1 auto; }
.row-inline input[type=number] { width: 84px; }
label.check, label.radio, label.switch {
  display: flex; align-items: flex-start; gap: 10px; font-weight: 400; font-size: .93rem;
  margin: 12px 0; cursor: pointer; }
label.check input, label.radio input { width: 20px; height: 20px; margin: 2px 0 0; flex: 0 0 auto;
  accent-color: var(--red); }
label.check span, label.radio span, label.switch span { font-weight: 400; }
.switch input { width: 44px; height: 24px; accent-color: var(--red); }
input[type=range] { width: 100%; accent-color: var(--red); height: 26px; }
.inline-err:not(:empty), .send-note:not(:empty) { margin-top: 12px; }
.err, .notice {
  border-radius: 10px; padding: 11px 13px; font-size: .92rem; margin: 10px 0;
  background: var(--amber-soft); border: 1.5px dashed rgba(181, 119, 42, .5); color: #6d4a17;
}
.notice-bad, .err { background: #ffe3e7; border-color: rgba(216, 50, 76, .45); color: var(--red-deep); }
.notice-link { font-weight: 700; }
.notice svg { vertical-align: -2px; }

/* ---------------- hearts ---------------- */
svg[class*="-heart"] { fill: var(--red); }
.tiny-heart { width: 15px; height: 15px; fill: var(--pink); vertical-align: -2px; }
.big-heart { width: 34px; height: 34px; fill: var(--red); display: block; margin-bottom: 6px; }
.lock-heart { width: 16px; height: 16px; fill: var(--ink-faint); margin-left: 6px; vertical-align: 1px; }
.corner-hearts { position: absolute; right: 14px; top: 12px; width: 78px; height: 34px;
  pointer-events: none; }
.corner-hearts i { position: absolute; display: block; width: 15px; height: 13px;
  background: var(--pink); }
.corner-hearts i::before, .corner-hearts i::after { content: ""; position: absolute; top: 0; left: 0;
  width: 50%; height: 80%; background: inherit; border-radius: 999px 999px 0 0;
  transform: rotate(-45deg); transform-origin: 0 100%; }
.corner-hearts i::after { left: 50%; transform: rotate(45deg); transform-origin: 100% 100%; }
.hero .corner-hearts i:nth-child(1) { right: 0; top: 0; }
.hero .corner-hearts i:nth-child(2) { right: 22px; top: 14px; width: 11px; height: 10px; background: var(--red); opacity: .8; }
.hero .corner-hearts i:nth-child(3) { right: 40px; top: 2px; width: 8px; height: 8px; background: var(--pink); }

/* ---------------- landing ---------------- */
.hero { background-image: linear-gradient(180deg, #fff, #fff3f6); }
.hero h1 { font-size: 2rem; color: var(--red-deep); }
.fact-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.fact-list li { display: flex; gap: 9px; align-items: center; font-size: .95rem; }
.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; gap: 12px; }
.steps li { display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: start; font-size: .95rem; }
.step-heart { display: grid; place-items: center; width: 30px; height: 30px; color: #fff;
  font-family: var(--hand); font-weight: 700; background: var(--red);
  clip-path: polygon(50% 100%, 0 55%, 0 22%, 25% 0, 50% 20%, 75% 0, 100% 22%, 100% 55%); }
.signin-card { background-image: linear-gradient(180deg, #fffdf9, #ffeef3); }
.teacher-card { border-style: dashed; }
.devbox { margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 10px; }
.devbox summary { cursor: pointer; font-family: var(--hand); color: var(--ink-soft); font-size: .92rem; }
.devbox[open] summary { color: var(--red-deep); }

/* ---------------- wizard ---------------- */
.wiz-top h1 { color: var(--red-deep); }
.wiz-steps { list-style: none; margin: 14px 0 8px; padding: 0; display: grid; gap: 6px; }
.ws { display: grid; grid-template-columns: 28px 1fr; gap: 8px; align-items: center;
  grid-template-areas: "num name" "num hint"; padding: 6px 8px; border-radius: 10px;
  border: 1.5px dashed transparent; font-size: .9rem; color: var(--ink-faint); }
.ws-num { grid-area: num; display: grid; place-items: center; width: 26px; height: 26px; color: #fff;
  font-family: var(--hand); background: var(--paper-3); color: var(--ink-soft);
  clip-path: polygon(50% 100%, 0 55%, 0 22%, 25% 0, 50% 20%, 75% 0, 100% 22%, 100% 55%); }
.ws-name { grid-area: name; font-family: var(--hand); font-weight: 700; }
.ws-hint { grid-area: hint; font-size: .78rem; }
.ws.on { border-color: rgba(216, 50, 76, .45); background: #fff0f4; color: var(--red-deep); }
.ws.on .ws-num { background: var(--red); color: #fff; }
.ws.done { color: var(--mint); }
.ws.done .ws-num { background: var(--mint); color: #fff; }
.bar { height: 12px; border-radius: 999px; background: var(--paper-3); overflow: hidden; margin: 8px 0 4px; }
.bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--pink), var(--red));
  border-radius: 999px; transition: width .35s ease; }
.wiz-nav { display: flex; gap: 10px; margin-top: 18px; }
.wiz-nav .btn { flex: 1; }
.prompt-box { margin-bottom: 16px; }
.counter { font-size: .78rem; color: var(--ink-faint); text-align: right; margin: 2px 0 0; }
.slider-row { margin: 14px 0 18px; }
.slider-ends { display: flex; justify-content: space-between; font-size: .82rem; color: var(--ink-soft); }
.slider-read { font-size: .82rem; color: var(--red-deep); margin: 0; min-height: 1.1em; }
.consent { font-size: 1rem; background: var(--pink-soft); padding: 12px; border-radius: 10px; }
.intent-set { border: 1.5px dashed var(--line); border-radius: 10px; padding: 8px 12px 12px; margin-top: 14px; }
.intent-set legend { font-size: .9rem; font-weight: 700; padding: 0 6px; }

/* ---------------- tags ---------------- */
.tag-group { margin: 14px 0; }
.tag-group h3 { font-size: .95rem; color: var(--red-deep); border-bottom: 1px dashed var(--line);
  padding-bottom: 3px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.tag { position: relative; display: inline-flex; align-items: center; gap: 6px; margin: 0;
  padding: 7px 13px; border-radius: 999px; border: 1.5px solid rgba(120, 70, 60, .28);
  background: #fff; font-size: .88rem; font-weight: 400; cursor: pointer; user-select: none; }
.tag input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tag:hover { border-color: var(--pink); }
.tag.on { background: var(--red); border-color: var(--red-deep); color: #fff; font-weight: 700; }
.tag.on::after { content: "\2665"; }
.tag-count { font-size: .86rem; margin-top: 10px; }
.chip { display: inline-flex; align-items: center; gap: 5px; margin: 0 6px 6px 0; padding: 4px 11px;
  border-radius: 999px; background: var(--paper-2); border: 1px solid var(--line); font-size: .82rem; }
.chip-hit { background: var(--pink-soft); border-color: rgba(216, 50, 76, .35); color: var(--red-deep);
  font-weight: 700; }
.chip-heart { width: 12px; height: 12px; fill: var(--red); }
.pill { display: inline-block; margin: 0 6px 6px 0; padding: 5px 11px; border-radius: 999px;
  font-size: .8rem; background: #fff0f4; border: 1px dashed rgba(216, 50, 76, .4); color: var(--red-deep); }
.pills-row { margin: 10px 0; }
.shared { font-size: .8rem; text-transform: uppercase; letter-spacing: .5px; color: var(--ink-faint);
  margin: 6px 0 4px; }

/* ---------------- match percent ring ---------------- */
.ring { position: relative; display: inline-block; flex: 0 0 auto; }
.ring svg { width: 100%; height: 100%; display: block; }
.ring-bg { stroke: var(--paper-3); }
.ring-fg { stroke: var(--pink); }
.ring.hi .ring-fg { stroke: var(--red); }
.ring.mid .ring-fg { stroke: #ef5c7c; }
.ring.low .ring-fg { stroke: var(--amber); }
.ring-num { position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--hand); font-weight: 700; color: var(--red-deep); font-size: 1.05rem; }
.ring.hi .ring-num { font-size: 1.15rem; }
.ring-num small { font-size: .6em; }

/* ---------------- matches ---------------- */
.matches-head h1 { color: var(--red-deep); margin-bottom: 2px; }
.match-grid { display: grid; gap: 14px; }
.match-card { position: relative; }
.is-locked { background-image: repeating-linear-gradient(135deg, #fffaf7 0 12px, #fdf1ea 12px 24px); }
.mc-head { display: flex; gap: 14px; align-items: center; }
.mc-id h3 { margin: 0; display: flex; align-items: center; }
.mc-meta { font-size: .86rem; color: var(--ink-soft); margin: 2px 0 0; }
.rank-badge { display: inline-flex; align-items: center; gap: 4px; position: absolute; top: 10px; left: 14px;
  font-family: var(--hand); font-weight: 700; color: var(--red-deep); font-size: .85rem; }
.rank-heart { width: 20px; height: 20px; fill: var(--pink); transform: rotate(-12deg); }
.unread-badge { display: inline-block; margin-top: 6px; padding: 2px 9px; border-radius: 999px;
  background: var(--red); color: #fff; font-size: .76rem; font-weight: 700; }
.banner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px;
  padding: 16px 18px; border-radius: var(--r); border: 2px dashed rgba(216, 50, 76, .4);
  background: linear-gradient(120deg, #fff2f5, #ffe9ef 60%, #fff7ef);
  box-shadow: var(--shadow);
}
.banner h2 { margin: 0 0 4px; color: var(--red-deep); }
.banner p { margin: 0; font-size: .92rem; max-width: 46ch; }
.match-detail .md-head { display: flex; gap: 16px; align-items: center; }
.answer { background: var(--paper-2); border-left: 3px solid var(--pink); padding: 8px 12px;
  border-radius: 0 10px 10px 0; margin: 0 0 10px; font-size: .95rem; }
.answer em { color: var(--ink-soft); font-size: .84rem; }
.cmp-row { margin: 10px 0 14px; }
.cmp-label { font-size: .82rem; color: var(--ink-soft); margin: 0 0 3px; }
.cmp-bar { position: relative; height: 12px; border-radius: 999px; background: var(--paper-3); }
.cmp-you, .cmp-them { position: absolute; top: -3px; width: 16px; height: 16px; border-radius: 50%;
  transform: translateX(-50%); border: 2px solid #fff; }
.cmp-you { background: var(--red); }
.cmp-them { background: var(--pink); top: 3px; }
.cmp-them.close { background: var(--mint); }

/* ---------------- redeem ---------------- */
.code-input { font-family: var(--hand); font-size: 1.7rem; letter-spacing: 4px; text-align: center;
  text-transform: uppercase; }
.code-input.shake { animation: shake .45s; border-color: var(--red); }
@keyframes shake { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-7px); }
  40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
.price-box { display: flex; gap: 12px; align-items: center; margin-top: 16px; padding-top: 12px;
  border-top: 1px dashed var(--line); }
.big-price { font-family: var(--hand); font-size: 1.9rem; color: var(--red-deep); margin: 0; }
.done-card { text-align: center; }

/* ---------------- chats ---------------- */
.chat-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.chat-row {
  display: flex; gap: 12px; align-items: center; justify-content: space-between;
  padding: 13px 15px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  text-decoration: none; color: inherit; box-shadow: var(--shadow);
}
.chat-row:hover { border-color: var(--pink); background: #fff6f9; }
.chat-row.has-unread { border-left: 5px solid var(--red); }
.cr-left { display: grid; gap: 2px; min-width: 0; }
.cr-name { font-family: var(--hand); font-weight: 700; font-size: 1.05rem; color: var(--red-deep); }
.cr-meta { font-size: .8rem; color: var(--ink-soft); }
.cr-last { font-size: .9rem; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; max-width: 60ch; }
.cr-right { display: grid; justify-items: end; gap: 4px; flex: 0 0 auto; }
.cr-time { font-size: .76rem; color: var(--ink-faint); }
.hidden-hint { color: var(--ink-faint); font-size: .8rem; }
.chat-card { display: grid; gap: 6px; }
.chat-head { display: flex; align-items: center; justify-content: space-between; gap: 14px;
  border-bottom: 2px dashed var(--line); padding-bottom: 10px; margin-bottom: 8px; }
.chat-head h1 { margin: 0; color: var(--red-deep); }
.thread { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 12px; }
.bubble { max-width: 88%; padding: 10px 14px; border-radius: 18px 18px 18px 4px;
  background: var(--paper-2); border: 1px solid var(--line); font-size: .96rem; }
.bubble p { margin: 0; white-space: pre-wrap; word-break: break-word; }
.bubble.mine { justify-self: end; border-radius: 18px 18px 4px 18px;
  background: var(--pink-soft); border-color: rgba(216, 50, 76, .28); }
.bubble.flagged { border-style: dashed; border-color: rgba(181, 119, 42, .6); background: var(--amber-soft); }
.bubble.is-hidden { background: repeating-linear-gradient(135deg, #fff 0 8px, var(--paper-2) 8px 16px); }
.blur-text { color: var(--ink-faint); font-style: italic; }
.lock-line { display: flex; gap: 6px; align-items: center; font-size: .8rem; color: var(--red-deep);
  margin-top: 4px !important; }
.bubble-meta { font-size: .72rem; color: var(--ink-faint); margin-top: 5px !important; }
.report-btn { font-size: .72rem; }
.report-form { margin-top: 8px; padding: 10px; border: 1px dashed var(--line); border-radius: 10px;
  background: #fff; }
.report-form .btn { margin-top: 8px; }
.composer { margin-top: 12px; }
.composer-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 8px; }
.composer-foot .btn { min-width: 140px; }
.send-note .err { margin: 8px 0 0; }
.chat-tools { display: grid; gap: 14px; margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--line); }
.tool { background: var(--paper); border-radius: 10px; padding: 10px 12px; }
.tool .fine { margin-bottom: 0; }

/* ---------------- admin ---------------- */
.stat-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 14px 16px; box-shadow: var(--shadow); display: grid; gap: 2px; }
.stat-v { font-family: var(--hand); font-size: 1.8rem; color: var(--red-deep); line-height: 1.1; }
.stat-l { font-size: .84rem; font-weight: 700; color: var(--ink); }
.stat-s { font-size: .78rem; color: var(--ink-soft); }
.stat.hot { background: linear-gradient(150deg, #fff, #ffeef3); border-color: rgba(216, 50, 76, .3); }
.stat.warn { background: var(--amber-soft); border-color: rgba(181, 119, 42, .45); }
.stat.warn .stat-v { color: var(--amber); }
.table-wrap { overflow-x: auto; margin-top: 12px; }
.grid-table { width: 100%; font-size: .88rem; min-width: 560px; }
.grid-table th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .4px;
  color: var(--ink-faint); border-bottom: 1.5px solid var(--line); padding: 8px 10px; }
.grid-table td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.grid-table tr:nth-child(even) td { background: rgba(255, 240, 245, .5); }
.td-code { font-family: "Courier New", monospace; font-weight: 700; letter-spacing: 1px;
  color: var(--red-deep); }
.td-email { font-size: .82rem; color: var(--ink-soft); }
.bodies-row td { background: var(--paper) !important; }
.code-plain { font-family: "Courier New", monospace; font-size: .95rem; letter-spacing: 2px;
  text-transform: uppercase; background: #fff; }
.flag-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.flag-row { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: #fff; }
.flag-row.is-done { opacity: .65; background: var(--paper); }
.flag-top { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.kind-chip { background: var(--amber-soft); color: var(--amber); }
.kind-report { background: #ffe3e7; color: var(--red-deep); }
.kind-contact { background: var(--pink-soft); color: var(--red-deep); }
.flag-body { margin: 8px 0; padding: 8px 12px; border-left: 3px solid var(--pink);
  background: var(--paper-2); border-radius: 0 8px 8px 0; font-size: .92rem; }
.resolve { margin-top: 10px; }
.tag-picker .tag-list { max-height: 260px; overflow-y: auto; padding-right: 4px; }
.tag-picker .tag.off { background: var(--paper-3); color: var(--ink-faint); text-decoration: line-through; }

/* ---------------- heart burst ---------------- */
.burst { position: fixed; inset: 0; pointer-events: none; z-index: 50; overflow: hidden; }
.burst i { position: absolute; top: -30px; width: var(--sz, 18px); height: var(--sz, 18px);
  background: var(--red); opacity: .9;
  clip-path: polygon(50% 100%, 0 58%, 0 25%, 24% 0, 50% 18%, 76% 0, 100% 25%, 100% 58%);
  animation: drop 2.2s ease-in forwards; }
.burst i:nth-child(3n) { background: var(--pink); }
.burst i:nth-child(4n) { background: #f9a8c0; }
@keyframes drop { 0% { transform: translateY(-20px) rotate(0); opacity: 1; }
  100% { transform: translateY(105vh) rotate(240deg); opacity: .15; } }

/* ---------------- toasts ---------------- */
#toasts { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 70;
  display: grid; gap: 8px; width: min(94vw, 420px); }
.toast { display: flex; align-items: center; gap: 10px; justify-content: space-between;
  padding: 11px 14px; border-radius: 12px; background: #fff; color: var(--ink);
  border: 1.5px solid var(--line); box-shadow: 0 12px 30px -12px rgba(80, 20, 30, .6);
  font-size: .92rem; animation: rise .25s ease-out; }
.toast p { margin: 0; }
.toast-good { border-color: rgba(47, 139, 106, .5); background: var(--mint-soft); color: #1f5e47; }
.toast-bad { border-color: rgba(216, 50, 76, .5); background: #ffe3e7; color: var(--red-deep); }
.toast-x { background: none; border: 0; font-size: 1.2rem; line-height: 1; cursor: pointer;
  color: inherit; opacity: .6; }
.toast-x:hover { opacity: 1; }
@keyframes rise { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------------- wider screens ---------------- */
@media (min-width: 620px) {
  .row2 { grid-template-columns: 1fr 1fr; }
  .match-grid { grid-template-columns: 1fr 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .btn-big { width: auto; min-width: 260px; }
  h1 { font-size: 2.1rem; }
  .mainnav { flex: 0 1 auto; order: 0; width: auto; }
}
@media (min-width: 900px) {
  body { font-size: 17.5px; }
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
  .wrap { padding: 22px 22px 70px; }
  .top { padding: 14px 26px; }
  .hero h1 { font-size: 2.5rem; }
  .cols > .card + .card { margin-top: 0; }
  .thread .bubble { max-width: 74%; }
}

/* ---------------- printing code slips ---------------- */
@media print {
  .top, .status-strip, #toasts, .wiz-nav, .btn, .devbox, .foot-note, .skip { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border: 1px solid #bbb; break-inside: avoid; }
  .code-plain { height: auto; font-size: 1.1rem; }
}

/* ---------------- gentle motion ---------------- */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; }
}
