/* ============================================================================
   styles.css — Seniority Console
   EFB / flight-deck instrument readout. Slate panels, mono tabular numerals,
   amber for the pilot's own seat. Signature: paired Captain / First Officer
   bid tables under each base band.
   ========================================================================== */

:root {
  --bg:        #11161d;
  --panel:     #1a222c;
  --panel-2:   #202b37;
  --line:      #2c3a48;
  --ink:       #e8edf2;
  --dim:       #8a99a8;
  --amber:     #f2b33d;
  --green:     #4cc38a;
  --red:       #d4636b;
  --font-disp: "Barlow Condensed", sans-serif;
  --font-body: "IBM Plex Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: 15px; line-height: 1.45;
  /* Notch/Dynamic Island clearance -- resolves to 0 on the website (Safari's
     own chrome already reserves this space there) and only matters in the
     native app / installed-PWA fullscreen context, where content otherwise
     draws under the status bar. Requires viewport-fit=cover (index.html). */
  padding-top: env(safe-area-inset-top);
}
.mono  { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.amber { color: var(--amber); }

/* ---- Top bar ------------------------------------------------------------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; padding: 0.9rem 1.5rem;
  border-bottom: 1px solid var(--line); background: var(--panel);
}
.brand { display: flex; align-items: baseline; gap: 0.75rem; }
.brand-mark {
  font-family: var(--font-disp); font-weight: 700; font-size: 1.6rem;
  letter-spacing: 0.18em; color: var(--amber);
}
.brand-mark-img { height: 2rem; width: auto; vertical-align: middle; display: inline-block; }
.brand-sub { color: var(--dim); font-size: 0.85rem; letter-spacing: 0.04em; }

.tabs { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.tab {
  font-family: var(--font-disp); font-weight: 600; font-size: 1.05rem;
  letter-spacing: 0.08em; text-transform: uppercase;
  background: none; border: 1px solid var(--line); border-radius: 4px;
  color: var(--dim); padding: 0.45rem 1.1rem; cursor: pointer;
}
.tab.active { color: var(--ink); border-color: var(--amber); }
.tab:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.tab:disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

.page { max-width: 1180px; margin: 0 auto; padding: 1.5rem; }

/* ---- Offline mode banner (native app only, see network-status.js) -------- */
#offline-banner {
  background: var(--red); color: #2a0d0f;
  font-family: var(--font-disp); font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; text-align: center;
  padding: 0.5rem; font-size: 0.85rem;
  position: sticky; top: 0; z-index: 50;
}

/* ---- First-sync overlay (native only, see offline-sync.js) --------------- */
#sync-overlay {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: rgba(11, 15, 20, 0.92);
  padding-top: env(safe-area-inset-top);
}
/* The plain #sync-overlay rule above (display: flex) has higher specificity
   than the browser's default [hidden] { display: none } rule, so without
   this override the overlay showed unconditionally on every page load
   regardless of the hidden attribute -- nothing ever needed to call
   showSyncOverlay() for it to be visible. */
#sync-overlay[hidden] { display: none; }
.sync-box { display: flex; flex-direction: column; align-items: center; gap: 1.1rem;
  max-width: 320px; padding: 0 1.5rem; text-align: center; }
.sync-spinner {
  width: 40px; height: 40px; border-radius: 50%;
  border: 3px solid rgba(242, 179, 61, 0.25); border-top-color: var(--amber);
  animation: sync-spin 0.8s linear infinite;
}
#sync-overlay-text { color: var(--ink); font-size: 0.95rem; margin: 0; }
@keyframes sync-spin { to { transform: rotate(360deg); } }

