/* Wingman Matcher — styles.
   Direction: a plate in a flight manual (same tokens/fonts as /bfm/bfm.css). The card photo is the only block of
   colour; everything else is type size, weight, 1px hairlines and whitespace. No shadows, glows, gradients or blur.
   Semantic colour: blue = like, red = pass, yellow = annotation / super. */

:root {
  --bg:     #141517;
  --page:   #0f1012;
  --plate:  #1b1d20;
  --ink:    #ebe8e1;
  --ink-2:  #b9b5ac;
  --ink-3:  #9a968e;
  --rule:   #2c2e32;
  --rule-2: #474a4f;
  --f:      #6fa3ff;   /* like */
  --b:      #ff7559;   /* pass */
  --note:   #e0b84f;   /* super, annotations */

  --font-zh:  "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", sans-serif;
  --font-num: "Barlow Semi Condensed", "Arial Narrow", "Noto Sans TC", sans-serif;
  --font-src: "Source Serif 4", Georgia, "Times New Roman", serif;

  --col: 430px;
  --top-h: 48px;
  --tabs-h: 56px;
  --act-h: 84px;
  color-scheme: dark;
}

/* Japanese: system Japanese faces first so kana / kanji do not fall back to the Traditional Chinese glyph forms. */
html:lang(ja) {
  --font-zh:  "Hiragino Sans", "Yu Gothic UI", "Meiryo", "Noto Sans JP", sans-serif;
  --font-num: "Barlow Semi Condensed", "Arial Narrow", "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif;
}
/* English rank names are much longer than the Chinese ones. */
html:lang(en) .nose-cell.rank b { font-size: clamp(13px, 3.8cqw, 15px); letter-spacing: .04em; }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--page);
  color: var(--ink);
  font: 400 15px/1.5 var(--font-zh);
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
a { color: var(--f); }
:focus-visible { outline: 2px solid var(--note); outline-offset: 2px; }
[hidden] { display: none !important; }
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ── App column ─────────────────────────────────────────── */
.app {
  display: flex; flex-direction: column;
  height: 100vh; height: 100dvh;
  max-width: var(--col); margin: 0 auto;
  background: var(--bg);
}
@media (min-width: 560px) {
  .app { border-left: 1px solid var(--rule); border-right: 1px solid var(--rule); }
}

