/* ============================================================
   HBR — Mobile PWA
   Phone-sized stage centered on desktop; fullscreen on mobile.
============================================================ */

:root {
  --paper:        #f3eee5;
  --paper-2:      #e9e1d3;
  --paper-3:      #ddd2c0;
  --ink:          #1a1f28;
  --ink-2:        #3c4453;
  --ink-3:        #6c7588;
  --rule:         #d6cdb9;
  --rule-2:       #e5dfd0;
  --blueprint:    #3a6386;
  --rust:         #d36034;
  --rust-2:       #e89a7c;
  --rust-wash:    #f3e0d6;
  --moss:         #57805e;
  --moss-wash:    #dee9d8;

  --display: "Fraunces", ui-serif, Georgia, serif;
  --sans:    "Hanken Grotesk", ui-sans-serif, system-ui, sans-serif;

  /* device viewport */
  --device-w: min(100vw, 430px);
  --device-h: min(100dvh, 100vh, 900px);

  --safe-top: env(safe-area-inset-top, 0);
  --safe-bot: env(safe-area-inset-bottom, 0);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
body {
  font-family: var(--sans);
  background: #0f1116;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  overflow: hidden;
  background-image:
    radial-gradient(ellipse 60% 50% at 50% 0%, #1a1f28 0%, #0f1116 70%);
}

/* ============================================================
   DEVICE FRAME
============================================================ */
#device {
  position: fixed;
  inset: 0;
  width: var(--device-w);
  height: 100dvh;
  max-height: var(--device-h);
  margin: auto;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  isolation: isolate;
}

@media (min-width: 720px) {
  body {
    display: grid;
    place-items: center;
    padding: 2rem 0;
  }
  #device {
    position: relative;
    inset: auto;
    margin: 0;
    border-radius: 44px;
    box-shadow:
      0 0 0 12px #1a1f28,
      0 0 0 13px #2c3340,
      0 40px 80px -20px rgba(0,0,0,0.55),
      0 80px 120px -40px rgba(0,0,0,0.4);
  }
  #device::before {
    content: "";
    position: absolute;
    top: 14px; left: 50%; transform: translateX(-50%);
    width: 110px; height: 28px;
    background: #0f1116;
    border-radius: 999px;
    z-index: 50;
  }
}

@media (max-width: 719px) {
  #status-bar { display: none; } /* real device has its own */
}

/* ============================================================
   STATUS BAR (desktop chrome)
============================================================ */
#status-bar {
  position: relative;
  z-index: 10;
  padding: 14px 28px 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  flex-shrink: 0;
}
@media (min-width: 720px) {
  #status-bar { padding-top: 26px; }
}
#status-icons { display: inline-flex; gap: 5px; align-items: center; }

/* ============================================================
   STAGE — where screens mount
============================================================ */
#stage {
  flex: 1;
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 88px;
}
#stage::-webkit-scrollbar { display: none; }

.screen {
  position: absolute;
  inset: 0;
  background: var(--paper);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 110px;
  scrollbar-width: none;
}
.screen::-webkit-scrollbar { display: none; }

/* Transition: slide-from-right on push, slide-out-left on pop */
.screen-enter { transform: translateX(100%); opacity: 0.6; }
.screen-enter-active { transform: translateX(0); opacity: 1; transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.32s ease; }
.screen-exit { transform: translateX(0); opacity: 1; }
.screen-exit-active { transform: translateX(-30%); opacity: 0; transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.32s ease; }

/* ============================================================
   TAB BAR
============================================================ */
#tab-bar {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  z-index: 30;
  background: rgba(248, 244, 236, 0.92);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  backdrop-filter: blur(20px) saturate(1.2);
  border-top: 1px solid var(--rule-2);
  padding: 8px 12px calc(8px + var(--safe-bot));
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 4px;
  align-items: center;
}
.tab {
  background: transparent;
  border: none;
  padding: 8px 4px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  letter-spacing: 0.04em;
  font-weight: 600;
  font-family: var(--sans);
  color: var(--ink-3);
  cursor: pointer;
  transition: color 0.2s ease;
}
.tab.active { color: var(--ink); }
.tab svg { color: inherit; }
.tab-camera .cam-circle {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  display: grid; place-items: center;
  margin-top: -6px;
  transition: transform 0.2s ease;
  box-shadow: 0 6px 18px -6px rgba(26, 31, 40, 0.6);
}
.tab-camera:active .cam-circle { transform: scale(0.94); }

/* ============================================================
   HOME INDICATOR (iPhone-style)
============================================================ */
#home-indicator {
  position: absolute;
  bottom: 6px; left: 50%; transform: translateX(-50%);
  width: 134px; height: 4px;
  background: var(--ink);
  border-radius: 2px;
  opacity: 0.3;
  z-index: 40;
  pointer-events: none;
}
@media (max-width: 719px) {
  #home-indicator { display: none; }
}

/* ============================================================
   SCREEN: HEADER / NAV
============================================================ */
.screen-head {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(243, 238, 229, 0.94);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  backdrop-filter: blur(20px) saturate(1.2);
  padding: 14px 20px 12px;
  display: grid;
  grid-template-columns: 32px 1fr 32px;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--rule-2);
}
.screen-head .back {
  background: none; border: none;
  width: 32px; height: 32px;
  display: grid; place-items: center;
  color: var(--ink);
  cursor: pointer;
  border-radius: 50%;
  padding: 0;
}
.screen-head .back:active { background: var(--paper-2); }
.screen-head .title {
  text-align: center;
  font-family: var(--display);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.012em;
  color: var(--ink);
  line-height: 1;
}
.screen-head .title small {
  display: block;
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ink-3);
  margin-bottom: 3px;
}
.screen-head .action {
  background: none; border: none;
  width: 32px; height: 32px;
  display: grid; place-items: center;
  color: var(--ink-2);
  cursor: pointer;
}

/* ============================================================
   HOUSE SCREEN
============================================================ */
.house-hero {
  padding: 20px 20px 24px;
  background: var(--paper);
}
.house-hero .greet {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ink-3);
}
.house-hero h1 {
  font-family: var(--display);
  font-size: 32px;
  font-weight: 300;
  letter-spacing: -0.025em;
  margin: 4px 0 0;
  color: var(--ink);
  line-height: 1.05;
}
.house-hero h1 em {
  font-style: italic;
  font-weight: 500;
}

.year-card {
  margin: 16px 20px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 16px;
  padding: 18px 20px 20px;
  position: relative;
  overflow: hidden;
}
.year-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(243,238,229,0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(243,238,229,0.05) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
}
.year-card .label {
  font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase;
  font-weight: 700;
  color: rgba(243,238,229,0.55);
}
.year-card .month {
  font-family: var(--display);
  font-size: 36px; font-weight: 300;
  letter-spacing: -0.03em;
  margin-top: 6px;
  display: flex; align-items: baseline; gap: 6px;
}
.year-card .month em {
  font-style: italic;
  font-weight: 400;
}
.year-card .month small {
  font-family: var(--sans);
  font-size: 13px; font-weight: 600;
  color: rgba(243,238,229,0.55);
}
.year-card .progress {
  height: 4px;
  background: rgba(243,238,229,0.15);
  border-radius: 2px;
  margin-top: 12px;
  position: relative; overflow: hidden;
}
.year-card .progress-fill {
  position: absolute; inset: 0 auto 0 0;
  background: var(--rust);
  width: 75%; /* month 9 of 12 */
}
.year-card .progress-meta {
  display: flex; justify-content: space-between;
  margin-top: 8px;
  font-size: 11px;
  color: rgba(243,238,229,0.7);
}

