/* Acreford land calculators — shared styles.
   Identity: land-guide paper (light body) + game slate (hero bands carry the
   Godot-rendered county plates — same art family as the in-game atlas). */

:root {
  --paper: #F1F4F1; --ink: #17261E; --pine-deep: #1A3A2D; --pine: #2C5A45;
  --blaze: #E8611C; --stamp: #B3402A; --blueline: #2E5E7E; --moss: #DEE8E0;
  --moss2: #C4D4C8; --gold: #C89B3C;
  --slate0: #16202E; --slate1: #1D2A3D; --slate-line: #3A4A61;
  --slate-ink: #E2E8F0; --slate-dim: #7D8EA3; --accent: #5EA3F0;
}
* { box-sizing: border-box; }
body {
  margin: 0; color: var(--ink);
  font-family: 'Public Sans', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  line-height: 1.6; -webkit-font-smoothing: antialiased;
  background-color: var(--paper);
  /* faint topographic contours over the paper */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='280' height='280'%3E%3Cg fill='none' stroke='%231A3A2D' stroke-opacity='0.055' stroke-width='1.1'%3E%3Cpath d='M-20 60 C 40 20, 90 100, 150 60 S 260 40, 300 80'/%3E%3Cpath d='M-20 110 C 50 70, 100 150, 170 110 S 280 90, 320 130'/%3E%3Cpath d='M-20 170 C 60 130, 110 210, 190 170 S 290 150, 330 190'/%3E%3Cpath d='M-20 230 C 70 190, 120 270, 210 230 S 300 210, 340 250'/%3E%3Cpath d='M40 -20 C 10 60, 90 110, 50 190 S 70 270, 30 320'/%3E%3Cpath d='M200 -20 C 170 60, 250 110, 210 190 S 230 270, 190 320'/%3E%3C/g%3E%3C/svg%3E");
}
.wrap { max-width: 1060px; margin: 0 auto; padding: 40px 20px 80px; }
a { color: var(--blueline); }

/* ── hero band (game slate + Godot plate) ─────────────────── */
.hero {
  position: relative; overflow: hidden; border-radius: 12px; margin: 0 0 20px;
  background: linear-gradient(160deg, var(--slate0) 0%, var(--slate1) 62%, var(--slate0) 100%);
  color: var(--slate-ink); display: flex; align-items: stretch; gap: 0;
  box-shadow: 0 10px 26px rgba(22, 32, 46, 0.28);
}
.hero .copy { flex: 1 1 auto; padding: 34px 8px 34px 34px; min-width: 0; }
.hero .kicker {
  font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 11px;
  letter-spacing: 0.22em; text-transform: uppercase; color: var(--slate-dim); margin: 0 0 10px;
}
.hero h1 {
  font-family: Bitter, Georgia, serif; font-weight: 800; font-size: 32px; line-height: 1.15;
  margin: 0 0 8px; color: #fff;
}
.hero .meta { font-size: 14px; color: var(--slate-dim); margin: 0; max-width: 52ch; }
.hero .rule { position: absolute; left: 0; right: 0; bottom: 0; height: 4px;
  background: linear-gradient(90deg, var(--blaze) 0%, var(--blaze) 55%, var(--accent) 55%, var(--accent) 100%); }
.hero .plate {
  flex: 0 0 auto; width: 232px; padding: 26px 26px 30px 6px;
  display: flex; flex-direction: column; justify-content: center;
}
.hero .plate .matte {
  width: 100%; border: 1px solid var(--slate-line); background: #0F1725; padding: 7px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.45);
}
.hero .plate img { width: 100%; height: auto; display: block; filter: saturate(0.92); }
.hero .plate figcaption {
  font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 10px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--slate-dim); margin-top: 8px;
  display: flex; justify-content: space-between; gap: 8px;
}
.hero .plate figcaption b { color: var(--accent); font-weight: 600; }
@media (max-width: 700px) { .hero .plate { display: none; } .hero .copy { padding: 28px 24px 32px; } }