/* ---- Lookup bar ---------------------------------------------------------- */
.lookup-bar {
  display: flex; gap: 0.9rem; align-items: center; flex-wrap: wrap;
  background: var(--panel); border: 1px solid var(--line); border-radius: 6px;
  padding: 1rem 1.2rem;
}
.mode-toggle { display: flex; gap: 1rem; color: var(--dim); font-size: 0.9rem; }
.mode-toggle input { accent-color: var(--amber); margin-right: 0.3rem; }
#lookup-input, #ae-input {
  flex: 1; min-width: 220px;
  font-family: var(--font-mono); font-size: 1.05rem;
  background: var(--bg); color: var(--ink);
  border: 1px solid var(--line); border-radius: 4px; padding: 0.55rem 0.8rem;
}
#lookup-input:focus-visible, #ae-input:focus-visible { outline: 2px solid var(--amber); outline-offset: 1px; }
#lookup-btn, #ae-btn {
  font-family: var(--font-disp); font-weight: 600; font-size: 1rem;
  letter-spacing: 0.08em; text-transform: uppercase;
  background: var(--amber); color: #1a1408; border: none; border-radius: 4px;
  padding: 0.6rem 1.4rem; cursor: pointer;
}
#lookup-btn:hover, #ae-btn:hover { filter: brightness(1.08); }
#lookup-btn:focus-visible, #ae-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.msg   { color: var(--red); margin: 0.9rem 0 0; }
.empty { color: var(--dim); margin-top: 2.5rem; text-align: center; }

/* ---- Pilot identity card ------------------------------------------------- */
.pilot-card {
  display: flex; gap: 2.5rem; flex-wrap: wrap;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px;
  padding: 0.9rem 1.2rem; margin: 1.2rem 0;
}
.pilot-card > div { display: flex; flex-direction: column; }
.pc-label { color: var(--dim); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; }
.pc-val   { font-size: 1.15rem; font-weight: 600; }

/* ---- Base section -------------------------------------------------------- */
.base-section { margin-bottom: 1.6rem; }
.base-band {
  display: flex; align-items: baseline; gap: 1rem;
  background: var(--panel); border: 1px solid var(--line);
  border-bottom: none; border-radius: 6px 6px 0 0;
  padding: 0.5rem 1rem;
}
.bb-name {
  font-family: var(--font-disp); font-weight: 700; font-size: 1.45rem;
  letter-spacing: 0.16em; color: var(--ink);
}
.bb-sum  { color: var(--dim); font-size: 0.95rem; }
.bb-sum b { color: var(--amber); font-family: var(--font-mono); }

