:root {
  --ink: #172321;
  --muted: #677571;
  --paper: #f2f6f3;
  --panel: rgba(255,255,255,.82);
  --line: #dbe5df;
  --green: #0b7258;
  --green-light: #d9f5e9;
  --orange: #f3a93b;
  --shadow: 0 24px 70px rgba(31, 61, 51, .11);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  background:
    radial-gradient(circle at 10% -10%, #d5f1e7 0, transparent 28rem),
    radial-gradient(circle at 100% 20%, #ffe9c4 0, transparent 25rem),
    var(--paper);
  min-height: 100vh;
}

.topbar {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(24px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid rgba(23,35,33,.08);
  background: rgba(242,246,243,.72);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 3;
}
.brand, .pilot, .status-line, .panel-title { display: flex; align-items: center; }
.brand { gap: 12px; }
.logo {
  width: 42px; height: 42px; border-radius: 14px;
  display: grid; place-items: center;
  background: var(--ink); color: white; font-weight: 800; letter-spacing: -.08em;
}
.brand strong { display: block; }
.brand span { color: var(--muted); font-size: 12px; }
.pilot { gap: 10px; }
.pilot label { color: var(--muted); font-size: 13px; }
select {
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 34px 9px 12px;
  background: white; color: var(--ink); font: inherit;
}
.pilot button { padding: 9px 12px; }
.notification-wrap { position: relative; }
.notification-button {
  display: flex; align-items: center; gap: 7px; padding: 9px 12px;
  color: var(--ink); background: white; border: 1px solid var(--line);
}
.notification-count {
  min-width: 20px; padding: 3px 6px; border-radius: 999px;
  color: white; background: #b95039; font-size: 10px; text-align: center;
}
.notification-count.hidden, .notification-panel.hidden { display: none; }
.notification-panel {
  position: absolute; z-index: 30; top: calc(100% + 12px); right: 0;
  width: 380px; max-height: min(540px, calc(100vh - 100px)); overflow: auto;
  padding: 14px; border: 1px solid var(--line); border-radius: 17px;
  background: #fff; box-shadow: 0 22px 70px rgba(23,35,33,.2);
}
.notification-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 2px 2px 11px; border-bottom: 1px solid var(--line);
}
.notification-list { display: grid; gap: 5px; margin-top: 8px; }
.notification-item { padding: 11px; border-radius: 12px; background: #f3f6f4; }
.notification-item.unread { background: var(--green-light); }
.notification-item strong, .notification-item span, .notification-item small { display: block; }
.notification-item strong { margin-bottom: 4px; font-size: 13px; }
.notification-item span { color: var(--ink); font-size: 12px; line-height: 1.4; }
.notification-item small { margin-top: 6px; color: var(--muted); font-size: 9px; }
.quest-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.quest-guide { display: grid; }
.quest-card {
  display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 18px;
  border: 1px solid var(--line); border-radius: 17px; background: linear-gradient(145deg, #f8faf9, #edf3ef);
}
.quest-card.compact { grid-template-columns: 1fr 220px auto; align-items: center; }
.quest-card.completed { border-color: #b6dfcf; background: linear-gradient(145deg, #f4fbf7, #ddf3e8); }
.quest-card h3 { margin: 5px 0; font-size: 17px; }
.quest-card p { margin: 0; color: var(--muted); font-size: 11px; }
.quest-state { color: var(--green); font-size: 9px; font-weight: 900; letter-spacing: .12em; }
.quest-progress { align-self: end; height: 7px; border-radius: 999px; overflow: hidden; background: #dce5df; }
.quest-progress div { height: 100%; border-radius: inherit; background: var(--green); }
.quest-numbers { align-self: center; color: var(--muted); font-size: 10px; }
.quest-card button { align-self: center; font-size: 11px; }
.quest-card .buy { background: var(--green); color: white; }
.quest-complete { padding: 18px; border-radius: 15px; background: var(--green-light); color: var(--green); }
.quest-complete b, .quest-complete span { display: block; }
.quest-complete span { margin-top: 4px; font-size: 10px; }
.return-count { padding: 8px 11px; border-radius: 999px; background: var(--green-light); color: var(--green); font-size: 11px; }
.return-center { display: grid; gap: 8px; }
.return-item {
  display: grid; grid-template-columns: 1fr 110px auto; gap: 14px; align-items: center;
  padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #f5f8f6;
}
.return-item.priority-1, .return-item.priority-2 { background: #fff7e7; border-color: #efd49d; }
.return-item span { color: var(--green); font-size: 8px; font-weight: 900; letter-spacing: .12em; }
.return-item h3 { margin: 4px 0; font-size: 14px; }
.return-item p { margin: 0; color: var(--muted); font-size: 10px; }
.return-timer { color: var(--green); text-align: center; font-size: 13px; }
.passport-modal {
  position: fixed; inset: 0; z-index: 40; display: grid; place-items: center;
  padding: 24px; background: rgba(8,25,21,.66); backdrop-filter: blur(10px);
}
.passport-modal.hidden { display: none; }
.passport-dialog {
  position: relative; width: min(850px, 100%); max-height: calc(100vh - 48px); overflow: auto;
  padding: 30px; border-radius: 24px; background: #f8fbf9; box-shadow: 0 35px 100px rgba(0,0,0,.3);
}
.passport-close { position: absolute; top: 14px; right: 14px; padding: 6px 12px; background: #e9efeb; font-size: 20px; }
.passport-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.passport-title h2 { font-size: 34px; }
.passport-title span { color: var(--muted); font-size: 11px; }
.passport-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.passport-stats div { padding: 13px; border-radius: 13px; background: #eaf1ed; }
.passport-stats span, .passport-stats b { display: block; }
.passport-stats span { margin-bottom: 5px; color: var(--muted); font-size: 9px; }
.passport-section { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.passport-section h3 { margin: 0 0 10px; font-size: 15px; }
.passport-section p { color: var(--muted); font-size: 11px; }
.passport-flight { display: flex; gap: 8px; margin: 10px 0; }
.passport-flight b { padding: 9px 12px; border-radius: 10px; background: var(--green-light); color: var(--green); }
.passport-accuracy { color: var(--green); font-size: 13px; }
.passport-row { display: grid; grid-template-columns: 1fr auto 155px; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 11px; }
.passport-row small { color: var(--muted); text-align: right; }
.auth-screen {
  position: fixed; inset: 0; z-index: 20; display: grid; place-items: center;
  background: rgba(14, 36, 31, .72); backdrop-filter: blur(16px);
}
.auth-screen.hidden { display: none; }
.welcome-screen {
  position: fixed; inset: 0; z-index: 19; overflow-y: auto;
  background: radial-gradient(circle at 10% 0, #d5f1e7 0, transparent 32rem), #f2f6f3;
}
.welcome-screen.hidden { display: none; }
.welcome-shell { width: min(1120px, calc(100% - 32px)); margin: auto; }
.welcome-head { display: flex; justify-content: space-between; align-items: center; padding: 22px 0; }
.welcome-head .sidebar-brand { padding: 0; }
.welcome-head button { background: rgba(255,255,255,.65); }
.welcome-main { width: auto; max-width: none; margin: 0; padding: 0; }
.welcome-hero {
  display: grid; grid-template-columns: 1fr 330px; gap: 24px; align-items: stretch;
  padding: 54px; border-radius: 32px; color: white; background: linear-gradient(135deg, #102823, #155f4e);
  box-shadow: var(--shadow);
}
.welcome-hero h1 { max-width: 720px; font-size: clamp(42px, 7vw, 76px); }
.welcome-hero p:not(.eyebrow) { max-width: 670px; color: #c8ded6; line-height: 1.65; }
.welcome-actions { display: flex; gap: 16px; align-items: center; margin-top: 28px; }
.welcome-actions .primary { width: auto; min-width: 210px; }
.welcome-actions span { max-width: 260px; color: #9fc2b6; font-size: 10px; line-height: 1.45; }
.welcome-flight {
  display: flex; flex-direction: column; justify-content: center; gap: 9px; padding: 28px;
  border: 1px solid rgba(255,255,255,.16); border-radius: 22px; background: rgba(255,255,255,.07);
}
.welcome-flight span { color: #9ce1cb; font-size: 9px; font-weight: 900; letter-spacing: .14em; }
.welcome-flight strong { padding: 9px 12px; border-radius: 10px; background: rgba(255,255,255,.1); }
.welcome-flight b { margin: 8px 0; color: #f7ca75; font-size: 12px; text-align: center; }
.welcome-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 22px 0; }
.welcome-grid article { padding: 24px; border: 1px solid var(--line); border-radius: 20px; background: rgba(255,255,255,.75); }
.welcome-grid span { color: var(--green); font-size: 10px; font-weight: 900; letter-spacing: .14em; }
.welcome-grid h3 { margin: 20px 0 8px; font-size: 19px; }
.welcome-grid p, .welcome-rules p { color: var(--muted); font-size: 11px; line-height: 1.55; }
.welcome-rules {
  display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-bottom: 22px; padding: 30px;
  border: 1px solid var(--line); border-radius: 22px; background: #fff;
}
.welcome-rules ul { display: grid; gap: 10px; margin: 0; padding-left: 20px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.welcome-footer { display: flex; gap: 14px; justify-content: center; padding: 20px 0 32px; color: var(--muted); font-size: 10px; }
.welcome-footer strong { color: var(--ink); }
.auth-back { position: absolute; top: 18px; right: 18px; }
.auth-card {
  position: relative; width: min(430px, calc(100% - 28px)); padding: 34px; border-radius: 26px;
  background: #f8fbf9; box-shadow: 0 35px 100px rgba(0,0,0,.28);
}
.auth-card .logo { margin-bottom: 24px; }
.auth-card h2 { font-size: 32px; margin-bottom: 12px; }
.auth-note { color: var(--muted); line-height: 1.55; font-size: 13px; }
.auth-card input {
  width: 100%; padding: 13px; border: 1px solid var(--line); border-radius: 11px;
  background: white; font: inherit; outline-color: var(--green);
}
.auth-card form label span { display: block; margin-bottom: 7px; }
.auth-mode { width: 100%; margin-top: 10px; }
.pilot strong {
  min-width: 90px; padding: 10px 12px; border-radius: 10px;
  background: var(--green-light); color: var(--green); text-align: center;
}

main { width: min(1180px, calc(100% - 32px)); margin: 36px auto 80px; }
.hero {
  display: grid; grid-template-columns: 1fr 260px; gap: 24px;
  align-items: stretch; margin-bottom: 24px;
}
.hero > div:first-child {
  padding: 36px; border-radius: 28px; color: white;
  background: linear-gradient(135deg, #102a26, #126951);
  box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.hero > div:first-child::after {
  content: ""; position: absolute; width: 220px; height: 220px; right: -70px; top: -95px;
  border: 1px solid rgba(255,255,255,.22); border-radius: 50%;
  box-shadow: 0 0 0 30px rgba(255,255,255,.03), 0 0 0 70px rgba(255,255,255,.025);
}
.eyebrow {
  margin: 0 0 8px; color: var(--green); text-transform: uppercase;
  font-size: 11px; font-weight: 800; letter-spacing: .14em;
}
.hero .eyebrow { color: #9ce1cb; }
h1 { margin: 0; font-size: clamp(42px, 7vw, 76px); line-height: .95; letter-spacing: -.07em; }
.subtitle { max-width: 610px; color: rgba(255,255,255,.68); line-height: 1.55; }
.status-line { gap: 20px; font-size: 13px; color: rgba(255,255,255,.7); }
.slot-cards {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 22px;
}
.slot-card {
  display: grid; gap: 5px; text-align: left; padding: 12px;
  border: 1px solid rgba(255,255,255,.18); border-radius: 14px;
  background: rgba(255,255,255,.09); color: white; box-shadow: none;
}
.slot-card.active { border-color: #f7ca75; background: rgba(247,202,117,.22); }
.slot-card span { color: #9ce1cb; font-size: 10px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.slot-card b { font-size: 18px; }
.slot-card small { color: rgba(255,255,255,.72); font-size: 10px; line-height: 1.35; }
.bot-badge {
  display: inline-flex; margin-left: 4px; padding: 2px 5px; border-radius: 999px;
  background: #e7f0fb; color: #315c85; font-size: 9px; font-weight: 900; text-transform: uppercase;
}
.badge {
  padding: 7px 10px; border-radius: 999px; background: #d5f6e8; color: #075b44;
  font-weight: 800; font-size: 11px; letter-spacing: .06em;
}
.pool-card {
  border-radius: 28px; background: #f8bd58; padding: 30px;
  display: flex; flex-direction: column; justify-content: flex-end; box-shadow: var(--shadow);
}
.pool-card span, .pool-card small { color: #6f4a0d; }
.pool-card strong { font-size: 68px; line-height: 1; letter-spacing: -.08em; margin: 12px 0 5px; }
.guide-strip {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: -4px 0 24px;
}
.guide-strip article {
  display: grid; grid-template-columns: 34px 1fr; gap: 11px; align-items: start;
  padding: 14px; border: 1px solid #dce6e0; border-radius: 16px;
  background: linear-gradient(150deg, #ffffff, #f4f8f5);
}
.guide-strip span {
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: 12px;
  background: var(--green-light); color: var(--green); font-weight: 900;
}
.guide-strip b, .guide-strip small { display: block; }
.guide-strip b { margin-bottom: 4px; font-size: 13px; }
.guide-strip small { color: var(--muted); font-size: 10px; line-height: 1.45; }

.grid { display: grid; grid-template-columns: 400px 1fr; gap: 24px; }
.progress-grid { display: grid; grid-template-columns: 400px 1fr; gap: 24px; margin-top: 24px; }
.panel {
  padding: 26px; border: 1px solid rgba(255,255,255,.8); border-radius: 24px;
  background: var(--panel); box-shadow: var(--shadow); backdrop-filter: blur(12px);
}
.panel-title { justify-content: space-between; gap: 16px; margin-bottom: 24px; }
h2 { margin: 0; font-size: 24px; letter-spacing: -.045em; }
.flight-icon {
  width: 48px; height: 48px; display: grid; place-items: center; border-radius: 15px;
  background: var(--green-light); color: var(--green); font-size: 25px; font-weight: 700;
}
form label { display: block; margin-bottom: 24px; }
form label span { display: flex; justify-content: space-between; margin-bottom: 12px; color: var(--muted); font-size: 13px; }
form label b { color: var(--ink); }
input[type=range] { width: 100%; accent-color: var(--green); }
.forecast-guard {
  margin: -8px 0 14px; padding: 11px 13px; border-radius: 12px;
  background: #edf3ef; color: var(--muted); font-size: 10px;
}
.forecast-guard b, .forecast-guard span { display: block; }
.forecast-guard b { margin-bottom: 3px; color: var(--green); font-size: 11px; }
.forecast-guard.warning { background: #f8e8df; }
.forecast-guard.warning b { color: #a24f38; }
.preview-button { width: 100%; margin-bottom: 10px; }
.launch-preview {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px;
  margin-bottom: 10px; padding: 12px; border-radius: 13px; background: #edf3ef;
}
.launch-preview.hidden { display: none; }
.launch-preview div { padding: 8px; border-radius: 9px; background: rgba(255,255,255,.72); }
.launch-preview span, .launch-preview b { display: block; }
.launch-preview span { color: var(--muted); font-size: 9px; }
.launch-preview b { margin-top: 4px; font-size: 12px; }
.launch-preview small { grid-column: 1 / -1; color: var(--muted); font-size: 9px; line-height: 1.4; }
button {
  border: 0; border-radius: 12px; padding: 12px 16px; cursor: pointer;
  font: inherit; font-weight: 750; transition: transform .15s, opacity .15s;
}
button:hover { transform: translateY(-1px); }
button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.primary { width: 100%; padding: 15px; background: var(--green); color: white; }
.secondary { background: var(--ink); color: white; font-size: 12px; }
.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); font-size: 12px; }
.message { min-height: 18px; margin: 16px 0 0; color: var(--green); font-size: 13px; }
.baseline-card {
  display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center;
  padding: 13px; border-radius: 14px; background: #edf3ef; margin-top: 16px;
}
.baseline-card span { display: block; color: var(--muted); font-size: 10px; margin-top: 3px; }
.baseline-card strong { color: var(--green); font-size: 12px; }

.drones { display: grid; gap: 10px; }
.drone-row, .ledger-row {
    display: grid; align-items: center; gap: 12px; border-bottom: 1px solid var(--line);
}
.drone-row.is-mine {
  border-color: #cbe5d9; background: linear-gradient(145deg, #f4fbf7, #edf7f1);
  box-shadow: inset 3px 0 0 var(--green);
}
.drone-inline-actions {
  grid-column: 1 / -1; justify-content: flex-end; padding-top: 8px;
  border-top: 1px solid #e2e9e5;
}
.drone-inline-actions input { width: 95px; }
.drone-row { grid-template-columns: 36px 1fr auto auto; padding: 12px 0; }
.drone-row:last-child, .ledger-row:last-child { border-bottom: 0; }
.drone-number {
  width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px;
  background: #e7efea; color: var(--muted); font-size: 12px; font-weight: 800;
}
.drone-row strong { display: block; font-size: 14px; }
.drone-row small { color: var(--muted); }
.weather-values { color: var(--muted); font-size: 12px; white-space: nowrap; }
.payout { text-align: right; color: var(--green); min-width: 65px; }
.market-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.market-actions input {
  width: 100px; padding: 9px; border: 1px solid var(--line); border-radius: 10px;
  background: white; font: inherit;
}
.market-actions button { padding: 9px 12px; font-size: 12px; }
.market-actions .buy { background: var(--green); color: white; }
.market-actions .sell { background: var(--ink); color: white; }
.market-actions .cancel { background: #f5e7df; color: #9a4935; }
.market-history { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); }
.empty { color: var(--muted); text-align: center; padding: 32px; }
.render-error {
  border: 1px solid #e1b8aa; border-radius: 14px;
  color: #8c3c2d; background: #fff5f1;
}
.render-error b, .render-error span { display: block; }
.render-error span { margin-top: 6px; font-size: 11px; line-height: 1.45; }
.fact {
  background: #fff4dc; color: #714f16; border-radius: 14px; padding: 13px 15px;
  margin-bottom: 14px; font-size: 13px;
}
.estimate {
  display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 12px;
  background: var(--green-light); color: var(--green); border-radius: 14px; padding: 13px 15px;
  margin-bottom: 14px; font-size: 13px;
}
.estimate span { display: block; color: var(--muted); margin-top: 3px; font-size: 11px; }
.estimate strong { font-size: 20px; }
.rank-badge {
  min-width: 52px; padding: 11px; border-radius: 14px; background: var(--ink);
  color: white; text-align: center; font-size: 20px;
}
.ranking-note { color: var(--muted); font-size: 11px; }
.stat-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat-card { padding: 14px; border-radius: 14px; background: #edf3ef; }
.stat-card span { display: block; color: var(--muted); font-size: 11px; margin-bottom: 6px; }
.stat-card strong { font-size: 18px; }
.leaderboard { display: grid; gap: 4px; }
.leader-row {
  display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center;
  padding: 10px 12px; border-radius: 13px;
}
.leader-row.is-me { background: var(--green-light); color: var(--green); }
.leader-row span { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }
.leader-rank { color: var(--muted); }
.title-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.title-card {
  display: flex; flex-direction: column; min-height: 210px; padding: 18px;
  border: 1px solid #dce5df; border-radius: 17px;
  background: linear-gradient(150deg, #f8faf9, #edf3ef);
}
.title-card.is-mine {
  border-color: #d6aa51; background: linear-gradient(150deg, #fff8e8, #f6e3b9);
  box-shadow: inset 0 0 0 1px rgba(214,170,81,.25);
}
.title-mark { color: var(--green); font-size: 9px; font-weight: 900; letter-spacing: .12em; }
.title-card.is-mine .title-mark { color: #966717; }
.title-card h3 { margin: 12px 0 7px; font-size: 18px; letter-spacing: -.035em; }
.title-card p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.title-holder { margin-top: auto; padding-top: 18px; }
.title-holder strong, .title-holder span { display: block; }
.title-holder strong { font-size: 14px; }
.title-holder span { margin-top: 4px; color: var(--green); font-size: 11px; }
.title-holder.empty-holder span { color: var(--muted); }
.title-history { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.title-history h3 { margin: 0 0 12px; font-size: 15px; }
.title-history-row {
  display: grid; grid-template-columns: 1fr auto 150px; gap: 14px; align-items: center;
  padding: 11px 2px; border-bottom: 1px solid var(--line);
}
.title-history-row:last-child { border-bottom: 0; }
.title-history-row strong, .title-history-row span { display: block; }
.title-history-row span, .title-history-row small { color: var(--muted); font-size: 10px; }
.title-history-row span { margin-top: 3px; }
.title-history-row b { color: var(--green); font-size: 11px; }
.battle-results { display: grid; gap: 8px; }
.battle-row {
  display: grid; grid-template-columns: 44px 1.35fr repeat(4, 1fr); gap: 12px;
  align-items: center; padding: 13px; border-radius: 15px; background: #edf3ef;
}
.battle-row.is-me { box-shadow: inset 0 0 0 2px var(--green); }
.result-place { font-size: 20px; color: var(--green); }
.result-drone span, .accuracy-cell span, .accuracy-cell small {
  display: block; color: var(--muted); font-size: 10px;
}
.accuracy-cell b { display: block; margin: 3px 0; font-size: 16px; }
.accuracy-cell.overall { color: var(--green); }
.weather-history { display: grid; gap: 6px; }
.weather-history-row {
  display: grid; grid-template-columns: 1fr repeat(3, 100px) 230px; gap: 12px;
  align-items: center; padding: 11px 13px; border-radius: 13px; background: #edf3ef;
}
.weather-history-row span { color: var(--muted); font-size: 11px; }
.weather-history-row div span { display: block; margin-top: 3px; }
.admin-slots { display: grid; gap: 8px; }
.admin-rules {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: -8px 0 18px;
}
.admin-rules div {
  padding: 14px; border: 1px solid #dce6e0; border-radius: 15px;
  background: #f5f8f6;
}
.admin-rules b, .admin-rules span { display: block; }
.admin-rules span { margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.admin-player-activity { display: grid; gap: 8px; margin-bottom: 18px; }
.admin-player-row {
  display: grid; grid-template-columns: 1fr repeat(5, auto); gap: 10px; align-items: center;
  padding: 12px; border: 1px solid #dce6e0; border-radius: 14px; background: #f8faf9;
}
.admin-player-row.is-bot { opacity: .72; background: #edf3ef; }
.admin-player-row b, .admin-player-row span { display: block; }
.admin-player-row div span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.admin-player-row > span { color: var(--muted); font-size: 11px; white-space: nowrap; }
.admin-tools {
  display: grid; grid-template-columns: 1fr 180px 130px 110px auto auto auto;
  gap: 9px; align-items: center; margin-bottom: 18px; padding: 14px;
  border: 1px solid var(--line); border-radius: 15px; background: #edf3ef;
}
.admin-tools span { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.admin-tools input { width: 100%; padding: 9px; border: 1px solid var(--line); border-radius: 10px; font: inherit; }
.admin-tools .buy { background: var(--green); color: white; }
.admin-tools .cancel { background: #f5e7df; color: #9a4935; }
.admin-slot {
  display: grid; grid-template-columns: 1fr 75px 75px 75px auto; gap: 10px;
  align-items: center; padding: 12px; border-radius: 14px; background: #edf3ef;
}
.admin-slot span { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }
.admin-slot input {
  width: 100%; padding: 8px; border: 1px solid var(--line); border-radius: 9px; font: inherit;
}
.hidden { display: none; }
.ledger-panel { margin-top: 24px; }
.ledger-row { grid-template-columns: 1fr auto auto; padding: 10px 0; font-size: 13px; }
.ledger-row span { color: var(--muted); }
.ledger-filters { display: flex; gap: 6px; }
.ledger-filters .active { color: white; background: var(--green); border-color: var(--green); }
.positive { color: var(--green); font-weight: 800; }
.negative { color: #b1533f; font-weight: 800; }

@media (max-width: 850px) {
    .hero, .grid, .progress-grid, .guide-strip { grid-template-columns: 1fr; }
  .battle-row { grid-template-columns: 36px 1fr 1fr 1fr; }
  .weather-history-row { grid-template-columns: 1fr repeat(3, auto); }
  .weather-history-row > span { grid-column: 1 / -1; }
  .admin-slot { grid-template-columns: 1fr repeat(3, 70px); }
  .admin-slot .market-actions { grid-column: 1 / -1; }
  .admin-player-row { grid-template-columns: 1fr 1fr 1fr; }
  .admin-player-row div { grid-column: 1 / -1; }
  .admin-tools { grid-template-columns: 1fr 1fr; }
  .admin-tools > div:first-child { grid-column: 1 / -1; }
  .accuracy-cell:nth-last-child(-n+2) { grid-column: span 1; }
  .pool-card { min-height: 180px; }
  .pilot label { display: none; }
}
@media (max-width: 560px) {
  .brand span, .pilot strong { display: none; }
  .pilot #game-balance, .pilot #free-balance {
    display: inline-flex; align-items: center; min-height: 30px; padding: 6px 9px;
    border: 1px solid var(--line); border-radius: 999px; background: #fff;
    font-size: 10px; white-space: nowrap;
  }
  .topbar { padding: 0 16px; }
  main { width: min(100% - 20px, 1180px); margin-top: 20px; }
  .hero > div:first-child, .panel, .pool-card { border-radius: 20px; padding: 20px; }
  .status-line { align-items: flex-start; flex-direction: column; gap: 7px; }
  .drone-row { grid-template-columns: 32px 1fr; }
  .weather-values, .payout { grid-column: 2; text-align: left; }
  .market-actions { grid-column: 2; justify-content: flex-start; flex-wrap: wrap; }
  .battle-row { grid-template-columns: 32px 1fr; }
  .accuracy-cell { grid-column: 2; }
  .baseline-card { grid-template-columns: 1fr; }
  .weather-history-row { grid-template-columns: 1fr 1fr; }
  .admin-slot { grid-template-columns: 1fr; }
  .admin-slot .market-actions { grid-column: 1; }
  .admin-rules { grid-template-columns: 1fr; }
  .admin-player-row { grid-template-columns: 1fr 1fr; }
}

/* Desktop application shell */
body { background: #e9efeb; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 232px; z-index: 10;
  display: flex; flex-direction: column; padding: 24px 16px;
  color: #e8f4ef; background: linear-gradient(180deg, #102823 0%, #071713 100%);
  box-shadow: 18px 0 50px rgba(6, 28, 22, .16);
}
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 26px; }
.sidebar-brand strong, .sidebar-brand span { display: block; }
.sidebar-brand span { margin-top: 3px; color: #7fa69a; font-size: 11px; }
.sidebar .logo { background: #e6b657; color: #102823; }
.main-nav { display: grid; gap: 7px; }
.nav-button {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 14px;
  color: #92ada5; background: transparent; border: 1px solid transparent; text-align: left;
}
.nav-button span { color: #54756b; font-size: 10px; letter-spacing: .12em; }
.nav-button:hover, .nav-button.active {
  color: white; background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.07);
  transform: none;
}
.nav-button.active::after {
  content: ""; width: 6px; height: 6px; margin-left: auto; border-radius: 50%; background: #e6b657;
}
.nav-button.hidden { display: none; }
.sidebar-note {
  margin-top: auto; padding: 15px; border-radius: 15px; background: rgba(255,255,255,.06);
}
.sidebar-note b, .sidebar-note span { display: block; }
.sidebar-note span { margin-top: 4px; color: #789b90; font-size: 10px; }
.workspace { min-height: 100vh; margin-left: 232px; }
.topbar {
  height: 72px; padding: 0 30px; background: rgba(248,250,249,.9);
  border-bottom-color: #d7e0da;
}
.topbar .brand { display: none; }
.pilot { margin-left: auto; }
main { width: auto; max-width: 1450px; margin: 28px auto 70px; padding: 0 30px; }
.screen-section { display: none; animation: screen-in .22s ease-out; }
.screen-section.active { display: grid; }
.panel.screen-section.active { display: block; }
.screen-section.hidden { display: none; }
@keyframes screen-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: none; }
}
.panel {
  border-color: #dce5df; background: rgba(255,255,255,.93);
  box-shadow: 0 12px 35px rgba(31,61,51,.07);
}
.hero > div:first-child { background: linear-gradient(135deg, #102823, #155f4e); }
.pool-card { background: linear-gradient(145deg, #f7ca75, #e9aa42); }
.drone-row {
  margin-bottom: 8px; padding: 13px; border: 1px solid #e1e9e4; border-radius: 15px;
  background: #f7f9f8;
}
.drone-row:last-child { border-bottom: 1px solid #e1e9e4; }
.ledger-panel { margin-top: 0; }
.progress-grid { margin-top: 0; }
.screen-summary {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 22px;
}
.summary-card {
  padding: 15px; border: 1px solid #e0e8e3; border-radius: 15px;
  background: linear-gradient(145deg, #f8faf9, #eef4f0);
}
.summary-card span { display: block; color: var(--muted); font-size: 10px; margin-bottom: 7px; }
.summary-card strong { color: var(--ink); font-size: 18px; }
.status-chip {
  display: inline-flex; align-items: center; width: max-content; padding: 6px 9px; border-radius: 999px;
  color: #52645f; background: #e6ece8; font-size: 10px; font-weight: 800; white-space: nowrap;
}
.status-active { color: #087052; background: #d8f4e7; }
.status-locked, .status-listed { color: #82601b; background: #fff0c8; }
.status-calculated, .status-landed { color: #315c85; background: #dcebf8; }
.status-cancelled, .status-refunded { color: #934934; background: #f6e2dc; }
.drone-card {
  margin-bottom: 12px; padding: 18px; border: 1px solid #dce6e0; border-radius: 18px;
  background: linear-gradient(150deg, #ffffff, #f4f8f5); box-shadow: 0 8px 22px rgba(31,61,51,.055);
}
.hangar-note {
  margin: -6px 0 18px; padding: 15px; border-radius: 15px;
  background: #edf3ef; border: 1px solid #dce6e0;
}
.hangar-note b, .hangar-note span { display: block; }
.hangar-note span { margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.hangar-section-title {
  margin: 18px 0 10px; color: var(--green); font-size: 13px; text-transform: uppercase; letter-spacing: .12em;
}
.drone-card-head { display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 12px; }
.drone-card-head strong, .drone-card-head small { display: block; }
.drone-card-head small { color: var(--muted); font-size: 10px; margin-top: 3px; }
.drone-metrics {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 15px 0;
}
.drone-metrics > div { padding: 11px; border-radius: 12px; background: #edf3ef; }
.drone-metrics span, .drone-metrics b { display: block; }
.drone-metrics span { color: var(--muted); font-size: 9px; margin-bottom: 5px; }
.drone-metrics b { font-size: 12px; }
.drone-card .market-actions { padding-top: 12px; border-top: 1px solid #e2e9e5; }
.card-price { color: var(--green); font-size: 20px; }
.market-signal {
  display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: center;
  margin: 0 0 13px; padding: 11px 13px; border-radius: 12px; background: #edf3ef;
}
.market-signal span, .market-signal b { display: block; }
.market-signal span { color: var(--muted); font-size: 9px; margin-bottom: 4px; }
.market-signal b { font-size: 13px; }
.market-signal small { max-width: 230px; color: var(--muted); font-size: 9px; line-height: 1.4; }
.station-intro {
  display: flex; justify-content: space-between; gap: 20px; align-items: center;
  margin-bottom: 20px; padding: 18px; border-radius: 16px;
  color: white; background: linear-gradient(135deg, #102823, #155f4e);
}
.station-intro b, .station-intro span { display: block; }
.station-intro span { max-width: 720px; margin-top: 5px; color: #c8ded6; font-size: 11px; line-height: 1.5; }
.station-intro strong { white-space: nowrap; color: #f7ca75; font-size: 20px; }
.station-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.station-module {
  display: flex; flex-direction: column; min-height: 260px; padding: 20px;
  border: 1px solid #dce6e0; border-radius: 18px; background: #f6f9f7;
}
.station-module.built { border-color: #8bcab5; background: linear-gradient(150deg, #effaf5, #ddf2e8); }
.station-module.locked { opacity: .62; }
.station-module-head { display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.station-module.built .station-module-head b { color: var(--green); }
.station-module h3 { margin: 26px 0 8px; font-size: 19px; }
.station-module p { min-height: 55px; margin: 0 0 20px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.station-module-cost { display: flex; justify-content: space-between; align-items: center; margin-top: auto; margin-bottom: 12px; padding-top: 14px; border-top: 1px solid #dce6e0; }
.station-module-cost span { color: var(--muted); font-size: 10px; }
.tutorial-modal {
  position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 20px;
  background: rgba(8, 25, 20, .72); backdrop-filter: blur(5px);
}
.tutorial-modal.hidden { display: none; }
.tutorial-dialog {
  position: relative; width: min(560px, 100%); padding: 34px; overflow: hidden;
  border: 1px solid #d7e4dc; border-radius: 24px; background: #fff;
  box-shadow: 0 25px 80px rgba(7, 29, 22, .3);
}
.tutorial-progress { position: absolute; inset: 0 0 auto; height: 5px; background: #e7eeea; }
.tutorial-progress div { height: 100%; background: var(--green); transition: width .25s ease; }
.tutorial-dialog h2 { margin: 8px 35px 10px 0; font-size: 28px; }
.tutorial-text { min-height: 66px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.tutorial-visual {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center;
  min-height: 100px; margin: 22px 0; padding: 18px; border-radius: 17px;
  background: linear-gradient(135deg, #102823, #155f4e); color: white;
}
.tutorial-visual div { padding: 12px; border-radius: 12px; background: rgba(255,255,255,.08); }
.tutorial-visual strong, .tutorial-visual span { display: block; }
.tutorial-visual span { margin-top: 5px; color: #c8ded6; font-size: 10px; line-height: 1.4; }
.tutorial-visual .tutorial-drone { grid-column: 1 / -1; text-align: center; }
.tutorial-actions { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; }
.tutorial-actions span { color: var(--muted); font-size: 11px; text-align: center; }
.tutorial-focus { animation: tutorial-pulse 1.8s ease; }
.bug-report-dialog form { display: grid; gap: 14px; margin-top: 18px; }
.bug-report-dialog label span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 10px; font-weight: 700; }
.bug-report-dialog textarea {
  width: 100%; min-height: 90px; resize: vertical; box-sizing: border-box; padding: 12px;
  border: 1px solid #d7e2dc; border-radius: 12px; font: inherit; color: var(--ink); background: #f8faf9;
}
.admin-subtitle { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.bug-report-list { display: grid; gap: 10px; margin-bottom: 22px; }
.bug-report-card { padding: 15px; border: 1px solid #e7c6bc; border-radius: 14px; background: #fff8f5; }
.bug-report-card.resolved { opacity: .62; border-color: #dce6e0; background: #f5f8f6; }
.bug-report-head { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.bug-report-head strong, .bug-report-head span { display: block; }
.bug-report-head span, .bug-report-card small { margin-top: 4px; color: var(--muted); font-size: 10px; white-space: pre-line; }
.bug-report-card p { margin: 12px 0; font-size: 12px; line-height: 1.55; white-space: pre-line; }
@keyframes tutorial-pulse {
  0%, 100% { box-shadow: 0 12px 35px rgba(31,61,51,.07); }
  35% { box-shadow: 0 0 0 5px rgba(21, 128, 94, .2), 0 18px 45px rgba(21, 128, 94, .22); }
}

@media (max-width: 1050px) {
  .sidebar { width: 82px; padding: 20px 10px; }
  .sidebar-brand > div:last-child, .sidebar-note, .nav-button:not(.active)::after { display: none; }
  .sidebar-brand { padding: 0 10px 24px; }
  .nav-button { justify-content: center; padding: 13px 8px; font-size: 0; }
  .nav-button span { font-size: 11px; }
  .workspace { margin-left: 82px; }
  .screen-summary, .drone-metrics { grid-template-columns: 1fr 1fr; }
  .slot-cards { grid-template-columns: 1fr 1fr; }
  .title-grid { grid-template-columns: 1fr 1fr; }
  .quest-card.compact { grid-template-columns: 1fr; }
  .station-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .sidebar {
    position: fixed; inset: auto 0 0 0; width: auto; height: 66px; padding: 7px;
    flex-direction: row; align-items: center;
  }
  .sidebar-brand, .sidebar-note { display: none; }
  .main-nav {
    display: flex; width: 100%; gap: 4px; overflow-x: auto; overscroll-behavior-x: contain;
    scrollbar-width: none; scroll-snap-type: x proximity;
  }
  .main-nav::-webkit-scrollbar { display: none; }
  .nav-button {
    flex: 0 0 auto; width: auto; min-width: 72px; min-height: 50px; padding: 8px 10px;
    justify-content: center; font-size: 9px; scroll-snap-align: center;
  }
  .nav-button span { display: none; }
  .workspace { margin-left: 0; padding-bottom: 70px; }
  .topbar { height: 64px; padding: 0 10px; overflow-x: auto; }
  .pilot { gap: 6px; min-width: max-content; }
  .pilot select { max-width: 150px; padding: 8px 25px 8px 9px; font-size: 11px; }
  .pilot button { min-height: 42px; padding: 8px 10px; font-size: 10px; }
  #tutorial-open { display: none; }
  main { padding: 0 12px; }
  .screen-summary, .drone-metrics { grid-template-columns: 1fr; }
  .slot-cards { grid-template-columns: 1fr; }
  .title-grid { grid-template-columns: 1fr; }
  .quest-grid { grid-template-columns: 1fr; }
  .return-item { grid-template-columns: 1fr auto; }
  .return-item button { grid-column: 1 / -1; }
  .drone-card-head { grid-template-columns: 36px 1fr; }
  .drone-card-head > :last-child { grid-column: 2; }
  .notification-panel { position: fixed; top: 76px; right: 10px; left: 10px; width: auto; }
  .title-history-row { grid-template-columns: 1fr auto; }
  .title-history-row small { grid-column: 1 / -1; }
  .passport-dialog { padding: 22px; }
  .passport-stats { grid-template-columns: 1fr 1fr; }
  .passport-row { grid-template-columns: 1fr auto; }
  .passport-row small { grid-column: 1 / -1; text-align: left; }
  .launch-preview { grid-template-columns: 1fr; }
  .launch-preview small { grid-column: 1; }
  .market-signal { grid-template-columns: 1fr 1fr; }
  .market-signal small { grid-column: 1 / -1; }
  .station-intro { align-items: flex-start; flex-direction: column; }
  .panel { padding: 18px; border-radius: 18px; }
  .panel-title { align-items: flex-start; margin-bottom: 18px; }
  .hero > div:first-child, .pool-card { padding: 22px; border-radius: 20px; }
  .status-line { flex-wrap: wrap; gap: 9px 14px; }
  .estimate { grid-template-columns: 1fr auto; }
  .estimate button { grid-column: 1 / -1; }
  .ledger-row { grid-template-columns: 1fr auto; gap: 8px; }
  .ledger-row > :last-child { grid-column: 1 / -1; text-align: left; }
  .market-actions { justify-content: flex-start; flex-wrap: wrap; }
  .market-actions input { flex: 1 1 95px; }
  button, select, input, textarea { touch-action: manipulation; }
  input[type=range] { min-height: 32px; }
  .tutorial-dialog { max-height: calc(100vh - 24px); overflow-y: auto; padding: 26px 20px 20px; }
  .tutorial-visual { grid-template-columns: 1fr; }
  .tutorial-visual b { text-align: center; }
  .welcome-shell { width: min(100% - 20px, 1120px); }
  .welcome-head { padding: 12px 2px; }
  .welcome-head .sidebar-brand span { display: block; }
  .welcome-hero { grid-template-columns: 1fr; padding: 26px 20px; border-radius: 22px; }
  .welcome-hero h1 { font-size: 42px; }
  .welcome-flight { display: none; }
  .welcome-actions { align-items: stretch; flex-direction: column; }
  .welcome-actions .primary { width: 100%; }
  .welcome-grid, .welcome-rules { grid-template-columns: 1fr; }
  .welcome-grid { gap: 8px; margin: 12px 0; }
  .welcome-grid article { padding: 18px; }
  .welcome-grid h3 { margin-top: 10px; }
  .welcome-rules { gap: 12px; padding: 20px; }
  .welcome-footer { flex-wrap: wrap; gap: 6px 12px; }
}
