/* Event App v1.5.2 */
:root {
  --bg: #edf1ed;
  --card: #ffffff;
  --ink: #14201c;
  --muted: #65716b;
  --line: #d6ded8;
  --accent: #294b3e;
  --accent-strong: #18352b;
  --soft: #f6f8f6;
  --soft-2: #eef3ef;
  --danger: #9a2e2e;
  --warning: #94620b;
  --shadow: 0 12px 30px rgba(20, 40, 32, .08);
  --shadow-strong: 0 18px 44px rgba(20, 40, 32, .14);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  background:
    radial-gradient(circle at top right, rgba(41,75,62,.07), transparent 28rem),
    var(--bg);
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
.hidden { display: none !important; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: 78px 1fr 78px;
  align-items: center;
  gap: 8px;
  padding: max(10px, env(safe-area-inset-top)) 14px 10px;
  border-bottom: 1px solid rgba(214,222,216,.9);
  background: rgba(237,241,237,.94);
  backdrop-filter: blur(14px);
}
.title-wrap { text-align: center; min-width: 0; }
.topbar h1 {
  margin: 2px 0 0;
  font-size: clamp(16px, 4vw, 20px);
  line-height: 1.05;
  letter-spacing: .01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.eyebrow {
  display: block;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .14em;
  color: var(--muted);
}
.small-btn {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: white;
  color: var(--ink);
  font-weight: 850;
  box-shadow: 0 3px 10px rgba(20,40,32,.04);
}
.shell {
  width: min(800px, 100%);
  margin: 0 auto;
  padding: 18px 14px 72px;
}
.view { animation: fadeIn .18s ease-out; }
@keyframes fadeIn {
  from { opacity: .25; transform: translateY(3px); }
  to { opacity: 1; transform: none; }
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 14px;
}
.hero { padding: 26px; }
.home-hero {
  overflow: hidden;
  position: relative;
  color: white;
  border: 0;
  background:
    linear-gradient(135deg, rgba(255,255,255,.04), rgba(255,255,255,0)),
    linear-gradient(135deg, #17352b, #315946);
  box-shadow: var(--shadow-strong);
}
.home-hero::after {
  content: "";
  position: absolute;
  right: -42px;
  top: -58px;
  width: 180px;
  height: 180px;
  border: 30px solid rgba(255,255,255,.045);
  border-radius: 50%;
}
.hero-eyebrow, .home-hero .lead { color: rgba(255,255,255,.74); }
.home-hero h2 {
  position: relative;
  z-index: 1;
  margin: 6px 0 7px;
  font-size: clamp(36px, 9vw, 56px);
  line-height: .98;
  letter-spacing: -.045em;
}
.lead {
  position: relative;
  z-index: 1;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 18px;
  font-weight: 650;
}

.event-meta {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin-top: 22px;
}
.event-fact {
  min-width: 0;
  border: 1px solid rgba(255,255,255,.15);
  background: rgba(255,255,255,.095);
  border-radius: 16px;
  padding: 11px 12px;
}
.event-fact span {
  display: block;
  color: rgba(255,255,255,.66);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .11em;
}
.event-fact strong {
  display: block;
  margin-top: 4px;
  color: white;
  font-size: 16px;
  line-height: 1.22;
}

.section-intro { margin: 20px 4px 10px; }
.section-intro h2 {
  margin: 2px 0 0;
  font-size: 26px;
  letter-spacing: -.02em;
}

.team-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 12px 0 18px;
}
.team-btn {
  position: relative;
  overflow: hidden;
  border: 0;
  min-height: 118px;
  border-radius: 21px;
  color: white;
  text-align: left;
  padding: 20px;
  box-shadow: var(--shadow);
  transition: transform .12s ease, box-shadow .12s ease;
}
.team-btn:active { transform: scale(.985); }
.team-btn::after {
  content: "›";
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 42px;
  line-height: 1;
  opacity: .55;
}
.team-btn .team-icon { display: block; margin-bottom: 8px; font-size: 23px; }
.team-btn strong {
  display: block;
  padding-right: 32px;
  font-size: 24px;
  line-height: 1.05;
}
.team-btn span {
  display: block;
  margin-top: 7px;
  padding-right: 28px;
  opacity: .8;
  font-size: 14px;
  font-weight: 650;
}

.details { padding: 0; overflow: hidden; }
.details summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 19px 20px;
  font-size: 20px;
  line-height: 1.2;
  font-weight: 900;
  cursor: pointer;
}
.details summary::-webkit-details-marker { display: none; }
.details summary::after {
  content: "+";
  margin-left: auto;
  color: var(--muted);
  font-size: 25px;
  font-weight: 700;
}
.details[open] summary::after { content: "–"; }
.summary-icon { width: 28px; text-align: center; }
.details-body {
  border-top: 1px solid var(--line);
  padding: 18px 20px 20px;
  line-height: 1.65;
}
.details-body p:first-child { margin-top: 0; }
.details-body p:last-child { margin-bottom: 0; }

.rule {
  position: relative;
  padding: 14px 0 14px 41px;
  border-bottom: 1px solid var(--line);
}
.rule:last-child { border-bottom: 0; }
.rule .rule-icon {
  position: absolute;
  left: 0;
  top: 14px;
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--soft-2);
  font-size: 16px;
}
.rule h3 {
  margin: 0 0 5px;
  font-size: 18px;
  line-height: 1.25;
}
.rule p {
  margin: 0;
  color: #3b4741;
  line-height: 1.55;
}