/* ---- Seat pair (Captain | First Officer) --------------------------------- */
.seat-pair {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
  background: var(--line);                       /* gap line between tables */
  border: 1px solid var(--line); border-top: none; border-radius: 0 0 6px 6px;
  overflow: hidden;
}
.seat-table {
  width: 100%; border-collapse: collapse; background: var(--bg);
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: 0.9rem;
}
.seat-table caption {
  caption-side: top;
  font-family: var(--font-disp); font-weight: 700; font-size: 1.05rem;
  letter-spacing: 0.12em; text-transform: uppercase;
  padding: 0.4rem; color: var(--ink); background: var(--panel-2);
}
.seat-table caption.cap-a { box-shadow: inset 0 -2px 0 #5b9bd5; }
.seat-table caption.cap-b { box-shadow: inset 0 -2px 0 #9a7fd1; }

.seat-table thead th {
  font-family: var(--font-disp); font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--dim); background: var(--panel);
  border: 1px solid var(--line); padding: 0.3rem 0.5rem; text-align: center;
}
.seat-table thead .sub th { font-size: 0.82rem; }
.seat-table tbody td {
  border: 1px solid #1e2935; padding: 0.34rem 0.6rem; text-align: center;
}
.seat-table td.num   { text-align: right; }
.seat-table td.equip { text-align: left; font-weight: 600; color: var(--ink); }
.seat-table tbody tr:hover { background: #1d2733; }
.seat-table td.none { color: var(--dim); text-align: center; padding: 0.8rem; }

/* state colors */
.pct.ok { color: var(--green); font-weight: 600; }
.nq     { color: var(--red);   font-weight: 600; }
td.dim  { color: var(--dim); }
.net-up { color: var(--green); font-weight: 600; }
.net-dn { color: var(--red); }
.bb-arrow { color: var(--amber); padding: 0 0.25rem; }
.award-note {
  background: rgba(242, 179, 61, 0.10); border: 1px solid rgba(242, 179, 61, 0.35);
  border-radius: 6px; color: var(--amber); font-size: 0.9rem;
  padding: 0.6rem 0.9rem; margin: 0 0 1rem;
}

/* the pilot's own current seat */
tr.own td { background: rgba(242, 179, 61, 0.13); color: var(--amber); }
tr.own td.equip { box-shadow: inset 3px 0 0 var(--amber); }
tr.own .pct.ok { color: var(--amber); }

/* ---- View toggle (show hidden categories) -------------------------------- */
.view-toggle {
  display: inline-flex; align-items: center; gap: 0.45rem;
  color: var(--dim); font-size: 0.85rem; margin: 0 0 1rem;
  cursor: pointer; user-select: none;
}
.view-toggle input { accent-color: var(--amber); width: 1rem; height: 1rem; }
.view-toggle:hover { color: var(--ink); }

/* ---- Legend -------------------------------------------------------------- */
.legend { color: var(--dim); font-size: 0.82rem; margin-top: 1rem; display: flex;
          align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.key { width: 0.9rem; height: 0.9rem; border-radius: 2px; display: inline-block;
       vertical-align: middle; margin-right: 0.15rem; }
.key-hold { background: var(--green); }
.key-nq   { background: var(--red); }
.key-own  { background: var(--amber); }

/* ---- Stats page ---------------------------------------------------------- */
.stat-cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1rem; margin-bottom: 1.5rem;
}
.stat {
  background: var(--panel); border: 1px solid var(--line); border-radius: 6px;
  padding: 1rem 1.2rem; display: flex; flex-direction: column;
}
.stat-num   { font-size: 1.9rem; font-weight: 600; }
.stat-label { color: var(--dim); font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase; }

.charts { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.chart-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 6px;
  padding: 1rem 1.2rem;
}
.chart-card.wide { grid-column: 1 / -1; }
.chart-card h2 {
  font-family: var(--font-disp); font-weight: 600; font-size: 1.05rem;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); margin: 0 0 0.8rem;
}
.chart-title-date {
  font-family: var(--font-mono); font-weight: 500; font-size: 0.8rem;
  letter-spacing: normal; text-transform: none; color: var(--ink);
}

@media (max-width: 820px) {
  .seat-pair { grid-template-columns: 1fr; }
  .charts { grid-template-columns: 1fr; }
  .pilot-card { gap: 1.2rem; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---- Footer / admin link --------------------------------------------------- */
.footer {
  max-width: 1180px; margin: 2rem auto 0; padding: 0.8rem 1.5rem 1.4rem;
  border-top: 1px solid var(--line); text-align: right;
}
.footer a { color: var(--dim); font-size: 0.8rem; text-decoration: none; }
.footer a:hover, .footer a:focus-visible { color: var(--amber); }

/* ---- Modals ----------------------------------------------------------------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(8, 11, 15, 0.72);
  display: flex; align-items: center; justify-content: center; z-index: 50;
}
.modal-backdrop[hidden] { display: none; }
.modal {
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: 1.4rem 1.6rem; width: min(92vw, 360px);
}
.modal-wide { width: min(92vw, 560px); }
.modal h2 {
  font-family: var(--font-disp); font-weight: 700; font-size: 1.25rem;
  letter-spacing: 0.08em; text-transform: uppercase; margin: 0 0 1rem;
}
.modal label { display: block; color: var(--dim); font-size: 0.85rem; margin-bottom: 0.8rem; }
.modal input {
  display: block; width: 100%; margin-top: 0.25rem;
  font-family: var(--font-mono); font-size: 1rem;
  background: var(--bg); color: var(--ink);
  border: 1px solid var(--line); border-radius: 4px; padding: 0.5rem 0.7rem;
}
.modal input:focus-visible { outline: 2px solid var(--amber); outline-offset: 1px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 0.6rem; margin-top: 1rem; }

button.primary {
  font-family: var(--font-disp); font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; font-size: 0.95rem;
  background: var(--amber); color: #1a1408; border: none; border-radius: 4px;
  padding: 0.5rem 1.2rem; cursor: pointer;
}
button.primary:hover { filter: brightness(1.08); }
button.ghost {
  font-family: var(--font-disp); font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; font-size: 0.95rem;
  background: none; color: var(--dim);
  border: 1px solid var(--line); border-radius: 4px;
  padding: 0.5rem 1.2rem; cursor: pointer;
}
button.ghost:hover { color: var(--ink); border-color: var(--dim); }
button.ghost:disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }
button.primary:focus-visible, button.ghost:focus-visible {
  outline: 2px solid var(--amber); outline-offset: 2px;
}

.err-title { color: var(--red); }
.error-list {
  max-height: 45vh; overflow-y: auto; margin: 0.6rem 0 0; padding-left: 1.2rem;
  font-family: var(--font-mono); font-size: 0.85rem; color: var(--red);
}
.error-list li { margin-bottom: 0.35rem; }

/* ---- Admin page -------------------------------------------------------------- */
.settings-bar {
  background: var(--panel); border: 1px solid var(--line); border-radius: 6px;
  padding: 0.7rem 1.2rem; margin-bottom: 1.2rem;
}
.settings-bar .view-toggle { margin: 0; }
.hint-inline { color: var(--dim); font-size: 0.8rem; }
.admin-tabs { margin-bottom: 1.2rem; }
.hint { color: var(--dim); font-size: 0.85rem; margin: 0.2rem 0 0.9rem; }
.ae-current-note {
  color: var(--dim); font-size: 0.8rem; margin: 0.3rem 0 0.9rem; font-style: italic;
}
.ae-current-note:empty { display: none; }

.upload-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 6px;
  padding: 1rem 1.2rem; margin-bottom: 1.4rem;
}
.upload-card h2 {
  font-family: var(--font-disp); font-weight: 600; font-size: 1.1rem;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink); margin: 0;
}
.upload-row { display: flex; gap: 0.7rem; align-items: center; flex-wrap: wrap; }
.upload-row select, .upload-row input[type="number"] {
  font-family: var(--font-mono); font-size: 0.95rem;
  background: var(--bg); color: var(--ink);
  border: 1px solid var(--line); border-radius: 4px; padding: 0.45rem 0.6rem;
}
.upload-row input[type="number"] { width: 6.5rem; }
.file-btn {
  font-family: var(--font-disp); font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; font-size: 0.95rem;
  border: 1px solid var(--line); border-radius: 4px; color: var(--dim);
  padding: 0.45rem 1rem; cursor: pointer;
}
.file-btn:hover { color: var(--ink); border-color: var(--dim); }
.file-name { color: var(--dim); font-size: 0.85rem; font-family: var(--font-mono); }

.archive-table {
  width: 100%; border-collapse: collapse;
  font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 0.92rem;
  border: 1px solid var(--line); border-radius: 6px; overflow: hidden;
}
.archive-table thead th {
  font-family: var(--font-disp); font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--dim); text-align: left;
  background: var(--panel); border-bottom: 1px solid var(--line);
  padding: 0.55rem 0.9rem;
}
.archive-table th.num, .archive-table td.num { text-align: right; }
.archive-table td { padding: 0.45rem 0.9rem; border-bottom: 1px solid #1e2935; }
.archive-table td.act { text-align: right; }
.archive-table .slot-btn { padding: 0.25rem 0.8rem; font-size: 0.8rem; }
.archive-table td.none { color: var(--dim); text-align: center; padding: 1rem; }

.cur-badge, .ok-badge, .miss-badge {
  font-family: var(--font-disp); font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.1em; padding: 0.1rem 0.5rem; border-radius: 3px;
}
.cur-badge  { background: rgba(242,179,61,0.18);  color: var(--amber); }
.ok-badge   { background: rgba(76,195,138,0.15);  color: var(--green); }
.miss-badge { background: rgba(212,99,107,0.15);  color: var(--red); }

.placeholder {
  border: 1px dashed var(--line); border-radius: 6px;
  padding: 3rem 1rem; text-align: center; color: var(--dim);
}
.placeholder h2 {
  font-family: var(--font-disp); letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink); margin: 0 0 0.4rem;
}