.stat-strip {
  margin: 0 20px 20px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.stat-strip .stat {
  text-align: left;
}
.stat-strip .stat .v {
  font-family: var(--display);
  font-size: 24px; font-weight: 400;
  letter-spacing: -0.022em;
  line-height: 1;
  color: var(--ink);
}
.stat-strip .stat.claim .v { color: var(--rust); }
.stat-strip .stat .k {
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  font-weight: 700;
  color: var(--ink-3);
  margin-top: 6px;
}

.section-h {
  padding: 8px 20px 6px;
  display: flex; justify-content: space-between; align-items: baseline;
}
.section-h h2 {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.012em;
  margin: 0;
  color: var(--ink);
}
.section-h .link {
  font-size: 12px; font-weight: 600;
  color: var(--rust);
  text-decoration: none;
}

/* Room list */
.room-list {
  list-style: none; margin: 0; padding: 0 20px;
  display: grid; gap: 8px;
}
.room-row {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease;
}
.room-row:active { transform: scale(0.985); background: var(--paper-2); }
.room-row .icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--paper-2);
  display: grid; place-items: center;
  color: var(--ink-2);
}
.room-row .meta { display: flex; flex-direction: column; gap: 2px; }
.room-row .nm { font-weight: 600; font-size: 15px; color: var(--ink); }
.room-row .sub { font-size: 12px; color: var(--ink-3); }
.room-row .count {
  font-family: var(--display);
  font-size: 20px; font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--ink);
  position: relative;
  padding-right: 12px;
}
.room-row .count.has::after {
  content: "";
  position: absolute;
  right: 0; top: 50%; transform: translateY(-50%);
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--rust);
}
.room-row .count.none { color: var(--ink-3); }
.room-row .chev { color: var(--ink-3); }

/* Activity feed */
.activity {
  padding: 0 20px;
  display: grid; gap: 8px;
}
.activity-row {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 12px;
  align-items: center;
  cursor: pointer;
}
.activity-row:active { background: var(--paper-2); }
.activity-row .thumb {
  width: 48px; height: 48px;
  border-radius: 8px;
  background-size: cover;
  background-position: 50% 40%;
  border: 1px solid var(--rule);
}
.activity-row .desc { font-size: 13px; color: var(--ink); }
.activity-row .desc small {
  display: block;
  font-size: 11px; color: var(--ink-3);
  margin-top: 2px;
}
.activity-row .tag {
  display: inline-block;
  font-size: 9px; font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase;
  padding: 2px 6px; border-radius: 3px;
  margin-right: 6px;
  vertical-align: middle;
}
.activity-row .tag.normal { background: var(--moss-wash); color: var(--moss); }
.activity-row .tag.watch  { background: #f3e7c4; color: #8a6d20; }
.activity-row .tag.claim  { background: var(--rust-wash); color: var(--rust); }

/* ============================================================
   ROOM DETAIL SCREEN
============================================================ */
.room-hero {
  padding: 16px 20px 20px;
  background: var(--paper);
}
.room-hero .crumb {
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  font-weight: 700; color: var(--ink-3);
}
.room-hero h1 {
  font-family: var(--display);
  font-size: 30px; font-weight: 400;
  letter-spacing: -0.025em;
  margin: 4px 0 0;
  color: var(--ink);
  line-height: 1.05;
}
.room-hero h1 em {
  font-style: italic;
  font-weight: 300;
  display: block;
  font-size: 16px;
  color: var(--ink-3);
  margin-top: 2px;
}

.minimap {
  margin: 0 20px 16px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 14px;
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 14px;
  align-items: center;
}
.minimap svg { width: 80px; height: 60px; }
.minimap .info { font-size: 12px; color: var(--ink-2); }
.minimap .info strong { color: var(--ink); font-weight: 600; }

.issue-list {
  list-style: none; margin: 0; padding: 0 20px;
  display: grid; gap: 8px;
}
.issue-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 14px;
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  align-items: start;
  cursor: pointer;
}
.issue-card:active { background: var(--paper-2); }
.issue-card .thumb {
  width: 64px; height: 64px;
  border-radius: 8px;
  background-size: cover;
  background-position: 50% 40%;
  border: 1px solid var(--rule);
  position: relative;
  overflow: hidden;
}
.issue-card .thumb svg {
  position: absolute; inset: 0; width: 100%; height: 100%;
}
.issue-card .body {
  display: flex; flex-direction: column; gap: 4px;
}
.issue-card .top {
  display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
}
.issue-card .tag {
  font-size: 9px; font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase;
  padding: 2px 6px; border-radius: 3px;
  line-height: 1;
}
.issue-card .tag.normal { background: var(--moss-wash); color: var(--moss); }
.issue-card .tag.watch  { background: #f3e7c4; color: #8a6d20; }
.issue-card .tag.claim  { background: var(--rust-wash); color: var(--rust); }
.issue-card .date { font-size: 10px; color: var(--ink-3); margin-left: auto; font-variant-numeric: tabular-nums; }
.issue-card .desc { font-size: 14px; color: var(--ink); font-weight: 500; }
.issue-card .sub  { font-size: 12px; color: var(--ink-3); }

.fab {
  position: sticky;
  bottom: 100px;
  margin: 18px 20px 0;
  background: var(--ink);
  color: var(--paper);
  border-radius: 999px;
  border: none;
  padding: 14px 20px;
  font-weight: 600;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  cursor: pointer;
  width: calc(100% - 40px);
  box-shadow: 0 10px 30px -10px rgba(26, 31, 40, 0.4);
  z-index: 4;
}
.fab:active { transform: scale(0.98); }

/* ============================================================
   CAPTURE SCREEN
============================================================ */
.capture-screen {
  position: absolute;
  inset: 0;
  background: #0f1116;
  display: flex; flex-direction: column;
  z-index: 100; /* over tabs */
}
.capture-screen .top {
  padding: 14px 20px;
  display: flex; justify-content: space-between; align-items: center;
  color: var(--paper);
}
.capture-screen .top button {
  background: rgba(255,255,255,0.1);
  border: none;
  border-radius: 999px;
  padding: 8px 14px;
  color: var(--paper);
  font-size: 13px; font-weight: 600;
  cursor: pointer;
}
.capture-screen .vf-box {
  flex: 1;
  position: relative;
  margin: 0 16px;
  border-radius: 16px;
  overflow: hidden;
  background:
    radial-gradient(circle at center, #2c3340 0%, #15181f 100%);
  display: grid;
  place-items: center;
}
.capture-screen .vf-photo {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.capture-screen .vf-photo.show { opacity: 1; }
.capture-screen .vf-frame {
  position: absolute;
  inset: 30px;
  border: 1px solid rgba(255,255,255,0.5);
}
.capture-screen .vf-frame::before, .capture-screen .vf-frame::after {
  content: ""; position: absolute; inset: 0; margin: auto;
  background: rgba(255,255,255,0.8);
}
.capture-screen .vf-frame::before { width: 28px; height: 1.5px; }
.capture-screen .vf-frame::after { width: 1.5px; height: 28px; }
.capture-screen .vf-hint {
  position: relative; z-index: 2;
  color: rgba(255,255,255,0.85);
  font-family: var(--display);
  font-style: italic;
  font-weight: 300;
  font-size: 18px;
  text-align: center;
  padding: 0 24px;
  pointer-events: none;
}
.capture-screen .controls {
  padding: 20px 20px calc(34px + var(--safe-bot));
  display: grid;
  grid-template-columns: 60px 1fr 60px;
  align-items: center;
  gap: 8px;
}
.capture-screen .controls .shot {
  width: 72px; height: 72px;
  margin: 0 auto;
  border-radius: 50%;
  background: var(--paper);
  border: 4px solid var(--paper);
  box-shadow: inset 0 0 0 3px #0f1116;
  cursor: pointer;
  transition: transform 0.1s ease;
}
.capture-screen .controls .shot:active { transform: scale(0.92); }
.capture-screen .controls .upload-btn,
.capture-screen .controls .flip-btn {
  background: rgba(255,255,255,0.12);
  border: none;
  width: 44px; height: 44px;
  border-radius: 50%;
  color: var(--paper);
  cursor: pointer;
  display: grid; place-items: center;
}
.capture-screen input[type=file] {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  border: 0;
}

/* Room picker overlay (before capture) */
.room-picker {
  position: absolute;
  inset: 0;
  background: rgba(15, 17, 22, 0.92);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  z-index: 102;
  display: flex; flex-direction: column;
  padding: 14px 16px calc(20px + var(--safe-bot));
}
.room-picker .head {
  display: flex; justify-content: space-between; align-items: center;
  color: var(--paper);
  padding: 8px 4px 16px;
}
.room-picker .head h3 {
  font-family: var(--display);
  font-weight: 400;
  font-size: 20px;
  margin: 0;
}
.room-picker .head button {
  background: rgba(255,255,255,0.1);
  border: none; color: var(--paper);
  padding: 6px 12px; border-radius: 999px;
  font-size: 13px; font-weight: 600;
}
.room-picker .opts { display: grid; gap: 8px; }
.room-picker .opt {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--paper);
  padding: 14px 16px;
  border-radius: 12px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  cursor: pointer;
  text-align: left;
  font-family: var(--sans);
}
.room-picker .opt .nm { font-weight: 600; font-size: 15px; }
.room-picker .opt .sub { font-size: 12px; opacity: 0.7; margin-top: 2px; }
.room-picker .opt .count { font-family: var(--display); font-size: 18px; font-weight: 400; }

/* ============================================================
   ANALYZE / RESULT
============================================================ */
.analyze-screen {
  position: absolute;
  inset: 0;
  z-index: 110;
  background: var(--paper);
  display: flex; flex-direction: column;
}
.analyze-screen .photo-stage {
  position: relative;
  flex: 1;
  background: #0f1116;
  overflow: hidden;
}
.analyze-screen .photo-stage .pic {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
}
.analyze-screen .photo-stage .scan-line {
  position: absolute; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--rust), transparent);
  box-shadow: 0 0 24px var(--rust);
  animation: scan 1.4s ease-in-out infinite;
}
@keyframes scan {
  0%   { top: 0; opacity: 0.5; }
  50%  { top: 100%; opacity: 1; }
  100% { top: 0; opacity: 0.5; }
}
.analyze-screen .photo-stage .bbox-overlay {
  position: absolute;
  inset: 25% 40% 25% 40%;
  border: 2px dashed var(--rust);
  opacity: 0;
  transition: opacity 0.4s ease;
}
.analyze-screen .photo-stage .bbox-overlay.show { opacity: 1; }
.analyze-screen .photo-stage .badge {
  position: absolute; top: 18px; left: 18px;
  background: var(--ink); color: var(--paper);
  padding: 6px 10px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase;
  z-index: 2;
}

