@import url('https://fonts.googleapis.com/css2?family=Jost:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:       #0a0a0a;
  --surface:  #141414;
  --border:   #242424;
  --border2:  #1e1e1e;
  --white:    #ffffff;
  --gray-1:   #f0f0f0;
  --gray-2:   #aaaaaa;
  --gray-3:   #808080;
  --gray-4:   #2a2a2a;
  --max-w:    430px;
  --font: 'Jost', 'Futura', 'Century Gothic', 'Trebuchet MS', Arial, sans-serif;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  background: #000;
  -webkit-tap-highlight-color: transparent;  /* no gray flash on tap (app feel) */
  overscroll-behavior-y: none;                /* no rubber-band revealing the page edge */
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--white);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  overscroll-behavior-y: none;
}

/* Shell */
.app {
  width: 100%;
  max-width: var(--max-w);
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  position: relative;
}

/* ── Top bar ── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  min-height: 56px;
}
.topbar-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--white);
  flex-shrink: 0;
  text-decoration: none;
}
.topbar-title {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-logo-img {
  height: 22px;
  width: auto;
  flex-shrink: 0;
  object-fit: contain;
  /* logo is white so it's visible on dark topbar */
  filter: brightness(1);
}

.topbar-logo {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gray-2);
  flex-shrink: 0;
}

/* ── Hero photo ── */
.hero-wrap {
  position: relative;
}

.topbar--hero {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: transparent;
  border-bottom: none;
  z-index: 10;
}

.home-hero-photo {
  position: relative;
  width: 100%;
  height: 340px;
  overflow: hidden;
  background: #111;
}
.home-hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 60%;
  display: block;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.50) 0%,
    rgba(0,0,0,0.15) 28%,
    rgba(0,0,0,0.45) 58%,
    rgba(10,10,10,0.90) 80%,
    rgba(10,10,10,1.00) 100%
  );
}
.hero-text {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.hero-eyebrow {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  margin-bottom: 4px;
}
.hero-text h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.1;
  text-transform: uppercase;
  color: var(--white);
}
.hero-meta {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  margin-top: 2px;
}

/* ── Section label ── */
.section-label {
  padding: 24px 20px 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gray-3);
}

/* ── Stats strip ── */
.stats-strip {
  display: flex;
  border-bottom: 1px solid var(--border);
}
.stat-cell {
  flex: 1;
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  border-right: 1px solid var(--border);
}
.stat-cell:last-child { border-right: none; }
.stat-num {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.stat-lbl {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--gray-3);
  font-weight: 600;
}

/* ── Card list ── */
.card-list { display: flex; flex-direction: column; }

.card-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border2);
  text-decoration: none;
  color: var(--white);
  transition: background 0.1s;
  cursor: pointer;
}
.card-row:active { background: var(--surface); }
.card-row:last-child { border-bottom: none; }

.card-icon {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
}

.card-content { flex: 1; min-width: 0; }
.card-name {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-sub {
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--gray-3);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-chevron { color: var(--gray-3); flex-shrink: 0; }

/* ── Badge ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: var(--surface);
  color: var(--gray-2);
  border: 1px solid var(--border);
}

/* ── Item detail ── */
.item-photo {
  width: 100%;
  height: 500px;
  background: var(--surface);
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.item-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center; }

.item-header { padding: 22px 20px 0; }
.item-header .badge { margin-bottom: 10px; }
.item-header h2 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1.2;
  text-transform: uppercase;
}
.item-header .location {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gray-3);
  margin-top: 6px;
}

/* ── Spec table ── */
.spec-table {
  margin: 18px 20px 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.spec-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border2);
}
.spec-row:last-child { border-bottom: none; }
.spec-key {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gray-3);
  width: 130px;
  flex-shrink: 0;
  padding-top: 1px;
  font-weight: 500;
}
.spec-val {
  font-size: 13px;
  font-weight: 400;
  flex: 1;
  word-break: break-word;
  line-height: 1.4;
}
.spec-val .sub {
  font-size: 11px;
  color: var(--gray-3);
  margin-top: 2px;
}

/* ── Doc buttons ── */
.doc-buttons {
  padding: 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.doc-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--white);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.1s, border-color 0.1s;
}
.doc-btn:active { background: var(--gray-4); }
.doc-btn-text { flex: 1; }
.doc-btn-sub {
  font-size: 11px;
  font-weight: 400;
  color: var(--gray-3);
  margin-top: 2px;
  letter-spacing: 0.02em;
}
.doc-btn.unavailable { opacity: 0.4; }
.doc-btn.unavailable .doc-btn-sub { font-style: italic; }

/* ── Divider ── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0 0;
}

/* ── QR zone ── */
.qr-zone {
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.qr-placeholder {
  width: 68px;
  height: 68px;
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-3);
  flex-shrink: 0;
  background: var(--surface);
}
.qr-label { font-size: 13px; font-weight: 500; }
.qr-desc { font-size: 11px; color: var(--gray-3); margin-top: 3px; line-height: 1.5; }

/* ── PDF Modal overlay ── */
.pdf-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 999;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}
.pdf-modal-overlay.open { display: flex; }

.pdf-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px 16px 0 0;
  width: 100%;
  max-width: var(--max-w);
  height: 92vh;
  margin-top: auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.pdf-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.pdf-modal-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.pdf-modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gray-4);
  border: none;
  cursor: pointer;
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font);
}
.pdf-frame {
  flex: 1;
  width: 100%;
  border: none;
  background: #fff;
}

/* PDF placeholder (shown when no real PDF) */
.pdf-placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--gray-3);
}
.pdf-placeholder svg { opacity: 0.3; }
.pdf-placeholder p { font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; }

/* ── Settings section ── */
.settings-heading {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 28px 20px 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gray-3);
}
.settings-list {
  display: flex;
  flex-direction: column;
  margin: 0 4px;
}
.settings-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border2);
  cursor: pointer;
  text-align: left;
  width: 100%;
  color: var(--white);
  font-family: var(--font);
}
.settings-row:last-child { border-bottom: none; }
.settings-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--gray-2);
}
.settings-content { flex: 1; min-width: 0; }
.settings-name { font-size: 15px; font-weight: 500; color: var(--white); }
.settings-sub  { font-size: 12px; color: var(--gray-3); margin-top: 2px; }

