/* Operação: Última Expedição — dossiê de missão de campo */
:root {
  --kraft: #e9dfc7;
  --paper: #f5eedc;
  --paper-2: #efe5cc;
  --ink: #16180f;
  --ink-2: #4a4c3c;
  --ink-3: #7b7a64;
  --olive: #2f3a22;
  --olive-2: #4d5c36;
  --moss: #8a9a5b;
  --signal: #f26a1b;
  --signal-ink: #ffffff;
  --water: #1e3a4a;
  --water-2: #2f5a70;
  --line: rgba(22, 24, 15, 0.16);
  --line-2: rgba(22, 24, 15, 0.08);
  --ok: #4d6b2a;
  --warn: #b5541a;
  --shadow: 0 1px 0 rgba(22, 24, 15, 0.08), 0 8px 24px -14px rgba(22, 24, 15, 0.45);
  --topo-stroke: %232f3a22;
  --topo-op: 0.13;
  --tape: rgba(242, 106, 27, 0.82);
  --bg: var(--kraft);
  --card: var(--paper);
  --nav: #16180f;
  --nav-ink: #e9dfc7;
  --f-stencil: "Saira Stencil One", "Impact", sans-serif;
  --f-ui: "Barlow Condensed", "Arial Narrow", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #11130c;
    --card: #1b1f14;
    --paper-2: #232819;
    --ink: #ece3cb;
    --ink-2: #bdb79f;
    --ink-3: #8c8a72;
    --olive: #9cae67;
    --olive-2: #c2d18b;
    --water: #8ec3dc;
    --water-2: #6aa6c2;
    --line: rgba(236, 227, 203, 0.16);
    --line-2: rgba(236, 227, 203, 0.07);
    --ok: #a8c46a;
    --warn: #ff8a45;
    --shadow: 0 10px 30px -18px rgba(0, 0, 0, 0.9);
    --topo-op: 0.22;
    --nav: #070805;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #11130c;
  --card: #1b1f14;
  --paper-2: #232819;
  --ink: #ece3cb;
  --ink-2: #bdb79f;
  --ink-3: #8c8a72;
  --olive: #9cae67;
  --olive-2: #c2d18b;
  --water: #8ec3dc;
  --water-2: #6aa6c2;
  --line: rgba(236, 227, 203, 0.16);
  --line-2: rgba(236, 227, 203, 0.07);
  --ok: #a8c46a;
  --warn: #ff8a45;
  --shadow: 0 10px 30px -18px rgba(0, 0, 0, 0.9);
  --topo-op: 0.22;
  --nav: #070805;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-ui);
  font-size: 18px;
  line-height: 1.3;
  min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: var(--topo-op);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='520' height='520' viewBox='0 0 520 520' fill='none' stroke='%238a9a5b' stroke-width='1.3'%3E%3Cpath d='M260 120c70 0 140 40 150 110s-40 150-130 160-170-30-180-110 90-160 160-160z'/%3E%3Cpath d='M262 150c55 0 110 32 116 86s-32 118-102 124-132-24-140-86 72-124 126-124z'/%3E%3Cpath d='M264 182c40 0 78 22 82 60s-24 84-74 88-94-18-98-60 50-88 90-88z'/%3E%3Cpath d='M266 214c24 0 46 14 48 36s-14 48-42 50-54-10-56-34 26-52 50-52z'/%3E%3Cpath d='M-20 470c80-30 150-10 220 20s170 40 230 0 90-50 110-40'/%3E%3Cpath d='M-20 500c80-26 160-6 230 22s160 34 230-4 80-40 100-34'/%3E%3Cpath d='M-20 40c60 30 120 30 180 0s120-50 200-30 140 40 180 20'/%3E%3Cpath d='M-20 10c60 26 130 26 186-4s128-44 200-24 136 34 174 16'/%3E%3Cpath d='M440 300c40 10 70 40 70 80s-20 70-50 80'/%3E%3Cpath d='M30 260c-30 20-40 60-20 90s50 40 70 30'/%3E%3C/svg%3E");
  background-size: 520px 520px;
  z-index: 0;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

.app { position: relative; z-index: 1; max-width: 680px; margin: 0 auto; padding: 0 16px calc(96px + env(safe-area-inset-bottom)); }

/* ---------- topo ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  margin: 0 -16px; padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px dashed var(--line);
}
.brand { display: flex; flex-direction: column; line-height: 1; margin-right: auto; text-decoration: none; }
.brand b { font-family: var(--f-stencil); font-weight: 400; font-size: 20px; letter-spacing: 0.04em; color: var(--olive); }
.brand small { font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.12em; color: var(--ink-3); text-transform: uppercase; margin-top: 3px; }
.sync { display: inline-flex; align-items: center; gap: 6px; font-family: var(--f-mono); font-size: 11px; color: var(--ink-3); }
.sync i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent); }
.sync.off i { background: var(--warn); box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 25%, transparent); }
.chip-me, .icon-btn {
  border: 1px solid var(--line); background: var(--card); border-radius: 999px;
  height: 36px; padding: 0 12px; display: inline-flex; align-items: center; gap: 6px;
  font-weight: 600; font-size: 16px;
}
.icon-btn { width: 36px; padding: 0; justify-content: center; }
.icon-btn svg { width: 18px; height: 18px; }

/* ---------- tipografia ---------- */
h1, h2, h3 { margin: 0; font-weight: 400; }
.h-stencil { font-family: var(--f-stencil); letter-spacing: 0.02em; line-height: 0.95; }
.page-title { font-family: var(--f-stencil); font-size: 44px; line-height: 0.9; color: var(--olive); margin: 22px 0 4px; letter-spacing: 0.01em; }
.page-sub { color: var(--ink-2); margin: 0 0 18px; font-size: 18px; }
.kicker { font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3); }
.mono { font-family: var(--f-mono); }
.section-h { display: flex; align-items: baseline; gap: 10px; margin: 26px 0 10px; }
.section-h h2 { font-family: var(--f-stencil); font-size: 24px; color: var(--ink); }
.section-h .count { font-family: var(--f-mono); font-size: 12px; color: var(--ink-3); margin-left: auto; }

