/* Housebook — mobile-first styles. Palette kept from the original landing page. */
:root {
  --bg: #1a1a2e;
  --bg-card: #16213e;
  --bg-elev: #1f2b4d;
  --accent: #d4a574;
  --text: #f5f1e8;
  --muted: #9a96a8;
  --danger: #e07a6b;
  --radius: 12px;
  --tabbar-h: 64px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg); color: var(--text);
  font-family: system-ui, -apple-system, sans-serif;
  -webkit-text-size-adjust: 100%;
}

/* App shell: scrollable view area above a fixed bottom tab bar */
#view {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px 16px calc(var(--tabbar-h) + 24px);
  min-height: 100vh;
}

h1 { font-size: 24px; color: var(--accent); margin: 4px 0 16px; }
h2 { font-size: 18px; margin: 0 0 12px; }
p { line-height: 1.5; }
.muted { color: var(--muted); }

/* Buttons & inputs — 44px+ touch targets */
button, .btn {
  font: inherit; cursor: pointer;
  min-height: 48px; padding: 0 18px;
  border: none; border-radius: var(--radius);
  background: var(--accent); color: #1a1a2e; font-weight: 600;
}
button.secondary, .btn.secondary {
  background: var(--bg-elev); color: var(--text);
}
button.danger { background: var(--danger); color: #1a1a2e; }
button:active { transform: translateY(1px); }

input, select, textarea {
  font: inherit; width: 100%;
  min-height: 48px; padding: 10px 12px;
  margin: 0; border: 1px solid #2c3a63; border-radius: var(--radius);
  background: var(--bg-card); color: var(--text);
}
textarea { min-height: 88px; resize: vertical; }
label { display: block; font-size: 13px; color: var(--muted); margin: 14px 0 6px; }

/* Search + filter chips */
.search { margin-bottom: 12px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; }
.chip {
  flex: 0 0 auto; min-height: 36px; padding: 0 14px;
  border-radius: 999px; background: var(--bg-card); color: var(--muted);
  font-size: 14px; line-height: 36px; border: 1px solid #2c3a63; cursor: pointer;
}
.chip.active { background: var(--accent); color: #1a1a2e; border-color: var(--accent); font-weight: 600; }

/* Item list */
.list { list-style: none; margin: 8px 0 0; padding: 0; }
.row {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 12px; padding: 14px 16px; margin-bottom: 8px;
  background: var(--bg-card); border-radius: var(--radius); cursor: pointer;
}
.row .title { font-weight: 600; }
.row .sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.row .price { color: var(--accent); white-space: nowrap; font-variant-numeric: tabular-nums; }

.empty { text-align: center; color: var(--muted); padding: 56px 16px; }

/* Detail view */
.detail dt { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-top: 14px; }
.detail dd { margin: 2px 0 0; font-size: 16px; }
.row-actions { display: flex; gap: 12px; margin-top: 28px; }
.row-actions button { flex: 1; }

.form-actions { display: flex; gap: 12px; margin-top: 24px; }
.form-actions button { flex: 1; }

.topbar { display: flex; align-items: center; gap: 12px; margin: 4px 0 12px; }
.topbar .back { background: none; color: var(--accent); min-height: auto; padding: 0; font-weight: 600; }

/* Bottom tab bar */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; height: var(--tabbar-h);
  display: flex; background: var(--bg-card); border-top: 1px solid #2c3a63;
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar button {
  flex: 1; background: none; color: var(--muted);
  border-radius: 0; min-height: var(--tabbar-h); font-weight: 500; font-size: 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
}
.tabbar button .ico { font-size: 20px; line-height: 1; }
.tabbar button.active { color: var(--accent); }

/* List row thumbnails (photos) */
.row { align-items: center; }
.row .thumb {
  flex: 0 0 auto; width: 48px; height: 48px;
  border-radius: 8px; object-fit: cover; background: var(--bg-elev);
}
.row .row-main { flex: 1; min-width: 0; }

/* Photo section on item detail */
.photos { margin-top: 28px; }
.photo-grid { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }
.photo-thumb {
  width: 96px; height: 96px; object-fit: cover;
  border-radius: var(--radius); cursor: pointer; background: var(--bg-elev);
}
.photo-add { width: 100%; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  opacity: 0; pointer-events: none;
}

/* Full-screen photo viewer */
.photo-viewer {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(10, 10, 20, 0.94);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 16px; padding: 16px;
}
.photo-viewer img { max-width: 100%; max-height: 75vh; border-radius: var(--radius); }
.viewer-actions { display: flex; gap: 12px; }

/* Lock screen */
.lock {
  display: flex; flex-direction: column; gap: 12px;
  max-width: 320px; margin: 18vh auto 0; text-align: center;
}
.lock h1 { margin-bottom: 0; }
.lock-input {
  text-align: center; font-size: 28px; letter-spacing: 0.4em;
  font-variant-numeric: tabular-nums;
}
.lock-error { color: var(--danger); font-size: 14px; min-height: 1em; margin: 0; }

/* Backup restore review */
.review-group { margin-top: 24px; }
.review-group h3 { font-size: 15px; color: var(--accent); margin: 0 0 2px; }
.review-group .hint { font-size: 13px; color: var(--muted); margin: 0 0 10px; }
.check-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; margin: 0 0 8px;
  background: var(--bg-card); border-radius: var(--radius);
  font-size: 16px; color: var(--text); cursor: pointer;
}
.check-row input[type=checkbox] {
  flex: 0 0 auto; width: 22px; height: 22px; min-height: auto;
  margin: 0; accent-color: var(--accent);
}
.check-row .title { font-weight: 600; }
.check-row .sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.check-row.info { cursor: default; opacity: 0.75; }

/* Projects & settings */
.section-gap { margin-top: 28px; }
.total-line { text-align: right; color: var(--accent); font-weight: 600; }
.stack { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.link { color: var(--accent); }

@media (min-width: 720px) {
  #view { padding-top: 24px; }
}