/* Settings modals (bottom-sheet) */
.smodal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.72);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 400;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.smodal-overlay.open { display: flex; }
.smodal {
  background: #1a1a1a;
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: var(--max-w);
  max-height: 82vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.smodal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--border);
}
.smodal-title { font-size: 17px; font-weight: 600; color: var(--white); }
.smodal-close {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--surface);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-3);
}
.smodal-body { padding: 20px; overflow-y: auto; flex: 1; }

/* Contact blocks inside modals */
.scontact-block {
  background: var(--surface);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 14px;
}
.scontact-head {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gray-3);
  padding: 12px 16px 6px;
}
.scontact-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-top: 1px solid var(--border2);
  color: var(--white);
}
.scontact-icon { color: var(--gray-3); flex-shrink: 0; }
.scontact-lbl  { font-size: 11px; color: var(--gray-3); margin-bottom: 2px; }
.scontact-val  { font-size: 15px; color: var(--white); }
.scontact-link { color: #5ba4f5; text-decoration: none; }
.scontact-link--red { color: #e74c3c; }

/* Placeholder block */
.s-placeholder {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 16px;
  font-size: 13px;
  color: var(--gray-3);
  line-height: 1.6;
  margin-bottom: 14px;
}
.s-placeholder code {
  font-size: 11px;
  background: var(--border);
  padding: 2px 5px;
  border-radius: 4px;
  color: var(--gray-2);
}

/* Access / Coming Soon */
.smodal-access-lock {
  display: flex; flex-direction: column;
  align-items: center; text-align: center;
  padding: 24px 10px 16px;
}
.smodal-lock-icon {
  width: 80px; height: 80px;
  background: var(--surface);
  border-radius: 22px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 18px;
}
.smodal-lock-title { font-size: 19px; font-weight: 600; color: var(--white); margin-bottom: 8px; }
.smodal-lock-sub   { font-size: 14px; color: var(--gray-3); line-height: 1.55; margin-bottom: 22px; max-width: 280px; }
.s-coming-soon {
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--gray-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 8px 20px;
}

/* ToS */
.smodal-tos { font-size: 13px; color: var(--gray-3); line-height: 1.7; }
.smodal-tos h3 { font-size: 14px; font-weight: 600; color: var(--white); margin: 16px 0 6px; }
.smodal-tos p  { margin-bottom: 10px; }
.smodal-tos-version { font-size: 11px; color: var(--gray-3); margin-top: 20px; }

/* About */
.smodal-about {
  display: flex; flex-direction: column;
  align-items: center; text-align: center;
  padding: 20px 0 12px;
  gap: 6px;
}
.smodal-about-logo   { width: 64px; height: 64px; object-fit: contain; border-radius: 14px; margin-bottom: 8px; }
.smodal-about-name   { font-size: 17px; font-weight: 700; color: var(--white); }
.smodal-about-sub    { font-size: 13px; color: var(--gray-3); }
.smodal-about-version{ font-size: 12px; color: var(--gray-3); margin-top: 6px; }
.smodal-about-copy   { font-size: 11px; color: var(--gray-3); margin-top: 4px; }

/* ── Bottom pad ── */
.bottom-pad { height: 96px; } /* extra space so FAB doesn't cover last row */

/* ── Camera FAB ── */
.cam-fab {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--white);
  color: var(--bg);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 24px rgba(0,0,0,0.55), 0 1px 4px rgba(0,0,0,0.3);
  z-index: 200;
  transition: transform 0.15s, box-shadow 0.15s;
}
.cam-fab:active {
  transform: translateX(-50%) scale(0.93);
  box-shadow: 0 2px 12px rgba(0,0,0,0.45);
}
/* Keep FAB within phone frame on desktop */
@media (min-width: 500px) {
  .cam-fab {
    position: absolute;
    bottom: 28px;
    left: 50%;
  }
}

/* ── Scan overlay ── */
.scan-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.88);
  z-index: 999;
  align-items: flex-end;
  justify-content: center;
}
.scan-overlay.open { display: flex; }
@media (min-width: 500px) {
  .scan-overlay { position: absolute; }
}

.scan-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: var(--max-w);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.25s cubic-bezier(0.32,0.72,0,1);
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

.scan-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.scan-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.scan-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--gray-4);
  border: none;
  cursor: pointer;
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Scan body + states ── */
.scan-body { padding: 0 0 32px; }

.scan-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 36px 28px 8px;
}

.scan-icon-ring {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--gray-4);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}
.scan-icon-ring--dim { background: transparent; border: 1px solid var(--border); color: var(--gray-3); }

.scan-prompt {
  font-size: 14px;
  font-weight: 400;
  color: var(--gray-2);
  text-align: center;
  line-height: 1.6;
}

.scan-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 6px;
  padding: 14px 36px;
  background: var(--white);
  color: var(--bg);
  border-radius: 50px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  user-select: none;
  transition: opacity 0.15s;
}
.scan-btn-primary:active { opacity: 0.8; }

.scan-btn-ghost {
  padding: 12px 28px;
  background: transparent;
  color: var(--gray-2);
  border: 1px solid var(--border);
  border-radius: 50px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s;
}
.scan-btn-ghost:active { border-color: var(--gray-3); }
.scan-btn-upload { display: inline-flex; align-items: center; justify-content: center; margin-top: 10px; }
.a2hs-intro { font-size: 14px; color: var(--gray-2); line-height: 1.5; margin: 0 0 16px; }
.a2hs-steps { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 18px; }
.a2hs-cap { display: flex; align-items: flex-start; gap: 9px; font-size: 14px; color: var(--white); line-height: 1.45; margin-bottom: 9px; }
.a2hs-num { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--surface); border: 1px solid var(--border); font-size: 12px; font-weight: 600; flex-shrink: 0; }
.a2hs-img { display: block; width: 100%; max-width: 300px; border-radius: 10px; border: 1px solid var(--border); }
.a2hs-note { font-size: 13px; color: var(--gray-3); margin: 16px 0 0; }
.fs-note { font-size: 12px; color: var(--gray-3); text-align: center; line-height: 1.45; margin: 12px auto 0; max-width: 320px; }
.nh-login-form { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; }

.scan-privacy {
  font-size: 10px;
  color: var(--gray-3);
  text-align: center;
  line-height: 1.6;
  padding: 0 8px;
  margin-top: -4px;
}
.scan-privacy-link { color: var(--gray-3); text-decoration: underline; }

/* ── Spinner ── */
.scan-spinner {
  width: 40px;
  height: 40px;
  border: 2.5px solid var(--border);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  margin-bottom: 4px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Result cards ── */
.scan-results-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gray-3);
  margin-bottom: -4px;
  align-self: flex-start;
}