.plat { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 11px; letter-spacing: 0.18em; color: var(--blueline); text-transform: uppercase; }
h2 { font-family: Bitter, Georgia, serif; font-size: 21px; color: var(--pine-deep); margin: 32px 0 10px; }
p { font-size: 15px; margin: 10px 0; }
.meta { font-size: 13px; color: var(--ink); opacity: 0.7; }
.callout { background: #FEF3E2; border-left: 4px solid var(--blaze); padding: 14px 18px; margin: 20px 0; border-radius: 4px; font-size: 14px; }

/* ── panels ───────────────────────────────────────────────── */
.panel { background: rgba(255,255,255,0.94); border: 1px solid var(--moss); border-radius: 12px;
         padding: 22px; margin: 18px 0; box-shadow: 0 2px 10px rgba(23,38,30,0.05); }
.panel h2, h2.panel-heading { font-family: Bitter, Georgia, serif; font-size: 17px; color: var(--pine-deep); margin: 0 0 14px; }
.subtle { font-size: 12.5px; color: var(--ink); opacity: 0.65; margin: 2px 0 0; }

/* ── slider fields ────────────────────────────────────────── */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 22px; }
@media (max-width: 660px) { .grid { grid-template-columns: 1fr; } }
.field label { display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
               font-size: 12.5px; font-weight: 600; margin-bottom: 6px; }
.field label .val { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-weight: 700;
                    color: var(--pine); font-size: 14px; }
input[type=number], select {
  width: 100%; padding: 8px 10px; font: inherit; font-size: 14px;
  border: 1px solid var(--moss); border-radius: 4px; background: #fff; color: var(--ink);
}
input:focus, select:focus { outline: 2px solid var(--blueline); outline-offset: 0; }
input[type=number]::-webkit-outer-spin-button, input[type=number]::-webkit-inner-spin-button { opacity: 0.35; }
.countyinfo { font-size: 13px; color: var(--blueline); margin: 6px 0 0; }
.divider { border: none; border-top: 1px dashed var(--moss2); margin: 20px 0 16px; }

