/* Yard Signals v2.3 — style.css
   One family (Nunito), one bold shape (the yard sign), everything else quiet on cream. */

:root {
  --page: #F7F5EE;
  --paper: #FFFFFF;
  --ink: #1E2A22;
  --muted: #66716A;
  --line: #DDD9CE;
  --leaf: #2F6B3A;
  --leaf-deep: #24532D;
  --moss: #E4EFE6;
  --amber: #D9A441;
  --amber-soft: #FFF4E5;
  --sky: #6FA8C9;
  --radius: 16px;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; height: 100%; }
body {
  margin: 0; min-height: 100%;
  font-family: "Nunito", -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px; line-height: 1.4;
  background: var(--page); color: var(--ink);
  touch-action: manipulation;           /* no double-tap zoom */
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
}
/* Every input at 16px+ — iOS zooms the viewport on focus for anything smaller. */
input, select, textarea, button { font: inherit; font-size: 16px; color: inherit; }
.hidden { display: none !important; }
a { color: var(--leaf); }

/* ---------------------------------------------------------------- header */
header {
  padding: calc(12px + var(--sat)) 18px 6px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand svg { width: 34px; height: 34px; flex: none; border-radius: 9px; }
.brand h1 { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -0.2px; line-height: 1.1; }
.brand .place { color: var(--muted); font-size: 13px; font-weight: 600; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gear { border: none; background: none; padding: 8px; margin: -8px; color: var(--muted); }
.gear svg { width: 24px; height: 24px; display: block; }

main { padding: 4px 16px calc(84px + var(--sab)); max-width: 560px; margin: 0 auto; }
section > h2 { font-size: 17px; font-weight: 800; margin: 18px 0 8px; }
h3 { font-size: 16px; font-weight: 700; margin: 0 0 4px; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; color: var(--muted); }
.spacer { height: 10px; }

/* ---------------------------------------------------------------- buttons */
button.primary, button.plain, button.ghost {
  padding: 12px 16px; border-radius: 12px; font-weight: 700; cursor: pointer;
}
button.primary { background: var(--leaf); color: #fff; border: 1px solid var(--leaf); }
button.primary:active { background: var(--leaf-deep); }
button.plain { background: var(--paper); color: var(--ink); border: 1px solid var(--line); }
button.ghost { background: none; color: var(--leaf); border: none; padding: 8px 4px; }
button:disabled { opacity: .5; }
button.block { width: 100%; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }

/* ---------------------------------------------------------------- forms */
.field { margin-top: 8px; }
.field input { width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.field input:focus { border-color: var(--leaf); outline: none; }
.msg { font-size: 14px; color: var(--muted); margin-top: 8px; min-height: 1.2em; }
.msg.err { color: #9B3A1F; }

/* ---------------------------------------------------------------- panels (quiet containers) */
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin: 10px 0; }
.panel.moss { background: var(--moss); border-color: transparent; }
.panel.attn { background: var(--amber-soft); border-color: var(--amber); }

/* ---------------------------------------------------------------- the yard sign (firing card) */
.sign { position: relative; margin: 12px 0 30px; }
.sign .panel-sign {
  background: var(--leaf); color: #fff; border-radius: 18px; padding: 16px 16px 14px;
  border: 3px solid var(--leaf-deep);
}
.sign .panel-sign h3 { color: #fff; font-size: 18px; font-weight: 800; margin: 0 0 4px; line-height: 1.2; }
.sign .panel-sign p { color: rgba(255,255,255,.88); font-size: 15px; }
.sign .why { display: inline-block; margin-top: 8px; font-size: 12px; font-weight: 700; color: rgba(255,255,255,.75); }
.sign .done-row { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.sign .done-row button.plain { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.35); padding: 9px 14px; }
.sign .done-row .doneline { color: rgba(255,255,255,.85); font-size: 14px; font-weight: 700; }
.sign::before, .sign::after {
  content: ""; position: absolute; bottom: -22px; width: 12px; height: 26px; border-radius: 0 0 4px 4px;
  background: var(--leaf-deep);
}
.sign::before { left: 18%; } .sign::after { right: 18%; }
.sign.quiet .panel-sign { background: var(--paper); color: var(--ink); border: 2px dashed var(--line); }
.sign.quiet .panel-sign h3 { color: var(--ink); }
.sign.quiet .panel-sign p { color: var(--muted); }
.sign.quiet::before, .sign.quiet::after { background: var(--line); }
.sign.quiet .next { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 15px; }
.sign.quiet .next b { color: var(--leaf); }

/* ---------------------------------------------------------------- tonight numbers */
.numbers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 6px; }
.numbers .n { text-align: left; }
.numbers .n b { display: block; font-size: 26px; font-weight: 800; letter-spacing: -0.5px; line-height: 1; }
.numbers .n span { font-size: 12px; color: var(--muted); font-weight: 600; }
.days { display: flex; gap: 6px; margin-top: 12px; }
.days .d { flex: 1; background: var(--moss); border-radius: 12px; padding: 8px 6px; text-align: center; }
.days .d b { display: block; font-size: 13px; font-weight: 800; }
.days .d span { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
.days .d em { display: block; font-style: normal; font-size: 12px; color: var(--sky); font-weight: 700; }

/* ---------------------------------------------------------------- install / push card */
.steps { margin: 10px 0 0; padding: 0; list-style: none; counter-reset: s; }
.steps li { position: relative; padding: 6px 0 6px 34px; font-size: 15px; }
.steps li::before {
  counter-increment: s; content: counter(s); position: absolute; left: 0; top: 5px;
  width: 24px; height: 24px; border-radius: 50%; background: var(--leaf); color: #fff;
  font-size: 13px; font-weight: 800; display: flex; align-items: center; justify-content: center;
}
.steps svg { width: 18px; height: 18px; vertical-align: -3px; margin: 0 2px; }

/* ---------------------------------------------------------------- signals list */
.row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: none; }
.row .name { font-weight: 800; font-size: 16px; }
.row .rule { color: var(--muted); font-size: 14px; margin-top: 3px; line-height: 1.8; }
.row .rule input.pill {
  width: 62px; display: inline-block; padding: 3px 8px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--paper); font-weight: 800; color: var(--leaf); text-align: center; font-size: 16px;
}
.row .rule input.pill:focus { border-color: var(--leaf); outline: none; }
.row .armed { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.row .suggest { display: inline-block; margin-top: 6px; font-size: 13px; font-weight: 700; color: var(--leaf); background: var(--moss); border: none; border-radius: 999px; padding: 4px 10px; }
.row.off .name, .row.off .rule { opacity: .5; }
.toggle { appearance: none; -webkit-appearance: none; flex: none; width: 48px; height: 28px; border-radius: 14px; background: #CFCBC0; position: relative; margin: 2px 0 0; cursor: pointer; }
.toggle:checked { background: var(--leaf); }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: left .15s; }
.toggle:checked::after { left: 23px; }
@media (prefers-reduced-motion: reduce) { .toggle::after { transition: none; } }

/* optimize */
.seg { display: flex; gap: 6px; margin-top: 8px; }
.seg button { flex: 1; padding: 10px 6px; border-radius: 12px; border: 1px solid var(--line); background: var(--paper); font-weight: 700; font-size: 14px; line-height: 1.2; }
.seg button.on { background: var(--leaf); color: #fff; border-color: var(--leaf); }
.checks { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; }
.checks label { display: flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 600; }
.checks input { width: 20px; height: 20px; accent-color: var(--leaf); }
.chip { display: inline-block; background: var(--moss); color: var(--leaf); font-weight: 800; font-size: 13px; border-radius: 999px; padding: 3px 10px; }
.chip.amber { background: var(--amber-soft); color: #6B4A00; }

/* ---------------------------------------------------------------- yard */
.yard-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.yard-head .zone { font-size: 34px; font-weight: 800; letter-spacing: -1px; line-height: 1; }
.yard-head .zone small { font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: 0; display: block; margin-top: 2px; }
.count { margin-top: 12px; padding: 12px 14px; background: var(--moss); border-radius: 12px; }
.count b { font-size: 20px; font-weight: 800; display: block; }
.count span { font-size: 14px; color: var(--muted); }
.cal { margin: 4px 0 0; }
.cal .r { display: flex; justify-content: space-between; align-items: baseline; padding: 9px 0; border-bottom: 1px solid var(--line); gap: 10px; }
.cal .r:last-child { border-bottom: none; }
.cal .r span { font-size: 15px; }
.cal .r b { font-size: 15px; font-weight: 800; white-space: nowrap; }
.cal .r i { font-style: normal; font-size: 12px; color: var(--muted); display: block; }
.tasks { list-style: none; margin: 4px 0 0; padding: 0; }
.tasks li { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.tasks li:last-child { border-bottom: none; }
.tasks input { width: 22px; height: 22px; accent-color: var(--leaf); flex: none; margin-top: 1px; }
.tasks label { font-size: 15px; font-weight: 600; flex: 1; }
.tasks label small { display: block; color: var(--muted); font-weight: 600; font-size: 13px; }
.tasks li.done label { text-decoration: line-through; color: var(--muted); }

/* ---------------------------------------------------------------- log / journal */
.day-h { font-size: 13px; font-weight: 800; color: var(--muted); margin: 16px 0 4px; }
.entry { padding: 10px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.entry:last-child { border-bottom: none; }
.entry b { display: block; font-size: 15px; font-weight: 800; }
.entry span { font-size: 14px; color: var(--muted); }
.entry .time { display: block; font-size: 12px; margin-top: 2px; }
.entry .st { flex: none; font-size: 12px; font-weight: 800; border-radius: 999px; padding: 3px 9px; background: var(--moss); color: var(--leaf); }
.entry .st.test { background: var(--page); color: var(--muted); border: 1px solid var(--line); }
.entry .st.sent { background: var(--amber-soft); color: #6B4A00; }

/* ---------------------------------------------------------------- nav */
nav {
  position: fixed; bottom: 0; left: 0; right: 0; display: flex; background: var(--paper);
  border-top: 1px solid var(--line); padding: 6px 0 calc(6px + var(--sab)); z-index: 5;
}
nav button { flex: 1; border: none; background: none; color: var(--muted); font-size: 12px; font-weight: 700; padding: 4px 0 2px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
nav button svg { width: 24px; height: 24px; }
nav button.active { color: var(--leaf); }

/* ---------------------------------------------------------------- sheet (settings) + tour overlay */
.scrim { position: fixed; inset: 0; background: rgba(30,42,34,.45); z-index: 20; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 21; background: var(--page);
  border-radius: 20px 20px 0 0; padding: 12px 16px calc(20px + var(--sab)); max-height: 88vh; overflow: auto;
}
.sheet .grab { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 0 auto 12px; }
.sheet h2 { font-size: 18px; font-weight: 800; margin: 0 0 6px; }
.srow { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.srow:last-child { border-bottom: none; }
.srow .l { font-weight: 700; font-size: 15px; }
.srow .l small { display: block; color: var(--muted); font-weight: 600; font-size: 13px; }
.stamp { text-align: center; color: var(--muted); font-size: 12px; padding: 14px 0 0; }
.sel { padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); font-weight: 700; color: var(--leaf); max-width: 46%; }
.gauge { margin-top: 8px; }

.tour { position: fixed; inset: 0; z-index: 30; background: var(--page); display: flex; flex-direction: column; padding: calc(24px + var(--sat)) 24px calc(24px + var(--sab)); }
.tour .art { flex: none; display: flex; justify-content: center; margin-top: 8vh; }
.tour .art svg { width: 132px; height: 132px; border-radius: 30px; }
.tour .body { flex: 1; display: flex; flex-direction: column; justify-content: center; text-align: center; max-width: 380px; margin: 0 auto; }
.tour h2 { font-size: 24px; font-weight: 800; margin: 0 0 8px; letter-spacing: -0.3px; }
.tour p { font-size: 16px; color: var(--muted); }
.tour .dots { display: flex; justify-content: center; gap: 6px; margin: 18px 0; }
.tour .dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.tour .dots i.on { background: var(--leaf); width: 20px; border-radius: 4px; }
.tour .foot { display: flex; gap: 10px; align-items: center; }
.tour .foot .ghost { flex: none; }
.tour .foot .primary { flex: 1; }

.toast { position: fixed; left: 50%; bottom: calc(76px + var(--sab)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 999px; font-size: 14px; font-weight: 700; z-index: 40; max-width: 90vw; text-align: center; }