.scan-cards {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.scan-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  color: var(--white);
  transition: background 0.1s;
}
.scan-card:active { background: var(--gray-4); }
.scan-card-inner { flex: 1; min-width: 0; }

.scan-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}
.scan-card-badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gray-3);
}
.scan-confidence {
  font-size: 9px;
  letter-spacing: 0.06em;
  color: #888;
  font-style: italic;
}
.scan-card-name {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.scan-card-meta {
  font-size: 11px;
  color: var(--gray-3);
  margin-top: 2px;
}
.scan-card-model {
  font-size: 10px;
  color: var(--gray-3);
  margin-top: 2px;
  letter-spacing: 0.04em;
}

/* ── Scan modal photo background (results state) ── */
.scan-modal { position: relative; }
.scan-modal.has-photo-bg {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.scan-modal.has-photo-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.68);
  pointer-events: none;
  z-index: 0;
}
.scan-modal.has-photo-bg .scan-header,
.scan-modal.has-photo-bg .scan-body { position: relative; z-index: 1; }
.scan-modal.has-photo-bg .scan-header { border-bottom-color: rgba(255,255,255,0.1); }
.scan-modal.has-photo-bg .scan-card { background: rgba(20,20,20,0.72); border-color: rgba(255,255,255,0.1); }

/* ── Hide FAB everywhere (bottom nav handles camera) ── */
.cam-fab { display: none !important; }

/* ── Bottom nav ── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--max-w);
  height: 64px;
  background: rgba(10,10,10,0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  z-index: 200;
}
/* Always fixed — never scroll with the page */

.bottom-nav-btn {
  flex: 1;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--gray-3);
  cursor: pointer;
  transition: color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.bottom-nav-btn:active { color: var(--white); }
.bottom-nav-btn--disabled { opacity: 0.2; cursor: default; pointer-events: none; }
.bottom-nav-btn--cam { color: var(--white); }

/* ── History panel ── */
.history-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.88);
  z-index: 999;
  align-items: flex-end;
  justify-content: center;
}
.history-overlay.open { display: flex; }
@media (min-width: 500px) { .history-overlay { position: absolute; } }