.analyze-screen .panel {
  background: var(--paper);
  border-top-left-radius: 22px;
  border-top-right-radius: 22px;
  padding: 22px 20px calc(28px + var(--safe-bot));
  box-shadow: 0 -10px 30px -10px rgba(0,0,0,0.15);
  position: relative;
  max-height: 64%;
  overflow-y: auto;
  scrollbar-width: none;
}
.analyze-screen .panel::-webkit-scrollbar { display: none; }
.analyze-screen .panel::before {
  content: "";
  position: absolute;
  top: 8px; left: 50%; transform: translateX(-50%);
  width: 40px; height: 4px;
  background: var(--rule);
  border-radius: 2px;
}

.analyze-screen .status {
  text-align: center;
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  font-size: 18px;
  color: var(--ink);
}
.analyze-screen .substatus {
  text-align: center;
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  font-weight: 700; color: var(--ink-3);
  margin-top: 6px;
}

.verdict-block {
  display: none;
}
.verdict-block.show { display: block; }

.verdict-block .pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--rust); color: var(--paper);
  padding: 6px 12px;
  font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; font-weight: 700;
  border-radius: 999px;
}
.verdict-block .pill.normal { background: var(--moss); }
.verdict-block .pill.watch  { background: #b58a3a; }
.verdict-block .pill.claim  { background: var(--rust); }
.verdict-block h2 {
  font-family: var(--display);
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin: 12px 0 2px;
  color: var(--ink);
  line-height: 1.05;
}
.verdict-block h2.claim { color: var(--rust); }
.verdict-block .conf {
  font-size: 12px; color: var(--ink-3);
}
.verdict-block .conf strong {
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  font-weight: 700;
}
.verdict-block .conf-bar {
  height: 3px;
  background: var(--paper-3);
  margin-top: 8px;
  position: relative;
  border-radius: 2px;
  overflow: hidden;
}
.verdict-block .conf-bar::after {
  content: ""; position: absolute; inset: 0 auto 0 0;
  background: var(--rust);
  width: var(--w, 50%);
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.verdict-block .rows {
  margin-top: 16px;
  display: grid;
  grid-template-columns: auto 1fr;
  border-top: 1px solid var(--rule);
}
.verdict-block .rows .k, .verdict-block .rows .v {
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 12px;
}
.verdict-block .rows .k {
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 10px;
  font-weight: 700;
  padding-right: 16px;
}
.verdict-block .rows .v {
  font-weight: 600;
  text-align: right;
  color: var(--ink);
}
.verdict-block .draft {
  margin-top: 14px;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 12px 14px;
  font-family: var(--display);
  font-style: italic;
  font-weight: 300;
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.5;
}
.verdict-block .actions {
  margin-top: 16px;
  display: grid;
  gap: 8px;
}
.btn-pill {
  width: 100%;
  padding: 14px;
  border-radius: 999px;
  border: none;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: transform 0.12s ease;
}
.btn-pill:active { transform: scale(0.98); }
.btn-pill.primary { background: var(--ink); color: var(--paper); }
.btn-pill.rust    { background: var(--rust); color: var(--paper); }
.btn-pill.ghost   { background: transparent; border: 1px solid var(--ink); color: var(--ink); }

/* ============================================================
   ISSUE DETAIL SCREEN
============================================================ */
.issue-screen {
  position: absolute;
  inset: 0;
  background: var(--paper);
  z-index: 105;
  display: flex; flex-direction: column;
  animation: slide-up 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes slide-up {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
.issue-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 100px;
}
.issue-body::-webkit-scrollbar { display: none; }

.big-photo {
  position: relative;
  aspect-ratio: 4/3;
  background-size: cover;
  background-position: center;
  overflow: hidden;
}
.big-photo::after {
  content: "";
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(0,0,0,0.25) 0%, transparent 30%, transparent 70%, rgba(0,0,0,0.35) 100%);
}
.big-photo .crack {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  z-index: 1;
  mix-blend-mode: multiply;
}
.big-photo .region-badge {
  position: absolute; top: 16px; left: 16px;
  background: var(--ink); color: var(--paper);
  padding: 5px 9px;
  font-size: 10px; letter-spacing: 1.6px; text-transform: uppercase; font-weight: 700;
  z-index: 2;
}
.big-photo .region-meta {
  position: absolute; bottom: 16px; right: 16px;
  background: rgba(15, 17, 22, 0.65);
  color: var(--paper);
  padding: 4px 8px;
  font-family: var(--display); font-style: italic; font-weight: 300;
  font-size: 12px;
  z-index: 2;
}

.issue-section {
  padding: 18px 20px 6px;
}
.issue-section .pill {
  display: inline-block;
  background: var(--rust); color: var(--paper);
  padding: 4px 10px;
  font-size: 10px; letter-spacing: 1.6px; text-transform: uppercase; font-weight: 700;
  border-radius: 999px;
}
.issue-section .pill.normal { background: var(--moss); }
.issue-section .pill.watch  { background: var(--watch-fg, #8a6d20); }
.issue-section .pill.rust   { background: var(--rust); }
.issue-section h2 {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.014em;
  color: var(--ink);
  margin: 10px 0 4px;
  line-height: 1.15;
}
.issue-section h2.claim { color: var(--rust); }
.issue-section h3 {
  font-family: var(--display);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink-2);
  text-transform: uppercase;
  margin: 0 0 12px;
  font-style: italic;
}
.issue-section .sub {
  font-size: 13px; color: var(--ink-3);
  line-height: 1.5;
}

.timeline {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column;
  position: relative;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 10px;
  bottom: 10px;
  width: 1.5px;
  background: var(--rule);
}
.t-row {
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 14px;
  padding: 6px 0 14px;
  position: relative;
}
.t-row .dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--paper-2);
  border: 1.5px solid var(--ink-3);
  margin-top: 2px;
  position: relative;
  z-index: 1;
}
.t-row.active .dot { background: var(--rust); border-color: var(--rust); }
.t-row .dot.normal { background: var(--moss); border-color: var(--moss); }
.t-row .dot.watch  { background: #b58a3a; border-color: #b58a3a; }
.t-row .dot.claim  { background: var(--rust); border-color: var(--rust); }
.t-row .dot.next   { background: var(--paper); border-color: var(--rule); }

.t-body { padding-top: 1px; }
.t-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 2px;
}
.t-label {
  font-family: var(--display);
  font-style: italic;
  font-weight: 500;
  font-size: 15px;
  color: var(--ink);
}
.t-row:not(.active) .t-label { color: var(--ink-3); }
.t-mm {
  font-size: 11px; letter-spacing: 1.2px;
  font-weight: 700;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.t-desc {
  font-size: 12px;
  color: var(--ink-3);
}

.btn-pill.text {
  background: transparent; border: none;
  color: var(--ink-3);
  font-size: 12px;
  padding: 8px;
}
.btn-pill.text:active { color: var(--ink); }

/* ============================================================
   BUILDER SCREEN
============================================================ */
.builder-screen .hero {
  padding: 16px 20px 24px;
}
.builder-screen .hero .crumb {
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  font-weight: 700; color: var(--ink-3);
}
.builder-screen .hero h1 {
  font-family: var(--display);
  font-size: 28px; font-weight: 400;
  letter-spacing: -0.025em;
  margin: 4px 0 0;
  color: var(--ink);
  line-height: 1.05;
}

.report-card {
  margin: 0 20px;
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 4px 4px 0 var(--paper-3);
}
.report-card .head {
  display: flex; justify-content: space-between; align-items: flex-start;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 14px; margin-bottom: 14px;
}
.report-card .head .name {
  font-family: var(--display);
  font-weight: 500; font-size: 20px;
  letter-spacing: -0.018em;
}
.report-card .head .name small {
  display: block;
  font-family: var(--sans);
  font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase;
  font-weight: 700; color: var(--ink-3);
  margin-top: 4px;
}
.report-card .head .score {
  font-family: var(--display);
  font-weight: 300;
  font-size: 36px;
  letter-spacing: -0.04em;
  line-height: 1;
}
.report-card .head .score sub {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 12px;
  color: var(--ink-3);
  margin-left: 2px;
}
.report-card .bars { display: flex; flex-direction: column; gap: 10px; }
.report-card .bar-row {
  display: grid;
  grid-template-columns: 1fr 3rem;
  gap: 10px; align-items: center;
  font-size: 12px;
}
.report-card .bar-row .k { color: var(--ink-2); font-weight: 500; }
.report-card .bar-row .track { height: 5px; background: var(--paper-3); border-radius: 3px; position: relative; grid-column: 1 / -1; margin-top: 2px; }
.report-card .bar-row .fill { position: absolute; inset: 0 auto 0 0; background: var(--ink); border-radius: 3px; }
.report-card .bar-row.warn .fill { background: var(--rust); }
.report-card .bar-row.ok .fill { background: var(--moss); }
.report-card .bar-row .v {
  font-variant-numeric: tabular-nums;
  text-align: right;
  font-weight: 700;
  color: var(--ink-2);
}
.report-card .footnote {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--rule);
  font-family: var(--display);
  font-style: italic;
  font-weight: 300;
  font-size: 12px;
  color: var(--ink-3);
}

/* ============================================================
   DESKTOP CHROME (sidebar on big screens)
============================================================ */
#desktop-chrome {
  display: none;
}
@media (min-width: 920px) {
  body { grid-template-columns: 1fr min(430px, 100%); }
  #desktop-chrome {
    display: block;
    align-self: center;
    justify-self: end;
    max-width: 380px;
    margin-right: 4rem;
    color: rgba(243, 238, 229, 0.86);
    font-size: 14px;
    line-height: 1.6;
  }
  #desktop-chrome .dc-brand {
    display: flex; align-items: center; gap: 12px;
    color: var(--paper);
    font-family: var(--display);
    font-size: 22px;
    font-weight: 500;
    letter-spacing: -0.018em;
    margin-bottom: 16px;
  }
  #desktop-chrome .dc-brand small {
    display: block;
    font-family: var(--sans);
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-weight: 600;
    color: rgba(243, 238, 229, 0.5);
    margin-top: 4px;
  }
  #desktop-chrome p { margin: 0 0 16px; }
  #desktop-chrome ul {
    margin: 16px 0; padding: 0; list-style: none;
    display: grid; gap: 10px;
    border-top: 1px solid rgba(243,238,229,0.15);
    padding-top: 16px;
  }
  #desktop-chrome li {
    font-size: 13px;
  }
  #desktop-chrome li em {
    color: rgba(243,238,229,0.6);
    font-style: italic;
  }
  #desktop-chrome .dc-back {
    display: inline-block;
    margin-top: 12px;
    color: var(--rust-2);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid currentColor;
    padding-bottom: 2px;
  }
}