/* ---- Login gate + auth bar ----------------------------------------------- */
#gate {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(1200px 600px at 50% -10%, #15212e, var(--bg));
}
.gate-card {
  width: min(360px, 90vw); background: var(--panel);
  border: 1px solid var(--line); border-radius: 10px; padding: 1.6rem 1.5rem;
  box-shadow: 0 20px 60px rgba(0,0,0,.45);
}
.gate-brand { font-family: "Barlow Condensed", sans-serif; font-size: 1.5rem;
  font-weight: 700; letter-spacing: .04em; display: flex; align-items: center; gap: .5rem; }
.gate-sub { color: var(--dim); margin: .15rem 0 1.2rem; font-size: .9rem; }
.gate-card label { display: block; font-size: .8rem; color: var(--dim); margin-bottom: .8rem; }
.gate-card input {
  width: 100%; margin-top: .3rem; padding: .55rem .65rem; box-sizing: border-box;
  background: var(--bg); border: 1px solid var(--line); border-radius: 6px;
  color: var(--ink); font-family: "IBM Plex Mono", monospace; font-size: .95rem;
}
.gate-card input:focus-visible { outline: 2px solid var(--amber); outline-offset: 1px; }
.gate-card .primary { width: 100%; margin-top: .4rem; }

.pwa-banner {
  background: rgba(242,179,61,.08); border: 1px solid rgba(242,179,61,.35);
  border-radius: 8px; padding: .7rem .85rem; margin-bottom: 1.1rem;
}
.pwa-banner-text { margin: 0 0 .6rem; font-size: .8rem; line-height: 1.45; color: var(--ink); }
.pwa-banner-actions { display: flex; gap: .5rem; justify-content: flex-end; }
.pwa-banner-actions button { width: auto; margin-top: 0; padding: .35rem .75rem; font-size: .75rem; }