.history-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: var(--max-w);
  max-height: 72vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.25s cubic-bezier(0.32,0.72,0,1);
}
.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.history-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.history-list { overflow-y: auto; flex: 1; }
.history-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 28px;
  text-align: center;
  font-size: 13px;
  color: var(--gray-3);
  line-height: 1.7;
  gap: 10px;
}
.history-empty svg { opacity: 0.25; }
.history-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border2);
  text-decoration: none;
  color: var(--white);
  transition: background 0.1s;
}
.history-item:active { background: var(--gray-4); }
.history-item:last-child { border-bottom: none; }
.history-item-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--gray-4);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--gray-3);
}
.history-item-content { flex: 1; min-width: 0; }
.history-item-name {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.history-item-meta { font-size: 11px; color: var(--gray-3); margin-top: 2px; }
.history-item-time { font-size: 10px; color: var(--gray-3); flex-shrink: 0; letter-spacing: 0.03em; }

/* ── Phone frame on desktop ── */
@media (min-width: 500px) {
  body { background: #050505; padding: 48px 0; }
  .app {
    border-radius: 44px;
    overflow: hidden;
    box-shadow: 0 0 0 1px #222, 0 40px 80px rgba(0,0,0,0.8);
    min-height: unset;
    height: 844px;
    overflow-y: auto;
    scrollbar-width: none;
  }
  .app::-webkit-scrollbar { display: none; }
  .pdf-modal { max-width: var(--max-w); border-radius: 16px 16px 0 0; }
}

/* ============================================================
   FOLIO — Phase 1 overrides (loaded only by the folio variant)
   ============================================================ */
:root {
  --warm:     #c9a27a;
  --warm-dim: #9a948a;
}

/* ── Cinematic hero ── */
.page-folio .home-hero-photo { height: 364px; overflow: hidden; }
.page-folio .home-hero-photo img {
  animation: nh-kenburns 18s ease-out forwards;
  transform-origin: 60% 35%;
}
@keyframes nh-kenburns { from { transform: scale(1.0); } to { transform: scale(1.09); } }
.page-folio .hero-overlay {
  background: linear-gradient(to top, #0a0a0a 3%, rgba(10,10,10,.6) 32%, rgba(10,10,10,.05) 72%, transparent 100%);
}
.page-folio .hero-text { animation: nh-rise .9s cubic-bezier(.16,1,.3,1) both; }
@keyframes nh-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.page-folio .hero-eyebrow { color: var(--warm); letter-spacing: .16em; font-weight: 500; }
.page-folio .hero-text h1 { font-weight: 300; letter-spacing: .005em; text-transform: none; font-size: 31px; }
.page-folio .hero-meta { color: var(--warm-dim); }
.page-folio.tod-dawn .hero-overlay { background-image: linear-gradient(to top, #0a0a0a 3%, rgba(40,30,18,.55) 34%, transparent 78%); }
.page-folio.tod-dusk .hero-overlay { background-image: linear-gradient(to top, #0a0a0a 3%, rgba(46,28,14,.6) 34%, transparent 78%); }

/* ── Fully-documented line ── */
.folio-doc-line {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
}
.folio-doc-line .fdl-ico { color: var(--warm); display: flex; }
.folio-doc-line .fdl-main { font-size: 13px; color: #cfc8bd; letter-spacing: .02em; }
.folio-doc-line .fdl-count { font-size: 13px; color: var(--gray-3); margin-left: auto; font-variant-numeric: tabular-nums; }

/* ── Stats trio ── */
.page-folio .stat-num { font-weight: 300; font-variant-numeric: tabular-nums; }
.page-folio .stat-cell.is-zero .stat-num { color: var(--warm); }

/* ── Room rows: circular icon + count + press ── */
.page-folio.page-home .card-row { transition: transform .12s ease, background .12s ease; }
.page-folio.page-home .card-row:active { background: rgba(255,255,255,.03); transform: scale(.99); }
.page-folio.page-home .card-icon {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--gray-4);
  background: transparent;
}
.card-count {
  font-size: 13px; color: var(--gray-3);
  font-variant-numeric: tabular-nums;
  margin-right: 10px;
}

/* ── Item page: catalogue plate ── */
.page-item .item-photo {
  height: 380px;
  background: radial-gradient(120% 80% at 50% 0%, #1d1d1d 0%, #0e0e0e 70%);
  display: flex; align-items: center; justify-content: center;
  padding: 30px;
  overflow: hidden;
}
.page-item .item-photo img {
  width: auto; max-width: 100%; height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 26px 44px rgba(0,0,0,.55));
}
.page-item .photo-fallback {
  flex-direction: column; gap: 14px;
  width: 100%; height: 100%;
  align-items: center; justify-content: center;
}
.page-item .photo-fallback svg { opacity: .18; }
.page-item .photo-fallback .pf-cap {
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--gray-3);
}
.page-item .spec-row { border-bottom: 1px solid var(--border2); }
.page-item .spec-key {
  text-transform: uppercase; font-size: 10px; letter-spacing: .14em;
  color: var(--gray-3);
}
.page-item .spec-val { font-variant-numeric: tabular-nums; }

/* ── Phase 2: item actions (Find / Copy) ── */
.item-actions { display: flex; gap: 10px; padding: 14px 20px 4px; }
.item-action {
  flex: 1;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 12px 10px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--gray-1);
  font-family: var(--font); font-size: 13px; letter-spacing: .02em;
  text-decoration: none; cursor: pointer;
  transition: transform .12s ease, border-color .15s ease, color .15s ease;
}
.item-action:active { transform: scale(.98); }
.item-action.is-copied { color: var(--warm); border-color: var(--warm); }

/* ── Phase 2: Handover first-open moment ── */
body.handover-active { overflow: hidden; }
.handover {
  position: fixed; inset: 0; z-index: 999;
  background: #0a0a0a;
  display: flex; align-items: center; justify-content: center;
}
.handover.done { opacity: 0; transition: opacity 1s ease; pointer-events: none; }
.handover-inner { text-align: center; opacity: 0; }
.handover.play .handover-inner { animation: nh-handover-rise 1.1s cubic-bezier(.16,1,.3,1) .15s both; }
@keyframes nh-handover-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.handover-logo { width: 56px; height: 56px; object-fit: contain; margin-bottom: 20px; }
.handover-welcome { font-size: 12px; letter-spacing: .24em; text-transform: uppercase; color: var(--warm); margin-bottom: 12px; }
.handover-house { font-size: 30px; font-weight: 300; color: #fff; letter-spacing: .01em; }

/* ── Respect reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .page-folio .home-hero-photo img,
  .page-folio .hero-text,
  .handover.play .handover-inner { animation: none !important; }
}

/* ── Phase 3: item-list photo thumbnails ── */
.page-folio .card-thumb { padding: 0; overflow: hidden; background: var(--surface); }
.page-folio .card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ── Fact Sheet (home page) ── */
.factsheet {
  margin: 4px 20px 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface);
}
.fs-head { padding: 18px 18px 15px; border-bottom: 1px solid var(--border); }
.fs-sub { font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--warm); margin-bottom: 9px; }
.fs-addr { font-size: 15px; color: var(--white); line-height: 1.5; font-weight: 300; }
.fs-addr a { color: inherit; text-decoration: none; }
.fs-tmk { font-size: 12px; color: var(--gray-3); margin-top: 9px; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.fs-grid { display: grid; grid-template-columns: 1fr 1fr; }
.fs-cell {
  padding: 16px 12px; text-align: center;
  border-right: 1px solid var(--border2);
  border-bottom: 1px solid var(--border2);
}
.fs-cell:nth-child(2n) { border-right: none; }
.fs-cell:nth-last-child(-n+2) { border-bottom: none; }
.fs-num { font-size: 23px; font-weight: 300; color: var(--white); font-variant-numeric: tabular-nums; }
.fs-dash { color: var(--warm); }
.fs-lbl { font-size: 9px; letter-spacing: .14em; text-transform: uppercase; color: var(--gray-3); margin-top: 5px; }
.fs-community { padding: 14px 18px 16px; border-top: 1px solid var(--border); }
.fs-comm-head { font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--warm); margin-bottom: 8px; }
.fs-comm-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; }
.fs-comm-lbl { font-size: 13px; color: var(--gray-2); }
.fs-comm-val { font-size: 14px; color: var(--white); }


/* ── Sub-pages (Fact Sheet / Directory) ── */
.subpage-pad { padding: 14px 0 0; }

/* ── Directory page ── */
.dir-list { display: flex; flex-direction: column; gap: 10px; padding: 4px 20px 0; }
.dir-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  background: var(--surface);
}
.dir-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.dir-company { font-size: 15px; font-weight: 500; color: var(--white); line-height: 1.3; }
.dir-trade {
  font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--warm); white-space: nowrap; flex-shrink: 0; padding-top: 2px;
}
.dir-person { font-size: 13px; color: var(--gray-2); margin-top: 3px; }
.dir-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.dir-act {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 13px;
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 13px; color: var(--gray-1); text-decoration: none;
}
.dir-act:active { background: rgba(255,255,255,.04); }
.dir-addr { font-size: 12px; color: var(--gray-3); margin-top: 11px; line-height: 1.45; }
.dir-note-line { font-size: 12px; color: var(--warm-dim); margin-top: 7px; }

.fs-comm-sub { font-size: 12px; color: var(--gray-3); margin: -2px 0 9px; }

/* ── Maintenance page ── */
.mnt-list { display: flex; flex-direction: column; gap: 10px; padding: 4px 20px 0; }
.mnt-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  background: var(--surface);
}
.mnt-task { font-size: 15px; font-weight: 500; color: var(--white); }
.mnt-detail { font-size: 12.5px; color: var(--gray-3); margin-top: 4px; line-height: 1.45; }
.mnt-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.mnt-act {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 13px;
  border: 1px solid var(--warm); border-radius: 8px;
  font-size: 13px; color: var(--warm); text-decoration: none;
}
.mnt-act:active { background: rgba(201,162,122,.08); }
.mnt-link {
  display: inline-flex; align-items: center;
  padding: 8px 12px;
  font-size: 13px; color: var(--gray-2); text-decoration: none;
}

/* ── Page transitions (app feel) ── */
@keyframes nhPageIn { from { opacity: 0; } to { opacity: 1; } }

/* Modern browsers: animate cross-page navigations like a native app. */
@view-transition { navigation: auto; }
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.24s;
  animation-timing-function: ease;
}

/* Browsers without View Transitions: fade each page in on load instead. */
@supports not (view-transition-name: none) {
  .page-folio .app { animation: nhPageIn 0.26s ease-out both; }
}

@media (prefers-reduced-motion: reduce) {
  .page-folio .app { animation: none; }
  ::view-transition-old(root),
  ::view-transition-new(root) { animation: none; }
}