/* Hide desktop chrome on PWA-installed screens (no chrome shown there) */
@media (display-mode: standalone) {
  #desktop-chrome { display: none !important; }
}

/* Empty state */
.empty {
  text-align: center;
  padding: 40px 24px;
  color: var(--ink-3);
}
.empty .ico {
  width: 56px; height: 56px;
  margin: 0 auto 16px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--paper-2);
  color: var(--ink-3);
}
.empty h3 {
  font-family: var(--display);
  font-size: 18px; font-weight: 500;
  color: var(--ink);
  margin: 0 0 6px;
}
.empty p { font-size: 13px; max-width: 24ch; margin: 0 auto; }

/* Toast */
.toast {
  position: absolute;
  bottom: 110px; left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--ink); color: var(--paper);
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  z-index: 200;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  white-space: nowrap;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============================================================
   5-TAB BAR — overrides the 3-col grid set up earlier
============================================================ */
#tab-bar {
  grid-template-columns: 1fr 1fr 1.4fr 1fr 1fr;
}

/* ============================================================
   HOUSE — WALKTHROUGH CTA
============================================================ */
.walk-cta {
  margin: 12px 20px 16px;
  display: grid;
  grid-template-columns: 40px 1fr 18px;
  gap: 14px;
  align-items: center;
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 14px;
  padding: 14px 16px;
  text-align: left;
  cursor: pointer;
  font-family: var(--sans);
  color: var(--ink);
  position: relative;
  overflow: hidden;
}
.walk-cta::before {
  content: "";
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 4px;
  background: var(--rust);
}
.walk-cta:active { background: var(--paper-2); }
.walk-cta .ic {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
}
.walk-cta .body { display: flex; flex-direction: column; gap: 2px; }
.walk-cta .hd {
  font-family: var(--display);
  font-style: italic;
  font-weight: 500;
  font-size: 17px;
  letter-spacing: -0.015em;
  line-height: 1.1;
}
.walk-cta .sb {
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.02em;
}
.walk-cta .cv {
  font-family: var(--display);
  font-size: 22px;
  color: var(--rust);
  font-weight: 300;
}