.authbar { display: flex; align-items: center; gap: .8rem; margin-left: auto; }
.who { display: flex; flex-direction: column; line-height: 1.1; text-align: right; }
#who-user { font-weight: 600; font-size: .9rem; }
.who-role { color: var(--amber); font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; }

/* ---- AE position-change direction (senior green / junior red) ------------ */
.more-sr { color: var(--green); font-weight: 600; }
.more-jr { color: var(--red); font-weight: 600; }
.delta { font-size: 0.85em; }
.bb-delta { font-size: 0.85em; margin-left: .15rem; }

/* ---- Most-junior Captain cards under base summary ------------------------ */
.bb-jr { display: flex; flex-wrap: wrap; gap: .5rem; padding: .5rem .9rem .6rem;
  border-bottom: 1px solid var(--line); background: rgba(0,0,0,.14); }
.jr-card { display: flex; flex-direction: column; gap: .15rem; min-width: 200px;
  padding: .35rem .6rem; border-left: 2px solid var(--amber); border-radius: 2px;
  background: rgba(255,255,255,.02); }
.jr-lab { color: var(--amber); text-transform: uppercase; letter-spacing: .06em;
  font-size: .66rem; font-weight: 600; }
.jr-val { font-family: "IBM Plex Mono", monospace; font-size: .85rem; color: var(--ink); }

/* ---- Make Current button in archive rows --------------------------------- */
.archive-table .act { display: flex; gap: .4rem; justify-content: flex-end; flex-wrap: nowrap; }
.archive-table td.act { white-space: nowrap; }
.mk-cur { padding: .25rem .6rem; font-size: .78rem; }