/* ── Home Documents page ── */
.hdoc-list { display: flex; flex-direction: column; gap: 10px; padding: 4px 20px 0; }
.hdoc-card {
  display: flex; align-items: center; gap: 14px;
  border: 1px solid var(--border); border-radius: 12px;
  padding: 14px 16px; background: var(--surface);
  text-decoration: none; color: var(--white);
  transition: background .12s ease, transform .12s ease;
}
.hdoc-card:active { background: rgba(255,255,255,.04); transform: scale(.99); }
.hdoc-icon {
  width: 42px; height: 42px; border-radius: 8px; flex-shrink: 0;
  background: rgba(255,255,255,.04); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
}
.hdoc-content { flex: 1; min-width: 0; }
.hdoc-name { font-size: 15px; font-weight: 500; color: var(--white); }
.hdoc-sub { font-size: 12.5px; color: var(--gray-3); margin-top: 3px; line-height: 1.4; }
.hdoc-tag {
  display: inline-block; margin-top: 8px;
  font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--warm);
}
.hdoc-open { color: var(--gray-3); flex-shrink: 0; }

/* ── Wi-Fi ── */
.wifi-list { display: flex; flex-direction: column; gap: 10px; padding: 4px 20px 0; }
.wifi-card { border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; background: var(--surface); }
.wifi-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.wifi-icon { color: var(--warm); display: flex; }
.wifi-label { font-size: 15px; font-weight: 500; color: var(--white); }
.wifi-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border2); }
.wifi-row:first-of-type { border-top: none; }
.wifi-k { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--gray-3); width: 74px; flex-shrink: 0; }
.wifi-v { font-size: 14px; color: var(--gray-1); flex: 1; min-width: 0; word-break: break-all; }
.wifi-v.wifi-empty { color: var(--gray-3); font-style: italic; }
.wifi-mono { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: .02em; }
.wifi-copy {
  background: none; border: 1px solid var(--border); border-radius: 8px;
  color: var(--warm); font-family: var(--font); font-size: 12px; padding: 6px 12px; cursor: pointer; flex-shrink: 0;
}
.wifi-copy:active { background: rgba(201,162,122,.08); }
.wifi-note { font-size: 12px; color: var(--gray-3); margin-top: 10px; line-height: 1.4; }

/* ── Emergency shutoffs ── */
.shut-list { display: flex; flex-direction: column; gap: 10px; padding: 4px 20px 0; }
.shut-card {
  display: flex; align-items: center; gap: 14px;
  border: 1px solid var(--border); border-radius: 12px;
  padding: 14px 16px; background: var(--surface);
}
.shut-icon {
  width: 40px; height: 40px; border-radius: 8px; flex-shrink: 0;
  background: rgba(201,162,122,.08); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; color: var(--warm);
}
.shut-body { flex: 1; min-width: 0; }
.shut-label { font-size: 15px; font-weight: 500; color: var(--white); }
.shut-loc { font-size: 12.5px; color: var(--gray-2); margin-top: 3px; line-height: 1.4; }
.shut-loc--empty { color: var(--gray-3); font-style: italic; }

/* ── Offline fallback page ── */
.offline-wrap {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 14px; padding: 40px 32px;
}
.offline-logo { width: 48px; height: 48px; object-fit: contain; opacity: .9; margin-bottom: 8px; }
.offline-title { font-size: 20px; font-weight: 500; color: var(--white); }
.offline-sub { font-size: 13px; color: var(--gray-3); line-height: 1.5; max-width: 260px; }
.offline-btn {
  margin-top: 10px; padding: 11px 22px;
  border: 1px solid var(--warm); border-radius: 10px;
  font-size: 13px; letter-spacing: .04em; color: var(--warm); text-decoration: none;
}
.offline-btn:active { background: rgba(201,162,122,.08); }

/* ── Empty room state ── */
.room-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 80px 24px; text-align: center;
  color: var(--gray-3);
}
.room-empty svg { opacity: .4; }
.room-empty p { font-size: 13px; letter-spacing: .04em; }

