/* Last War Tool — site design system.
   Tokens and components follow docs/website-redesign-plan.md. */

:root {
  --bg: #151515;
  --panel: #202020;
  --raised: #292929;
  --ink: #f5f5f2;
  --muted: #b8b8b0;
  --line: #3a3a3a;
  --accent: #ff9a3c;
  --gold: #f3cb57;
  --green-bg: #233227;
  --green-ink: #b8e3b3;
  --green-line: #426047;
  --red-bg: #3a2323;
  --red-ink: #f2b0ab;
  --red-line: #6b3d38;
  --amber-bg: #372f1c;
  --amber-ink: #f3d58a;
  --amber-line: #6e5a2a;
  --radius: 16px;
  --radius-sm: 9px;
  --content-max: 1200px;
  /* #65655e measured 2.77:1 against --panel, short of WCAG 1.4.11's 3:1
     for essential UI component boundaries; this clears both --bg and
     --panel with margin. */
  --input-border: #7a7973;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.65 "Segoe UI Variable Display", "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p {
  margin: 0;
}

a {
  color: var(--accent);
}

a:hover, a:focus-visible {
  text-decoration: underline;
}

img {
  max-width: 100%;
  /* Without this, an <img width height> with explicit attributes keeps its
     raw pixel height when max-width shrinks it, stretching/squishing the
     image instead of scaling proportionally. */
  height: auto;
}