/* ---- Bid Lookup month selector ------------------------------------------- */
#lookup-month {
  background: var(--bg); color: var(--ink); border: 1px solid var(--line);
  border-radius: 6px; padding: 0 .5rem; font-family: "IBM Plex Mono", monospace;
  font-size: .85rem; min-height: 38px;
}

/* ---- Fleet Stats custom pivot -------------------------------------------- */
.pivot-card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 1rem 1.1rem 1.2rem; margin-top: 1rem; }
.pivot-card h2 { font-family: "Barlow Condensed", sans-serif; font-weight: 600;
  letter-spacing: .03em; margin: 0 0 .8rem; }
.pivot-controls { display: flex; flex-wrap: wrap; gap: 1rem 1.4rem; align-items: center;
  margin-bottom: 1rem; }
.pivot-controls label { display: flex; flex-direction: column; gap: .25rem;
  font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--dim); }
.pivot-controls select { background: var(--bg); color: var(--ink); border: 1px solid var(--line);
  border-radius: 6px; padding: .35rem .5rem; font-family: "IBM Plex Mono", monospace; font-size: .85rem; }
.pivot-controls .view-toggle { flex-direction: row; align-items: center; gap: .4rem;
  text-transform: none; letter-spacing: 0; font-size: .8rem; color: var(--ink); }
.pivot-wrap { overflow-x: auto; }
table.pivot { border-collapse: collapse; width: 100%; font-family: "IBM Plex Mono", monospace;
  font-size: .85rem; }
table.pivot th, table.pivot td { padding: .4rem .6rem; text-align: right; border-bottom: 1px solid var(--line); }
table.pivot thead th { color: var(--amber); text-transform: uppercase; font-size: .72rem;
  letter-spacing: .04em; border-bottom: 1px solid var(--amber); }
table.pivot tbody th { text-align: left; color: var(--ink); font-weight: 600; }
table.pivot td { color: var(--dim); }
table.pivot td.tot, table.pivot th.tot { color: var(--ink); font-weight: 600; }
table.pivot tr.grand th, table.pivot tr.grand td { color: var(--ink); font-weight: 700;
  border-top: 1px solid var(--amber); border-bottom: none; }

/* ---- AE Relative Movement ------------------------------------------------ */
.aesub-tabs { margin-bottom: .9rem; }
.relmove-bar { display: flex; flex-wrap: wrap; gap: .8rem 1rem; align-items: flex-end;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.1rem; }
.relmove-bar > label { display: flex; flex-direction: column; gap: .25rem;
  font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--dim); }
.relmove-bar select, .relmove-bar input:not([type="radio"]) {
  background: var(--bg); color: var(--ink); border: 1px solid var(--line); border-radius: 6px;
  padding: .45rem .55rem; font-family: "IBM Plex Mono", monospace; font-size: .9rem; min-height: 38px; }
.relmove-bar input:not([type="radio"]) { min-width: 160px; }
.relmove-bar .mode-toggle { align-self: center; }
.relmove-bar button { min-height: 40px; }

.relmove-table { border-collapse: collapse; width: 100%; margin: .9rem 0;
  font-family: "IBM Plex Mono", monospace; font-size: .9rem; }
.relmove-table th, .relmove-table td { padding: .5rem .7rem; border-bottom: 1px solid var(--line); text-align: right; }
.relmove-table thead th { color: var(--amber); text-transform: uppercase; font-size: .72rem;
  letter-spacing: .04em; border-bottom: 1px solid var(--amber); }
.relmove-table thead th:first-child, .relmove-table td.equip { text-align: left; }
.relmove-table td.equip { color: var(--ink); font-weight: 600; }
.relmove-table td { color: var(--dim); }
.relmove-table td.tot { color: var(--ink); font-weight: 600; }
.relmove-proj { font-family: "IBM Plex Mono", monospace; font-size: .95rem; padding: .6rem .2rem;
  border-top: 1px solid var(--line); }