/* Year card is now clickable */
.year-card { cursor: pointer; }
.year-card:active { transform: scale(0.998); }

/* ============================================================
   GENERIC .tag — used in calendar + walk findings
============================================================ */
.tag {
  display: inline-block;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 4px;
  background: var(--paper-2);
  color: var(--ink-2);
  vertical-align: middle;
}
.tag.normal { background: var(--moss-wash); color: var(--moss); }
.tag.watch  { background: #f3e7c4; color: #8a6d20; }
.tag.claim  { background: var(--rust-wash); color: var(--rust); }

/* ============================================================
   CALENDAR SCREEN
============================================================ */
.cal-hero {
  padding: 20px 20px 18px;
}
.cal-hero .crumb {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ink-3);
}
.cal-hero h1 {
  font-family: var(--display);
  font-size: 36px;
  font-weight: 300;
  letter-spacing: -0.025em;
  margin: 6px 0 8px;
  line-height: 1.0;
}
.cal-hero h1 em {
  font-style: italic;
  font-weight: 500;
  color: var(--rust);
}
.cal-hero .lede {
  font-family: var(--display);
  font-style: italic;
  font-size: 14px;
  font-weight: 300;
  color: var(--ink-2);
  margin: 0;
}

.year-bar {
  margin: 4px 20px 24px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 14px;
  padding: 16px 20px 14px;
  position: relative;
  overflow: hidden;
}
.year-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(243,238,229,0.05) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
}
.yb-head {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 700;
  color: rgba(243,238,229,0.55);
}
.yb-now { color: var(--rust-2); }
.yb-track {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 4px;
  margin: 12px 0 8px;
  position: relative;
  z-index: 1;
}
.yb-track .dot {
  height: 18px;
  border-radius: 2px;
  background: rgba(243,238,229,0.12);
  position: relative;
}
.yb-track .dot.past   { background: rgba(243,238,229,0.42); }
.yb-track .dot.now    {
  background: var(--rust);
  height: 22px;
  margin-top: -2px;
  box-shadow: 0 0 0 2px var(--rust-wash);
}
.yb-track .dot.milestone::after {
  content: "";
  position: absolute;
  bottom: -8px; left: 50%;
  transform: translateX(-50%);
  width: 4px; height: 4px;
  border-radius: 50%;
  background: rgba(243,238,229,0.55);
}
.yb-track .dot.milestone.critical::after {
  background: var(--rust-2);
  width: 5px; height: 5px;
}
.yb-foot {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: rgba(243,238,229,0.55);
  margin-top: 10px;
  position: relative; z-index: 1;
}

.milestone-list {
  list-style: none;
  margin: 0 20px 22px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ms-row {
  display: grid;
  grid-template-columns: 64px 1fr 16px;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  background: var(--paper);
  border: 1px solid var(--rule-2);
  border-radius: 12px;
}
.ms-row.past {
  background: transparent;
  opacity: 0.55;
}
.ms-row.soon {
  border-color: var(--rust);
  background: var(--rust-wash);
}
.ms-row.critical:not(.past) .ms-label { color: var(--rust); }
.ms-when {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  border-right: 1px solid var(--rule-2);
  padding-right: 12px;
  line-height: 1;
}
.ms-when small {
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ink-3);
  margin-bottom: 4px;
}
.ms-when strong {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.ms-row.past .ms-when strong { color: var(--ink-3); }
.ms-body {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.ms-label {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.012em;
  line-height: 1.2;
}
.ms-sub {
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.01em;
}
.ms-flag svg { display: block; }

.claim-deadlines {
  list-style: none;
  margin: 0 20px 16px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cd-row {
  display: grid;
  grid-template-columns: 6px 1fr 18px;
  gap: 14px;
  padding: 12px 14px 12px 0;
  align-items: center;
  background: var(--paper);
  border: 1px solid var(--rule-2);
  border-radius: 12px;
  cursor: pointer;
  overflow: hidden;
}
.cd-row:active { background: var(--paper-2); }
.cd-bar {
  width: 6px;
  align-self: stretch;
  background: var(--paper-2);
  position: relative;
}
.cd-bar-fill {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: var(--rust);
}
.cd-meta { display: flex; flex-direction: column; gap: 3px; padding-left: 4px; }
.cd-top {
  display: flex; align-items: center; gap: 8px;
}
.cd-room {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ink-3);
}
.cd-desc {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.012em;
  line-height: 1.25;
  color: var(--ink);
}
.cd-time {
  font-size: 11px;
  color: var(--ink-3);
}
.cd-cv {
  font-family: var(--display);
  font-size: 20px;
  color: var(--ink-3);
  padding-right: 12px;
}

/* ============================================================
   SETTINGS SCREEN
============================================================ */
.settings-screen .cal-hero h1 em { color: var(--ink); font-style: italic; }
.settings-form {
  padding: 0 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.set-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.set-group label {
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ink-3);
}
.set-group input {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 12px 14px;
  font-family: var(--display);
  font-size: 16px;
  letter-spacing: -0.008em;
  color: var(--ink);
  width: 100%;
}
.set-group input:focus {
  outline: none;
  border-color: var(--ink);
}
.set-group .hint {
  font-size: 10px;
  letter-spacing: 0.02em;
  color: var(--ink-3);
  margin-top: 2px;
}
.set-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.set-divider {
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ink-3);
  border-top: 1px solid var(--rule-2);
  padding-top: 14px;
  margin-top: 6px;
}
.set-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}
.set-footnote {
  font-family: var(--display);
  font-style: italic;
  font-size: 12px;
  font-weight: 300;
  color: var(--ink-3);
  line-height: 1.5;
  margin: 6px 0 0;
}

/* ============================================================
   DEEP CLAIM DRILL-DOWN — cost callout
============================================================ */
.meta-mini {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ink-3);
}

.cost-callout {
  margin: 0 20px 18px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 14px;
  padding: 16px 18px 14px;
  position: relative;
  overflow: hidden;
}
.cost-callout::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, rgba(243,238,229,0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(243,238,229,0.05) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
}
.cost-callout.claim::after {
  content: "";
  position: absolute; top: 0; left: 0; bottom: 0;
  width: 4px;
  background: var(--rust);
}
.cost-row {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: end;
}
.cost-num {
  font-family: var(--display);
  font-size: 44px;
  font-weight: 300;
  letter-spacing: -0.04em;
  line-height: 0.95;
  color: var(--rust-2);
}
.cost-lbl {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
  color: rgba(243,238,229,0.7);
  text-align: right;
  line-height: 1.4;
}
.cost-bar {
  position: relative; z-index: 1;
  height: 3px;
  background: rgba(243,238,229,0.15);
  border-radius: 2px;
  margin: 12px 0 8px;
  overflow: hidden;
}
.cost-bar-fill {
  position: absolute; inset: 0 auto 0 0;
  background: var(--rust);
}
.cost-meta {
  position: relative; z-index: 1;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: rgba(243,238,229,0.7);
  letter-spacing: 0.01em;
}
.cost-meta strong { color: var(--paper); font-weight: 700; }