.map-button {
  margin-top: 18px;
  background: #e9f0eb;
  border: 1px solid #cad8cf;
  color: var(--accent-strong);
}

.home-footer-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}
.home-action { min-height: 48px; }
.ghost {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
}

.team-header {
  position: relative;
  overflow: hidden;
  color: white;
  border-radius: 22px;
  padding: 23px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-strong);
}
.team-header::after {
  content: "🛡️";
  position: absolute;
  right: 18px;
  top: 12px;
  font-size: 54px;
  opacity: .14;
}
.team-header h2 {
  margin: 4px 0;
  padding-right: 54px;
  font-size: clamp(31px, 8vw, 44px);
  line-height: 1;
  letter-spacing: -.035em;
}
.team-header p { margin: 8px 0 0; opacity: .82; font-weight: 700; }

.card-heading {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.card-heading h2 {
  margin: 2px 0 0;
  font-size: 28px;
  line-height: 1.05;
  letter-spacing: -.025em;
}
.card-icon {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--soft-2);
  font-size: 22px;
}
.compact-heading { align-items: center; }
.standing-panel {
  border-left: 5px solid var(--accent);
  padding-left: 18px;
}
.standing {
  margin: 15px 0 0;
  color: #2f3c36;
  line-height: 1.62;
  font-size: 16px;
}

