/* AuSpaces Casita Check v2 — one question, one answer */
:root {
  --paper: #F4EFE6;
  --card: #FFFDF9;
  --ink: #1D1B18;
  --ink-2: #4A453F;
  --muted: #857C71;
  --line: #E4DCCF;
  --night: #22201D;
  --clay: #B4532A;
  --clay-press: #97441F;
  --go: #3F6B3A;
  --go-bg: #E6EFE1;
  --warn: #9A6A12;
  --warn-bg: #F7ECD4;
  --no: #A8431F;
  --no-bg: #F6E1D7;
  --r: 16px;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  background: var(--paper); color: var(--ink);
  font: 17px/1.45 var(--sans); -webkit-font-smoothing: antialiased;
  display: flex; flex-direction: column;
}
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
a { color: var(--clay); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.hp { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 3px solid rgba(180, 83, 42, 0.45); outline-offset: 2px; }

/* bar */
.bar {
  height: 52px; padding: 0 20px; padding-top: env(safe-area-inset-top);
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 5;
  background: rgba(244, 239, 230, 0.86); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
.brand { display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-weight: 700; letter-spacing: -0.01em; }
.brand svg { width: 22px; height: 22px; color: var(--clay); }
.call { color: var(--clay); text-decoration: none; font-weight: 600; font-size: 16px; padding: 8px 0 8px 12px; }

/* screens */
main { flex: 1; width: 100%; max-width: 560px; margin: 0 auto; padding: 32px 20px 40px; }
.screen.in { animation: rise .32s cubic-bezier(.2, .8, .2, 1); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
h1 { font: 700 40px/1.06 var(--display); letter-spacing: -0.035em; margin: 18px 0 12px; }
h2 { font: 700 30px/1.1 var(--display); letter-spacing: -0.03em; margin: 8px 0 8px; }
h3 { font: 600 13px/1.3 var(--sans); text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 28px 0 8px; }
.sub { color: var(--ink-2); margin: 0 0 24px; font-size: 18px; }
.fine { color: var(--muted); font-size: 13px; margin: 20px 0 0; text-align: center; }
.small { color: var(--muted); font-size: 14px; }
.note { color: var(--muted); font-size: 14px; margin: 8px 0 0; }
.stack { display: flex; flex-direction: column; gap: 14px; }

/* inputs */
.big-input, .big-select, .field input, .field select, .with-unit input {
  width: 100%; min-height: 56px; padding: 0 16px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--card);
  font-size: 18px; -webkit-appearance: none; appearance: none;
  transition: border-color .15s, box-shadow .15s;
}
.big-input { font-size: 20px; min-height: 60px; }
.big-select, .field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23857C71' stroke-width='1.8' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center; padding-right: 40px;
}
input:focus, select:focus { outline: none; border-color: var(--ink-2); box-shadow: 0 0 0 4px rgba(29, 27, 24, 0.07); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.field em { font-style: normal; font-weight: 400; color: var(--muted); }
.with-unit { position: relative; display: block; }
.with-unit em { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-style: normal; color: var(--muted); font-size: 15px; pointer-events: none; }
.with-unit input { padding-right: 76px; }
.field.inline { margin-bottom: 12px; }
.field.inline input, .field.inline select { min-height: 48px; font-size: 17px; }
.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.error { color: var(--no); font-size: 15px; margin: 0; }

/* segmented */
.seg { display: flex; background: rgba(29, 27, 24, 0.06); border-radius: 12px; padding: 3px; }
.seg label { flex: 1; cursor: pointer; position: relative; min-width: 0; }
.seg input, .tap input { position: absolute; left: 0; top: 0; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.seg span { display: block; text-align: center; padding: 12px 6px; border-radius: 9px; font-size: 16px; font-weight: 500; color: var(--ink-2); transition: background .15s, box-shadow .15s; }
.seg input:checked + span { background: var(--card); color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.seg input:focus-visible + span { outline: 3px solid rgba(180, 83, 42, 0.45); }
.seg.small span { padding: 9px 4px; font-size: 15px; }

/* buttons */
.primary {
  width: 100%; min-height: 56px; border: 0; border-radius: 14px;
  background: var(--clay); color: #fff; font-size: 18px; font-weight: 600; letter-spacing: -0.01em;
  cursor: pointer; transition: background .15s, transform .08s;
}
.primary:hover { background: var(--clay-press); }
.primary:active { transform: scale(0.99); }
.primary:disabled { opacity: 0.6; }
.text-btn { background: none; border: 0; padding: 10px 4px; color: var(--clay); font-size: 17px; font-weight: 500; cursor: pointer; text-decoration: none; }
.back { background: none; border: 0; padding: 0; margin: 0 0 8px; color: var(--clay); font-size: 17px; cursor: pointer; }
.back::before { content: "‹ "; font-size: 22px; line-height: 0; vertical-align: -2px; }
.links { display: flex; justify-content: center; gap: 28px; margin: 6px 0 18px; }

/* result */
.place { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 10px; margin: 4px 0 18px; }
.place-addr { font: 700 22px/1.2 var(--display); letter-spacing: -0.02em; flex: 1 1 auto; }
.place-meta { order: 3; flex-basis: 100%; color: var(--muted); font-size: 15px; }
.place .text-btn { padding: 0; font-size: 16px; }

.poster { border-radius: 22px; padding: 28px 24px 22px; background: var(--card); border: 1px solid var(--line); margin-bottom: 16px; }
.poster.yes { background: var(--go-bg); border-color: #CFDDC6; }
.poster.likely { background: var(--warn-bg); border-color: #EBD9AE; }
.poster.no { background: var(--no-bg); border-color: #EBC7B6; }
.poster.unknown { background: var(--card); border-color: var(--line); }
.verdict-word { font: 800 60px/1 var(--display); letter-spacing: -0.045em; }
.poster.yes .verdict-word { color: var(--go); }
.poster.likely .verdict-word { color: var(--warn); font-size: 52px; }
.poster.no .verdict-word { color: var(--no); font-size: 54px; }
.poster.unknown .verdict-word { color: var(--ink-2); font-size: 40px; line-height: 1.05; letter-spacing: -0.035em; }
.verdict-line { font-size: 20px; font-weight: 600; margin: 12px 0 18px; letter-spacing: -0.01em; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0; padding-top: 16px; border-top: 1px solid rgba(0, 0, 0, 0.07); }
.facts dt { font-size: 13px; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-size: 19px; font-weight: 600; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.type-row { margin: 0 0 16px; }

/* drawers */
.drawer { border-top: 1px solid var(--line); }
.drawer:last-of-type { border-bottom: 1px solid var(--line); }
.drawer summary {
  list-style: none; cursor: pointer; padding: 18px 2px; font-size: 17px; font-weight: 500;
  display: flex; align-items: center; gap: 10px;
}
.drawer summary::-webkit-details-marker { display: none; }
.drawer summary::after { content: ""; margin-left: auto; width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .2s; margin-right: 4px; }
.drawer[open] summary::after { transform: rotate(-135deg); }
.drawer-body { padding: 0 2px 20px; }
.pill { background: var(--warn); color: #fff; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 2px 8px; }
.toggle { display: flex; align-items: center; gap: 12px; font-size: 17px; margin-bottom: 14px; cursor: pointer; }
.toggle input { width: 22px; height: 22px; accent-color: var(--clay); }
.money-word { font: 700 28px/1.1 var(--display); letter-spacing: -0.03em; margin: 8px 0 4px; }
.money-word.good { color: var(--go); } .money-word.tight { color: var(--warn); } .money-word.bad { color: var(--no); }
.money-line { color: var(--ink-2); margin: 0 0 14px; }
.rows { margin: 0; }
.rows div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 15px; }
.rows dt { color: var(--ink-2); }
.rows dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.checks { list-style: none; margin: 0 0 16px; padding: 0; }
.checks li { position: relative; padding: 8px 0 8px 26px; font-size: 15px; color: var(--ink-2); border-top: 1px solid var(--line); }
.checks li:first-child { border-top: 0; }
.checks li::before { position: absolute; left: 2px; top: 8px; font-weight: 700; }
.checks li.no::before { content: "✕"; color: var(--no); }
.checks li.warn::before { content: "!"; color: var(--warn); left: 6px; }
.checks li.info::before { content: "·"; color: var(--muted); font-size: 22px; line-height: 0.9; left: 5px; }
.taps { display: flex; flex-wrap: wrap; gap: 8px; }
.tap { cursor: pointer; position: relative; }
.tap span { display: inline-block; padding: 10px 14px; border-radius: 999px; background: rgba(29, 27, 24, 0.06); font-size: 15px; transition: background .15s, color .15s; }
.tap input:checked + span { background: var(--ink); color: #fff; }
.tap input:focus-visible + span { outline: 3px solid rgba(180, 83, 42, 0.45); }

/* packet */
.packet ul { margin: 0; padding-left: 20px; color: var(--ink-2); }
.packet li { margin: 6px 0; }
.packet p { margin: 0 0 8px; }
.notice { background: var(--night); color: #fff; border-radius: 14px; padding: 14px 16px; font-weight: 600; font-size: 16px; margin: 4px 0 8px; }
.math { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font: 600 15px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.boxes { list-style: none; padding: 0 !important; }
.boxes li { padding-left: 28px; position: relative; }
.boxes li::before { content: ""; position: absolute; left: 0; top: 4px; width: 16px; height: 16px; border: 1.5px solid var(--ink-2); border-radius: 4px; }
.packet .drawer { margin-top: 10px; }
.packet-actions { margin-top: 24px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.print-only { display: none; }

/* book */
.summary { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin: 0 0 20px; font-size: 16px; color: var(--ink-2); }
.summary b { color: var(--ink); }

/* done */
.done-mark { width: 72px; height: 72px; border-radius: 50%; background: var(--go); color: #fff; display: grid; place-items: center; font-size: 36px; margin: 40px 0 16px; }

/* footer, toast */
.foot { text-align: center; color: var(--muted); font-size: 12.5px; padding: 18px 20px calc(24px + env(safe-area-inset-bottom)); line-height: 1.6; }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--night); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 15px; max-width: calc(100vw - 32px); z-index: 20; }

@media (min-width: 720px) {
  main { padding-top: 64px; }
  h1 { font-size: 52px; }
  .verdict-word { font-size: 72px; }
}

@media print {
  @page { size: letter; margin: 0.5in; }
  body { background: #fff; font-size: 9.6pt; line-height: 1.35; }
  .bar, .foot, .no-print, .toast, .screen:not(.packet) { display: none !important; }
  .packet { display: block !important; }
  main { max-width: none; padding: 0; }
  .print-only { display: block; }
  .print-head { font-size: 9.5pt; color: #666; border-bottom: 1.5pt solid #000; padding-bottom: 6pt; margin-bottom: 10pt; }
  h2 { font-size: 17pt; margin: 0 0 2pt; }
  h3 { margin: 9pt 0 3pt; font-size: 8.5pt; }
  .sub { font-size: 10pt; margin: 0 0 6pt; }
  .notice { padding: 6pt 9pt; font-size: 10pt; border-radius: 6pt; }
  .math { padding: 5pt 8pt; font-size: 9pt; }
  .small, .fine { font-size: 8.5pt; }
  #pSetbacks, #pDocs, #pRejects, #pFields, #pPlot, #pChecklist { columns: 2; column-gap: 18pt; }
  .packet li { break-inside: avoid; }
  .notice, .math { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .drawer summary { padding: 8pt 0 2pt; font-weight: 700; }
  .drawer summary::after { display: none; }
  .drawer, .drawer:last-of-type { border: 0; }
  .packet li { margin: 1pt 0; }
  .packet .drawer { margin-top: 2pt; }
  .drawer-body { padding-bottom: 4pt; }
}

/* county lookup */
.lookup-note { border-radius: 14px; padding: 12px 14px; font-size: 15px; margin: -8px 0 18px; }
.lookup-note.ok { background: var(--go-bg); color: #2F5230; }
.lookup-note.miss { background: var(--warn-bg); color: #6E4C0D; }
.lookup-note b { font-weight: 700; }