/* Photo region annotations on the deep view */
.big-photo .dim-overlay {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}
.big-photo .dim-tag {
  position: absolute;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--display);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: -0.005em;
  padding: 3px 7px;
  border-radius: 3px;
  border: 1px solid var(--ink);
  z-index: 3;
}
.big-photo .plate {
  position: absolute;
  bottom: 12px; right: 12px;
  background: rgba(26, 31, 40, 0.85);
  color: var(--paper);
  font-size: 9px;
  letter-spacing: 0.18em;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 2px;
  z-index: 3;
}

/* Same-spot time-lapse strip */
.lapse-strip {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin: 10px 0 6px;
}
.lapse-cell {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.lapse-pic {
  position: relative;
  aspect-ratio: 3 / 4;
  background-size: cover;
  background-position: center;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--rule);
}
.lapse-pic .lapse-crack {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  transform-origin: center;
  transition: transform 0.3s ease;
}
.lapse-pic .lapse-now {
  position: absolute;
  top: 6px; left: 6px;
  background: var(--ink);
  color: var(--paper);
  font-size: 8px;
  letter-spacing: 0.22em;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 2px;
}
.lapse-meta {
  display: flex;
  flex-direction: column;
  font-size: 10px;
  line-height: 1.2;
}
.lapse-meta strong {
  font-family: var(--display);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.lapse-meta span {
  color: var(--ink-3);
  font-size: 10px;
}

.footnote {
  font-family: var(--display);
  font-style: italic;
  font-size: 12px;
  font-weight: 300;
  color: var(--ink-3);
  margin: 8px 0 0;
  line-height: 1.5;
}

/* Evidence grid */
.evidence-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 16px;
  padding: 14px 16px;
  background: var(--paper);
  border: 1px solid var(--rule-2);
  border-radius: 10px;
}
.evidence-grid .k {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ink-3);
  align-self: center;
}
.evidence-grid .v {
  font-family: var(--display);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--ink);
  text-align: right;
}

/* Comparable claims block */
.comparable {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  padding: 16px 18px;
  background: var(--paper);
  border: 1px solid var(--rule-2);
  border-radius: 12px;
  align-items: center;
}
.comp-big {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-right: 16px;
  border-right: 1px solid var(--rule-2);
}
.comp-big .n {
  font-family: var(--display);
  font-size: 42px;
  font-weight: 300;
  letter-spacing: -0.03em;
  line-height: 0.95;
  color: var(--ink);
}
.comp-big .u {
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ink-3);
  margin-top: 2px;
}
.comp-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  color: var(--ink-2);
  line-height: 1.3;
}
.comp-meta strong {
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--ink-3);
  margin-right: 4px;
}

/* Builder thread */
.thread {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.thread-msg {
  padding: 10px 14px;
  border-radius: 10px;
  max-width: 90%;
}
.thread-msg.you {
  background: var(--ink);
  color: var(--paper);
  align-self: flex-end;
  margin-left: auto;
  border-bottom-right-radius: 3px;
}
.thread-msg.builder {
  background: var(--paper-2);
  color: var(--ink);
  align-self: flex-start;
  border-bottom-left-radius: 3px;
}
.thread-msg .who {
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 800;
  margin-bottom: 4px;
  opacity: 0.7;
  display: flex;
  gap: 8px;
}
.thread-msg .who .dt { font-weight: 600; opacity: 0.7; }
.thread-msg .body-msg {
  font-size: 13px;
  line-height: 1.4;
}
.thread-reply {
  margin-top: 10px;
  background: none;
  border: 1px dashed var(--rule);
  border-radius: 10px;
  padding: 12px;
  width: 100%;
  text-align: left;
  font-size: 12px;
  color: var(--ink-3);
  cursor: pointer;
  font-family: var(--display);
  font-style: italic;
}
.thread-reply:active { background: var(--paper-2); }

/* Activity log */
.activity-log {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.log-row {
  display: grid;
  grid-template-columns: 14px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--rule-2);
  font-size: 12px;
}
.log-row:last-child { border-bottom: none; }
.log-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--ink);
}
.log-dot.plus { background: var(--moss); }
.log-dot.doc  { background: var(--ink); }
.log-dot.send { background: var(--rust); }
.log-lbl { font-family: var(--display); font-size: 13px; font-weight: 500; letter-spacing: -0.008em; }
.log-dt {
  font-size: 10px;
  color: var(--ink-3);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
}

/* Danger button */
.btn-pill.text.danger { color: var(--rust); }

/* ============================================================
   WALKTHROUGH OVERLAY
============================================================ */
.walkthrough-screen {
  position: absolute;
  inset: 0;
  background: var(--paper);
  z-index: 115;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.walk-head {
  position: sticky;
  top: 0;
  background: rgba(243,238,229,0.94);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  padding: 14px 20px 12px;
  display: grid;
  grid-template-columns: 32px 1fr 32px;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--rule-2);
  z-index: 5;
}
.walk-head .back {
  background: none; border: none;
  width: 32px; height: 32px;
  display: grid; place-items: center;
  cursor: pointer;
  color: var(--ink);
}
.walk-progress {
  display: flex; flex-direction: column; gap: 6px;
  align-items: center;
}
.walk-progress span {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ink-3);
}
.walk-bar {
  width: 100%;
  height: 3px;
  background: var(--rule);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}
.walk-bar-fill {
  position: absolute; inset: 0 auto 0 0;
  background: var(--rust);
  transition: width 0.3s ease;
}
.walk-body {
  flex: 1;
  padding: 28px 24px 40px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.walk-room {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ink-3);
}
.walk-room .icon {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--paper-2);
  display: grid; place-items: center;
  color: var(--ink);
}
.walk-prompt {
  font-family: var(--display);
  font-size: 28px;
  font-weight: 400;
  letter-spacing: -0.022em;
  line-height: 1.15;
  margin: 4px 0 6px;
  color: var(--ink);
}
.walk-threshold {
  font-size: 13px;
  color: var(--ink-2);
  margin: 0 0 8px;
  line-height: 1.45;
}
.walk-threshold em {
  font-family: var(--display);
  font-style: italic;
  font-weight: 600;
  color: var(--ink);
  margin-right: 4px;
}
.walk-photo {
  margin: 6px 0 4px;
  aspect-ratio: 3 / 4;
  border-radius: 14px;
  background: var(--paper-2);
  border: 2px dashed var(--rule);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--ink-3);
  position: relative;
  overflow: hidden;
}
.walk-photo.has {
  border-style: solid;
  border-color: var(--ink);
}
.walk-photo img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.walk-photo span {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
}
.walk-photo input[type="file"] {
  position: absolute; opacity: 0; pointer-events: none;
}
.walk-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}
.walk-back {
  background: none;
  border: none;
  padding: 14px;
  color: var(--ink-3);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  text-align: center;
}