/* custom range sliders — ruler track + gradient fill + tactile thumb */
input[type=range] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 36px; margin: 0;
  background: transparent; cursor: pointer; --fill: 0%;
}
input[type=range]::-webkit-slider-runnable-track {
  height: 10px; border-radius: 6px;
  background:
    repeating-linear-gradient(90deg,
      transparent 0 calc(10% - 1px), rgba(23,38,30,0.10) calc(10% - 1px) 10%),
    linear-gradient(90deg, #2C5A45 0%, #3F7D5F var(--fill), #D9E4DC var(--fill), #D9E4DC 100%);
  box-shadow: inset 0 1px 3px rgba(23,38,30,0.22), 0 1px 0 rgba(255,255,255,0.7);
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 26px; height: 26px; margin-top: -8px;
  border-radius: 50%; background: #fff; border: 7px solid var(--blaze);
  box-shadow: 0 3px 8px rgba(23,38,30,0.35), inset 0 0 0 1px rgba(23,38,30,0.06);
  transition: transform 100ms ease, border-color 100ms ease;
}
input[type=range]:hover::-webkit-slider-thumb { border-color: #F07A3A; transform: scale(1.06); }
input[type=range]:active::-webkit-slider-thumb { border-color: var(--stamp); transform: scale(1.15); }
input[type=range]:focus-visible { outline: 2px solid var(--blueline); outline-offset: 4px; border-radius: 6px; }
input[type=range]::-moz-range-track {
  height: 10px; border-radius: 6px; background: #D9E4DC;
  box-shadow: inset 0 1px 3px rgba(23,38,30,0.22);
}
input[type=range]::-moz-range-progress {
  height: 10px; border-radius: 6px; background: linear-gradient(90deg, #2C5A45, #3F7D5F);
}
input[type=range]::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%; background: #fff;
  border: 6px solid var(--blaze); box-shadow: 0 3px 8px rgba(23,38,30,0.35);
}

/* county-chip load flash */
@keyframes panelflash {
  0% { box-shadow: 0 0 0 4px rgba(232,97,28,0.65); }
  100% { box-shadow: 0 2px 10px rgba(23,38,30,0.05); }
}
.panel.flash { animation: panelflash 900ms ease; }

/* mobile live-result strip — headline numbers stay visible while dragging the sliders */
.stickybar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: none;
             background: rgba(22,32,46,0.97); border-top: 3px solid var(--blaze);
             box-shadow: 0 -6px 18px rgba(0,0,0,0.35); }
.stickybar .cell { flex: 1; text-align: center; padding: 7px 4px calc(7px + env(safe-area-inset-bottom)); }
.stickybar .cell span { display: block; font-size: 9.5px; letter-spacing: 0.08em; text-transform: uppercase;
                        color: var(--slate-dim); }
.stickybar .cell b { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 15px; color: #fff; }
.stickybar .cell b.neg { color: #FF9D7A; }
@media (max-width: 700px) {
  .stickybar { display: flex; }
  body { padding-bottom: 58px; }
}

/* ── bars ─────────────────────────────────────────────────── */
.barwrap { margin: 12px 0 4px; }
.track { position: relative; height: 30px; background: #E9EFEA; border: 1px solid var(--moss2);
         border-radius: 6px; overflow: hidden; box-shadow: inset 0 1px 3px rgba(23,38,30,0.08); }
.seg { position: absolute; top: 0; bottom: 0; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; }
.legend .li { display: flex; align-items: center; gap: 6px; font-size: 12.5px; }
.swatch { width: 11px; height: 11px; border-radius: 2px; flex: none; }
.mono { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-weight: 600; }

/* county range marker bar */
.rangebar { position: relative; height: 44px; margin-top: 10px; }
.rangebar .axis { position: absolute; left: 0; right: 0; top: 18px; height: 10px;
                  background: #E9EFEA; border: 1px solid var(--moss2); border-radius: 5px; }
.rangebar .band { position: absolute; top: 18px; height: 10px;
                  background: repeating-linear-gradient(135deg, var(--moss) 0 6px, #D2E0D6 6px 12px);
                  border-radius: 4px; }
.rangebar .tick { position: absolute; top: 8px; width: 2px; height: 30px; }
.rangebar .tick.buy { background: var(--blueline); }
.rangebar .tick.sell { background: var(--blaze); }
.rangebar .tlab { position: absolute; top: -6px; transform: translateX(-50%);
                  font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 11px; white-space: nowrap; }
.rangebar .blab { position: absolute; top: 38px; font-size: 10.5px; color: var(--ink); opacity: 0.6;
                  transform: translateX(-50%); white-space: nowrap; }

/* ── exit cards ───────────────────────────────────────────── */
.exits { display: grid; grid-template-columns: 1fr 1fr 1.25fr; gap: 16px; align-items: stretch; }
@media (max-width: 900px) { .exits { grid-template-columns: 1fr; } }
.exit { border: 1px solid var(--moss); border-radius: 12px; padding: 18px; background: rgba(255,255,255,0.96);
        display: flex; flex-direction: column; box-shadow: 0 2px 10px rgba(23,38,30,0.06);
        transition: transform 120ms ease, box-shadow 120ms ease; }
.exit:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(23,38,30,0.12); }
.exit.hot { border: 2px solid var(--blaze); }
.exit .kind { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 10.5px;
              letter-spacing: 0.14em; text-transform: uppercase; color: var(--blueline); }
.exit h3 { font-family: Bitter, Georgia, serif; font-size: 18px; color: var(--pine-deep); margin: 2px 0 2px; }
.exit .speed { font-size: 12px; color: var(--ink); opacity: 0.65; margin-bottom: 10px; }
.exit .big { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 26px; font-weight: 700;
             color: var(--pine-deep); margin: 4px 0 0; }
.exit .big.neg { color: var(--stamp); }
.exit .biglab { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.08em;
                color: var(--ink); opacity: 0.6; }
.exit .stat { display: flex; justify-content: space-between; gap: 8px; font-size: 13px;
              padding: 5px 0; border-bottom: 1px dashed var(--moss2); }
.exit .stat:last-of-type { border-bottom: none; }
.exit .stat b { font-family: 'IBM Plex Mono', ui-monospace, monospace; }
.exit .barwrap { margin-top: auto; padding-top: 12px; }

/* two-bar compare (all-in vs net) */
.duo .duorow { display: grid; grid-template-columns: 74px 1fr; gap: 8px; align-items: center; margin: 5px 0; }
.duo .duorow .lb { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em;
                   color: var(--ink); opacity: 0.7; text-align: right; }
.duo .duobar { height: 18px; background: #E9EFEA; border: 1px solid var(--moss2); border-radius: 4px;
               position: relative; overflow: hidden; }
.duo .fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--pine); }
.duo .fill.profit { background: linear-gradient(180deg, #F07A3A, var(--blaze)); }
.duo .fill.loss { background: var(--stamp); }
.duo .duonote { font-size: 11px; color: var(--ink); opacity: 0.65; margin-top: 4px; }

/* note scenario rows */
.noteopt { border: 1px solid var(--moss); border-radius: 8px; padding: 12px 14px; margin-top: 10px;
           background: var(--paper); }
.noteopt .hdr { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.noteopt .terms { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 12.5px;
                  font-weight: 700; color: var(--blueline); }
.noteopt .pay { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 13px; }
.noteopt .stats { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; margin-top: 6px; }
.noteopt .stats span b { font-family: 'IBM Plex Mono', ui-monospace, monospace; }
.noteopt .track { height: 14px; margin-top: 8px; }
.noteopt .int { color: var(--blaze); font-weight: 700; }

/* buy-side outcome chips (lo / mid / hi) */
.chips { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin: 14px 0 4px; }
@media (max-width: 660px) { .chips { grid-template-columns: 1fr; } }
.chip { border: 1px solid var(--moss); border-radius: 10px; padding: 12px 14px;
        background: rgba(255,255,255,0.9); text-align: center; }
.chip .lab { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink); opacity: 0.6; }
.chip .p { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 21px; font-weight: 700;
           color: var(--pine-deep); margin-top: 2px; }
.chip .p.neg { color: var(--stamp); }
.chip .m { font-size: 12px; color: var(--ink); opacity: 0.7; }
.gate { font-size: 13.5px; padding: 10px 14px; border-radius: 6px; margin: 10px 0 0; }
.gate.ok  { background: #E4EEE7; color: var(--pine-deep); border-left: 4px solid var(--pine); }
.gate.thin{ background: #FEF3E2; color: var(--stamp); border-left: 4px solid var(--gold); }
.gate.fat { background: #F9E9E4; color: var(--stamp); border-left: 4px solid var(--stamp); }

.flag { font-size: 13px; padding: 8px 12px; border-radius: 4px; margin: 6px 0;
        background: var(--moss); color: var(--pine-deep); }
.flag.warn { background: #FEF3E2; color: var(--stamp); }

.links { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.links a { display: inline-block; background: var(--moss); color: var(--pine-deep); padding: 6px 14px;
           border-radius: 4px; text-decoration: none; font-size: 13px; }
.links a:hover { background: var(--blueline); color: #fff; }

/* hub tool cards */
.tools { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 22px 0; }
@media (max-width: 760px) { .tools { grid-template-columns: 1fr; } }
.tool { display: flex; gap: 16px; align-items: stretch; background: rgba(255,255,255,0.95);
        border: 1px solid var(--moss); border-radius: 12px; padding: 18px; text-decoration: none;
        color: inherit; box-shadow: 0 2px 10px rgba(23,38,30,0.05);
        transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease; }
.tool:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(23,38,30,0.13);
              border-color: var(--blaze); }
.tool .matte { flex: 0 0 128px; align-self: flex-start; border: 1px solid var(--slate-line);
               background: #0F1725; padding: 5px; }
.tool .matte img { width: 100%; height: auto; display: block; }
.tool .tc { min-width: 0; }
.tool .kind { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 10.5px;
              letter-spacing: 0.16em; text-transform: uppercase; color: var(--blueline); }
.tool h2 { font-family: Bitter, Georgia, serif; font-size: 20px; color: var(--pine-deep); margin: 4px 0 6px; }
.tool p { font-size: 14px; margin: 0 0 10px; }
.tool .go { font-weight: 700; color: var(--blaze); font-size: 14px; }

.cta { background: var(--pine-deep); color: #fff; padding: 24px; border-radius: 12px; margin: 28px 0;
       text-align: center; }
.cta a { display: inline-block; background: var(--blaze); color: #fff; padding: 12px 32px;
         border-radius: 4px; text-decoration: none; font-weight: 700; font-size: 16px; }
.cta a:hover { background: var(--stamp); }
.cta a.ghost { background: transparent; border: 1px solid rgba(255,255,255,0.5); margin-left: 10px; }
.cta a.ghost:hover { background: rgba(255,255,255,0.12); }
code { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 13px; background: var(--moss);
       padding: 1px 5px; border-radius: 3px; }
footer { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--moss); font-size: 13px; opacity: 0.6; }
footer a { color: var(--blueline); }