/* ---------- dossiê (hero) ---------- */
.dossier {
  position: relative; margin-top: 18px; padding: 22px 18px 18px;
  background: var(--card); border: 1px solid var(--line); border-radius: 4px 18px 4px 4px;
  box-shadow: var(--shadow); overflow: hidden;
}
.dossier::after { /* fita */
  content: ""; position: absolute; top: -8px; right: 26px; width: 92px; height: 26px;
  background: var(--tape); transform: rotate(6deg); opacity: 0.9;
}
.dossier .kicker { color: var(--signal); }
.dossier h1 { font-family: var(--f-stencil); font-size: clamp(40px, 12vw, 64px); line-height: 0.88; color: var(--olive); margin: 10px 0 12px; }
.dossier .alvo { font-size: 20px; color: var(--ink-2); margin: 0 0 14px; }
.dossier .alvo b { color: var(--ink); }
.stamp {
  display: inline-block; font-family: var(--f-stencil); color: var(--signal);
  border: 3px solid var(--signal); padding: 4px 10px 2px; border-radius: 4px;
  transform: rotate(-8deg); letter-spacing: 0.08em; font-size: 16px; opacity: 0.88;
  mix-blend-mode: multiply;
}
:root[data-theme="dark"] .stamp { mix-blend-mode: normal; }
.dossier .stamp { position: absolute; right: 14px; top: 44px; }
.coords { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.coords > div { background: var(--card); padding: 10px 12px; min-width: 0; }
.coords .kicker { color: var(--ink-3); display: block; margin-bottom: 4px; }
.coords .v { font-weight: 600; font-size: 18px; overflow-wrap: anywhere; }

.tminus { margin-top: 14px; display: flex; gap: 8px; align-items: stretch; }
.tminus .lbl { font-family: var(--f-stencil); color: var(--signal); font-size: 22px; writing-mode: vertical-rl; transform: rotate(180deg); text-align: center; }
.tminus .cell { flex: 1; background: var(--nav); color: var(--nav-ink); border-radius: 6px; padding: 10px 6px 8px; text-align: center; }
.tminus .cell b { display: block; font-family: var(--f-mono); font-size: 30px; font-weight: 600; line-height: 1; }
.tminus .cell span { font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.14em; opacity: 0.7; }
.tminus.empty .cell { background: transparent; color: var(--ink-2); border: 1px dashed var(--line); }

/* ---------- progresso ---------- */
.meters { display: grid; gap: 10px; }
.meter { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center; text-decoration: none; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; }
.meter .name { font-weight: 700; font-size: 19px; text-transform: uppercase; letter-spacing: 0.02em; }
.meter .num { font-family: var(--f-mono); font-size: 14px; color: var(--ink-2); }
.bar { grid-column: 1 / -1; height: 8px; border-radius: 2px; background: var(--line-2); overflow: hidden; position: relative; }
.bar > i { position: absolute; inset: 0 auto 0 0; background: repeating-linear-gradient(-45deg, var(--olive) 0 6px, var(--olive-2) 6px 12px); border-radius: 2px; transition: width 0.4s ease; }
.bar.signal > i { background: var(--signal); }
.bar.water > i { background: var(--water); }

/* ---------- cards genéricos ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 14px; box-shadow: var(--shadow); }
.alert {
  position: relative; padding: 14px 14px 14px 18px; border-radius: 8px;
  background: color-mix(in srgb, var(--water) 12%, var(--card)); border: 1px solid color-mix(in srgb, var(--water) 35%, transparent);
}
.alert::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 4px; border-radius: 0 3px 3px 0; background: var(--water); }
.alert h3 { font-family: var(--f-stencil); font-size: 20px; color: var(--water); margin-bottom: 6px; }
.alert ul { margin: 0; padding-left: 18px; color: var(--ink-2); }
.alert li { margin: 3px 0; }
.intel { display: grid; gap: 6px; }
.intel a { display: flex; align-items: center; gap: 10px; text-decoration: none; padding: 10px 12px; border-radius: 6px; background: var(--card); border: 1px dashed color-mix(in srgb, var(--signal) 55%, transparent); }
.intel a b { font-family: var(--f-mono); color: var(--signal); min-width: 28px; font-size: 16px; }
.intel a span { color: var(--ink-2); }
.intel a svg { margin-left: auto; width: 16px; height: 16px; color: var(--ink-3); flex: none; }

/* ---------- lista / itens ---------- */
.group { margin-top: 18px; }
.group-h { display: flex; align-items: center; gap: 10px; padding: 0 2px 8px; border-bottom: 2px solid var(--ink); margin-bottom: 4px; }
.group-h h3 { font-family: var(--f-stencil); font-size: 20px; }
.group-h .count { margin-left: auto; font-family: var(--f-mono); font-size: 12px; color: var(--ink-3); }
.rows { list-style: none; margin: 0; padding: 0; }
.row { display: flex; align-items: flex-start; gap: 12px; padding: 12px 2px; border-bottom: 1px dashed var(--line); }
.row .body { flex: 1; min-width: 0; text-align: left; background: none; border: 0; padding: 0; }
.row .t { font-weight: 600; font-size: 19px; line-height: 1.2; }
.row .meta { display: flex; flex-wrap: wrap; gap: 6px 10px; margin-top: 5px; font-size: 15px; color: var(--ink-2); align-items: center; }
.row .obs { margin-top: 4px; font-size: 15px; color: var(--ink-3); }
.row.done .t { text-decoration: line-through; text-decoration-color: var(--signal); text-decoration-thickness: 2px; color: var(--ink-3); }
.row .right { font-family: var(--f-mono); font-size: 14px; color: var(--ink-2); text-align: right; white-space: nowrap; padding-top: 3px; }

.check {
  flex: none; width: 30px; height: 30px; margin-top: 1px; border-radius: 5px;
  border: 2px solid var(--ink); background: transparent; display: grid; place-items: center;
  transition: transform 0.15s ease, background 0.15s ease;
}
.check svg { width: 18px; height: 18px; opacity: 0; color: var(--signal-ink); }
.check:active { transform: scale(0.9); }
.done .check { background: var(--signal); border-color: var(--signal); }
.done .check svg { opacity: 1; }

.pill { display: inline-flex; align-items: center; gap: 4px; font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; padding: 3px 7px; border-radius: 3px; border: 1px solid var(--line); color: var(--ink-2); background: var(--paper-2); }
.pill.person { background: color-mix(in srgb, var(--olive) 14%, transparent); border-color: color-mix(in srgb, var(--olive) 35%, transparent); color: var(--olive); font-weight: 600; }
.pill.ok { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.pill.bad { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.miss {
  display: inline-block; font-family: var(--f-mono); font-size: 10px; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--signal); border: 1px dashed var(--signal);
  padding: 2px 6px; border-radius: 3px; background: color-mix(in srgb, var(--signal) 7%, transparent); white-space: nowrap;
}

.status-btn { flex: none; min-width: 92px; height: 32px; border-radius: 4px; font-family: var(--f-mono); font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; border: 1.5px solid var(--ink-3); background: transparent; color: var(--ink-2); }
.status-btn.ok { border-color: var(--ok); background: var(--ok); color: var(--bg); }
.status-btn.bad { border-color: var(--warn); color: var(--warn); }

/* ---------- filtros ---------- */
.filters { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 4px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filter { flex: none; height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-weight: 600; font-size: 16px; }
.filter[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ---------- cofre ---------- */
.vault { background: var(--nav); color: var(--nav-ink); border-radius: 10px; padding: 18px; position: relative; overflow: hidden; }
.vault .kicker { color: rgba(233, 223, 199, 0.6); }
.vault .big { font-family: var(--f-mono); font-size: clamp(34px, 10vw, 46px); font-weight: 600; line-height: 1; margin: 6px 0 2px; }
.vault .sub { font-family: var(--f-mono); font-size: 13px; opacity: 0.75; }
.vault .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 16px; padding-top: 14px; border-top: 1px dashed rgba(233, 223, 199, 0.25); }
.vault .grid b { display: block; font-family: var(--f-mono); font-size: 20px; font-weight: 600; }
.vault .pos { color: #a8c46a; }
.vault .neg { color: #ff8a45; }
.vault .bar { background: rgba(233, 223, 199, 0.12); margin-top: 12px; }
.vault .bar > i { background: var(--signal); }

/* ---------- mais (pastas) ---------- */
.folders { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 12px; margin-top: 18px; }
.folder { position: relative; text-decoration: none; padding: 26px 14px 14px; min-height: 128px; background: var(--card); border: 1px solid var(--line); border-radius: 0 10px 10px 10px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.folder::before { content: ""; position: absolute; top: -12px; left: -1px; width: 52%; height: 13px; background: var(--card); border: 1px solid var(--line); border-bottom: 0; border-radius: 8px 14px 0 0; }
.folder .kicker { color: var(--signal); }
.folder b { font-family: var(--f-stencil); font-size: 26px; line-height: 1; margin-top: 6px; color: var(--olive); }
.folder span { margin-top: auto; padding-top: 10px; font-size: 15px; color: var(--ink-2); }
.folder.wide { grid-column: 1 / -1; min-height: 100px; }

/* ---------- cronograma ---------- */
.timeline { position: relative; margin-left: 10px; padding-left: 22px; border-left: 2px dashed var(--olive); }
.tl-item { position: relative; padding: 4px 0 18px; }
.tl-item::before { content: ""; position: absolute; left: -31px; top: 8px; width: 14px; height: 14px; border-radius: 50%; background: var(--bg); border: 3px solid var(--signal); }
.tl-item .h { font-family: var(--f-mono); font-size: 13px; color: var(--signal); font-weight: 600; letter-spacing: 0.04em; }
.tl-item button { text-align: left; background: none; border: 0; padding: 0; width: 100%; }
.tl-item .t { font-weight: 700; font-size: 20px; margin-top: 2px; }
.day-h { font-family: var(--f-stencil); font-size: 30px; color: var(--olive); margin: 20px 0 10px; }

/* ---------- tropa ---------- */
.troop { display: grid; gap: 10px; }
.soldier { display: flex; gap: 12px; align-items: center; padding: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; }
.soldier .badge { flex: none; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 6px; background: var(--olive); color: var(--bg); font-family: var(--f-stencil); font-size: 24px; }
.soldier.alvo .badge { background: var(--signal); color: #fff; }
.soldier .body { flex: 1; min-width: 0; text-align: left; background: none; border: 0; padding: 0; }
.soldier .n { font-weight: 700; font-size: 21px; display: flex; gap: 8px; align-items: center; }
.soldier .m { font-size: 15px; color: var(--ink-2); margin-top: 3px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.soldier .acts { display: flex; gap: 6px; }
.soldier .acts a { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 6px; border: 1px solid var(--line); }
.soldier .acts svg { width: 18px; height: 18px; }

/* ---------- operações ---------- */
.op { position: relative; padding: 18px 16px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); margin-top: 16px; }
.op .num { position: absolute; top: -14px; left: 14px; background: var(--ink); color: var(--bg); font-family: var(--f-stencil); font-size: 16px; padding: 3px 10px 1px; border-radius: 3px; }
.op h3 { font-family: var(--f-stencil); font-size: 28px; color: var(--olive); margin: 2px 0 8px; line-height: 1; }
.op p { margin: 0 0 10px; color: var(--ink-2); }
.op dl { display: grid; grid-template-columns: 100px 1fr; gap: 8px 10px; margin: 10px 0 0; font-size: 16px; }
.op dt { font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); padding-top: 3px; }
.op dd { margin: 0; }
.op .edit { position: absolute; top: 12px; right: 12px; }

.bracket { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.duplas { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0; }
.dupla { padding: 8px 10px; border-radius: 6px; background: var(--paper-2); border: 1px solid var(--line); font-weight: 600; font-size: 16px; }
.dupla small { display: block; font-family: var(--f-mono); font-size: 10px; color: var(--ink-3); letter-spacing: 0.1em; }
.match { display: grid; gap: 6px; margin: 10px 0; }
.match .kicker { margin-bottom: 2px; }
.match button { display: flex; justify-content: space-between; align-items: center; text-align: left; padding: 10px 12px; border-radius: 6px; border: 1.5px solid var(--line); background: var(--card); font-weight: 600; font-size: 17px; }
.match button.win { border-color: var(--signal); background: color-mix(in srgb, var(--signal) 12%, var(--card)); }
.match button.win::after { content: "VENCEU"; font-family: var(--f-mono); font-size: 10px; color: var(--signal); letter-spacing: 0.12em; }
.match button:disabled { opacity: 0.45; cursor: default; }
.champ { text-align: center; padding: 14px; margin-top: 8px; }
.champ .stamp { font-size: 22px; }

/* ---------- botões ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 18px; border-radius: 6px; border: 0; background: var(--signal); color: var(--signal-ink); font-weight: 700; font-size: 18px; text-transform: uppercase; letter-spacing: 0.04em; text-decoration: none; }
.btn.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); }
.btn.danger { background: transparent; color: var(--warn); border: 1.5px solid var(--warn); }
.btn.sm { height: 34px; font-size: 15px; padding: 0 12px; }
.btn svg { width: 18px; height: 18px; }
.mini { width: 34px; height: 34px; border-radius: 6px; border: 1px solid var(--line); background: var(--card); display: grid; place-items: center; }
.mini svg { width: 16px; height: 16px; }
.add-row { width: 100%; margin-top: 10px; height: 44px; border: 1.5px dashed var(--ink-3); border-radius: 6px; background: transparent; color: var(--ink-2); font-weight: 600; font-size: 17px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.add-row svg { width: 16px; height: 16px; }
.fab { position: fixed; right: max(16px, calc(50% - 324px)); bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 25; width: 58px; height: 58px; border-radius: 14px; border: 0; background: var(--signal); color: #fff; box-shadow: 0 10px 24px -8px rgba(242, 106, 27, 0.7); display: grid; place-items: center; }
.fab svg { width: 26px; height: 26px; }

/* ---------- navegação ---------- */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: var(--nav); color: var(--nav-ink);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  display: flex; justify-content: center;
  border-top: 3px solid var(--signal);
}
.nav-in { display: grid; grid-template-columns: repeat(5, 1fr); width: 100%; max-width: 680px; }
.nav a { display: flex; flex-direction: column; align-items: center; gap: 3px; text-decoration: none; padding: 6px 0 4px; border-radius: 8px; opacity: 0.6; font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.nav a svg { width: 24px; height: 24px; }
.nav a[aria-current="page"] { opacity: 1; color: var(--signal); }

/* ---------- bottom sheet ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; display: none; }
.sheet-wrap.open { display: block; }
.scrim { position: absolute; inset: 0; background: rgba(10, 12, 6, 0.55); animation: fade 0.2s ease; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 680px;
  max-height: 92dvh; overflow: auto; overscroll-behavior: contain;
  background: var(--bg); border-radius: 16px 16px 0 0; padding: 10px 16px calc(18px + env(safe-area-inset-bottom));
  animation: up 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
  border-top: 3px solid var(--signal);
}
.sheet .grab { width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 12px; }
.sheet h2 { font-family: var(--f-stencil); font-size: 28px; color: var(--olive); margin: 0 0 14px; }
.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 5px; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 46px; padding: 10px 12px; border-radius: 6px;
  border: 1.5px solid var(--line); background: var(--card); font-size: 18px;
}
.field textarea { min-height: 84px; resize: vertical; line-height: 1.3; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--signal); box-shadow: 0 0 0 3px color-mix(in srgb, var(--signal) 22%, transparent); }
.field.bool { display: flex; align-items: center; gap: 10px; }
.field.bool input { width: 26px; min-height: 26px; height: 26px; accent-color: var(--signal); }
.field.bool > span { margin: 0; font-size: 13px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sheet-actions { display: flex; gap: 10px; margin-top: 6px; position: sticky; bottom: 0; background: var(--bg); padding-top: 8px; }
.sheet-actions .btn { flex: 1; }
.sheet .stamp-line { font-family: var(--f-mono); font-size: 11px; color: var(--ink-3); margin: -6px 0 14px; }

.who { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.who button { height: 54px; border-radius: 6px; border: 1.5px solid var(--line); background: var(--card); font-weight: 700; font-size: 19px; }
.who button[aria-pressed="true"] { border-color: var(--signal); color: var(--signal); }

.toast { position: fixed; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 6px; font-weight: 600; font-size: 16px; opacity: 0; pointer-events: none; transition: opacity 0.2s; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; }

.empty-state { text-align: center; color: var(--ink-3); padding: 30px 10px; font-size: 17px; }
.foot { text-align: center; font-family: var(--f-mono); font-size: 11px; color: var(--ink-3); margin-top: 28px; letter-spacing: 0.1em; }

@keyframes up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { 0% { transform: scale(1); } 50% { transform: scale(1.25); } 100% { transform: scale(1); } }
.pop { animation: pop 0.25s ease; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (min-width: 560px) { .page-title { font-size: 54px; } }

/* ---------- pop-up de instalação ---------- */
.install-hero { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.install-hero img { border-radius: 16px; flex: none; box-shadow: 0 8px 20px -10px rgba(0, 0, 0, 0.6); }
.install-hero h2 { margin: 4px 0 0; }
.install-hero .kicker { color: var(--signal); }
.install-steps { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 10px; }
.install-steps li { display: flex; gap: 12px; align-items: flex-start; padding: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; font-size: 18px; }
.install-steps li > b { flex: none; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 5px; background: var(--signal); color: #fff; font-family: var(--f-mono); }
.install-steps svg { width: 20px; height: 20px; vertical-align: -4px; color: var(--water-2); }
.install-note { font-size: 15px; color: var(--ink-3); margin: 0 0 8px; }
.folder { color: inherit; }

/* ---------- ajustes mobile do topo ---------- */
.chip-me { white-space: nowrap; max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
.brand small { white-space: nowrap; }
@media (max-width: 420px) {
  .sync span { display: none; }
  .brand b { font-size: 18px; }
  .brand small { font-size: 9px; letter-spacing: 0.08em; }
}
.dossier .kicker { display: block; max-width: 62%; line-height: 1.5; }
.dossier .stamp { top: 26px; }

/* ---------- tela de instalação obrigatória (celular no navegador) ---------- */
body.gated .app, body.gated .nav { display: none; }
body.gated { background: #11130c; }
#gate {
  position: fixed; inset: 0; z-index: 100; overflow-y: auto;
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(242, 106, 27, 0.18), transparent 60%),
    #11130c;
  color: #ece3cb;
  --card: #1b1f14; --line: rgba(236, 227, 203, 0.16); --ink-3: #8c8a72; --water-2: #8ec3dc;
}
.gate-in {
  position: relative; max-width: 460px; margin: 0 auto; min-height: 100%;
  padding: calc(28px + env(safe-area-inset-top)) 20px calc(28px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; justify-content: center;
}
.gate-top { position: relative; display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.gate-icon { border-radius: 20px; box-shadow: 0 14px 30px -12px rgba(242, 106, 27, 0.55), 0 0 0 1px rgba(236, 227, 203, 0.12); animation: gate-in 0.6s cubic-bezier(0.22, 0.61, 0.36, 1) both; }
.gate-top .stamp { mix-blend-mode: normal; font-size: 15px; animation: stamp-in 0.45s 0.35s cubic-bezier(0.22, 0.61, 0.36, 1) both; }
#gate .kicker { color: #f26a1b; display: block; margin-bottom: 8px; }
#gate h1 { font-family: var(--f-stencil); font-size: clamp(42px, 13vw, 58px); line-height: 0.92; color: #c2d18b; margin: 0 0 12px; }
.gate-lead { font-size: 19px; line-height: 1.35; color: #bdb79f; margin: 0 0 18px; }
.gate-lead b { color: #ece3cb; }
#gate .install-steps li { background: #1b1f14; border-color: rgba(236, 227, 203, 0.14); color: #ece3cb; }
.gate-btn { width: 100%; height: 56px; font-size: 20px; margin: 4px 0 10px; box-shadow: 0 12px 26px -12px rgba(242, 106, 27, 0.8); }
.gate-btn svg { width: 22px; height: 22px; }
.gate-note { font-size: 15px; color: #8c8a72; margin: 4px 0 0; text-align: center; }
.gate-note b { color: #bdb79f; }
@keyframes gate-in { from { opacity: 0; transform: translateY(10px) scale(0.92); } }
@keyframes stamp-in { from { opacity: 0; transform: rotate(-8deg) scale(1.6); } to { opacity: 0.9; transform: rotate(-8deg) scale(1); } }

/* ---------- fotos da tropa ---------- */
.ava { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.ava-txt { display: grid; place-items: center; font-family: var(--f-stencil); }
.ava.xs { width: 18px; height: 18px; border-radius: 50%; display: inline-block; margin: -2px 2px -4px -3px; flex: none; }
.ava-txt.xs { font-size: 10px; background: var(--olive); color: var(--bg); }
.pill.person { padding-left: 4px; }
.soldier .badge { overflow: hidden; border-radius: 50%; padding: 0; box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--olive); }
.soldier.alvo .badge { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--signal); }

.who { gap: 10px; }
.who button { height: auto; padding: 12px 8px 10px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.who button .ava { width: 76px; height: 76px; border-radius: 50%; box-shadow: 0 0 0 3px var(--card), 0 0 0 5px var(--line); }
.who button[aria-pressed="true"] .ava { box-shadow: 0 0 0 3px var(--card), 0 0 0 5px var(--signal); }
.who button small { font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--signal); margin-top: -6px; }

.alvo-row { display: flex; gap: 14px; align-items: flex-start; }
.alvo-row .alvo { flex: 1; }
.polaroid { flex: none; margin: -4px 2px 0 0; width: 96px; padding: 6px 6px 0; background: #fbf8ef; border-radius: 2px; transform: rotate(3deg); box-shadow: 0 10px 18px -10px rgba(0, 0, 0, 0.55); position: relative; }
.polaroid::before { content: ""; position: absolute; top: -9px; left: 50%; width: 46px; height: 16px; margin-left: -23px; background: var(--tape); transform: rotate(-4deg); }
.polaroid .ava { aspect-ratio: 1; height: auto; border-radius: 0; filter: contrast(1.05) saturate(0.85); }
.polaroid figcaption { font-family: var(--f-mono); font-size: 9px; letter-spacing: 0.08em; color: #16180f; text-align: center; padding: 5px 0 6px; white-space: nowrap; }

/* ---------- mapa ---------- */
#map-wrap { margin-bottom: 8px; }
.map-card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; box-shadow: var(--shadow); }
.map-card iframe { display: block; width: 100%; height: 260px; border: 0; filter: saturate(0.85); }
:root[data-theme="dark"] .map-card iframe { filter: saturate(0.7) brightness(0.9); }
.map-foot { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.map-foot > div { flex: 1; min-width: 0; }
.map-foot .kicker { display: block; color: var(--signal); }
.map-foot b { font-size: 20px; }
.map-link { display: block; margin-top: 4px; padding: 0; border: 0; background: none; font-family: var(--f-mono); font-size: 11px; color: var(--signal); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- vários responsáveis / sugestão / logística ---------- */
.avas { display: inline-flex; margin-right: 2px; }
.avas .ava.xs { margin: -2px 0 -4px -6px; box-shadow: 0 0 0 1.5px var(--card); }
.avas .ava.xs:first-child { margin-left: -3px; }
.sug { font-family: var(--f-mono); font-size: 12px; color: var(--ink-3); border: 1px dashed var(--line); padding: 2px 6px; border-radius: 3px; }
.people-pick { border: 0; padding: 0; margin: 0 0 12px; min-width: 0; }
.people-pick > span { display: block; font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px; }
.pick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.pick-item { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 2px 6px; border: 1.5px solid var(--line); border-radius: 8px; background: var(--card); font-size: 14px; font-weight: 600; cursor: pointer; }
.pick-item input { position: absolute; opacity: 0; pointer-events: none; }
.pick-item .ava.sm { width: 38px; height: 38px; border-radius: 50%; opacity: 0.55; filter: grayscale(0.6); }
.pick-item:has(input:checked) { border-color: var(--signal); background: color-mix(in srgb, var(--signal) 10%, var(--card)); }
.pick-item:has(input:checked) .ava.sm { opacity: 1; filter: none; }
.pick-item:has(input:focus-visible) { outline: 2px solid var(--signal); outline-offset: 2px; }
.logi { display: grid; gap: 10px; }
.logi > div { display: grid; grid-template-columns: 96px 1fr; gap: 10px; align-items: baseline; padding-bottom: 10px; border-bottom: 1px dashed var(--line); }
.logi > div:last-child { border-bottom: 0; padding-bottom: 0; }
.logi .kicker { color: var(--signal); }
.logi span:last-child { font-size: 17px; }

/* ---------- todos / contagem / cofre ---------- */
.pill.todos { background: color-mix(in srgb, var(--water) 14%, transparent); border-color: color-mix(in srgb, var(--water) 40%, transparent); color: var(--water); font-weight: 600; }
.pick-todos { grid-column: 1 / -1; flex-direction: row; justify-content: center; gap: 10px; padding: 10px; }
.pick-todos .ava.sm { width: 30px; height: 30px; font-size: 15px; background: var(--water); color: #fff; }
.tminus .cell b { font-size: 26px; }
.vault .big.neg { color: #ff8a45; }

/* ---------- foto do item ---------- */
.thumb { flex: none; width: 56px; height: 56px; border-radius: 8px; object-fit: cover; background: var(--paper-2); box-shadow: 0 0 0 1px var(--line); }
.row.done .thumb { filter: grayscale(0.8); opacity: 0.55; }