.mission {
  position: relative;
  overflow: hidden;
  border: 2px solid #cfd8d2;
}
.mission.active {
  border-color: var(--accent);
  box-shadow: 0 15px 34px rgba(20,40,32,.12);
}
.mission-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 5px;
}
.mission-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  padding: 6px 10px;
  background: #e8f1eb;
  color: #245339;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
}
.mission-status.idle {
  background: #f2f4f2;
  color: var(--muted);
}
.mission-sync {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.mission h2 {
  margin: 7px 0 8px;
  font-size: clamp(31px, 8vw, 43px);
  line-height: 1;
  letter-spacing: -.04em;
}
.mission-time {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 17px;
  border-radius: 11px;
  background: var(--soft-2);
  padding: 8px 11px;
  color: var(--accent-strong);
  font-weight: 900;
}
.mission-steps {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: mission-step;
}
.mission-steps li {
  position: relative;
  padding: 12px 13px 12px 47px;
  border: 1px solid #e0e6e2;
  border-radius: 14px;
  background: #fafbfa;
  color: #2d3933;
  line-height: 1.52;
  counter-increment: mission-step;
}
.mission-steps li::before {
  content: counter(mission-step);
  position: absolute;
  left: 12px;
  top: 11px;
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  font-size: 12px;
  font-weight: 900;
}
.mission-copy {
  white-space: pre-line;
  line-height: 1.62;
  color: #303c36;
}
.intel {
  margin-top: 16px;
  border: 1px solid #e0d3a5;
  background: #fbf7e9;
  border-radius: 15px;
  padding: 14px;
  color: #493c1e;
  line-height: 1.5;
}
.intel strong {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  letter-spacing: .09em;
}
.next-orders {
  border-top: 1px solid var(--line);
  margin-top: 17px;
  padding-top: 14px;
  color: var(--muted);
  font-weight: 800;
}

.notice {
  padding: 14px 16px;
  margin-bottom: 11px;
  border-radius: 16px;
  background: #fff5df;
  border: 1px solid #e8cfa0;
  box-shadow: 0 7px 18px rgba(119,83,20,.07);
}
.notice small {
  display: block;
  color: #7a5313;
  font-weight: 900;
  letter-spacing: .1em;
  margin-bottom: 4px;
}

.row-between {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.row-between small {
  max-width: 150px;
  color: var(--muted);
  text-align: right;
  line-height: 1.35;
}
.scoreboard {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 15px;
}
.score-box {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 15px;
  background: var(--soft);
}
.score-box strong {
  display: block;
  color: #4b5751;
  font-size: 14px;
  line-height: 1.25;
}
.score-box span {
  display: block;
  margin-top: 4px;
  font-size: 40px;
  line-height: .95;
  font-weight: 950;
  letter-spacing: -.05em;
}
.score-box small { color: var(--muted); }
.sync-note {
  margin: 9px 4px 0;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
  line-height: 1.45;
}

.button {
  border-radius: 13px;
  min-height: 46px;
  padding: 0 16px;
  font-weight: 850;
}
.primary {
  border: 0;
  background: var(--accent);
  color: white;
}
.secondary {
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
}
.danger {
  border: 1px solid #e8bcbc;
  background: #fff2f2;
  color: var(--danger);
}
.full { width: 100%; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(12,21,18,.6);
  display: grid;
  place-items: center;
  padding: 20px;
}
.modal-card {
  position: relative;
  width: min(430px, 100%);
  background: white;
  border-radius: 22px;
  padding: 24px;
  box-shadow: var(--shadow-strong);
}
.modal-card h2 {
  margin: 5px 30px 17px 0;
  font-size: 28px;
  line-height: 1.08;
}
.close-btn {
  position: absolute;
  right: 12px;
  top: 9px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: var(--soft);
  font-size: 26px;
  color: var(--muted);
}
.pin-form { display: flex; gap: 9px; }
.pin-input {
  width: 135px;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 13px;
  text-align: center;
  font-size: 23px;
  letter-spacing: .2em;
}
.error {
  color: var(--danger);
  min-height: 18px;
  font-size: 13px;
  font-weight: 750;
}
.install-help {
  color: #3f4b45;
  line-height: 1.6;
}

.map-modal {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: flex;
  flex-direction: column;
  background: #111814;
}
.map-toolbar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: max(10px, env(safe-area-inset-top)) 12px 10px;
  background: rgba(17,24,20,.96);
  color: white;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.map-toolbar > div {
  display: flex;
  align-items: center;
  gap: 8px;
}
.map-toolbar strong { font-size: 17px; }
.map-scroll {
  flex: 1;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 10px;
  text-align: center;
}
.map-scroll img {
  display: block;
  width: min(100%, 1000px);
  height: auto;
  margin: 0 auto;
  border-radius: 12px;
  background: white;
}

.admin-tabs {
  position: sticky;
  top: 72px;
  z-index: 20;
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding: 6px;
  border: 1px solid var(--line);
  background: rgba(237,241,237,.96);
  backdrop-filter: blur(12px);
  border-radius: 15px;
  margin-bottom: 14px;
}
.tab {
  flex: 1 0 auto;
  border: 0;
  border-radius: 10px;
  padding: 11px 12px;
  background: transparent;
  color: var(--muted);
  font-weight: 850;
}
.tab.active {
  background: white;
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
}
.admin-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 19px;
  margin-bottom: 13px;
  box-shadow: var(--shadow);
}
.admin-card h3 {
  margin: 4px 0 14px;
  font-size: 24px;
  line-height: 1.08;
  letter-spacing: -.02em;
}
.fields {
  display: grid;
  gap: 10px;
}
.fields.two { grid-template-columns: 1fr 1fr; }
.field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}
.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 12px;
  background: white;
  color: var(--ink);
  font-size: 16px;
}
.field textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.5;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.entry {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}
.entry:first-child { border-top: 0; }
.entry strong, .entry small { display: block; }
.entry small {
  color: var(--muted);
  margin-top: 3px;
  line-height: 1.4;
}
.badge {
  border-radius: 999px;
  background: #edf1ee;
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 850;
}
.badge.draft { background: #fff0d9; color: #71501f; }
.badge.live { background: #e4f3e9; color: #245f39; }
.admin-card .rule[data-mission-id] {
  margin: 12px 0 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fafbfa;
}

.admin-card .rule:not([data-mission-id]) {
  padding-left: 0;
}
.admin-card .rule:not([data-mission-id]) .rule-icon {
  display: none;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: max(25px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 200;
  max-width: calc(100vw - 32px);
  background: #17231e;
  color: white;
  border-radius: 999px;
  padding: 12px 18px;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
  box-shadow: var(--shadow-strong);
}
.loading-card {
  display: flex;
  align-items: center;
  gap: 10px;
}
.loading-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1s ease-in-out infinite alternate;
}
@keyframes pulse { to { opacity: .25; transform: scale(.72); } }

footer {
  text-align: center;
  color: var(--muted);
  font-size: 11px;
  padding: 5px 0 24px;
}

@media (max-width: 640px) {
  .shell { padding-left: 11px; padding-right: 11px; }
  .topbar { grid-template-columns: 72px 1fr 72px; }
  .event-meta { grid-template-columns: 1fr; }
  .event-fact { display: grid; grid-template-columns: 110px 1fr; align-items: center; }
  .event-fact strong { margin-top: 0; text-align: right; }
  .team-buttons { grid-template-columns: 1fr; }
  .team-btn { min-height: 100px; }
  .fields.two { grid-template-columns: 1fr; }
  .pin-form { flex-direction: column; }
  .pin-input, .pin-form .button { width: 100%; }
  .row-between { align-items: flex-start; }
}

@media (max-width: 410px) {
  .topbar { grid-template-columns: 64px 1fr 64px; padding-left: 8px; padding-right: 8px; }
  .small-btn { font-size: 13px; padding: 0 8px; }
  .home-footer-actions { grid-template-columns: 1fr 1fr; }
  .scoreboard { grid-template-columns: 1fr 1fr; }
  .score-box { padding: 12px; }
  .score-box span { font-size: 35px; }
  .details summary { font-size: 18px; }
}


/* v1.2.0 mission board */
.title-wrap {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: left;
}
.top-logo {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  object-fit: contain;
}
.top-title-copy {
  min-width: 0;
}
.topbar h1 {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.05;
  word-break: normal;
}
.standalone-map-button {
  margin: 0 0 16px;
  min-height: 52px;
  font-size: 16px;
  box-shadow: 0 8px 20px rgba(20,40,32,.06);
}
.team-map-button {
  margin-top: -2px;
  margin-bottom: 14px;
}

.mission-stack {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}
.player-mission-card {
  overflow: hidden;
  border: 2px solid var(--accent);
  border-radius: 20px;
  background: white;
  box-shadow: var(--shadow);
}
.player-mission-card summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 17px 18px;
  cursor: pointer;
  background: linear-gradient(90deg, #f4f8f5, #fff);
}
.player-mission-card summary::-webkit-details-marker { display: none; }
.player-mission-card summary::after {
  content: "▾";
  margin-left: 4px;
  color: var(--muted);
  font-size: 18px;
  transition: transform .16s ease;
}
.player-mission-card:not([open]) summary::after {
  transform: rotate(-90deg);
}
.player-mission-summary-main {
  min-width: 0;
  display: grid;
  gap: 6px;
}
.player-mission-summary-main strong {
  font-size: 24px;
  line-height: 1.04;
  letter-spacing: -.025em;
}
.player-mission-summary-time {
  flex: 0 0 auto;
  color: var(--accent-strong);
  font-weight: 900;
  font-size: 14px;
  white-space: nowrap;
}
.player-mission-body {
  padding: 17px 18px 19px;
  border-top: 1px solid var(--line);
}
.mission-next-global {
  margin: 1px 2px 0;
  padding: 12px 14px;
  border: 1px dashed #cbd6cf;
  border-radius: 13px;
  background: rgba(255,255,255,.55);
}
.idle-mission-card {
  margin-bottom: 0;
}
.mission-new {
  animation: missionArrival 10s ease-out forwards;
}
@keyframes missionArrival {
  0%, 8% { background: #eef8d9; box-shadow: 0 0 0 5px rgba(133,170,76,.22), var(--shadow-strong); }
  18% { background: #fff; }
  30% { background: #f4f8e9; }
  48%, 100% { background: #fff; box-shadow: var(--shadow); }
}

.admin-help {
  margin: -4px 0 15px;
  color: var(--muted);
  line-height: 1.5;
}
.pipeline-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 12px;
  margin-top: 14px;
}
.pipeline-lane {
  overflow: hidden;
  border: 1px solid var(--line);
  border-top: 5px solid var(--mission-team);
  border-radius: 16px;
  background: #fafbfa;
}
.pipeline-lane-title {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 13px;
  border-bottom: 1px solid var(--line);
}
.pipeline-lane-title strong {
  flex: 1;
  font-size: 15px;
}
.pipeline-lane-title > span:last-child {
  min-width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: white;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}
.team-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.pipeline-mission {
  margin: 9px;
  padding: 11px 11px 10px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--mission-team);
  border-radius: 12px;
  background: white;
}
.pipeline-mission.active {
  box-shadow: inset 0 0 0 1px #acd3b8;
  background: #f1f8f3;
}
.pipeline-mission > div:first-child {
  display: grid;
  gap: 3px;
}
.pipeline-mission strong {
  font-size: 14px;
  line-height: 1.25;
}
.pipeline-phase {
  color: var(--muted);
  font-size: 9px;
  font-weight: 950;
  letter-spacing: .1em;
}
.pipeline-mission.active .pipeline-phase { color: #216239; }
.pipeline-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}
.empty-pipeline {
  padding: 18px 13px;
  color: var(--muted);
  font-size: 13px;
}
.admin-section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin: 24px 3px 10px;
}
.admin-section-heading h2 {
  margin: 2px 0 0;
  font-size: 25px;
  line-height: 1.05;
}
.count-pill {
  min-width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: white;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}
.mission-add-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.new-mission-button {
  min-height: 43px;
  border: 1px solid;
  background: white;
}
.admin-mission-card {
  overflow: hidden;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-left: 7px solid var(--mission-team);
  border-radius: 18px;
  background: white;
  box-shadow: var(--shadow);
}
.admin-mission-card summary {
  list-style: none;
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 15px 16px;
  cursor: pointer;
  background: linear-gradient(90deg, color-mix(in srgb, var(--mission-team) 8%, white), white 44%);
}
.admin-mission-card summary::-webkit-details-marker { display: none; }
.admin-mission-card summary::after {
  content: "▾";
  grid-column: 2;
  grid-row: 1;
  align-self: start;
  margin-left: 5px;
  color: var(--muted);
}
.admin-mission-card:not([open]) summary::after { transform: rotate(-90deg); }
.admin-mission-summary-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  padding-right: 22px;
}
.admin-mission-summary-main strong {
  min-width: 0;
  font-size: 18px;
  line-height: 1.15;
}
.admin-mission-summary-meta {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 7px 12px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}
.admin-mission-body {
  padding: 16px;
  border-top: 1px solid var(--line);
}
.badge.active { background: #e4f3e9; color: #245f39; }
.badge.scheduled { background: #eaf0f6; color: #31556f; }
.badge.past { background: #eee; color: #686868; }
.badge.cancelled { background: #fff0f0; color: #8b3434; }
.badge.draft { background: #fff0d9; color: #71501f; }
.pipeline-button {
  border: 0;
  background: #315946;
  color: white;
}
.field-help {
  display: block;
  margin-top: -1px;
  color: #87918c;
  font-size: 10px;
  font-weight: 650;
}
.empty-admin-state {
  color: var(--muted);
  text-align: center;
  padding: 24px;
}
.archive-card {
  margin-top: 24px;
  padding: 0;
}
.archive-card > summary {
  padding: 17px 19px;
  cursor: pointer;
  font-weight: 900;
}
.archive-list {
  padding: 0 12px 12px;
}
.faction-settings {
  padding-bottom: 8px;
}
.faction-editor {
  margin: 14px -1px 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-left: 6px solid var(--mission-team);
  border-radius: 16px;
  background: #fafbfa;
}
.faction-editor h3 {
  margin-top: 3px;
}

@media (max-width: 640px) {
  .topbar {
    grid-template-columns: 64px minmax(0,1fr) 64px;
    gap: 5px;
  }
  .title-wrap {
    gap: 7px;
    justify-content: center;
  }
  .top-logo {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }
  .top-title-copy .eyebrow {
    font-size: 8px;
    letter-spacing: .11em;
  }
  .topbar h1 {
    font-size: 14px;
    max-width: 180px;
  }
  .player-mission-card summary {
    display: block;
    position: relative;
    padding-right: 38px;
  }
  .player-mission-card summary::after {
    position: absolute;
    right: 16px;
    top: 18px;
  }
  .player-mission-summary-time {
    margin-top: 8px;
    white-space: normal;
  }
  .pipeline-grid {
    grid-template-columns: 1fr;
  }
  .admin-mission-card summary {
    display: block;
    position: relative;
    padding-right: 38px;
  }
  .admin-mission-card summary::after {
    position: absolute;
    right: 15px;
    top: 16px;
  }
  .admin-mission-summary-main {
    padding-right: 0;
    align-items: flex-start;
  }
  .admin-mission-summary-meta {
    margin-top: 8px;
  }
  .mission-add-row {
    display: grid;
  }
  .new-mission-button {
    width: 100%;
  }
}

.mission-new > summary {
  animation: missionSummaryArrival 10s ease-out forwards;
}
@keyframes missionSummaryArrival {
  0%, 8% { background: #eff9dc; }
  18% { background: #fff; }
  30% { background: #f6faed; }
  48%, 100% { background: linear-gradient(90deg, #f4f8f5, #fff); }
}


/* v1.3.0 refinements */
.announcement-editor {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fafbfa;
}
.announcement-editor + .announcement-editor {
  margin-top: 10px;
}

.team-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.team-header::after {
  display: none;
}
.team-header-copy {
  min-width: 0;
}
.team-hero-icon {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 9px 24px rgba(0,0,0,.18);
  font-size: 42px;
  opacity: 1;
}

.player-mission-card .mission-status {
  background: #36e56c;
  color: #063817;
  box-shadow: 0 0 0 0 rgba(54,229,108,.55);
  animation: activeMissionPulse 1.35s ease-in-out infinite;
}
@keyframes activeMissionPulse {
  0%, 100% {
    background: #36e56c;
    box-shadow: 0 0 0 0 rgba(54,229,108,.42);
  }
  50% {
    background: #6cff94;
    box-shadow: 0 0 0 6px rgba(54,229,108,0);
  }
}
.badge.active {
  background: #43e875;
  color: #073818;
}

.standalone-map-button {
  margin-top: 2px;
}
.team-map-button {
  margin-top: 0;
  margin-bottom: 14px;
}

@media (max-width: 640px) {
  .top-title-copy {
    display: flex;
    align-items: baseline;
    gap: 6px;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
  }
  .top-title-copy .eyebrow {
    flex: 0 0 auto;
    font-size: 8px;
    letter-spacing: .08em;
  }
  .top-title-copy h1 {
    min-width: 0;
    margin: 0;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .top-logo {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }
  .team-hero-icon {
    width: 62px;
    height: 62px;
    border-radius: 17px;
    font-size: 36px;
  }
  .team-header h2 {
    padding-right: 0;
  }
}


/* v1.4.0 header, footer branding and quick mission templates */
.title-wrap {
  display: block;
  text-align: center;
  min-width: 0;
}
.topbar h1 {
  margin: 0;
  max-width: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: clamp(15px, 4.2vw, 19px);
  line-height: 1.1;
  letter-spacing: .01em;
}
.app-footer {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 20px 12px max(28px, env(safe-area-inset-bottom));
  color: var(--muted);
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #53605a;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .13em;
}
.footer-brand img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}
.footer-version {
  font-size: 10px;
  color: #7b857f;
}
.mission-template-builder {
  border-top: 4px solid var(--accent);
}
.mission-template-builder .mission-add-row {
  margin-top: 13px;
  margin-bottom: 0;
}

@media (max-width: 640px) {
  .title-wrap {
    display: block;
    text-align: center;
  }
  .topbar h1 {
    max-width: none;
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}


/* v1.4.1 header width and map button polish */
.topbar.solo-title {
  grid-template-columns: minmax(0, 1fr);
}
.topbar.solo-title .title-wrap {
  grid-column: 1;
  width: 100%;
}
.topbar.solo-title h1 {
  width: 100%;
  max-width: none;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  text-align: center;
}

.map-button {
  background: #ffffff;
  border: 1px solid var(--line);
  color: var(--ink);
  box-shadow: var(--shadow);
}
.standalone-map-button {
  min-height: 64px;
  border-radius: 20px;
  font-size: 20px;
  font-weight: 900;
}

@media (max-width: 640px) {
  .topbar.solo-title {
    grid-template-columns: minmax(0, 1fr);
  }
  .topbar.solo-title h1 {
    max-width: none;
    font-size: 17px;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }
}

/* v1.5.0: SWAG-style primary navigation, tools, touch map and offline-ready settings. */
.shell{padding-bottom:118px}.primary-page-intro p{margin:7px 0 0;color:var(--muted);line-height:1.5}.home-score-panel{margin-top:16px}
.bottom-nav{position:fixed;z-index:50;left:0;right:0;bottom:0;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:3px;padding:8px 8px calc(8px + env(safe-area-inset-bottom));background:rgba(255,255,255,.97);backdrop-filter:blur(18px);border-top:1px solid var(--line);box-shadow:0 -4px 24px rgba(20,40,32,.06)}
.navbtn{border:0;border-radius:12px;background:none;color:var(--muted);display:grid;place-items:center;align-content:center;gap:5px;min-height:54px;min-width:0;padding:7px 2px;font-size:14px;font-weight:650;text-align:center;transition:background .18s,color .18s,transform .18s}.navbtn span{display:block;line-height:1.15}.navbtn span:first-child{font-size:22px;line-height:1}.navbtn.active{color:var(--accent);background:var(--soft-2);font-weight:900}.navbtn:active{transform:scale(.97)}.app-footer{padding-bottom:calc(100px + env(safe-area-inset-bottom))}.toast{bottom:calc(98px + env(safe-area-inset-bottom))}
.settings-card h2{margin:5px 0 8px}.settings-card p{color:var(--muted);line-height:1.55}.settings-label{display:block;color:var(--accent);font-size:10px;font-weight:900;letter-spacing:.13em}.version-pill{display:inline-block;border-radius:999px;padding:4px 9px;background:var(--soft-2);color:var(--accent);font-size:13px;vertical-align:middle}.settings-actions{display:flex;gap:9px;flex-wrap:wrap;margin-top:14px}.settings-status{margin-top:12px;border:1px solid var(--line);border-radius:12px;padding:11px 12px;background:var(--soft);color:var(--muted);font-size:13px}
.tool-details>summary{min-height:72px}.radio-tool-body{padding-top:14px}.radio-inner-section{padding:4px 0 18px}.radio-inner-section+.radio-inner-section{border-top:1px solid var(--line);padding-top:18px}.radio-inner-section h3{margin:4px 0 6px;font-size:20px}.radio-section-intro{margin:5px 0 0;color:var(--muted);font-size:14px;line-height:1.5}.radio-legend{display:flex;gap:7px;flex-wrap:wrap;margin-top:10px}.radio-key{border:1px solid var(--line);border-radius:999px;padding:5px 9px;background:var(--soft);font-size:11px;font-weight:850;white-space:nowrap}.radio-subdetails{border-top:1px solid var(--line);padding:15px 0}.radio-subdetails>summary{cursor:pointer;font-size:17px;font-weight:900;color:var(--ink)}.radio-subdetails>summary::marker{color:var(--accent)}
.radio-list{display:grid;gap:6px;margin-top:14px}.radio-row{display:grid;grid-template-columns:62px 150px minmax(0,1fr) auto;align-items:center;gap:10px;min-height:48px;padding:8px 10px;border:1px solid var(--line);border-left:5px solid #2f7b4c;border-radius:11px;background:#f7faf8;font-size:13px}.radio-row.avoid{border-left-color:#c17a16;background:#fff8ec}.radio-row.blocked{border-left-color:var(--danger);background:#fff2f0}.radio-row.special{border-left-color:#327cbc;background:#eef6fc}.radio-row.scan{border-left-color:#7a8780;background:#f4f6f5}.radio-ch{font-size:14px;white-space:nowrap}.radio-freq{font-weight:800;font-variant-numeric:tabular-nums;white-space:nowrap;color:var(--ink)}.radio-freq:not(.scan-freq)::after{content:" MHz";font-size:10px;color:var(--muted);font-weight:700}.radio-use{color:var(--muted);font-weight:650;min-width:0}.radio-badge{font-size:10px;font-weight:900;letter-spacing:.06em;border-radius:999px;padding:4px 7px;border:1px solid currentColor;white-space:nowrap;color:#2f7b4c}.radio-row.avoid .radio-badge{color:#9a5a08}.radio-row.blocked .radio-badge{color:var(--danger)}.radio-row.special .radio-badge{color:#28699d}.radio-row.scan .radio-badge{color:#64716a}
.local-only{display:inline-flex;align-items:center;gap:6px;margin-top:5px;color:var(--muted);font-size:12px;font-weight:700}.game-freq-form{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:14px}.game-freq-form .notes{grid-column:1/-1}.game-freq-form .button{grid-column:1/-1;justify-self:start}.game-freq-saved{display:grid;gap:8px;margin-top:16px}.game-freq-empty{margin:0;padding:12px 14px;border:1px dashed var(--line);border-radius:12px;background:var(--soft);color:var(--muted);font-size:13px;text-align:center}.game-freq-card{border:1px solid #b8d0c2;border-left:5px solid var(--accent);border-radius:13px;background:#f4faf6;padding:13px 14px}.game-freq-top{display:flex;align-items:center;gap:10px}.game-freq-top strong{font-size:17px;line-height:1.25;flex:1}.game-freq-delete{width:34px;height:34px;flex:0 0 34px;border:1px solid #dfbeb8;border-radius:10px;background:#fff3f0;color:var(--danger);font-size:22px;line-height:1}.game-freq-meta{display:flex;gap:18px;flex-wrap:wrap;margin-top:10px}.game-freq-meta span{font-size:14px;font-weight:850}.game-freq-meta small{display:block;margin-bottom:2px;color:var(--muted);font-size:9px;font-weight:900;letter-spacing:.08em}.game-freq-card p{margin:9px 0 0;font-size:13px;line-height:1.5;white-space:pre-wrap}.radio-note{margin-top:3px;border-radius:13px;padding:14px;background:var(--soft)}.radio-note p{margin:5px 0 0;color:var(--muted);font-size:13px;line-height:1.55}
.map-scroll{position:relative;flex:1;overflow:hidden;overscroll-behavior:none;touch-action:none;padding:0;text-align:initial;user-select:none}.map-stage{position:absolute;left:0;top:0;transform-origin:0 0;will-change:transform}.map-scroll .map-stage img{display:block;width:auto;max-width:none;height:auto;margin:0;border-radius:0;background:white;pointer-events:none;user-select:none}.map-controls{display:flex;align-items:center;gap:6px!important}.map-control{min-width:40px;min-height:40px;border:1px solid rgba(255,255,255,.2);border-radius:10px;background:#26332c;color:white;font-size:20px;font-weight:900}.map-reset{padding:0 10px;font-size:13px}
@media(min-width:640px){.bottom-nav{left:50%;right:auto;transform:translateX(-50%);width:min(600px,calc(100% - 32px));bottom:16px;border:1px solid var(--line);border-radius:20px;padding:7px;box-shadow:0 8px 32px rgba(20,40,32,.12)}.app-footer{padding-bottom:130px}.radio-list.prs-list{grid-template-columns:1fr 1fr}.radio-list.prs-list .radio-row{grid-template-columns:58px 92px minmax(0,1fr);gap:8px}.radio-list.prs-list .radio-badge{display:none}}
@media(max-width:560px){.navbtn{font-size:12px}.game-freq-form{grid-template-columns:1fr}.game-freq-form .notes,.game-freq-form .button{grid-column:auto}.game-freq-form .button{width:100%}.radio-row{grid-template-columns:54px minmax(0,1fr) auto;gap:7px;min-height:46px;padding:8px}.radio-ch{grid-row:1/3;align-self:center}.radio-freq{grid-column:2}.radio-use{grid-column:2;grid-row:2;font-size:12px}.radio-badge{grid-column:3;grid-row:1/3;align-self:center}.radio-legend{justify-content:center}.map-toolbar{gap:6px}.map-toolbar>div:first-child strong{font-size:14px}.map-controls{gap:4px!important}.map-control{min-width:36px;min-height:38px}.map-reset{display:none}.map-toolbar .button.secondary{min-height:38px;padding:7px 10px}}

/* v1.5.2: Missions uses bottom navigation, so reserve the left header column without showing Back. */
.topbar.mission-header .title-wrap{grid-column:2}
.topbar.mission-header #switchBtn{grid-column:3}