/* ── Onboarding tour (spotlight) ── */
.nh-tour { position: fixed; inset: 0; z-index: 2400; background: transparent; }
.nh-tour.nh-tour--center { background: rgba(0,0,0,.8); }
.nh-tour-hole {
  position: fixed; left: 0; top: 0; width: 0; height: 0;
  border-radius: 12px; pointer-events: none;
  box-shadow: 0 0 0 100vmax rgba(0,0,0,.74);
  outline: 1px solid rgba(201,162,122,.5);
  transition: left .28s ease, top .28s ease, width .28s ease, height .28s ease, opacity .2s ease;
}
.nh-tour-card {
  position: fixed; left: 50%; transform: translateX(-50%);
  width: calc(100% - 40px); max-width: 340px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 18px 18px 16px; box-shadow: 0 20px 50px rgba(0,0,0,.55);
}
.nh-tour--center .nh-tour-card { top: 50% !important; transform: translate(-50%, -50%); }
.nh-tour-step { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--warm); }
.nh-tour-title { font-size: 18px; font-weight: 500; color: var(--white); margin-top: 6px; }
.nh-tour-body { font-size: 13.5px; color: var(--gray-2); line-height: 1.5; margin-top: 8px; }
.nh-tour-dots { display: flex; gap: 6px; justify-content: center; margin: 16px 0 4px; }
.nh-tour-dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--gray-4); }
.nh-tour-dots span.on { background: var(--warm); }
.nh-tour-nav { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.nh-tour-right { display: flex; gap: 8px; }
.nh-tour-skip {
  background: none; border: none; color: var(--gray-3);
  font-family: var(--font); font-size: 13px; padding: 8px 4px; cursor: pointer;
}
.nh-tour-back {
  background: none; border: 1px solid var(--border); border-radius: 9px;
  color: var(--gray-1); font-family: var(--font); font-size: 13px; padding: 9px 16px; cursor: pointer;
}
.nh-tour-next {
  background: var(--warm); border: 1px solid var(--warm); border-radius: 9px;
  color: #0a0a0a; font-family: var(--font); font-size: 13px; font-weight: 500; padding: 9px 18px; cursor: pointer;
}
@media (prefers-reduced-motion: reduce) { .nh-tour-hole { transition: opacity .2s ease; } }

/* Replay-tour button in the About modal */
.smodal-replay {
  display: block; width: 100%; margin: 4px 0 18px;
  background: none; border: 1px solid var(--border); border-radius: 10px;
  color: var(--warm); font-family: var(--font); font-size: 13px; letter-spacing: .02em;
  padding: 11px 14px; cursor: pointer;
}
.smodal-replay:active { background: rgba(201,162,122,.08); }

/* ── Passcode gate ── */
.nh-gate {
  position: fixed; inset: 0; z-index: 2000;
  background: #0a0a0a;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.nh-gate-box { width: 100%; max-width: 320px; text-align: center; }
.nh-gate-logo { width: 54px; height: 54px; object-fit: contain; margin-bottom: 22px; }
.nh-gate-title { font-size: 18px; font-weight: 500; color: var(--white); margin-bottom: 6px; }
.nh-gate-sub { font-size: 13px; color: var(--gray-3); margin-bottom: 22px; }
.nh-gate input {
  width: 100%; box-sizing: border-box;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 13px 16px; font-size: 16px; color: var(--white);
  font-family: var(--font); outline: none; text-align: center; letter-spacing: .05em;
}
.nh-gate input:focus { border-color: var(--warm); }
.nh-gate button {
  width: 100%; margin-top: 12px;
  background: var(--white); color: #0a0a0a; border: none; border-radius: 10px;
  padding: 13px; font-size: 15px; font-weight: 500; font-family: var(--font); cursor: pointer;
}
.nh-gate button:active { transform: scale(.99); }
.nh-gate-err { min-height: 18px; margin-top: 12px; font-size: 13px; color: #e2725b; }

/* ── Login screen ── */
.nh-login { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 40px 32px; text-align: center; }
.nh-login-logo { width: 54px; height: 54px; object-fit: contain; margin-bottom: 16px; }
.nh-login-title { font-size: 20px; font-weight: 500; color: var(--white); }
.nh-login-sub { font-size: 13px; color: var(--gray-3); max-width: 260px; margin-bottom: 10px; }
.nh-login input { width: 100%; max-width: 300px; box-sizing: border-box; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 13px 16px; font-size: 16px; color: var(--white); font-family: var(--font); outline: none; text-align: center; }
.nh-login input:focus { border-color: var(--warm); }
.nh-login button { width: 100%; max-width: 300px; margin-top: 6px; padding: 13px; border: 1px solid var(--warm); border-radius: 10px; background: var(--warm); color: #0a0a0a; font-family: var(--font); font-size: 14px; font-weight: 500; cursor: pointer; }
.nh-login-err { font-size: 12.5px; color: #e08585; min-height: 16px; margin-top: 4px; }

/* ─────────────────────────────────────────────────────────────────────────
   Native-feel pass (2026-07-13) — override-only; appended so existing rules
   stay intact. dvh fallbacks, safe-area insets, no input-zoom, focus rings.
   ───────────────────────────────────────────────────────────────────────── */
body, .app { min-height: 100dvh; }                    /* falls back to the 100vh above on old Safari */
.pdf-modal { height: 92dvh; }
.history-modal { max-height: 72dvh; padding-bottom: env(safe-area-inset-bottom, 0px); }
.scan-modal { padding-bottom: env(safe-area-inset-bottom, 0px); }
.bottom-nav {                                         /* keep buttons in the top 64px; blur extends past the home indicator */
  box-sizing: content-box;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
/* No <16px text field, so iOS never zoom-jumps on focus */
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea { font-size: 16px; }
/* Remove the legacy 300ms tap delay / double-tap zoom on controls */
a, button, label, .card-row, .item-action, .bottom-nav-btn, .doc-btn, .settings-row { touch-action: manipulation; }
/* Keyboard / switch-control users get a visible ring; touch & mouse users don't */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, [tabindex]:focus-visible, .card-row:focus-visible {
  outline: 2px solid var(--warm, #c9a27a); outline-offset: 2px; border-radius: 8px;
}

/* ── Search panel upgrade — thumbnails, room grouping, chips, scan fallback ── */
.nh-sr-section { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--gray-3); padding: 15px 20px 7px; }
.nh-sr-room {
  font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--gray-3);
  padding: 11px 20px 6px; background: var(--surface); position: sticky; top: 0; z-index: 1;
}
.nh-sr-thumb {
  position: relative; width: 40px; height: 40px; border-radius: 8px; overflow: hidden; flex-shrink: 0;
  background: var(--gray-4); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
}
.nh-sr-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.nh-sr-thumb b { font-size: 10px; font-weight: 600; color: var(--gray-3); letter-spacing: .04em; }
.nh-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 2px 20px 18px; }
.nh-chip {
  font-family: var(--font); font-size: 13px; color: var(--gray-1);
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
  padding: 7px 14px; cursor: pointer; transition: border-color .15s, color .15s;
}
.nh-chip:active { border-color: var(--warm, #c9a27a); color: var(--white); }
.nh-sr-scan {
  display: inline-flex; align-items: center; gap: 8px; margin: 6px 20px 18px;
  padding: 11px 16px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; color: var(--gray-1); font-family: var(--font); font-size: 13.5px; cursor: pointer;
}
.nh-sr-scan:active { border-color: var(--warm, #c9a27a); }
/* Compact Share action so it doesn't squeeze the wider item actions */
.nh-share-action { flex: 0 0 auto; }

/* ── Photo lightbox (pinch-to-zoom on the item photo) ── */
.page-item .item-photo { position: relative; }
.item-zoom-badge {
  position: absolute; right: 14px; bottom: 14px;
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(10,10,10,0.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.14);
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-1); pointer-events: none;
}
.lightbox-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.94); z-index: 1000; }
.lightbox-overlay.open { display: block; }
.lightbox-stage {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  overflow: hidden; touch-action: none;
}
.lightbox-img {
  max-width: 100%; max-height: 100%; object-fit: contain;
  will-change: transform; user-select: none; -webkit-user-drag: none; touch-action: none;
}
.lightbox-close {
  position: absolute; top: calc(16px + env(safe-area-inset-top, 0px)); right: 16px; z-index: 2;
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255,255,255,0.12); border: none; color: #fff;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
@media (prefers-reduced-motion: reduce) { .lightbox-img { transition: none !important; } }

/* ── Report an issue (subtle text link, item pages) ── */
.report-issue-link {
  display: block; width: 100%; text-align: center; background: none; border: none;
  color: var(--gray-3); font-family: var(--font); font-size: 12.5px; letter-spacing: .01em;
  padding: 16px 20px 4px; cursor: pointer;
}
.report-issue-link:active { color: var(--gray-2); }
.report-context { font-size: 13px; color: var(--gray-3); margin-bottom: 10px; }

/* ── Maintenance: "add all reminders" subscribe button ── */
.mnt-subscribe { padding: 16px 20px 4px; }
.mnt-subscribe-btn {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%; box-sizing: border-box; padding: 13px 16px;
  background: var(--warm); color: #0a0a0a; border: 1px solid var(--warm); border-radius: 12px;
  font-family: var(--font); font-size: 14px; font-weight: 600; letter-spacing: .02em;
  text-decoration: none; cursor: pointer; transition: transform .12s ease, opacity .15s ease;
}
.mnt-subscribe-btn:active { transform: scale(.99); opacity: .92; }
.mnt-subscribe-note { text-align: center; font-size: 12px; color: var(--gray-3); margin-top: 8px; }

/* ── Nicholson "Approved" seal on item photos ── */
.item-approved-seal {
  position: absolute; top: 12px; left: 12px;
  width: 46px; height: 46px;
  filter: drop-shadow(0 2px 7px rgba(0,0,0,.55));
  pointer-events: none; z-index: 2;
}

/* ── Paint & Finishes quick-reference ── */
.finish-intro { font-size: 13px; color: var(--gray-2); line-height: 1.5; padding: 6px 20px 4px; margin: 0; }
.finish-list {
  margin: 4px 20px 6px; border: 1px solid var(--border); border-radius: 12px;
  overflow: hidden; background: var(--surface);
}
.finish-row {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 15px; border-bottom: 1px solid var(--border2);
  text-decoration: none; color: var(--white);
}
.finish-row:last-child { border-bottom: none; }
a.finish-row:active { background: var(--gray-4); }
.finish-swatch {
  width: 38px; height: 38px; border-radius: 9px; flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.16);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.25);
}
.finish-swatch--tba {
  background:
    repeating-linear-gradient(45deg, transparent, transparent 5px, rgba(255,255,255,.05) 5px, rgba(255,255,255,.05) 10px),
    var(--gray-4);
  border: 1px dashed var(--border);
  box-shadow: none;
}
.finish-content { flex: 1; min-width: 0; }
.finish-loc { font-size: 14px; font-weight: 500; }
.finish-meta { font-size: 12px; color: var(--gray-2); margin-top: 3px; }
.finish-tba { color: var(--gray-3); font-style: italic; }
.finish-chev { flex-shrink: 0; color: var(--gray-3); }
.finish-foot { font-size: 12px; color: var(--gray-3); line-height: 1.5; padding: 8px 20px 0; margin: 0; }

/* ── Owner: house-name editor (Home Information) ── */
.hn-editor { padding: 16px 20px 4px; }
.hn-label { display: block; font-size: 12px; color: var(--gray-3); letter-spacing: .02em; margin-bottom: 8px; }
.hn-row { display: flex; gap: 8px; }
.hn-row input {
  flex: 1; min-width: 0; box-sizing: border-box;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 11px 14px; font-size: 16px; color: var(--white); font-family: var(--font); outline: none;
}
.hn-row input:focus { border-color: var(--warm); }
.hn-row button {
  flex-shrink: 0; padding: 0 18px; border: 1px solid var(--warm); border-radius: 10px;
  background: var(--warm); color: #0a0a0a; font-family: var(--font); font-size: 14px; font-weight: 600; cursor: pointer;
}
.hn-msg { font-size: 12.5px; min-height: 15px; margin-top: 8px; color: var(--gray-3); }
.hn-msg--ok { color: #6bbf7a; }
.hn-msg--err { color: #e08585; }

/* ── Home tiles: 2×2 grid ── */
.card-list--feature { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px 16px 6px; border-bottom: none; }
.card-list--feature .card-row { flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px 14px 13px; min-height: 124px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; }
.card-list--feature .card-row:last-child { border-bottom: 1px solid var(--border); }
.card-list--feature .card-row:active { background: #1a1a1a; border-color: #2e2e2e; }
.card-list--feature .card-icon { background: var(--bg); border-radius: 10px; }
.card-list--feature .card-row > svg { display: none; }
.card-list--feature .card-name { font-size: 14.5px; line-height: 1.25; }
.card-list--feature .card-sub { font-size: 11.5px; line-height: 1.35; margin-top: 2px; }
/* ── Maintenance & Contacts ── */
.seg { display: flex; gap: 6px; margin: 12px 20px 2px; padding: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.seg-btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 8px; border: 0; border-radius: 9px; background: transparent; color: var(--gray-3); font-family: var(--font); font-size: 13px; letter-spacing: .02em; cursor: pointer; }
.seg { position: relative; background: #1b1b1b; border-color: #2a2a2a; }
.seg-btn { position: relative; z-index: 1; transition: color .25s; }
.seg-btn.on { color: var(--white); }
/* baseline pill (no JS needed): the active button itself is black… */
.seg-btn.on, .plan-tab.on { background: #000; box-shadow: 0 0 0 1px rgba(201,162,122,.6) inset, 0 2px 8px rgba(0,0,0,.5); }
/* …and once the sliding thumb exists, the thumb draws the pill and the buttons go transparent */
.seg:has(.seg-thumb) .seg-btn.on, .plan-tabs:has(.seg-thumb) .plan-tab.on { background: transparent; box-shadow: none; }
.seg-thumb { position: absolute; z-index: 0; left: 0; top: 4px; height: calc(100% - 8px); width: 0; border-radius: 9px; background: #000; box-shadow: 0 0 0 1px rgba(201,162,122,.6) inset, 0 2px 8px rgba(0,0,0,.5); transition: left .45s cubic-bezier(.34,1.25,.64,1), width .45s cubic-bezier(.34,1.25,.64,1); pointer-events: none; opacity: 0; }
.plan-tabs .seg-thumb { top: 4px; }
.seg-count { font-size: 11px; color: var(--gray-3); background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 1px 7px; margin-left: 2px; }
.seg-btn.on .seg-count { color: var(--warm); }
.care-tab[hidden] { display: none; }
.dir-search-wrap { padding: 12px 20px 0; }
.dir-search { width: 100%; box-sizing: border-box; padding: 11px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; color: var(--white); font-family: var(--font); font-size: 15px; -webkit-appearance: none; }
.dir-search::placeholder { color: var(--gray-3); }
.dir-empty { padding: 22px 20px; text-align: center; color: var(--gray-3); font-size: 13px; }
.dir-card.is-hi { border-color: var(--warm); box-shadow: 0 0 0 1px var(--warm) inset; transition: border-color .3s, box-shadow .3s; }
.dir-card--builder { border-color: #2e2a25; }
.mnt-done { margin-left: auto; background: transparent; font-family: var(--font); font-size: 12.5px; cursor: pointer; -webkit-appearance: none; appearance: none; }
.mnt-done.is-done { color: #5aa469; border-color: #5aa469; }
.mnt-stamp { display: block; font-size: 11px; color: var(--gray-3); margin-top: 8px; }
.mnt-call { color: var(--warm); }

/* ── Home: room rows (lighter type, room icons, thumbnails) ── */
.room-row { padding: 14px 20px; gap: 12px; }
.room-row .card-name { font-weight: 300; font-size: 16.5px; letter-spacing: .01em; }
.room-row .card-sub { font-size: 11.5px; color: var(--gray-3); margin-top: 3px; letter-spacing: .01em; }
.room-row .card-sub .card-count { color: var(--gray-2); font-size: inherit; margin: 0; }
.room-row .card-icon { width: 38px; height: 38px; border-radius: 10px; }
.room-thumbs { display: flex; flex-shrink: 0; margin-right: 2px; }
.room-thumbs img { width: 26px; height: 26px; border-radius: 6px; object-fit: cover; background: var(--surface); border: 1.5px solid var(--bg); box-shadow: 0 0 0 1px var(--border); margin-left: -12px; }
.room-thumbs img:first-child { margin-left: 0; }

/* ══ Motion system (app-wide) ═══════════════════════════════════════════════
   Everything here is subtle, GPU-friendly (opacity/transform), and switched off under
   prefers-reduced-motion. Cross-document view transitions + hero motion live above. */
@keyframes nhSheetUp   { from { transform: translateY(28px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes nhFadeIn    { from { opacity: 0; } to { opacity: 1; } }
@keyframes nhRowIn     { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes nhPop       { 0% { transform: scale(.96); } 60% { transform: scale(1.03); } 100% { transform: none; } }
@keyframes nhPulse     { 0% { box-shadow: 0 0 0 0 rgba(90,164,105,.55); } 100% { box-shadow: 0 0 0 12px rgba(90,164,105,0); } }

/* bottom sheets & overlays: Settings modals, PDF viewer, and every dynamic sheet from the engine
   (they all use position:fixed;inset:0 with a rounded panel child) */
.smodal-overlay.open, .pdf-modal-overlay.open,
body > div[style*="position:fixed"][style*="inset:0"] { animation: nhFadeIn .18s ease-out both; }
.smodal-overlay.open .smodal, .pdf-modal-overlay.open .pdf-modal,
body > div[style*="position:fixed"][style*="inset:0"] > div { animation: nhSheetUp .34s cubic-bezier(.22,1,.36,1) both; }

/* press feedback: cards, tiles, chips, buttons */
.card-row, .doc-btn, .mnt-act, .dir-act, .item-action, .finish-row, .hdoc-card, .settings-row, .shut-card, .wifi-card,
.mnt-subscribe-btn, .seg-btn, .plan-tab, .plan-room, .bottom-nav-btn, .scan-btn-primary, .scan-btn-ghost {
  transition: transform .16s cubic-bezier(.2,.8,.2,1), background .18s, border-color .18s, color .18s, box-shadow .18s, opacity .18s;
}
.card-row:active, .doc-btn:active, .mnt-act:active, .dir-act:active, .item-action:active, .finish-row:active, .hdoc-card:active,
.settings-row:active, .mnt-subscribe-btn:active { transform: scale(.985); }
.card-list--feature .card-row:active { transform: scale(.975); }
.bottom-nav-btn:active { transform: scale(.9); }
.plan-tab:active, .seg-btn:active { transform: scale(.97); }
.plan-room:active { transform: scale(.985); }

/* list reveal: rows/tiles fade-up in sequence on first paint (engine adds .nh-reveal to lists) */
.nh-reveal > * { animation: nhRowIn .42s cubic-bezier(.22,1,.36,1) both; }
.nh-reveal > :nth-child(1)  { animation-delay: .03s; }  .nh-reveal > :nth-child(2)  { animation-delay: .07s; }
.nh-reveal > :nth-child(3)  { animation-delay: .11s; }  .nh-reveal > :nth-child(4)  { animation-delay: .15s; }
.nh-reveal > :nth-child(5)  { animation-delay: .19s; }  .nh-reveal > :nth-child(6)  { animation-delay: .23s; }
.nh-reveal > :nth-child(7)  { animation-delay: .27s; }  .nh-reveal > :nth-child(8)  { animation-delay: .31s; }
.nh-reveal > :nth-child(9)  { animation-delay: .35s; }  .nh-reveal > :nth-child(10) { animation-delay: .39s; }
.nh-reveal > :nth-child(n+11) { animation-delay: .42s; }

/* images: fade in when they arrive (engine toggles .nh-img-in on load) */
.card-thumb img, .room-thumbs img, .item-photo img, .nh-sr-thumb img { opacity: 0; transition: opacity .35s ease-out; }
.card-thumb img.nh-img-in, .room-thumbs img.nh-img-in, .item-photo img.nh-img-in, .nh-sr-thumb img.nh-img-in,
.card-thumb img[data-nh-static], .room-thumbs img[data-nh-static], .item-photo img[data-nh-static], .nh-sr-thumb img[data-nh-static] { opacity: 1; }

/* state changes */
.mnt-done.is-done { animation: nhPulse .6s ease-out; }
.dir-card.is-hi { animation: nhPop .4s cubic-bezier(.22,1,.36,1); }
.plan-room.is-sel { transition: background .18s, border-color .18s, box-shadow .18s, transform .18s; transform: scale(1.015); }
.plan-room-label { animation: nhFadeIn .18s ease-out both; }
.nh-live-card { animation: nhRowIn .35s cubic-bezier(.22,1,.36,1) both; }

@media (prefers-reduced-motion: reduce) {
  .smodal-overlay.open, .pdf-modal-overlay.open, body > div[style*="position:fixed"][style*="inset:0"],
  .smodal-overlay.open .smodal, .pdf-modal-overlay.open .pdf-modal, body > div[style*="position:fixed"][style*="inset:0"] > div,
  .nh-reveal > *, .mnt-done.is-done, .dir-card.is-hi, .plan-room-label, .nh-live-card { animation: none !important; }
  .card-row, .doc-btn, .mnt-act, .dir-act, .seg-btn, .plan-tab, .bottom-nav-btn, .plan-room, .seg-thumb { transition: none !important; }
  .card-thumb img, .room-thumbs img, .item-photo img, .nh-sr-thumb img { opacity: 1 !important; transition: none !important; }
}