button, input, textarea, select {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.kicker {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1.8px;
  font-size: 11px;
  font-weight: 600;
}

.dot-green {
  color: #70dc91;
  box-shadow: 0 0 0 3px rgba(112, 220, 145, 0.1), 0 0 10px rgba(112, 220, 145, 0.35);
}

.dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

/* ---------- Header / nav ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: #181818;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 14px clamp(20px, 4vw, 42px);
}

.logo-container { flex-shrink: 0; }

.skip-link {
  position: fixed;
  top: 12px;
  left: 20px;
  z-index: 30;
  padding: 10px 16px;
  background: var(--gold);
  color: var(--bg);
  border-radius: var(--radius-sm);
  transform: translateY(-160%);
}

.skip-link:focus { transform: translateY(0); }

.logo-container a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.5px;
}

.site-logo {
  display: block;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
}

.logo-wordmark small {
  display: block;
  font-size: 11px;
  letter-spacing: 1.8px;
  font-weight: 500;
  color: var(--muted);
}

.nav-toggle {
  display: none;
  margin-left: auto;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 12px;
  font-size: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
}

.nav-buttons {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}

.nav-btn:hover, .nav-btn:focus-visible {
  color: var(--ink);
  background: var(--raised);
  text-decoration: none;
}

.nav-btn.primary {
  color: #151515;
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 600;
}

.nav-btn.primary:hover {
  filter: brightness(1.08);
  background: var(--accent);
}

.nav-btn.logout {
  color: var(--red-ink);
}

.nav-btn.is-current {
  color: var(--accent);
  background: #30251c;
}

.nav-btn.primary.is-current { color: var(--bg); background: var(--accent); }
.nav-dropdown { position: relative; }
.nav-dropdown summary { cursor: pointer; list-style: none; gap: 10px; }
.nav-dropdown summary::-webkit-details-marker { display: none; }
.nav-dropdown[open] > summary { color: var(--ink); background: var(--raised); }
.nav-chevron { width: 6px; height: 6px; border-right: 1.5px solid; border-bottom: 1.5px solid; transform: rotate(45deg); margin-top: -3px; }
.nav-dropdown[open] > summary .nav-chevron { transform: rotate(225deg); margin-top: 3px; }
.nav-dropdown-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 220px;
  padding: 6px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 16px 40px #0006;
}
.nav-dropdown-panel .nav-btn { display: flex; }
.account-dropdown { margin-left: 8px; }
.account-summary { border-color: var(--line); }
.account-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
.account-avatar { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #43301e; color: var(--gold); font-size: 12px; }
.menu-lines { width: 16px; height: 12px; border-top: 1.5px solid; border-bottom: 1.5px solid; position: relative; }
.menu-lines::after { content: ''; position: absolute; left: 0; right: 0; top: 4px; border-top: 1.5px solid; }

@media (max-width: 1000px) {
  .header-inner { flex-wrap: wrap; gap: 12px; }
  .navigation-ready .nav-toggle {
    display: inline-flex;
  }

  .nav-buttons {
    width: 100%;
    margin: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    max-height: calc(100dvh - 90px);
    overflow-y: auto;
    padding-top: 8px;
    border-top: 1px solid var(--line);
  }

  .navigation-ready .nav-buttons { display: none; }
  .navigation-ready .nav-buttons.open { display: flex; }
  .account-dropdown { margin-left: 0; }
  .nav-dropdown-panel { position: static; margin: 4px 0; min-width: 0; box-shadow: none; background: var(--bg); }
  .nav-dropdown summary .nav-chevron { margin-left: auto; }

  .nav-btn {
    width: 100%;
  }
}

/* ---------- Layout shell ---------- */

main {
  width: 100%;
  flex: 1;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 40px clamp(20px, 4vw, 42px) 64px;
}

main.full-bleed {
  max-width: none;
  padding: 0;
}

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.footer-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 28px clamp(20px, 4vw, 42px);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.footer-inner p { max-width: 540px; }
.footer-inner strong { display: block; color: var(--ink); font-size: 12px; letter-spacing: 1.5px; margin-bottom: 6px; }
.footer-inner nav { line-height: 2.5; }

footer a {
  color: var(--muted);
}

footer a:hover {
  color: var(--ink);
}

/* ---------- Buttons ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 10px 22px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #151515;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  text-align: center;
  transition: background-color 140ms ease, border-color 140ms ease, filter 140ms ease;
}

[hidden] { display: none !important; }

.button:hover, .button:focus-visible {
  filter: brightness(1.08);
  text-decoration: none;
}

.button.secondary {
  background: transparent;
  color: var(--ink);
  border-color: #62625d;
}

.button.quiet {
  background: var(--raised);
  color: var(--ink);
  border-color: var(--line);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

/* ---------- Cards / forms ---------- */

.card {
  padding: 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 20px;
}

/* Card headings were <h3> with no explicit size, relying on the browser's
   default h3 sizing (~19px); promoted to <h2> to fix a skipped heading
   level (h1 -> h3 with no h2 between), so pin the same size explicitly
   to keep the visual result unchanged. */
.card h2 {
  font-size: 19px;
}

/* Admin dashboard's single-setting cards (duration/registration/IP limit/
   cleanup): a grid keeps every card the same width and height per row
   (flex-wrap left the odd one out stranded next to empty space when it
   didn't fill a row), and letting .form's default column layout apply
   instead of overriding it per-card keeps every label/input/button the
   same width regardless of label text length. */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.settings-card {
  margin-bottom: 0;
}

.settings-card h2 {
  margin-bottom: 6px;
}

.settings-card p {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 14px;
}

.settings-card .form button {
  align-self: flex-start;
}

.admin-panel {
  padding: 0;
  overflow: hidden;
}

.admin-panel-summary {
  /* display:flex directly on <summary> is unreliable across browsers for
     suppressing/positioning the native marker (it can end up stacked on
     its own line above flex content); flex lives on the inner span below
     instead, and <summary> just stays a plain, marker-free block. */
  display: block;
  padding: 18px 24px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.admin-panel-summary::-webkit-details-marker {
  display: none;
}

.admin-panel-summary::marker {
  content: "";
  display: none;
}

.admin-panel-summary-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.admin-panel-summary:hover {
  background: var(--raised);
}

.admin-panel[open] .admin-panel-summary {
  border-bottom: 1px solid var(--line);
}

.admin-panel .changelog-toggle-chevron {
  font-size: 14px;
}

.admin-panel[open] .changelog-toggle-chevron {
  transform: rotate(180deg);
}

.admin-panel-body {
  padding: 24px;
}

.admin-panel-body .settings-grid {
  margin-bottom: 0;
}

.content-box {
  max-width: 760px;
  margin: 0 auto 20px;
  padding: 28px clamp(20px, 4vw, 36px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  line-height: 1.75;
}

.content-box h2, .content-box h3 {
  font-size: 19px;
  margin-top: 24px;
  margin-bottom: 10px;
}

.section-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 12px;
}

.form-card {
  max-width: 480px;
  margin: 0 auto;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form label {
  display: block;
  margin-bottom: 0;
  font-size: 14px;
  color: var(--muted);
}

.form input[type="text"],
.form input[type="email"],
.form input[type="password"],
.form input[type="number"],
.form input:not([type]),
.form select,
.form textarea {
  display: block;
  width: 100%;
  min-height: 46px;
  margin-top: 7px;
  padding: 10px 12px;
  background: #191919;
  color: var(--ink);
  border: 1px solid var(--input-border);
  border-radius: 8px;
  font-size: 16px;
  font-family: inherit;
}

.form textarea {
  min-height: 90px;
  resize: vertical;
}

.form input:focus-visible,
.form select:focus-visible,
.form textarea:focus-visible {
  border-color: var(--gold);
}

.form input[readonly] {
  color: var(--muted);
  cursor: default;
}

.error {
  padding: 10px 14px;
  border: 1px solid var(--red-line);
  border-radius: var(--radius-sm);
  background: var(--red-bg);
  color: var(--red-ink);
  font-size: 13px;
}

.success {
  padding: 10px 14px;
  border: 1px solid var(--green-line);
  border-radius: var(--radius-sm);
  background: var(--green-bg);
  color: var(--green-ink);
  font-size: 13px;
}

.captcha-note {
  font-size: 12px;
  color: var(--muted);
}

/* ---------- Home hero ---------- */

.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 32px;
  align-items: center;
  padding: 56px 0 48px;
}

.hero h1 {
  font-size: clamp(38px, 5.4vw, 64px);
  font-weight: 600;
  letter-spacing: -0.05em;
  line-height: 1.08;
  margin: 20px 0;
}

.hero h1 em {
  font-style: normal;
  color: var(--accent);
}

.hero-description {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.75;
  max-width: 460px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 26px 0 14px;
}

.hero-caption {
  font-size: 12px;
  color: var(--muted);
}

.hero-art {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 260px;
  min-width: 0;
  padding: 16px;
}

.hero-orbit {
  position: relative;
  isolation: isolate;
  width: min(100%, 360px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 174, 60, 0.12), rgba(255, 154, 60, 0.035) 48%, transparent 72%);
  display: grid;
  place-items: center;
}

.hero-orbit-ring {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.hero-orbit-ring--outer {
  inset: 0;
  border: 1px solid rgba(255, 154, 60, 0.16);
  box-shadow: inset 0 0 28px rgba(255, 154, 60, 0.025);
}

.hero-orbit-ring--middle {
  inset: 9%;
  border: 1px dashed rgba(243, 203, 87, 0.23);
  transform: rotate(-25deg);
}

/* Small points sit on the middle orbit, keeping the logo the focal point. */
.hero-orbit-ring--middle::before,
.hero-orbit-ring--middle::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  transform: translateY(-50%);
}

.hero-orbit-ring--middle::before {
  right: -3px;
  background: var(--gold);
  box-shadow: 0 0 14px rgba(243, 203, 87, 0.45);
}

.hero-orbit-ring--middle::after {
  left: -3px;
  background: #ba7837;
  box-shadow: 0 0 10px rgba(255, 154, 60, 0.2);
}

.hero-orbit-ring--inner {
  inset: 18%;
  border: 1px solid rgba(255, 174, 60, 0.45);
  background: radial-gradient(circle at 50% 30%, rgba(243, 203, 87, 0.045), transparent 75%);
  box-shadow: 0 0 36px rgba(255, 154, 60, 0.045), inset 0 0 24px rgba(255, 154, 60, 0.025);
}

.hero-orbit img {
  position: relative;
  width: min(38%, 128px);
  height: auto;
  aspect-ratio: 1;
  border-radius: 28px;
  object-fit: cover;
  box-shadow: 0 24px 45px rgba(0, 0, 0, 0.45);
}

.hero-screenshot-frame {
  position: relative;
  width: 100%;
  max-width: 460px;
  padding: 10px;
  border-radius: 20px;
  background: radial-gradient(ellipse at 70% 20%, rgba(255, 154, 60, 0.16), transparent 65%), var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45);
}