/* ---- Payscales: Worth it? calculator -------------------------------------- */
.pssub-tabs { margin-bottom: .9rem; }
.worthit-grid {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem;
  align-items: start; margin-bottom: 1.2rem;
}
.worthit-side {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: .7rem;
}
.worthit-side h3 { margin: 0; font-family: var(--font-disp); letter-spacing: .06em;
  text-transform: uppercase; color: var(--amber); font-size: 1rem; }
.worthit-side label { display: flex; flex-direction: column; gap: .25rem;
  font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--dim); }
.worthit-side select {
  background: var(--bg); color: var(--ink); border: 1px solid var(--line); border-radius: 6px;
  padding: .45rem .55rem; font-family: "IBM Plex Mono", monospace; font-size: .9rem; min-height: 38px;
}
.worthit-side .mode-toggle { flex-direction: row; gap: 1rem; }
.worthit-rate { font-size: .85rem; color: var(--ink); }
.worthit-flip { display: flex; align-items: center; justify-content: center; padding-top: 2.2rem; }
.worthit-flip button { white-space: nowrap; }
.worthit-alv {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 1rem 1.1rem; margin-bottom: 1.2rem; max-width: 320px;
}
.worthit-alv label { display: flex; flex-direction: column; gap: .25rem;
  font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--dim); }
.worthit-alv input {
  background: var(--bg); color: var(--ink); border: 1px solid var(--line); border-radius: 6px;
  padding: .5rem .6rem; font-family: "IBM Plex Mono", monospace; font-size: 1rem;
}
@media (max-width: 640px) {
  .worthit-grid { grid-template-columns: 1fr; }
  .worthit-flip { padding-top: 0; }
}

.relmove-net { font-family: "IBM Plex Mono", monospace; font-size: .95rem; padding: .2rem .2rem .4rem; }

/* ---- Trends: metric cards ------------------------------------------------ */
.metric-row { display: flex; flex-wrap: wrap; gap: .8rem; margin: .2rem 0 1rem; }
.metric { background: rgba(255,255,255,.03); border: 1px solid var(--line); border-radius: 8px;
  padding: .6rem .9rem; min-width: 150px; display: flex; flex-direction: column; gap: .2rem; }
.m-lab { font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; color: var(--dim); }
.m-val { font-family: "IBM Plex Mono", monospace; font-size: 1.1rem; color: var(--ink); }
.key { display: inline-block; width: 12px; height: 12px; border-radius: 2px; vertical-align: middle; }
.chart-box { position: relative; height: 300px; width: 100%; }

/* Delete button in admin archive rows */
.act .danger { border-color: rgba(229,115,115,.5); color: #e57373; }
.act .danger:hover { background: rgba(229,115,115,.12); border-color: #e57373; }

/* ============================================================================
   Narrow-viewport hardening (phones + folded Galaxy Fold ~280px).
   Wide tables scroll inside their own box instead of pushing the page wide,
   and the page itself never scrolls sideways.
   ========================================================================== */
html, body { overflow-x: hidden; }            /* page never shifts horizontally */
.page { box-sizing: border-box; }

/* Any wide table gets its own horizontal scroll region. */
.table-scroll { width: 100%; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.seat-table { min-width: max-content; }       /* keep columns intact; scroll instead of squashing */

@media (max-width: 560px) {
  .topbar { padding: 0.7rem 0.8rem; gap: 0.6rem; }
  .tabs { gap: 0.35rem; width: 100%; }
  .tab { font-size: 0.82rem; padding: 0.35rem 0.6rem; letter-spacing: 0.04em; }
  .brand-mark { font-size: 1.3rem; }
  .brand-mark-img { height: 1.6rem; }
  .brand-sub { font-size: 0.72rem; }
  .page { padding: 1rem 0.8rem; }
  .authbar { gap: 0.5rem; }
}