/* Walkthrough summary */
.walk-tally {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin: 12px 0;
}
.wt-cell {
  background: var(--paper);
  border: 1px solid var(--rule-2);
  border-radius: 12px;
  padding: 14px 10px;
  text-align: center;
}
.wt-cell .n {
  font-family: var(--display);
  font-size: 32px;
  font-weight: 300;
  letter-spacing: -0.03em;
  line-height: 1;
}
.wt-cell .n.claim  { color: var(--rust); }
.wt-cell .n.watch  { color: #8a6d20; }
.wt-cell .n.normal { color: var(--moss); }
.wt-cell .l {
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--ink-3);
  margin-top: 4px;
}
.walk-h3 {
  font-family: var(--display);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.015em;
  margin: 16px 0 6px;
}
.walk-findings {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.wf-row {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  padding: 8px;
  background: var(--paper);
  border: 1px solid var(--rule-2);
  border-radius: 12px;
  align-items: center;
}
.wf-row img {
  width: 64px; height: 64px;
  object-fit: cover;
  border-radius: 8px;
}
.wf-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.wf-desc {
  font-family: var(--display);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.012em;
  line-height: 1.2;
}
.wf-sub {
  font-size: 11px;
  color: var(--ink-3);
}

/* ============================================================
   LETTER OVERLAY
============================================================ */
.letter-screen {
  position: absolute;
  inset: 0;
  background: var(--paper);
  z-index: 120;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.letter-body {
  flex: 1;
  padding: 0 0 28px;
  overflow-y: auto;
}
.letter-doc {
  margin: 18px 20px;
  background: #fbf7ef;
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 22px 22px 18px;
  position: relative;
  box-shadow: 0 1px 0 0 var(--rule), 0 8px 24px -16px rgba(26,31,40,0.18);
}
.letter-doc::before {
  content: "";
  position: absolute;
  top: 8px; left: 8px; right: 8px; bottom: 8px;
  border: 1px solid var(--rule-2);
  pointer-events: none;
  border-radius: 2px;
}
.letter-plate {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 10px;
  margin-bottom: 14px;
  position: relative; z-index: 1;
}
.lp-l strong {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.012em;
  display: block;
}
.lp-l small {
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ink-3);
  display: block;
  margin-top: 2px;
}
.lp-r {
  text-align: right;
  display: flex;
  flex-direction: column;
}
.lp-r small {
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ink-3);
}
.lp-r span {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink);
}
.letter-text {
  position: relative; z-index: 1;
  width: 100%;
  min-height: 280px;
  background: transparent;
  border: none;
  padding: 0;
  font-family: var(--display);
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink);
  resize: vertical;
  white-space: pre-wrap;
}
.letter-text:focus { outline: none; }
.letter-attached {
  position: relative; z-index: 1;
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px dashed var(--rule);
}
.letter-attached small {
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ink-3);
}
.letter-thumbs {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  margin-top: 8px;
}
.lt-thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  background-size: cover;
  background-position: center;
  border-radius: 4px;
  border: 1px solid var(--rule);
  overflow: hidden;
}
.lt-thumb span {
  position: absolute;
  bottom: 4px; left: 4px; right: 4px;
  background: rgba(26,31,40,0.75);
  color: var(--paper);
  font-size: 8px;
  letter-spacing: 0.08em;
  font-weight: 600;
  padding: 2px 4px;
  border-radius: 2px;
  text-align: center;
}
.letter-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 8px 20px 12px;
}
.letter-footnote {
  font-family: var(--display);
  font-style: italic;
  font-size: 12px;
  color: var(--ink-3);
  margin: 4px 20px 0;
  line-height: 1.5;
}

/* ============================================================
   ONBOARDING (first-launch)
============================================================ */
.onboarding-screen {
  position: absolute;
  inset: 0;
  background: var(--paper);
  z-index: 150;
  display: flex;
  flex-direction: column;
  padding: calc(40px + var(--safe-top)) 24px calc(28px + var(--safe-bot));
  animation: ob-fade 0.4s ease;
}
@keyframes ob-fade {
  from { opacity: 0; transform: scale(0.98); }
  to   { opacity: 1; transform: scale(1); }
}
.ob-skip {
  position: absolute;
  top: calc(20px + var(--safe-top));
  right: 22px;
  background: none;
  border: none;
  color: var(--ink-3);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
}
.ob-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 16px;
  padding: 0 4px;
}
.ob-icon {
  width: 80px; height: 80px;
  display: grid; place-items: center;
  background: var(--ink);
  color: var(--paper);
  border-radius: 50%;
  margin-bottom: 12px;
  position: relative;
}
.ob-icon::after {
  content: "";
  position: absolute;
  inset: -8px;
  border: 1px dashed var(--rule);
  border-radius: 50%;
  pointer-events: none;
}
.ob-tag {
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--rust);
}
.ob-title {
  font-family: var(--display);
  font-size: 34px;
  font-weight: 300;
  letter-spacing: -0.025em;
  line-height: 1.05;
  margin: 4px 0 0;
  color: var(--ink);
}
.ob-body {
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink-2);
  margin: 8px 0 0;
}
.ob-foot {
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: stretch;
}
.ob-dots {
  display: flex;
  justify-content: center;
  gap: 7px;
}
.ob-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--rule);
}
.ob-dot.on {
  background: var(--ink);
  transform: scale(1.2);
}

/* ============================================================
   HOUSE — REPORT CTA
============================================================ */
.report-cta {
  margin: 4px 20px 4px;
  display: grid;
  grid-template-columns: 40px 1fr 18px;
  gap: 14px;
  align-items: center;
  background: transparent;
  border: 1px dashed var(--rule);
  border-radius: 14px;
  padding: 14px 16px;
  cursor: pointer;
}
.report-cta:active { background: var(--paper-2); }
.report-cta .ic {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--paper-2);
  color: var(--ink);
}
.report-cta .body { display: flex; flex-direction: column; gap: 2px; }
.report-cta .hd {
  font-family: var(--display);
  font-style: italic;
  font-weight: 500;
  font-size: 15px;
  letter-spacing: -0.012em;
  color: var(--ink);
}
.report-cta .sb {
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.01em;
}
.report-cta .cv {
  font-family: var(--display);
  font-size: 18px;
  color: var(--ink-3);
  font-weight: 300;
}

/* ============================================================
   CONFIDENCE CHECKS (claim drill-down)
============================================================ */
.conf-mini {
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  font-size: 13px;
  letter-spacing: -0.01em;
  color: var(--ink-3);
  margin-left: 6px;
}
.conf-checks {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--paper);
  border: 1px solid var(--rule-2);
  border-radius: 10px;
  padding: 4px 0;
}
.conf-checks .ck {
  display: grid;
  grid-template-columns: 24px auto 1fr;
  gap: 8px;
  align-items: center;
  padding: 8px 14px;
  border-bottom: 1px solid var(--rule-2);
}
.conf-checks .ck:last-child { border-bottom: none; }
.conf-checks .ck-icon {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 50%;
  color: var(--paper);
}
.conf-checks .pass .ck-icon { background: var(--moss); }
.conf-checks .fail .ck-icon { background: oklch(60% 0.16 50); }
.conf-checks .ck-label {
  font-family: var(--display);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--ink);
}
.conf-checks .ck-detail {
  font-size: 11px;
  color: var(--ink-3);
  text-align: right;
  line-height: 1.3;
}
.conf-bar-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}
.conf-bar-row .conf-bar {
  height: 3px;
  background: var(--paper-2);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}
.conf-bar-row .conf-bar-fill {
  position: absolute; inset: 0 auto 0 0;
  background: var(--ink);
}
.conf-note {
  font-family: var(--display);
  font-style: italic;
  font-size: 11px;
  font-weight: 300;
  color: var(--ink-3);
}