.hero-screenshot-frame img {
  display: block;
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
}

@media (max-width: 900px) {
  .hero-screenshot-frame {
    max-width: 100%;
  }
}

.feature-band {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin: 0 0 48px;
  background: #1a1a1a;
}

.feature {
  min-width: 0;
  padding: 26px 24px 28px;
}

.feature + .feature {
  border-left: 1px solid var(--line);
}

.feature-label {
  color: var(--accent);
  font-size: 11px;
  letter-spacing: 1.2px;
  margin-bottom: 12px;
  font-weight: 600;
}

.feature h2 {
  font-size: 17px;
  margin-bottom: 7px;
}

.feature p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.65;
}

.steps-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
  padding: 8px 0 40px;
}

.steps-section h2 {
  font-size: 28px;
  font-weight: 600;
  line-height: 1.2;
  margin: 10px 0 16px;
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 20px;
}

.steps li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.step-num {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border: 1px solid #57534b;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  color: var(--gold);
}

.steps strong {
  display: block;
  font-size: 14px;
}

.steps p {
  font-size: 12px;
  color: var(--muted);
}

@media (max-width: 900px) {
  .hero, .steps-section {
    grid-template-columns: 1fr;
  }

  .feature-band {
    grid-template-columns: 1fr;
  }

  .feature + .feature {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}

/* ---------- License dashboard ---------- */

.license-container {
  display: grid;
  gap: 20px;
}

.page-heading { margin-bottom: 32px; }
.page-heading h1 { font-size: clamp(28px, 3.2vw, 38px); font-weight: 600; letter-spacing: -1px; line-height: 1.2; margin: 10px 0; }
.page-heading > p { color: var(--muted); }
.profile-heading { max-width: 480px; margin-left: auto; margin-right: auto; }
.form-card + .form-card { margin-top: 20px; }
.license-card { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); padding: 0; margin-bottom: 0; overflow: hidden; }
.license-details { padding: clamp(24px, 3vw, 36px); min-width: 0; }
.license-card-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.license-card h2 { font-size: clamp(23px, 2.5vw, 28px); font-weight: 600; letter-spacing: -0.6px; line-height: 1.25; margin-bottom: 10px; }
.license-description { color: var(--muted); }
.license-facts { display: flex; flex-wrap: wrap; gap: 16px 36px; margin: 24px 0; padding: 20px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.license-facts dt, .field-caption { color: var(--muted); font-size: 14px; margin-bottom: 6px; }
.license-facts dt span { font-size: 12px; }
.license-facts dd { margin: 0; font-size: 15px; font-variant-numeric: tabular-nums; }
.license-key-control { display: flex; gap: 8px; align-items: stretch; }
.license-key-control .license-key { display: flex; align-items: center; flex: 1; min-width: 0; padding: 12px; font-size: 14px; }
.copy-key { padding: 10px 14px; flex-shrink: 0; }
.copy-status { min-height: 24px; margin-top: 6px; color: var(--green-ink); font-size: 12px; }
.license-download { margin-top: 16px; }
.license-renewal { padding: clamp(24px, 3vw, 36px); background: #24211d; border-left: 1px solid var(--line); }
.license-renewal .kicker { margin-bottom: 14px; }
.license-renewal h3 { font-size: 19px; font-weight: 600; margin-bottom: 10px; }
.license-renewal > p:not(.renewal-price) { color: var(--muted); font-size: 14px; }
.renewal-price { font-size: 32px; font-weight: 600; letter-spacing: -1px; margin-bottom: 14px; }
.renewal-price span { font-size: 14px; font-weight: 400; letter-spacing: 0; color: var(--muted); }
.license-renewal > .button { margin-top: 20px; width: 100%; }
.legacy-billing { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.legacy-billing p { font-size: 12px; color: var(--muted); }
.billing-link { background: transparent; color: var(--accent); border: 0; padding: 8px 0; min-height: 44px; text-align: left; font-size: 14px; }
.billing-link:hover { background: transparent; text-decoration: underline; }
.badge-amber { color: var(--gold); background: #382f1c; border-color: #71603b; }
.badge-grey  { color: var(--muted); background: #262626; border-color: #3a3a3a; }

/* Remote Control, Live card. Each instance is the app's own split strip, measure for measure
   (ui_qt/theme.py + the RunPillButton): a title row above it (name · state | the task, right),
   then the strip -- a 66px header on the window tone holding the 50px Play/Stop pill (green =
   off, click starts; coral = on, click stops; paused wears the white countdown ring + m:ss), the
   five counter badges (17px value in its identity tint over a 9px uppercase caption), and in
   the corner the app's 2x3 chip grid takes (132x50) the Force Run stack: picker chip + Run,
   or the run in flight + Cancel. */
.live-install { margin-top: 14px; }
.live-install-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-bottom: 6px; }
.live-install-head .text-small { white-space: normal; }
/* fleet-wide controls for a whole install: Start All / Stop All / rotation toggle */
.fleet-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 2px 2px 12px; }
.fleet-controls[hidden] { display: none; }
.chip.fleet { display: inline-block; width: auto; height: auto; flex: 0 0 auto; padding: 6px 14px; line-height: 18px; font-size: 13px; }
.chip.fleet.active { color: var(--gold); border-color: #71603b; }
.fleet-note { font-size: 12px; color: var(--gold); min-width: 0; flex: 1 1 100%; }
.fleet-note:empty { display: none; }
/* the app's on/off settings, collapsed behind one line: tick a box and the app flips that FLEET
   switch. Rows are big enough to hit with a thumb; the list scrolls rather than pushing the fleet
   off the screen on a phone. */
.live-toggles { margin: 0 2px 12px; }
.live-toggles[hidden] { display: none; }
.live-toggles > summary { cursor: pointer; color: var(--muted); padding: 4px 0; list-style: none; }
.live-toggles > summary::-webkit-details-marker { display: none; }
.live-toggles > summary::before { content: "▸ "; }
.live-toggles[open] > summary::before { content: "▾ "; }
.live-toggles-body { max-height: 45vh; overflow: auto; padding: 2px 0 4px; }
.toggle-group { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted);
                margin: 10px 0 2px; }
.toggle-row { display: flex; align-items: center; gap: 10px; padding: 7px 4px; font-size: 13px;
              border-bottom: 1px solid rgba(255, 255, 255, .05); cursor: pointer; }
.toggle-row:last-child { border-bottom: 0; }
.toggle-row input { width: 17px; height: 17px; flex: 0 0 auto; accent-color: var(--gold); }
.toggle-row input:disabled { opacity: .5; }
@media (max-width: 760px) {
  /* full-width, easy phone targets: the three controls share the row (wrap if needed) */
  .chip.fleet { flex: 1 1 30%; padding: 10px 8px; }
}
.live-tag { font-size: 11px; color: var(--muted); font-weight: 400; }
.strip-title { display: flex; align-items: baseline; gap: 10px; margin: 12px 2px 4px; font-size: 13px; line-height: 18px; min-height: 18px; }
.strip-name { font-weight: 600; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.strip-state { color: var(--muted); font-size: 12px; white-space: nowrap; }
.strip-note { font-size: 12px; color: var(--gold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.strip-task { margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.strip { background: #111111; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.strip.stale { opacity: 0.6; }
.strip-head { display: flex; align-items: center; gap: 6px; padding: 8px 6px; height: 66px; background: var(--bg); }
.pill {
  position: relative; flex: 0 0 50px; width: 50px; height: 50px; border: 0; border-radius: 11px; padding: 0;
  cursor: pointer; background: var(--green-ink); display: inline-flex; align-items: center; justify-content: center;
}
.pill.on { background: var(--red-ink); }
/* off AND the game/emulator window not up: the app's quiet closed slate + muted play glyph
   (green is off-but-open, ready to start). A running pill (.on) always wins. */
.pill.closed { background: #4a4844; }
.pill.closed .glyph { fill: #b8b8b0; stroke: #b8b8b0; }
.pill:hover { filter: brightness(1.08); }
.pill:active { filter: brightness(0.88); }
.pill .glyph { width: 18px; height: 18px; display: block; }
.pill .ring { position: absolute; inset: 0; width: 50px; height: 50px; pointer-events: none; }
.pill .count { font-size: 13px; font-weight: 700; color: #151515; line-height: 1; }
/* rotation mode's arrows: shown while the app says the pill rotates, countdown or not (the
   digits sit over them), as the app's pill does */
.pill .arrows { position: absolute; inset: 0; width: 50px; height: 50px; pointer-events: none; display: none; }
.pill.rotating .arrows { display: block; }
.pill .count { position: relative; }
.pill.counting .glyph, .pill.counting:hover .count { display: none; }   /* hover swaps the countdown for the stop square */
.pill.counting:hover .glyph { display: block; }
/* (strip-badge, not .badge: the site's .badge is the round status pill further down) */
/* a badge keeps its natural width and shares the slack (the app's Expanding badges); the
   page's density ladder (the strip's own: full -> short captions -> drop) decides what shows */
.strip-badge {
  flex: 1 0 auto; height: 50px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.strip-badge[hidden] { display: none; }
.strip-badge-value { font-size: 17px; font-weight: 700; line-height: 1.1; white-space: nowrap; }
.strip-badge-label { font-size: 9px; font-weight: 700; letter-spacing: 0.9px; text-transform: uppercase; color: var(--input-border); white-space: nowrap; line-height: 1.1; }
.strip-badge-label .abbr, .strip-head.abbr .strip-badge-label .full { display: none; }
.strip-head.abbr .strip-badge-label .abbr { display: inline; }
/* two equal tracks (22px each in the 50px corner); the chips fill their track exactly -- a
   select's own minimum height would otherwise push it past a fixed 22px row into Run */
/* the corner grid: the picker (or the run in flight) across the top; Run (or Cancel) and the
   app's Focus chip below, the chip 40px wide as the app's are */
.strip-corner { flex: 0 0 132px; width: 132px; height: 50px; margin-left: auto; display: grid; grid-template-rows: 1fr 1fr; grid-template-columns: 1fr 40px; gap: 6px; }
.strip-corner .wide { grid-column: 1 / -1; }
.strip-corner.no-focus > :nth-child(2) { grid-column: 1 / -1; }   /* no snipe running: Run / Cancel takes the row */
.chip.focus { padding: 0; color: var(--input-border); display: inline-flex; align-items: center; justify-content: center; }
.chip.focus svg { width: 15px; height: 15px; }
.chip.focus.active { color: var(--gold); border-color: #71603b; animation: focus-pulse 1.6s ease-in-out infinite; }
@keyframes focus-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
.strip-task.focus { color: var(--gold); }
.chip {
  display: block; width: 100%; height: 100%; min-height: 0; margin: 0; box-sizing: border-box;
  background: var(--panel); border: 1px solid var(--line); border-radius: 6px;
  padding: 0 8px; font-size: 11px; line-height: 20px; color: var(--ink); cursor: pointer; text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
button.chip:hover:enabled, select.chip:hover { background: var(--raised); }
button.chip:disabled { color: var(--input-border); cursor: default; }
.chip.muted { color: var(--muted); cursor: default; }
.chip.gold { color: var(--gold); cursor: default; }
select.chip {
  appearance: none; -webkit-appearance: none; text-align: left; padding-right: 22px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b8b8b0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 5px center; background-size: 14px 14px;
}
.chip.busy, .pill.busy { opacity: 0.5; }
/* an inline text link, not a button box: it inherits the row's line height, so its appearing
   ("resume now" while paused) cannot move the row */
.live-link {
  display: inline; background: none; border: 0; margin: 0; padding: 0; height: auto; vertical-align: baseline;
  line-height: inherit; color: var(--accent); cursor: pointer; font-size: 12px; text-decoration: none;
}
.live-link:hover { text-decoration: underline; }
@media (max-width: 760px) {
  /* the corner drops to a full-width TWO-ROW stack: the Force Run picker on top (its own tappable
     row -- it used to sit UNDER the full-width Run button, which covered it), Run/Cancel + the
     Focus chip below. Same 1/-1 span rules as desktop, just full width and taller rows. */
  .strip-title { flex-wrap: wrap; }
  .strip-head { height: auto; flex-wrap: wrap; }
  .strip-corner { flex: 1 1 100%; width: auto; height: auto; grid-template-rows: 40px 40px; grid-template-columns: 1fr 44px; }
  .chip { line-height: 38px; font-size: 13px; }
}

@media (max-width: 760px) {
  .license-card { grid-template-columns: minmax(0, 1fr); }
  .license-renewal { border-left: 0; border-top: 1px solid var(--line); }
}

@media (max-width: 420px) {
  .license-key-control { flex-wrap: wrap; }
  .license-key-control .license-key { flex-basis: 100%; }
  .license-download { width: 100%; }
}

.license-card h3 {
  margin-bottom: 14px;
}

.license-key {
  display: inline-block;
  max-width: 100%;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 13px;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  background: #171717;
  border: 1px solid #565651;
  border-radius: 6px;
  overflow-wrap: anywhere;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--line);
}

.badge-green {
  background: var(--green-bg);
  color: var(--green-ink);
  border-color: var(--green-line);
}

.badge-red {
  background: var(--red-bg);
  color: var(--red-ink);
  border-color: var(--red-line);
}

.empty-card {
  text-align: center;
  padding: 40px 24px;
}

.empty-card p {
  margin-bottom: 16px;
  color: var(--muted);
}

/* ---------- Auth pages ---------- */

.auth-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 520px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 0 auto;
  max-width: 980px;
}

.auth-story {
  padding: 52px 40px;
  background: radial-gradient(ellipse at 0% 100%, rgba(255, 154, 60, 0.09), transparent 70%);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-story h2 {
  font-size: clamp(28px, 3.6vw, 40px);
  line-height: 1.1;
  letter-spacing: -1px;
  font-weight: 600;
  margin: 18px 0;
}

.auth-story h2 span {
  color: var(--accent);
}

.auth-story p {
  color: var(--muted);
  font-size: 14px;
  max-width: 300px;
}

.auth-form-panel {
  padding: 44px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-form-panel h1, .auth-form-panel h2 {
  font-size: 26px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.6px;
  margin-top: 12px;
  margin-bottom: 8px;
}

.auth-form-panel > p.auth-lead {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 22px;
}

.auth-footnote {
  font-size: 14px;
  color: var(--muted);
  text-align: center;
  margin-top: 8px;
}

.auth-form-panel > .error, .auth-form-panel > .success { margin-bottom: 20px; }
.auth-form-panel .form + .auth-footnote { margin-top: 22px; }
.form .legal-acceptance { display: flex; align-items: flex-start; gap: 10px; }
.form .legal-acceptance input { width: 18px; height: 18px; flex-shrink: 0; margin-top: 3px; accent-color: var(--accent); }

@media (max-width: 760px) {
  .auth-grid {
    grid-template-columns: 1fr;
  }

  /* Put the actual form first on mobile; the marketing panel follows
     rather than pushing the sign-in/register fields below the fold. */
  .auth-story {
    order: 2;
    border-right: 0;
    border-top: 1px solid var(--line);
    padding: 24px;
  }

  .auth-form-panel {
    order: 1;
    padding: 32px 24px;
  }
}

/* ---------- FAQ ---------- */

.faq-page {
  max-width: 760px;
  margin: 0 auto;
}

.faq-hero {
  margin-bottom: 28px;
}

.faq-hero h1 {
  font-size: 34px;
  font-weight: 600;
  margin-bottom: 10px;
}

.faq-hero p {
  color: var(--muted);
}

.faq-list {
  display: grid;
  gap: 12px;
}

.faq-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 16px 20px;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  color: var(--accent);
  font-size: 18px;
  flex-shrink: 0;
}

.faq-item[open] summary::after {
  content: "\2212";
}

.faq-answer {
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.faq-answer ul {
  padding-left: 20px;
}

.faq-footer {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

/* ---------- Changelog ---------- */

.changelog-content {
  max-width: 760px;
  margin: 0 auto;
}

.changelog-content h1 {
  font-size: 32px;
  margin-bottom: 20px;
}

.changelog-content ul {
  margin: 8px 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.changelog-content code {
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--raised);
  font-size: 0.92em;
}

.changelog-entry {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.changelog-entry:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.changelog-entry-summary {
  display: flex;
  align-items: baseline;
  gap: 10px;
  cursor: pointer;
  list-style: none;
  padding: 6px 4px;
  border-radius: var(--radius-sm);
  user-select: none;
}

.changelog-entry-summary::-webkit-details-marker {
  display: none;
}

.changelog-entry-summary:hover {
  background: var(--raised);
}

.changelog-version {
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
}

.changelog-date {
  font-size: 13px;
  color: var(--muted);
  flex: 1;
}

.changelog-toggle-chevron {
  color: var(--muted);
  font-size: 12px;
  transition: transform 0.15s ease;
}

.changelog-entry[open] .changelog-toggle-chevron {
  transform: rotate(180deg);
}

.changelog-entry-body {
  padding: 10px 4px 4px;
}

.tag-new {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  margin-right: 2px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  vertical-align: 1px;
}

/* ---------- Generic content fallback (admin/superuser tables etc.) ---------- */

.content-box ul {
  margin: 8px 0 16px;
  padding-left: 22px;
  color: var(--muted);
  line-height: 1.75;
}

.content-box li {
  margin-bottom: 4px;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 20px;
}

.table-responsive table {
  margin-bottom: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}

th, td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  vertical-align: top;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

th {
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

/* Bare form controls (admin/superuser pages not yet using .form/.button) */

textarea,
select,
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"] {
  min-height: 34px;
  padding: 6px 10px;
  background: #202020;
  color: var(--ink);
  border: 1px solid var(--input-border);
  border-radius: 8px;
  font-size: 13px;
}

textarea {
  min-height: 60px;
  font-family: inherit;
}

button {
  min-height: 34px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--raised);
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
}

button:hover {
  background: #333;
}

/* Compact per-row action buttons in dense admin tables: a fixed min-width
   lets them wrap into a tidy grid instead of the auto table layout
   squeezing the column down to one button per line. */
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 190px;
}

.row-actions button {
  min-height: 28px;
  padding: 4px 9px;
  font-size: 12px;
  white-space: nowrap;
}

.row-action-group {
  align-items: center;
}

.row-action-group .row-action-select {
  /* flex-basis 100% claims the whole row-actions line for the select, so
     the day-count box (and Go button) always wrap onto their own line
     below it instead of being squeezed alongside a wide dropdown. */
  flex: 1 1 100%;
  min-width: 150px;
  min-height: 28px;
  padding: 4px 6px;
  font-size: 12px;
}

.row-action-group .row-action-days {
  width: 64px;
  flex-shrink: 0;
  min-height: 28px;
  padding: 4px 6px;
  font-size: 12px;
}

.row-action-group .row-action-go {
  flex-shrink: 0;
}

.role-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.role-actions button {
  min-height: 26px;
  padding: 3px 8px;
  font-size: 11px;
  white-space: nowrap;
}

@media (pointer: coarse) {
  .row-actions button, select, input[type="number"] { min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

/* ---------- Screenshot lightbox ---------- */
/* Detailed UI screenshots (e.g. the feature-page settings tabs) are too
   dense to read once scaled down to a phone width; wrap them in a button
   that opens a full-size, scrollable overlay instead. */

.screenshot-trigger {
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: none;
  cursor: zoom-in;
  position: relative;
  overflow: hidden;
}

.screenshot-trigger img {
  display: block;
  width: 100%;
  border: none;
  border-radius: 0;
}

.screenshot-zoom-hint {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #151515cc;
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
  border-radius: 20px;
  pointer-events: none;
}

.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 20px 20px;
  background: #0a0a0ae6;
}

.lightbox-overlay[hidden] {
  display: none;
}

.lightbox-content {
  max-width: 100%;
  max-height: 100%;
  overflow: auto;
  border-radius: 8px;
}

.lightbox-content img {
  display: block;
  max-width: 100%;
  height: auto;
}

.lightbox-close {
  position: fixed;
  top: 14px;
  right: 14px;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.lightbox-close:hover {
  background: var(--raised);
}

/* ---------- Not-affiliated acknowledgement gate ---------- */
/* Blocks the whole page behind a full-screen overlay until the visitor
   explicitly agrees they aren't associated with the game (see terms.html
   section 1). The inline script in base.html's <head> adds gate-pending
   to <html> synchronously, before first paint, so there's no flash of
   gated content. /terms and /privacy are exempt so the linked policies
   in the gate itself can always be read without a chicken-and-egg loop. */

html.gate-pending body > *:not(#gate-overlay) {
  display: none !important;
}

#gate-overlay {
  display: none;
}

html.gate-pending #gate-overlay {
  display: flex;
}

.gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
  background: #0a0a0af2;
}

.gate-box {
  max-width: 560px;
  width: 100%;
  margin: auto;
  padding: 32px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.gate-box h2 {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.5px;
  margin: 8px 0 16px;
}

.gate-box p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 14px;
}

.gate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}