.top {
  flex: none; height: var(--top-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px;
  border-bottom: 1px solid var(--rule);
}
.brand { display: flex; align-items: baseline; gap: 10px; color: var(--ink); text-decoration: none; }
.brand-logo { width: auto; height: 22px; align-self: center; display: block; }
.brand-sub { font-size: 12px; color: var(--ink-3); }
.top-home { font: 600 13px/1 var(--font-num); letter-spacing: .12em; color: var(--ink-3); text-decoration: none; padding: 8px 0 8px 8px; }
.top-home:hover { color: var(--ink); }
.top-r { display: flex; align-items: center; gap: 6px; }

/* ── Add to home screen strip (shown only when installable / iOS Safari, see initInstall) ── */
.install { flex: none; display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 6px 0 14px; border-bottom: 1px solid var(--rule); font-size: 13px; color: var(--ink-3); }
.install-msg { flex: 1; margin: 0; }
.install .btn-text { font-size: 13px; color: var(--ink-2); }
.install-x { min-width: 36px; font-size: 20px; line-height: 1; text-decoration: none; }
.lang { display: flex; align-items: center; }
.lang button { position: relative; height: var(--top-h); padding: 0 9px; background: none; border: 0; cursor: pointer;
  font: 600 13px/1 var(--font-num); letter-spacing: .08em; color: var(--ink-3); }
.lang button + button::before { content: ""; position: absolute; left: 0; top: 17px; bottom: 17px; width: 1px; background: var(--rule-2); }
.lang button:hover, .lang button[aria-pressed="true"] { color: var(--ink); }

.views { position: relative; flex: 1; min-height: 0; }
.view { position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain; }

/* ── Tabs ───────────────────────────────────────────────── */
.tabs {
  flex: none; height: calc(var(--tabs-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  display: grid; grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--rule);
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  background: none; border: 0; border-top: 2px solid transparent; margin-top: -1px;
  color: var(--ink-3); font-size: 12px;
}
.tab svg { width: 22px; height: 22px; }
.tab[aria-current="page"] { color: var(--ink); border-top-color: var(--f); }
.tab-badge { color: var(--note); font: 600 12px/1 var(--font-num); margin-left: 3px; }

/* ── Explore: deck ──────────────────────────────────────── */
.view-explore { overflow: hidden; display: flex; flex-direction: column; }
.deck { position: relative; flex: 1; margin: 10px 10px 0; --p: 0; }
.card {
  position: absolute; inset: 0;
  border-radius: 4px; overflow: hidden;
  background: var(--plate);
  user-select: none; -webkit-user-select: none;
  transform-origin: 50% 60%;
  container-type: inline-size;   /* cqw below = card width: the nose numerals and the callsign scale with it */
}
.card::after { content: ""; position: absolute; inset: 0; z-index: 5; border: 1px solid var(--rule-2); border-radius: inherit; pointer-events: none; }
.card.is-top { touch-action: none; cursor: grab; will-change: transform; }
.card.is-top.is-dragging { cursor: grabbing; }
.card.is-next { transform: scale(calc(.95 + .05 * var(--p))); }
.card.is-next::before {
  content: ""; position: absolute; inset: 0; z-index: 4; background: var(--bg);
  opacity: calc(.55 - .55 * var(--p)); pointer-events: none;
}
.deck:not(.is-dragging) .card.is-next { transition: transform .3s ease; }
.card.is-returning { animation: card-return .34s cubic-bezier(.2, .8, .25, 1); }
@keyframes card-return { from { transform: translate(var(--rx, 0), var(--ry, 0)) rotate(var(--rr, 0deg)); } }
.card.bump-l { animation: bump-l .18s ease; }
.card.bump-r { animation: bump-r .18s ease; }
@keyframes bump-l { 50% { transform: translateX(-6px); } }
@keyframes bump-r { 50% { transform: translateX(6px); } }

.photo-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; display: block; background: var(--plate);
  pointer-events: none; -webkit-user-drag: none;
}
.tint { position: absolute; inset: 0; z-index: 1; opacity: 0; pointer-events: none; }
.bars { position: absolute; top: 8px; left: 8px; right: 8px; z-index: 2; display: flex; gap: 4px; }
.bars span { flex: 1; height: 3px; background: rgba(20, 21, 23, .45); box-shadow: inset 0 0 0 1px rgba(235, 232, 225, .35); }
.bars span.on { background: var(--ink); box-shadow: none; }

/* Info band: flat and solid for legibility; the photo stays full-bleed above it.
   The patch floats at the top left (overhanging the photo): the name row sits beside it, the detail lines run full width below,
   clear of the info button in the bottom right corner. */
.card-info {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: 12px 14px; min-height: 92px;
  background: var(--bg);
  border-top: 1px solid var(--rule-2);
}
.info-text { min-width: 0; }
.card-info .line, .card-info .line2, .card-info .overlap, .card-info .who:nth-last-child(-n+2) { margin-right: 40px; }
/* Nose art: big tabular numerals on the photo, on a short flat-to-transparent scrim directly behind them.
   Full card width, lifted clear of the patch; the numerals shrink with the card, and a cell that still does not fit
   wraps to a row above (wrap-reverse) instead of running off the card. */
.nose {
  position: absolute; left: 0; right: 0; bottom: 100%;
  display: flex; flex-wrap: wrap-reverse; justify-content: flex-end; align-items: baseline; gap: 4px clamp(10px, 3.6cqw, 18px);
  padding: 34px 14px 30px;
  background: linear-gradient(to top, rgba(20, 21, 23, .8), rgba(20, 21, 23, 0));
  pointer-events: none;
}
.nose-cell { display: inline-flex; align-items: baseline; gap: 3px; white-space: nowrap; }
.nose-cell b { font: 600 clamp(28px, 8.8cqw, 38px)/1 var(--font-num); font-variant-numeric: tabular-nums; letter-spacing: .02em; color: var(--ink); }
.nose-cell i { font: 600 13px/1 var(--font-zh); font-style: normal; letter-spacing: .08em; color: var(--note); }
.nose-cell.rank b { font: 700 clamp(16px, 5cqw, 22px)/1 var(--font-zh); letter-spacing: .12em; padding: 3px 0 2px; border-top: 2px solid var(--note); border-bottom: 2px solid var(--note); }
.nose.tail b { font: 600 64px/.9 var(--font-num); letter-spacing: .06em; color: var(--ink); text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

/* Squadron patch: the Discord avatar (or initials) in a 1px-ringed circle. */
.patch {
  --s: 56px; flex: none; position: relative;
  width: var(--s); height: var(--s); border-radius: 50%; overflow: hidden;
  display: grid; place-items: center;
  background: var(--plate); border: 1px solid var(--ink-2);
}
.patch img { width: 100%; height: 100%; object-fit: cover; display: block; }
.patch-txt { font: 600 calc(var(--s) * .38)/1 var(--font-num); letter-spacing: .04em; color: var(--ink); }
.patch.sm { --s: 30px; }
.patch.xs { --s: 26px; }
.patch.md { --s: 48px; }
.patch.lg { --s: 64px; }
.card-info > .patch { float: left; margin: -32px 12px 0 0; border: 2px solid var(--bg); outline: 1px solid var(--ink-2); }
button.patch { padding: 0; color: inherit; cursor: zoom-in; }
button.patch:disabled { cursor: inherit; }
button.patch:focus-visible { outline: 2px solid var(--note); outline-offset: 2px; }

.super-mark {
  display: flex; align-items: center; gap: 6px;
  color: var(--note); font-size: 12px; margin: 0 0 2px;
}
.super-mark svg { width: 14px; height: 14px; }
.prospect-mark { font-weight: 500; letter-spacing: .06em; padding-bottom: 2px; border-bottom: 1px solid var(--note); width: fit-content; margin-bottom: 4px; }
.stamp-invite { font: 700 38px/1.15 var(--font-zh); letter-spacing: .2em; padding: 2px 6px 0 14px; }
.prospect-note { margin: 14px 0 0; padding-left: 10px; border-left: 2px solid var(--note); color: var(--ink-2); font-size: 14px; }
.who { margin: 0; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; font-weight: 400; }
.who .cs { font: 600 30px/1.1 var(--font-num); letter-spacing: .02em; }
/* Long callsigns shrink to fit one line (--cs-em: estimated width in em, from wingman.js); the ellipsis is only a backstop. */
.card .who .cs { font-size: clamp(20px, (100cqw - 96px) / var(--cs-em, 6), 30px); min-width: 0; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who .age { font: 400 24px/1.1 var(--font-num); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.m75 { font: 600 12px/1 var(--font-num); letter-spacing: .14em; color: var(--ink-2); border-bottom: 1px solid var(--note); padding-bottom: 1px; text-decoration: none; }
/* Same family as the M75 mark: small type over a hairline, in the annotation colour. */
.rookie-mark { font: 500 12px/1 var(--font-zh); letter-spacing: .1em; color: var(--note); border-bottom: 1px solid var(--note); padding-bottom: 2px; }
.founder-mark { font: 500 12px/1 var(--font-zh); letter-spacing: .08em; color: var(--ink-2); border-bottom: 1px solid var(--note); padding-bottom: 2px; white-space: nowrap; }
.line { margin: 2px 0 0; color: var(--ink-2); font: 400 15px/1.45 var(--font-num); letter-spacing: .01em; white-space: nowrap; display: flex; align-items: baseline; }
.line .fl { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.line .more { flex: none; margin-left: .3em; color: var(--ink-3); }
.line b { font-weight: 500; color: var(--ink); }
/* Max two lines that only break between items. Every item carries its "·" in front; the block is pulled left by one separator
   width, so the separator that starts each line falls outside the clip and no line ends on a dangling dot. */
.line2 { margin: 1px 0 0; color: var(--ink-3); font-size: 13px; line-height: 20px; max-height: 40px; overflow: hidden; }
.line2 .facts { display: block; margin-left: -1.2em; }
.line2 .fact { display: inline-block; white-space: nowrap; }
.line2 .fact::before { content: "·"; content: "·" / ""; display: inline-block; width: 1.2em; text-align: center; }
.line .num, .line2 .num { font-size: 1.05em; }
.overlap { margin: 3px 0 0; font-size: 12px; color: var(--note); }

.icon-btn {
  display: grid; place-items: center;
  width: 32px; height: 32px; padding: 0;
  border-radius: 50%; background: transparent;
  border: 1px solid var(--rule-2); color: var(--ink);
}
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:hover { border-color: var(--ink-3); }
.card-info .icon-btn { position: absolute; right: 12px; bottom: 14px; }

.stamp {
  position: absolute; z-index: 3; top: 48px;
  padding: 2px 10px 0;
  border: 3px solid currentColor; border-radius: 3px;
  font: 600 42px/1.05 var(--font-num); letter-spacing: .1em;
  opacity: 0; pointer-events: none;
  background: rgba(20, 21, 23, .7);
  transform: var(--st);
}
.stamp-like { left: 18px; color: var(--f); --st: rotate(-14deg); }
.stamp-nope { right: 18px; color: var(--b); --st: rotate(14deg); }
.stamp-super { left: 50%; top: 38%; color: var(--note); --st: translateX(-50%) rotate(-8deg); }
/* Armed = past the commit threshold: the stamp fills with its colour and slams down once. */
.stamp.armed { color: var(--bg); animation: slam .12s ease-out; }
.stamp-like.armed  { background: var(--f);    border-color: var(--f); }
.stamp-nope.armed  { background: var(--b);    border-color: var(--b); }
.stamp-super.armed { background: var(--note); border-color: var(--note); }
@keyframes slam { from { transform: var(--st) scale(1.4) rotate(-4deg); } }

/* ── Action row ─────────────────────────────────────────── */
.actions {
  flex: none; height: var(--act-h);
  display: flex; align-items: center; justify-content: center; gap: 16px;
}
.act {
  --c: var(--ink-3);
  display: grid; place-items: center; padding: 0;
  border-radius: 50%; background: transparent;
  border: 1px solid var(--rule-2); color: var(--c);
  transition: background-color .12s, border-color .12s;
}
.act svg { width: 46%; height: 46%; }
.act.sm { width: 44px; height: 44px; }
.act.lg { width: 60px; height: 60px; }
.act-pass  { --c: var(--b);    border-color: var(--b); }
.act-like  { --c: var(--f);    border-color: var(--f); }
.act-super { --c: var(--note); border-color: var(--note); }
.act:hover:not(:disabled) { background: rgba(235, 232, 225, .06); }
.act-pass:hover:not(:disabled)  { background: rgba(255, 117, 89, .12); }
.act-like:hover:not(:disabled)  { background: rgba(111, 163, 255, .12); }
.act-super:hover:not(:disabled) { background: rgba(224, 184, 79, .12); }
.act:active:not(:disabled) { transform: scale(.92); }
.act:disabled { opacity: .3; }
/* Press: quick scale-down while the button fills with its colour for a beat. */
.act.is-pressed { animation: press .28s ease-out; }
@keyframes press { 30% { transform: scale(.86); background: var(--c); color: var(--bg); } 70% { background: var(--c); color: var(--bg); } }

/* ── Panels (empty deck, login, no profile) ─────────────── */
.panel { padding: 22px 22px 28px; }
.view-explore .panel { position: absolute; inset: 0 0 var(--act-h); overflow-y: auto; }
.panel-fig { display: block; width: 100%; max-width: 280px; height: auto; margin: 4px 0 18px; }
.kicker { margin: 0 0 4px; color: var(--note); font: 500 13px/1.3 var(--font-num); letter-spacing: .12em; }
.panel h2 { margin: 0 0 8px; font-size: 20px; font-weight: 500; }
.panel p { margin: 0 0 14px; color: var(--ink-2); max-width: 34em; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 16px;
  border: 1px solid var(--rule-2); border-radius: 3px;
  background: transparent; color: var(--ink);
  font-size: 15px; text-decoration: none;
}
.btn:hover:not(:disabled) { border-color: var(--ink-3); background: rgba(235, 232, 225, .04); }
.btn:disabled { color: var(--ink-3); opacity: .7; }
.btn-primary { border-color: var(--f); }
.btn-primary:hover:not(:disabled) { background: rgba(111, 163, 255, .1); border-color: var(--f); }
.btn-danger { border-color: transparent; color: var(--b); padding: 0 4px; }
.btn-danger:hover:not(:disabled) { background: none; border-color: transparent; text-decoration: underline; }
.btn-text { border: 0; padding: 0 2px; min-height: 36px; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }
.btn-text:hover:not(:disabled) { color: var(--ink); background: none; }
.btn-danger.btn-box { border: 1px solid var(--b); padding: 0 16px; }
.btn-danger.btn-box:hover:not(:disabled) { background: rgba(255, 117, 89, .1); border-color: var(--b); text-decoration: none; }
.btn-block { width: 100%; }

.note {
  margin: 16px 0 0; padding-top: 10px;
  border-top: 1px solid var(--rule);
  font-size: 13px; color: var(--ink-3);
}
.note a { color: var(--ink-2); }

/* ── Profile sheet (dialog) ─────────────────────────────── */
dialog {
  padding: 0; border: 0; color: var(--ink); background: var(--bg);
  width: 100%; max-width: var(--col); height: 100%; max-height: 100%;
  margin: 0 auto;
}
dialog::backdrop { background: rgba(10, 11, 12, .82); }
@media (min-width: 560px) {
  dialog { border-left: 1px solid var(--rule); border-right: 1px solid var(--rule); }
}
.sheet[open] { display: flex; flex-direction: column; }
.sheet-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.photo-clip { position: absolute; inset: 0; overflow: hidden; }   /* clips a zoomed (transform: scale) photo; .sheet-close hangs below the box so .sheet-photo itself cannot clip */
.sheet-photo { touch-action: pan-y; position: relative; height: min(60vh, 520px); background: var(--plate); border-bottom: 1px solid var(--rule-2); }
.photo-nav {
  position: absolute; top: 0; bottom: 0; width: 50%; z-index: 1;
  background: transparent; border: 0; padding: 0;
}
.photo-nav.prev { left: 0; }
.photo-nav.next { right: 0; }
.photo-nav:focus-visible { outline-offset: -4px; }
.sheet-close {
  position: absolute; right: 16px; bottom: -22px; z-index: 3;
  width: 44px; height: 44px; background: var(--bg);
}
.sheet-close svg { width: 20px; height: 20px; }

.sheet-body { padding: 18px 18px 24px; container-type: inline-size; }
.sheet-body .who .cs { font-size: clamp(22px, (100cqw - 78px) / var(--cs-em, 6), 32px); overflow-wrap: anywhere; }
.meta { margin: 2px 0 0; color: var(--ink-3); font-size: 13px; }
.sheet-who { display: flex; align-items: center; gap: 14px; }
.sheet-who > div { min-width: 0; }

/* ── Avatar lightbox (#dlg-zoom) ── */
dialog.zoom { max-width: none; background: transparent; border: 0; }
.zoom[open] { display: grid; place-items: center; padding: 56px 16px; }
.zoom::backdrop { background: rgba(10, 11, 12, .92); }
.zoom-img { display: block; width: min(100%, 560px, calc(100dvh - 112px)); aspect-ratio: 1; object-fit: contain; border-radius: 4px; }
.zoom-close { position: fixed; top: 12px; right: 12px; width: 44px; height: 44px; background: var(--bg); }
.zoom-close svg { width: 18px; height: 18px; }
.credit { margin: 0 64px 12px 0; font-size: 12px; line-height: 1.45; color: var(--ink-3); overflow-wrap: anywhere; }
.credit a { color: var(--ink-2); }
.bio { margin: 14px 0 4px; font: 400 17px/1.55 var(--font-src); color: var(--ink); white-space: pre-line; overflow-wrap: anywhere; }

.sec-h {
  margin: 22px 0 0; padding-bottom: 6px;
  border-bottom: 1px solid var(--rule-2);
  font: 500 12px/1.3 var(--font-zh); letter-spacing: .08em; color: var(--ink-3);
  display: flex; justify-content: space-between; align-items: baseline;
}
.sec-h .num { color: var(--ink-3); }
.rows { margin: 0; }
.rows > div { display: grid; grid-template-columns: 6.5em 1fr; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--rule); }
.rows dt { color: var(--ink-3); font-size: 13px; padding-top: 1px; }
.rows dd { margin: 0; overflow-wrap: anywhere; }
.rows dd.num { text-align: right; font-size: 17px; }
.rows.stats > div { grid-template-columns: 1fr auto; }

.fleet-list { list-style: none; margin: 0; padding: 0; }
.fleet-list li { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--rule); }
.fl-name { font: 600 17px/1.25 var(--font-num); letter-spacing: .02em; }
.fl-meta { color: var(--ink-2); font-size: 13px; }
.fl-main { margin-left: auto; font-size: 12px; color: var(--note); letter-spacing: .08em; }
.rows .fl-main { margin-left: 8px; }
/* Spec table: three columns of hairline-ruled values, like a data plate. */
.spec { width: 100%; border-collapse: collapse; table-layout: fixed; }
.spec th, .spec td { padding: 7px 8px 7px 0; text-align: left; border-bottom: 1px solid var(--rule); }
.spec th + th, .spec td + td { padding-left: 10px; border-left: 1px solid var(--rule); }
.spec th { font-weight: 400; font-size: 12px; color: var(--ink-3); }
.spec td { font-size: 15px; }
.sheet-body .overlap { margin-top: 8px; }

.meter { display: inline-flex; gap: 3px; vertical-align: middle; margin-right: 10px; }
.meter i { width: 14px; height: 6px; border: 1px solid var(--ink-3); }
.meter i.on { background: var(--ink); border-color: var(--ink); }

.slots { width: 100%; border-collapse: collapse; margin-top: 2px; }
.slots th, .slots td { border-bottom: 1px solid var(--rule); padding: 7px 0; text-align: center; font-weight: 400; }
.slots thead th { color: var(--ink-3); font-size: 12px; }
.slots tbody th { text-align: left; color: var(--ink-3); font-size: 13px; width: 4em; }
.slot-mark { display: inline-block; width: 12px; height: 12px; border: 1px solid var(--rule-2); vertical-align: middle; }
.slot-mark.on { background: var(--ink); border-color: var(--ink); }

.flight-cta { margin-top: 14px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.flight-cta .hint { font-size: 13px; color: var(--ink-3); }

.sheet-foot {
  flex: none; border-top: 1px solid var(--rule);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
}
.sheet-foot.actions { height: auto; padding-top: 12px; padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
.sheet-foot .btn-row { justify-content: space-between; }

/* ── Match overlay ──────────────────────────────────────── */
.match[open] { display: flex; flex-direction: column; overflow-y: auto; }
.match-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: brightness(.22) saturate(.6); pointer-events: none; }
.match-inner { position: relative; padding: 28px 22px 24px; }
.match-title { margin: 0 0 18px; }
.match-title .zh { display: block; font: 700 42px/1.1 var(--font-zh); letter-spacing: .16em; }
.match-title .en { display: block; margin-top: 8px; font: 600 15px/1 var(--font-num); letter-spacing: .34em; color: var(--note); }
.match-title .word { display: inline-block; white-space: nowrap; }
.match-title .word span { display: inline-block; animation: type-in .12s ease-out both; animation-delay: calc(.32s + var(--i) * .05s); }
@keyframes type-in { from { opacity: 0; transform: translateY(.18em); } }
/* Two-ship echelon: lead top-left; the wingman slides into a dashed station stepped down-right,
   the station fades once it is filled, and a frame opens around the formed flight. All once. */
.echelon { position: relative; padding-bottom: calc(57.5% + 46px); margin: 4px 0 6px; }
.station {
  position: absolute; right: 0; bottom: 46px; width: 62%; aspect-ratio: 3 / 2;
  border: 1px dashed var(--note); border-radius: 3px; pointer-events: none;
  animation: station-out .25s ease .5s both;
}
@keyframes station-out { to { opacity: 0; } }
.ship { position: absolute; width: 62%; margin: 0; }
.ship.lead { left: 0; top: 0; z-index: 1; animation: ship-l .5s cubic-bezier(.2, .7, .2, 1) both; }
.ship.wing { right: 0; bottom: 0; animation: ship-r .5s cubic-bezier(.2, .7, .2, 1) .08s both; }
@keyframes ship-l { from { transform: translate(-115%, -6%); } }
@keyframes ship-r { from { transform: translate(115%, 6%); } }
.ship img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 3px; outline: 1px solid var(--ink-3); outline-offset: -1px; background: var(--plate); }
.ship figcaption { margin-top: 6px; height: 40px; display: flex; align-items: center; gap: 8px; }
.ship.lead figcaption { max-width: 60%; }
.ship figcaption > span:not(.patch) { display: flex; flex-direction: column; min-width: 0; }
.ship .cs { font: 600 18px/1.15 var(--font-num); letter-spacing: .03em; }
.ship .sub { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lockbox { position: absolute; inset: -8px -8px 38px; pointer-events: none; animation: lock .3s cubic-bezier(.3, .7, .3, 1) .62s both; }
.lockbox i { position: absolute; width: 18px; height: 18px; border: 0 solid var(--note); }
.lockbox i:nth-child(1) { left: 0; top: 0; border-width: 2px 0 0 2px; }
.lockbox i:nth-child(2) { right: 0; top: 0; border-width: 2px 2px 0 0; }
.lockbox i:nth-child(3) { left: 0; bottom: 0; border-width: 0 0 2px 2px; }
.lockbox i:nth-child(4) { right: 0; bottom: 0; border-width: 0 2px 2px 0; }
@keyframes lock { from { opacity: 0; transform: scale(.94); } }
.match-body { margin: 14px 0 4px; color: var(--ink-2); }
.match .rows { margin-bottom: 18px; }
.match-links { display: grid; gap: 10px; }
.match-links .sub { justify-self: start; font-size: 13px; }

/* ── Matches tab ────────────────────────────────────────── */
.list-pad { padding: 4px 16px 24px; }
.new-row, .like-row { list-style: none; margin: 12px 0 0; padding: 0 0 4px; display: flex; gap: 12px; overflow-x: auto; }
.new-item { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; padding: 0; border: 0; background: none; width: 76px; text-align: left; }
.new-item .thumb { position: relative; display: block; width: 76px; height: 100px; }
.new-item .thumb > img { width: 76px; height: 100px; object-fit: cover; border-radius: 3px; outline: 2px solid var(--note); outline-offset: -2px; background: var(--plate); display: block; }
.new-item .thumb .patch { position: absolute; left: 4px; bottom: 4px; }
.new-item > span:last-child { font: 600 14px/1.2 var(--font-num); letter-spacing: .03em; max-width: 76px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.muted { color: var(--ink-3); font-size: 14px; margin: 12px 0 0; }
/* likes you: the same thumbs as "new matches", hairline outline; a super like gets the annotation yellow and a small mark */
.like-item .thumb > img { outline-color: var(--rule-2); }
.like-item.is-super .thumb > img { outline-color: var(--note); }
.super-tag { position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; display: grid; place-items: center; background: var(--bg); color: var(--note); border-radius: 2px; }
.super-tag svg { width: 16px; height: 16px; }
.sec-h[tabindex]:focus { outline: none; }
.overlap .active { color: var(--ink-3); }
.block-list { list-style: none; margin: 4px 0 0; padding: 0; }
.block-list li { display: grid; grid-template-columns: 48px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.block-list .cs { font: 600 17px/1.2 var(--font-num); letter-spacing: .03em; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.block-list .btn-text { font-size: 13px; }

.roster { list-style: none; margin: 0; padding: 0; }
.roster li { border-bottom: 1px solid var(--rule); }
.roster-item {
  width: 100%; display: grid; grid-template-columns: 48px 1fr auto; gap: 12px; align-items: center;
  padding: 10px 0; background: none; border: 0; text-align: left;
}
.roster-item .t { display: flex; flex-direction: column; min-width: 0; }
.roster-item .t > span:first-child { display: flex; align-items: baseline; gap: 8px; }
.roster-item .cs { font: 600 18px/1.2 var(--font-num); letter-spacing: .03em; }
.roster-item .sub { color: var(--ink-3); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.roster-item .date { color: var(--ink-3); font-size: 13px; }
.paused-note { margin: 0; font-size: 12.5px; color: var(--note); }
.contact { padding: 0 0 10px; }
.contact-row { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin: 0 0 4px; font-size: 14px; }
.contact-row .k { color: var(--ink-3); font-size: 13px; }
.contact-name { font: 600 15px/1.4 var(--font-num); letter-spacing: .02em; user-select: all; }
.contact .hint { margin: 0 0 8px; }
.contact-extra { overflow-wrap: anywhere; }
.report-row, .block-row { display: flex; flex-wrap: wrap; gap: 0 18px; margin: 22px 0 8px; }
.report-row .btn-text, .block-row .btn-text { color: var(--ink-3); font-size: 13px; min-height: 32px; padding: 0; }
.radios.col { flex-direction: column; gap: 0; }
.ph-list { list-style: none; margin: 0; padding: 0; }
.ph-item { display: grid; grid-template-columns: 72px auto 1fr; align-items: center; gap: 4px 12px; padding: 8px 0; border-bottom: 1px solid var(--rule); }
.ph-item img { width: 72px; height: 54px; object-fit: cover; border: 1px solid var(--rule-2); background: var(--plate); }
.ph-n { color: var(--ink-3); font-size: 13px; }
.ph-ctl { display: flex; flex-wrap: wrap; gap: 0 10px; justify-content: flex-end; align-items: center; }
.ph-ctl .btn-text, .ph-ctl .btn-danger { font-size: 13px; min-height: 36px; }
.av-row { display: flex; align-items: center; gap: 14px; }
.av-row .ph-ctl { justify-content: flex-start; gap: 8px; }
.adm-top { padding: 6px 0 0; }
.adm-top .btn-text { padding: 0; }
.adm-tabs { display: flex; gap: 18px; margin: 6px 0 14px; border-bottom: 1px solid var(--rule); }
.adm-tabs .btn-text { text-decoration: none; color: var(--ink-3); border-bottom: 2px solid transparent; border-radius: 0; padding: 0 2px; }
.adm-tabs .btn-text[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--note); }
.adm-group { padding: 16px 0; border-bottom: 1px solid var(--rule-2); }
.adm-who { display: flex; gap: 14px; align-items: center; }
.adm-who p { margin: 0; }
.adm-who .cs { font: 600 18px/1.3 var(--font-num); letter-spacing: .03em; }
.adm-who .meta, .adm-reports .meta { font-size: 12.5px; color: var(--ink-3); overflow-wrap: anywhere; }
.adm-tag { margin-left: 6px; font: 500 12px/1 var(--font-num); color: var(--note); }
.adm-group .bio { margin: 10px 0 0; font-size: 14px; color: var(--ink-2); overflow-wrap: anywhere; }
.adm-photos { display: flex; gap: 8px; margin: 10px 0; }
.adm-photos img { width: 84px; height: 84px; object-fit: cover; border: 1px solid var(--rule-2); background: var(--plate); }
.adm-reports { list-style: none; margin: 0 0 10px; padding: 0; font-size: 14px; }
.adm-reports li { padding: 8px 0; border-top: 1px solid var(--rule); }
.adm-reports p { margin: 2px 0 0; overflow-wrap: anywhere; }
/* owner statistics: hairline plates and flat bars, no fills or glow */
.st-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.st-tile { background: var(--plate); border: 1px solid var(--rule-2); padding: 12px 12px 10px; min-width: 0; }
.st-tile p { margin: 0; }
.st-k { font-size: 12.5px; color: var(--ink-3); }
.st-v { font-size: 30px; line-height: 1.15; font-weight: 600; color: var(--ink); }
.st-s { font-size: 12px; color: var(--ink-3); }
.st-h { margin: 26px 0 8px; font: 500 12px/1.3 var(--font-zh); letter-spacing: .08em; color: var(--ink-3); border-bottom: 1px solid var(--rule-2); padding-bottom: 6px; }
.st-chart { margin: 14px 0 0; }
.st-chart figcaption { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; color: var(--ink-2); }
.st-bars { display: flex; align-items: flex-end; gap: 2px; height: 64px; margin-top: 6px; border-bottom: 1px solid var(--rule-2); }
.st-bars i { flex: 1 1 0; min-width: 0; background: var(--f); }
.st-bars i.z { background: var(--rule-2); }
.st-axis { display: flex; justify-content: space-between; margin-top: 3px; font-size: 11.5px; color: var(--ink-3); }
.st-note { margin: 4px 0 0; font-size: 12px; color: var(--ink-3); }
.st-dist { margin-top: 16px; }
.st-dist h3 { margin: 0 0 4px; font: 500 13px/1.3 var(--font-zh); color: var(--ink-2); }
.st-dist ul { list-style: none; margin: 0; padding: 0; }
.st-dist li { display: grid; grid-template-columns: minmax(5em, 38%) 1fr auto; gap: 10px; align-items: center; padding: 4px 0; font-size: 14px; }
.st-l { overflow-wrap: anywhere; }
.st-bar { height: 8px; background: var(--rule); }
.st-bar i { display: block; height: 100%; background: var(--f); }
.st-n { font-size: 13px; color: var(--ink-3); text-align: right; min-width: 4.5em; }
.st-defs ul { margin: 0; padding-left: 18px; font-size: 13px; color: var(--ink-3); }
.st-defs li { margin: 4px 0; }
.sheet-foot > .paused-note { padding: 0 0 8px; }
.roster-item:hover .cs { text-decoration: underline; text-underline-offset: 3px; }

/* ── Profile form ───────────────────────────────────────── */
.banner { margin: 14px 0 0; padding: 0 0 0 10px; border-left: 2px solid var(--note); color: var(--ink-2); font-size: 14px; }
.field { padding: 12px 0 0; }
fieldset.field { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset.field > legend { float: left; width: 100%; padding: 12px 0 0; }
fieldset.field > legend + * { clear: both; }
.field-label { display: block; font-size: 13px; color: var(--ink-3); margin-bottom: 6px; }
.field-label .req { color: var(--note); margin-left: 2px; }
.input {
  width: 100%; min-height: 42px; padding: 8px 10px;
  background: var(--page); border: 1px solid var(--rule-2); border-radius: 3px;
}
.input:focus-visible { outline: 2px solid var(--note); outline-offset: 0; border-color: transparent; }
.input[aria-invalid="true"] { border-color: var(--b); }
textarea.input { min-height: 96px; resize: vertical; line-height: 1.55; }
.input-num { width: 7em; font-family: var(--font-num); font-variant-numeric: tabular-nums; font-size: 17px; }
.inline { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.counter { display: block; text-align: right; font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.err { margin: 6px 0 0; color: var(--b); font-size: 13px; }

.hint { margin: 6px 0 0; font-size: 12.5px; color: var(--ink-3); line-height: 1.5; }

.checks { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--rule); }
.checks.two { grid-template-columns: repeat(2, 1fr); }
.checks[aria-invalid="true"] { border-top-color: var(--b); }
.check {
  display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 4px 8px 4px 0;
  border-bottom: 1px solid var(--rule); font-size: 15px; cursor: pointer; min-width: 0;
}
.check > span { overflow-wrap: anywhere; }
.check input, .radio input, .toggle input { accent-color: var(--f); width: 18px; height: 18px; margin: 0; flex: none; }
.check .num { font-size: 15px; }
.radios { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.radio { display: flex; align-items: center; gap: 8px; min-height: 40px; cursor: pointer; font-size: 14px; }

/* Segmented choice: hairline grid of cells (1px gap over the rule colour), the picked cell fills on selection. */
.seg {
  --n: 3;
  display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 1px;
  background: var(--rule-2); border: 1px solid var(--rule-2); border-radius: 3px; overflow: hidden;
}
.seg label { position: relative; display: flex; cursor: pointer; }
.seg input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.seg label > span {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; text-align: center;
  min-height: 48px; padding: 6px 8px; background: var(--bg); color: var(--ink-2); font-size: 15px; line-height: 1.3;
  transition: background-color .12s, color .12s;
}
.seg label:hover > span { color: var(--ink); background: #191a1d; }
.seg label > input:checked + span { background: #1d283d; color: var(--ink); box-shadow: inset 0 -2px 0 var(--f); }
.seg input:focus-visible + span { outline: 2px solid var(--note); outline-offset: -2px; }
.seg.col label > span { justify-content: flex-start; padding-left: 14px; }
.seg.col .num { width: 1em; color: var(--ink-3); font-size: 16px; }
.seg[aria-invalid="true"] { border-color: var(--b); background: var(--b); }
.toggle { display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 4px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); cursor: pointer; font-size: 15px; }
.toggle input:checked + span { color: var(--note); }
.toggle + .hint { margin-top: 6px; }
.note-flak { color: var(--note); }

.slots-form td { padding: 0; }
.slots-form label { display: flex; justify-content: center; align-items: center; min-height: 46px; cursor: pointer; }
.slots-form input { accent-color: var(--f); width: 16px; height: 16px; margin: 0; }
.slots-form[aria-invalid="true"] thead th { color: var(--b); }

.reimport { margin: 10px 0 0; }
.rec { display: inline-flex; align-items: baseline; gap: 10px; color: var(--ink-2); font-size: 14px; }
.rec .num { font-size: 16px; }

/* ── Fleet picker ───────────────────────────────────────── */
.tray-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.tray-title { margin: 0; font-size: 13px; font-weight: 400; color: var(--ink-3); }
.tray-head .num { color: var(--ink-2); font-size: 15px; }
#f-fleet { outline-offset: 2px; }
#f-fleet[aria-invalid="true"] .tray { border-top-color: var(--b); }
.tray { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink-3); }
.tray-row { padding: 8px 0 10px; border-bottom: 1px solid var(--rule); }
.tray-row.is-main { box-shadow: inset 2px 0 0 var(--note); padding-left: 10px; }
.tray-top { display: flex; align-items: center; gap: 8px; }
.tray-name { flex: 1; min-width: 0; font: 600 18px/1.2 var(--font-num); letter-spacing: .02em; overflow-wrap: anywhere; }
.tray-sim { display: block; font: 400 12px/1.3 var(--font-zh); letter-spacing: 0; color: var(--ink-3); }
.main-btn {
  min-height: 40px; min-width: 52px; padding: 0 10px;
  background: none; border: 1px solid var(--rule-2); border-radius: 3px; color: var(--ink-3); font-size: 13px;
}
.main-btn:hover { color: var(--ink); border-color: var(--ink-3); }
.main-btn[aria-pressed="true"] { background: var(--note); border-color: var(--note); color: var(--bg); font-weight: 500; }
.rm-btn { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; background: none; border: 1px solid transparent; border-radius: 3px; color: var(--ink-3); }
.rm-btn:hover { color: var(--b); border-color: var(--rule-2); }
.rm-btn svg { width: 18px; height: 18px; }
.tray-row .seg { margin-top: 8px; }
.tray-row .seg label > span { min-height: 42px; font-size: 14px; }
.tray-empty { padding: 14px 0; color: var(--ink-3); font-size: 14px; border-bottom: 1px solid var(--rule); }
.sim-cat { margin-top: 18px; }
.sim-cat > .input { font-size: 16px; }   /* 16px: no iOS zoom on focus */
.grp { border-bottom: 1px solid var(--rule); }
.grp:first-of-type { margin-top: 8px; border-top: 1px solid var(--rule-2); }
.grp summary {
  display: flex; align-items: center; gap: 10px; min-height: 48px; cursor: pointer; list-style: none;
  font-size: 15px; color: var(--ink);
}
.grp summary::-webkit-details-marker { display: none; }
.grp summary > span:first-child { flex: 1; }
.grp-n { color: var(--ink-3); font-size: 15px; }
.chev svg { display: block; width: 18px; height: 18px; color: var(--ink-3); transition: transform .15s; }
.grp[open] > summary .chev svg { transform: rotate(180deg); }
.grp .checks { border-top: 1px solid var(--rule); margin-bottom: 8px; }
.checks.one { grid-template-columns: 1fr; }
/* Multi-seat catalog row: looks like a checkbox row; tapping expands the seat choices inline. */
.seat-entry { border-bottom: 1px solid var(--rule); }
.seat-entry > .check { border-bottom: 0; }
.seat-row { width: 100%; background: none; border: 0; color: inherit; text-align: left; }
.seat-row:disabled { opacity: .45; }
.seat-row .box {
  display: grid; place-items: center; flex: none; width: 18px; height: 18px;
  background: #3b3b3b; border: 1px solid #858585; border-radius: 3px; color: transparent;
}
.seat-row .box svg { width: 14px; height: 14px; }
.seat-row.on .box { background: var(--f); border-color: var(--f); color: var(--bg); }
.seat-name { flex: 1; min-width: 0; }
.seat-cur { font-size: 13px; color: var(--note); white-space: nowrap; }
.seat-row .chev svg { display: block; width: 18px; height: 18px; color: var(--ink-3); transition: transform .15s; }
.seat-entry.open .seat-row .chev svg { transform: rotate(180deg); }
.seat-panel { padding: 0 0 10px 28px; }
.seat-pick {
  --n: 3; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 1px;
  background: var(--rule-2); border: 1px solid var(--rule-2); border-radius: 3px; overflow: hidden;
}
.seat-pick button { min-height: 48px; padding: 6px 8px; border: 0; background: var(--bg); color: var(--ink-2); font-size: 14px; line-height: 1.3; }
.seat-pick button:hover { color: var(--ink); background: #191a1d; }
.seat-pick button[aria-checked="true"] { background: #1d283d; color: var(--ink); box-shadow: inset 0 -2px 0 var(--f); }
.seat-pick button:focus-visible { outline: 2px solid var(--note); outline-offset: -2px; }
.seat-rm { margin-top: 4px; color: var(--b); font-size: 13px; }

/* ── Onboarding wizard ──────────────────────────────────── */
.wz { min-height: 100%; display: flex; flex-direction: column; }
.wz-form { flex: 1; display: flex; flex-direction: column; }
.wz-prog { position: sticky; top: 0; z-index: 3; height: 3px; background: var(--rule); }
.wz-prog i { display: block; height: 100%; width: calc(var(--v) * 100%); background: var(--f); transition: width .25s ease; }
.wz-head { padding: 20px 16px 2px; }
.wz-head .kicker { font-size: 14px; }
.wz-title { margin: 0 0 6px; font-size: 26px; font-weight: 500; line-height: 1.25; }
.wz-title:focus { outline: none; }
.wz-lead { margin: 0; color: var(--ink-2); font-size: 14px; max-width: 34em; }
.wz-body { flex: 1; padding: 4px 16px 24px; }
.wz-body > .rows { margin-top: 14px; }
.wz-foot {
  position: sticky; bottom: 0; z-index: 3;
  display: grid; grid-template-columns: minmax(96px, auto) 1fr; gap: 10px; align-items: center;
  padding: 10px 16px; background: var(--bg); border-top: 1px solid var(--rule);
}
.wz-foot .btn { min-height: 52px; font-size: 16px; }
.wz-foot .status { grid-column: 1 / -1; font-size: 13px; color: var(--ink-3); }
.wz-foot .status:empty { display: none; }

/* ── Filter dialog ──────────────────────────────────────── */
.filter { height: auto; max-height: 90%; margin: auto auto 0; border-top: 1px solid var(--rule-2); }
.filter form { padding: 18px 18px 20px; }
.filter h2 { margin: 0 0 4px; font-size: 18px; font-weight: 500; }
.filter fieldset { border: 0; margin: 14px 0 0; padding: 0; min-width: 0; }
.filter legend { padding: 0; margin-bottom: 4px; font-size: 13px; color: var(--ink-3); }
.filter .btn-row { margin-top: 18px; justify-content: flex-end; }

.crop h2 { margin-bottom: 6px; }
.crop-frame {
  position: relative; overflow: hidden; margin: 14px auto 0; background: var(--plate); border: 1px solid var(--rule-2); border-radius: 4px;
  --ar: .7; aspect-ratio: var(--ar); width: min(100%, calc((100dvh - 330px) * var(--ar))); min-width: 160px;
  touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none;
}
.crop-frame:active { cursor: grabbing; }
.crop-frame:focus-visible { outline: 2px solid var(--note); outline-offset: 2px; }
.crop-band {
  position: absolute; left: 0; right: 0; bottom: 0; height: 26%; display: flex; align-items: flex-end; padding: 6px 8px;
  background: rgba(20, 21, 23, .55); border-top: 1px dashed var(--ink-3); font-size: 11px; color: var(--ink-2); pointer-events: none;
}
.crop-zoom { display: flex; align-items: center; gap: 12px; margin-top: 14px; font-size: 13px; color: var(--ink-3); }
.crop-zoom input { flex: 1; min-width: 0; min-height: 32px; accent-color: var(--f); }
.crop .btn-row { justify-content: space-between; }

/* ── Toast ──────────────────────────────────────────────── */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabs-h) + var(--act-h) + 10px); z-index: 50;
  transform: translateX(-50%);
  max-width: min(400px, calc(100vw - 32px));
  margin: 0; padding: 9px 14px;
  background: var(--plate); border: 1px solid var(--rule-2); border-left: 2px solid var(--note); border-radius: 2px;
  font-size: 14px;
  opacity: 0; pointer-events: none; transition: opacity .15s;
}
.toast.show { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-delay: 0s !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ── Intro overlay ─────────────────────────────────────────
   Timeline (s): 0.00 lead (F-16) rises into frame, smoke on
                 0.15 No.2's station shown dashed
                 0.30 No.2 (F-14) joins from behind, settles with a small overrun (1.10)
                 0.95 station drops out; 1.05 lock brackets close once; 1.10 ship numbers
                 1.30 WINGDR types in, 60 ms per letter (done 1.76)
                 2.10 overlay fades, page underneath (2.50) */
.intro {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  background: var(--page);
  animation: intro-out .4s ease 2.1s forwards;
  cursor: pointer;
}
.intro.is-skip { animation: skip-out .2s ease forwards; }
@keyframes skip-out { to { opacity: 0; visibility: hidden; pointer-events: none; } }
@keyframes intro-out { to { opacity: 0; visibility: hidden; pointer-events: none; } }

.lockup { display: flex; flex-direction: column; align-items: center; gap: clamp(26px, 6vmin, 42px); width: min(58vmin, 300px); }
.mark { width: 100%; height: auto; display: block; overflow: visible; }
.word { width: 92%; height: auto; display: block; color: var(--ink); overflow: visible; }

/* Ships fly in from below the viewport (in metres: the mark is drawn to scale). */
.lead { animation: rise-lead .6s cubic-bezier(.2, .7, .2, 1) both; }
.wing { animation: rise-wing .8s cubic-bezier(.25, .7, .3, 1) .3s both; }
@keyframes rise-lead { from { transform: translateY(56px); } }
@keyframes rise-wing { 0% { transform: translateY(62px); } 78% { transform: translateY(-.7px); } 100% { transform: none; } }
.station { opacity: 0; animation: station 1.15s linear forwards; }
@keyframes station { 0%, 13% { opacity: 0; } 14%, 82% { opacity: 1; } 100% { opacity: 0; } }
.lock { transform-box: fill-box; transform-origin: 50% 50%; animation: lock .3s cubic-bezier(.3, .7, .3, 1) 1.05s both; }
@keyframes lock { from { opacity: 0; transform: scale(1.16); } }
.no { font: 600 5px/1 var(--font-num); fill: var(--ink-3); letter-spacing: .3px; animation: no-in .15s ease 1.1s both; }
@keyframes no-in { from { opacity: 0; } }
.word > g { animation: type-in .16s ease-out both; animation-delay: calc(1.3s + var(--i) * .06s); }
@keyframes type-in { from { opacity: 0; transform: translateY(18px); } }
.tag-other { display: inline-block; margin-left: 6px; padding: 1px 5px; border: 1px solid currentColor; border-radius: 3px; font: 500 11px/1.3 var(--font-zh); letter-spacing: 0; opacity: .75; vertical-align: middle; }
.other-add { display: flex; gap: 8px; padding: 8px 0; }
.other-add .input { flex: 1; min-width: 0; }

/* ── creator card (site owner, .is-creator on the deck card and on #dlg-profile): pink→lavender glow ── */
.is-creator { color: var(--ink); }                        /* body colour is inherited as a value: re-set it here */
.is-creator .bars { --ink: #fff; }
.is-creator .bars span:not(.on) { background: rgba(255, 255, 255, .28); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .5); }
.is-creator .who .cs { background: var(--cr-name); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: 2px; }
.is-creator .meter i.on, .is-creator .slot-mark.on { background: var(--cr-acc); border-color: transparent; }
.is-creator .btn:disabled { opacity: 1; }
/* Gradient hairline frame on the card (::after already draws the 1px frame in wingman.css). */
.card.is-creator::after {
  border: 1.5px solid transparent; background: var(--cr-frame) border-box;
  -webkit-mask: linear-gradient(#000 0 0) padding-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}

/* the photo melts into a luminous pink→lavender card that glows on the dark app */
.is-creator {
  --bg: #f7d5ec; --plate: #f7d5ec;
  --ink: #2a1c40; --ink-2: #3f3159; --ink-3: #574873;
  --rule: rgba(255, 255, 255, .6); --rule-2: rgba(255, 255, 255, .85);
  --note: #a01f66;
  --cr-grad: radial-gradient(90% 45% at 90% 100%, rgba(255, 255, 255, .6), rgba(255, 255, 255, 0) 70%),
             radial-gradient(70% 40% at 0% 70%, rgba(255, 196, 228, .7), rgba(255, 196, 228, 0) 70%),
             linear-gradient(175deg, #ffd3e9 0%, #f8d1ee 50%, #dcd1ff 100%);
  --cr-name: linear-gradient(95deg, #c8237a 0%, #9a2fa6 55%, #6c3fd0 100%);
  --cr-acc:  linear-gradient(90deg, #e2559a, #8a62e0);
  --cr-frame: linear-gradient(160deg, #ffb6da, #ffffff 45%, #c9b5ff);
}
.card.is-creator {
  border-radius: 14px; background: var(--cr-grad);
  box-shadow: 0 0 18px rgba(255, 130, 195, .45), 0 0 48px rgba(190, 140, 255, .28);
}
.card.is-creator .photo-img, .sheet.is-creator .sheet-photo .photo-img { background: transparent; }
.card.is-creator .photo-img { -webkit-mask-image: linear-gradient(to bottom, #000 58%, transparent 84%); mask-image: linear-gradient(to bottom, #000 58%, transparent 84%); }
.card.is-creator .card-info { background: linear-gradient(to bottom, rgba(255, 212, 236, .92), rgba(255, 212, 236, 0) 75%); border-top: 0; }   /* continues the haze: no seam */
.card.is-creator .nose { background: linear-gradient(to top, rgba(255, 212, 236, .92), rgba(255, 212, 236, 0)); }   /* the existing scrim, recoloured */
.card.is-creator .nose b { background: var(--cr-name); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 10px rgba(255, 255, 255, .8)); }
.card.is-creator .nose-cell i { color: var(--note); }
.is-creator .patch { border: 3px solid #fff; outline: 0; box-shadow: 0 0 0 1px rgba(255, 160, 210, .7), 0 4px 18px rgba(225, 85, 160, .35); }
.is-creator .icon-btn { background: rgba(255, 255, 255, .62); border-color: #fff; color: var(--ink); }
.sheet.is-creator { background: var(--cr-grad); }
.sheet.is-creator .sheet-photo { background: transparent; border-bottom: 0; }
.sheet.is-creator .sheet-photo .photo-img { -webkit-mask-image: linear-gradient(to bottom, #000 74%, transparent 100%); mask-image: linear-gradient(to bottom, #000 74%, transparent 100%); }
.sheet.is-creator .sheet-close { box-shadow: 0 2px 12px rgba(200, 80, 150, .25); }
.sheet.is-creator .sec-h { color: var(--note); }
.sheet.is-creator .slot-mark:not(.on) { background: rgba(255, 255, 255, .55); border-color: #fff; }
.sheet.is-creator .btn:not(.btn-text) { background: rgba(255, 255, 255, .55); border-color: #fff; }
.sheet.is-creator .sheet-foot { background: rgba(255, 255, 255, .32); border-top-color: rgba(255, 255, 255, .85); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.sheet.is-creator .act { background: rgba(255, 255, 255, .75); border-color: #fff; box-shadow: 0 3px 14px rgba(200, 80, 150, .2); }
.sheet.is-creator .act-pass  { --c: #b8225c; }
.sheet.is-creator .act-super { --c: #8f2c8f; }
.sheet.is-creator .act-like  { --c: #fff; background: var(--cr-acc); }

/* ── My profile: hub + edit pages (replaces the one-page edit form; the onboarding wizard is untouched) ──
   Two heading levels only: .edp-title (page title, 18px) and .sec-h (group label, 12px, already in wingman.css).
   Rule of the screen: whatever sits on the hub takes effect at once (switches); everything behind a chevron is a page with a Save bar. */

/* Hub */
.hub { padding: 0 16px 40px; }
.hub-id { display: flex; align-items: flex-start; gap: 14px; padding: 18px 0 4px; }
.hub-who { flex: 1; min-width: 0; }
.hub-cs { margin: 2px 0 0; font: 600 24px/1.15 var(--font-num); letter-spacing: .02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hub-sum { margin: 2px 0 10px; font-size: 13px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hub-off { color: var(--note); }
.hub .banner { margin-top: 12px; }
.hub-list { list-style: none; margin: 0; padding: 0; }
.hub-list > li { border-bottom: 1px solid var(--rule); }
.hub-row {
  width: 100%; min-height: 60px; display: flex; align-items: center; gap: 12px;
  padding: 9px 0; background: none; border: 0; color: inherit; text-align: left; text-decoration: none; cursor: pointer;
}
.hub-row:focus-visible { outline-offset: -2px; }
.hub-row:hover .hub-k { text-decoration: underline; text-underline-offset: 3px; }
.hub-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.hub-k { font-size: 15px; line-height: 1.4; color: var(--ink); }
.hub-v { font-size: 13px; line-height: 1.45; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hub-flag { flex: none; font-size: 12px; letter-spacing: .04em; color: var(--note); }   /* same yellow as the required-field asterisk; red stays for errors after a save attempt */
.hub-chev { flex: none; width: 18px; height: 18px; color: var(--ink-3); }
.hub-chev svg { display: block; width: 100%; height: 100%; transform: rotate(-90deg); }   /* the existing "down" icon, turned */
/* Switch rows: the whole row is the label; the hint may wrap to two lines. */
.hub-sw .hub-row:hover .hub-k { text-decoration: none; }
.hub-sw .hub-v { white-space: normal; }
.hub-danger { margin-top: 28px; }
.hub-danger .hint { margin: 0 0 12px; }

/* Panel switch: square-cornered like the segmented controls, flat fill when on. A native checkbox with role="switch". */
.switch {
  -webkit-appearance: none; appearance: none; flex: none; position: relative;
  width: 46px; height: 26px; margin: 0; cursor: pointer;
  background: var(--page); border: 1px solid var(--rule-2); border-radius: 3px;
  transition: background-color .12s, border-color .12s;
}
.switch::before {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 2px;
  background: var(--ink-3); transition: transform .12s, background-color .12s;
}
.switch:checked { background: #1d283d; border-color: var(--f); }
.switch:checked::before { transform: translateX(20px); background: var(--f); }
.switch:disabled { cursor: not-allowed; opacity: .45; }
.switch:focus-visible { outline: 2px solid var(--note); outline-offset: 2px; }

/* Edit page */
.edp { min-height: 100%; display: flex; flex-direction: column; }
.edp-top {
  position: sticky; top: 0; z-index: 3; flex: none;
  display: flex; align-items: center; gap: 2px; height: 52px; padding: 0 16px 0 4px;
  background: var(--bg); border-bottom: 1px solid var(--rule);
}
.edp-back { flex: none; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; background: none; border: 0; border-radius: 3px; color: var(--ink); }
.edp-back svg { width: 22px; height: 22px; transform: rotate(90deg); }
.edp-back:hover { background: rgba(235, 232, 225, .06); }
.edp-title { margin: 0; min-width: 0; font-size: 18px; font-weight: 500; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.edp-title:focus { outline: none; }
.edp-body { flex: 1; padding: 4px 16px 28px; }
.edp-body > .reimport { margin: 12px 0 0; }
.edp-foot {
  position: sticky; bottom: 0; z-index: 3; flex: none;
  display: flex; align-items: center; gap: 12px; padding: 10px 16px;
  background: var(--bg); border-top: 1px solid var(--rule);
}
.edp-status { flex: 1; min-width: 0; margin: 0; font-size: 13px; line-height: 1.4; color: var(--ink-3); }
.edp-status.is-err { color: var(--b); }
.edp-foot .btn { min-height: 48px; min-width: 112px; font-size: 16px; }
.edp-foot .btn-primary:disabled { border-color: var(--rule-2); }
/* "Discard changes?" uses the .filter bottom sheet; a fixed modal with top and bottom both at 0 would stretch to 90%, so let it hug its content. */
.edp-confirm { top: auto; }