/* ============================================================
   HOUSE REPORT (printable)
============================================================ */
.report-screen {
  position: absolute;
  inset: 0;
  background: var(--paper);
  z-index: 125;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.report-doc {
  background: #fbf7ef;
  margin: 16px;
  border: 1px solid var(--rule);
  padding: 22px 22px 28px;
  border-radius: 3px;
  flex: 1;
}
.rd-plate {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 12px;
  margin-bottom: 18px;
}
.rd-plate strong {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.015em;
  display: block;
}
.rd-plate small {
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ink-3);
}
.rd-plate-r {
  text-align: right;
}
.rd-plate-r small {
  display: block;
  margin-bottom: 2px;
}
.rd-plate-r span {
  font-family: var(--display);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
}
.rd-house {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 16px;
  margin-bottom: 16px;
}
.rd-house-l, .rd-house-r {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.rd-k {
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ink-3);
  margin-top: 6px;
}
.rd-k:first-child { margin-top: 0; }
.rd-v {
  font-family: var(--display);
  font-size: 13px;
  font-weight: 400;
  color: var(--ink);
  line-height: 1.35;
}
.rd-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 22px;
}
.rd-stat {
  border: 1px solid var(--rule);
  padding: 12px 6px;
  text-align: center;
  border-radius: 3px;
}
.rd-stat.highlight {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.rd-stat .n {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: -0.022em;
  color: var(--ink);
  line-height: 1;
}
.rd-stat.highlight .n { color: var(--rust-2); }
.rd-stat .l {
  font-size: 8px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--ink-3);
  margin-top: 4px;
}
.rd-stat.highlight .l { color: rgba(243,238,229,0.7); }
.rd-h2 {
  font-family: var(--display);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.012em;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 6px;
  margin: 22px 0 12px;
}
.rd-empty {
  font-family: var(--display);
  font-style: italic;
  font-size: 12px;
  color: var(--ink-3);
  margin: 0 0 10px;
}
.rd-issue {
  border: 1px solid var(--rule);
  border-left-width: 3px;
  padding: 12px 14px;
  margin-bottom: 10px;
  background: var(--paper);
  border-radius: 2px;
}
.rd-issue.claim  { border-left-color: var(--rust); }
.rd-issue.watch  { border-left-color: #8a6d20; }
.rd-issue.normal { border-left-color: var(--moss); }
.rd-issue-hd {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.rd-room {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink-2);
}
.rd-date {
  font-size: 10px;
  color: var(--ink-3);
  margin-left: auto;
}
.rd-issue-h {
  font-family: var(--display);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.012em;
  margin: 0 0 2px;
}
.rd-issue-sub {
  font-size: 11px;
  color: var(--ink-3);
  margin: 0 0 8px;
}
.rd-issue-grid {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 4px 12px;
  font-size: 11px;
}
.rd-issue-grid .k {
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ink-3);
}
.rd-issue-grid .v { color: var(--ink-2); line-height: 1.3; }
.rd-normal {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 12px;
}
.rd-normal li {
  padding: 4px 0;
  border-bottom: 1px dotted var(--rule);
  color: var(--ink-2);
}
.rd-normal li strong { color: var(--ink); font-weight: 600; }
.rd-normal li span { color: var(--ink-3); margin-left: 6px; }
.rd-foot {
  border-top: 1px solid var(--rule);
  margin-top: 18px;
  padding-top: 10px;
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ink-3);
}
.report-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 20px 24px;
}

/* Print styles — hide chrome, render report on paper */
@media print {
  body { background: white !important; }
  #desktop-chrome, #status-bar, #tab-bar, #home-indicator,
  .screen-head, .report-actions, #stage { display: none !important; }
  #device {
    position: static !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    background: white !important;
    width: auto !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }
  #device::before { display: none !important; }
  .report-screen {
    position: static !important;
    background: white !important;
    overflow: visible !important;
  }
  .report-doc {
    background: white !important;
    margin: 0 !important;
    border: none !important;
    padding: 0 !important;
  }
  .rd-issue {
    page-break-inside: avoid;
    background: white !important;
  }
  .rd-stat.highlight {
    background: white !important;
    color: var(--ink) !important;
    border: 2px solid var(--ink) !important;
  }
  .rd-stat.highlight .n { color: var(--ink) !important; }
  .rd-stat.highlight .l { color: var(--ink-3) !important; }
  .no-print { display: none !important; }
}

/* Hide desktop chrome when embedded in an iframe (marketing site demo) */
body.embedded #desktop-chrome { display: none !important; }

/* ============================================================
   HOMEOWNER NOTES
============================================================ */
.notes-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.note-row {
  background: var(--paper);
  border: 1px solid var(--rule-2);
  border-left: 3px solid var(--ink);
  border-radius: 4px;
  padding: 10px 12px;
}
.note-date {
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--ink-3);
  display: block;
  margin-bottom: 4px;
}
.note-body {
  margin: 0;
  font-family: var(--display);
  font-style: italic;
  font-weight: 300;
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink);
}

/* Add-note overlay */
.note-screen {
  position: absolute;
  inset: 0;
  background: var(--paper);
  z-index: 130;
  display: flex;
  flex-direction: column;
}
.note-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.note-body textarea {
  width: 100%;
  background: #fbf7ef;
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 14px;
  font-family: var(--display);
  font-style: italic;
  font-size: 15px;
  font-weight: 300;
  line-height: 1.5;
  color: var(--ink);
  resize: vertical;
  min-height: 140px;
}
.note-body textarea:focus { outline: none; border-color: var(--ink); }
.note-tips {
  background: var(--paper-2);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.5;
}
.note-tips strong {
  display: block;
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--ink-3);
  margin-bottom: 3px;
}
.note-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
}

/* ============================================================
   RESOLVED STAMP + BEFORE/AFTER
============================================================ */
.resolved-stamp {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--moss-wash);
  color: var(--moss);
  font-family: var(--display);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: -0.01em;
  border: 1px solid var(--moss);
  border-radius: 999px;
  padding: 8px 14px 8px 12px;
  width: max-content;
  margin-bottom: 4px;
}
.resolved-stamp svg { display: block; color: var(--moss); }

/* Before/After variants of the lapse strip */
.lapse-strip.ba {
  grid-template-columns: 1fr 1fr;
}
.lapse-now.ba-before { background: var(--ink-3); color: var(--paper); }
.lapse-now.ba-after  { background: var(--moss);  color: var(--paper); }

/* ============================================================
   UNDO TOAST
============================================================ */
.undo-toast {
  position: absolute;
  bottom: 110px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--ink);
  color: var(--paper);
  padding: 8px 6px 8px 16px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 14px;
  z-index: 220;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 12px 24px -8px rgba(0,0,0,0.45);
}
.undo-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.undo-toast .ut-label { color: var(--paper); }
.undo-toast .ut-btn {
  background: var(--rust);
  color: var(--paper);
  border: none;
  padding: 6px 14px;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
}
.undo-toast .ut-btn:active { background: oklch(50% 0.16 40); }

/* ============================================================
   CALENDAR FILTER CHIPS + SEARCH
============================================================ */
.cal-filter {
  padding: 0 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.filter-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0 -20px;
  padding: 0 20px 2px;
}
.filter-chips::-webkit-scrollbar { display: none; }
.chip {
  background: var(--paper);
  border: 1px solid var(--rule);
  color: var(--ink-2);
  padding: 7px 12px;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}
.chip.on {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.chip-n {
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  font-size: 12px;
  letter-spacing: -0.01em;
  opacity: 0.7;
}
.chip.on .chip-n { color: var(--rust-2); opacity: 1; }
.filter-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 8px 12px;
  color: var(--ink-3);
}
.filter-search input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink);
}
.filter-search input::placeholder { color: var(--ink-3); }
.filter-clear {
  background: var(--paper-2);
  border: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-2);
  cursor: pointer;
  line-height: 1;
}
.tag.resolved { background: var(--moss-wash); color: var(--moss); }
.tag.filed    { background: var(--paper-2);   color: var(--ink-2); }
.cd-row.resolved { opacity: 0.65; }
.cd-row.resolved .cd-desc { text-decoration: line-through; text-decoration-color: var(--rule); }
