/* ---------------------------------------------------------------
   Tokens
--------------------------------------------------------------- */
:root {
  --bg: #1c1a17;
  --bg-raised: #262320;
  --bg-inset: #16140f;
  --line: #3a352e;
  --line-soft: #2d2924;

  --paper: #f2ecdd;
  --paper-dim: #e7dfca;

  --amber: #e8a33d;
  --amber-dim: #c98a2e;
  --steel: #8a97a0;
  --steel-dim: #5f6a72;

  --open: #c1502e;
  --open-bg: rgba(193, 80, 46, 0.16);
  --progress: #e8a33d;
  --progress-bg: rgba(232, 163, 61, 0.16);
  --complete: #4f7942;
  --complete-bg: rgba(79, 121, 66, 0.18);

  --ink: #ede7d8;
  --ink-dim: #b9b2a0;
  --ink-faint: #837c6c;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;

  --shadow-card: 0 1px 0 rgba(0, 0, 0, 0.4), 0 8px 20px -8px rgba(0, 0, 0, 0.5);
  --shadow-modal: 0 20px 60px -12px rgba(0, 0, 0, 0.7);

  --font-display: 'Barlow Condensed', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

body {
  background-image:
    radial-gradient(circle at 15% 0%, rgba(232, 163, 61, 0.05), transparent 45%),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.012) 0px, rgba(255,255,255,0.012) 1px, transparent 1px, transparent 3px);
  min-height: 100vh;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.01em;
  margin: 0;
  color: var(--ink);
}

p { margin: 0; }
button { font-family: var(--font-body); cursor: pointer; }
input, textarea { font-family: var(--font-body); }
::selection { background: var(--amber); color: #1c1a17; }

.muted { color: var(--ink-dim); font-size: 13.5px; line-height: 1.5; }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber);
  margin: 0 0 4px;
}

a { color: var(--amber); }

/* ---------------------------------------------------------------
   Boot screen
--------------------------------------------------------------- */
.boot-screen {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.boot-mark {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 800;
  color: var(--amber);
  border: 3px solid var(--amber);
  width: 84px;
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.55; transform: scale(0.97); }
  50% { opacity: 1; transform: scale(1); }
}

/* ---------------------------------------------------------------
   Buttons & fields
--------------------------------------------------------------- */
.btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  padding: 10px 16px;
  transition: transform 0.08s ease, background 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 12px; font-size: 13px; }

.btn-primary {
  background: var(--amber);
  color: #201a0f;
  box-shadow: 0 2px 0 var(--amber-dim);
}
.btn-primary:hover { background: #edb254; }

.btn-ghost {
  background: transparent;
  color: var(--ink-dim);
  border-color: var(--line);
}
.btn-ghost:hover { color: var(--ink); border-color: var(--steel-dim); }

.btn-danger {
  background: transparent;
  color: var(--open);
  border-color: rgba(193, 80, 46, 0.4);
}
.btn-danger:hover { background: var(--open-bg); }

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.field > span {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.field small { color: var(--ink-faint); font-size: 12px; }

input[type="text"], input[type="email"], input[type="password"], textarea {
  background: var(--bg-inset);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  font-size: 16px;
  outline: none;
  transition: border-color 0.15s ease;
}
input:focus, textarea:focus {
  border-color: var(--amber);
}
textarea { resize: vertical; font-family: var(--font-body); }

.form-error {
  color: var(--open);
  font-size: 13px;
  min-height: 0;
}
.form-error:empty { display: none; }

.inline-form { display: flex; gap: 8px; }
.inline-form input { flex: 1; }

/* ---------------------------------------------------------------
   Auth screen — punch card
--------------------------------------------------------------- */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.punch-card {
  position: relative;
  width: 100%;
  max-width: 380px;
  background: var(--paper);
  color: #22201c;
  border-radius: 4px;
  padding: 40px 32px 32px;
  box-shadow: var(--shadow-modal);
  background-image:
    repeating-linear-gradient(90deg, transparent, transparent 39px, rgba(0,0,0,0.05) 39px, rgba(0,0,0,0.05) 40px);
}
.punch-hole {
  position: absolute;
  top: 20px;
  left: 24px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: inset 0 2px 3px rgba(0,0,0,0.5);
}
.punch-card-header { text-align: center; margin-bottom: 22px; }
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2.5px solid #22201c;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  margin-bottom: 10px;
}
.punch-card-header h1 {
  font-size: 30px;
  color: #22201c;
}
.tagline {
  font-size: 13px;
  color: #5a5647;
  margin-top: 6px;
  line-height: 1.5;
}

.auth-tabs {
  display: flex;
  border-bottom: 1.5px solid rgba(0,0,0,0.12);
  margin-bottom: 20px;
}
.auth-tab {
  flex: 1;
  background: none;
  border: none;
  padding: 10px 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #8a8371;
  border-bottom: 2px solid transparent;
  margin-bottom: -1.5px;
}
.auth-tab.is-active {
  color: #22201c;
  border-bottom-color: var(--amber-dim);
}

.auth-form .field > span { color: #8a8371; }
.auth-form input {
  background: #fbf8f0;
  border: 1px solid rgba(0,0,0,0.15);
  color: #22201c;
}
.auth-form input:focus { border-color: var(--amber-dim); }
.auth-form.is-hidden { display: none; }

/* ---------------------------------------------------------------
   App shell
--------------------------------------------------------------- */
.shell { display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(28, 26, 23, 0.9);
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 14px; }

.brand-mark.small {
  width: 30px; height: 30px; font-size: 13px;
  border: 2px solid var(--amber);
  color: var(--amber);
}

.household-switch {
  background: none;
  border: none;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.household-switch svg { color: var(--ink-faint); }
.household-switch:hover { color: var(--amber); }
.household-switch:hover svg { color: var(--amber); }

.user-chip { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-dim); }
.user-initials {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--amber);
}

.main-view { flex: 1; padding: 32px 24px 60px; max-width: 1180px; margin: 0 auto; width: 100%; }

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 26px;
  gap: 16px;
  flex-wrap: wrap;
}
.page-head h2 { font-size: 30px; }

/* ---------------------------------------------------------------
   Households grid
--------------------------------------------------------------- */
.invites-banner {
  background: var(--bg-raised);
  border: 1px dashed var(--amber-dim);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 22px;
}
.invite-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
}
.invite-row + .invite-row { border-top: 1px solid var(--line-soft); }
.invite-row-actions { display: flex; gap: 8px; }

.household-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
  margin-bottom: 30px;
}

.household-card {
  background: var(--bg-raised);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 18px;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.1s ease;
  box-shadow: var(--shadow-card);
}
.household-card:hover { border-color: var(--amber-dim); transform: translateY(-2px); }
.household-card h3 { font-size: 22px; margin-bottom: 10px; }
.household-card .hc-counts {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
}
.household-card .hc-count { color: var(--ink-dim); }
.household-card .hc-count b { color: var(--ink); }
.household-card .hc-members { font-size: 12px; color: var(--ink-faint); margin-top: 4px; }

.household-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 620px) {
  .household-actions { grid-template-columns: 1fr; }
}

.ticket-panel {
  background: var(--bg-raised);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 20px;
}
.ticket-panel h3 { font-size: 19px; margin-bottom: 6px; }
.ticket-panel .muted { margin-bottom: 14px; display: block; }

/* ---------------------------------------------------------------
   Board
--------------------------------------------------------------- */
.board-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  align-items: start;
}
@media (max-width: 900px) {
  .board-columns { grid-template-columns: 1fr; }
}

.board-column {
  background: var(--bg-inset);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  padding: 14px;
  min-height: 140px;
}

.column-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 4px 14px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--line-soft);
}
.column-head h3 { font-size: 17px; flex: 1; letter-spacing: 0.02em; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; }
.column-head.status-open .status-dot { background: var(--open); }
.column-head.status-in-progress .status-dot { background: var(--progress); }
.column-head.status-complete .status-dot { background: var(--complete); }

.count-badge {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-faint);
  background: var(--bg-raised);
  border: 1px solid var(--line-soft);
  padding: 2px 8px;
  border-radius: 999px;
}

.job-list { display: flex; flex-direction: column; gap: 10px; min-height: 40px; }
.job-list-empty {
  border: 1px dashed var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 18px 10px;
  text-align: center;
  color: var(--ink-faint);
  font-size: 13px;
}

.job-card {
  background: var(--paper);
  color: #221f1a;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  border-left: 4px solid var(--steel-dim);
  transition: transform 0.1s ease, box-shadow 0.15s ease;
}
.job-card:hover { transform: translateY(-2px) rotate(-0.2deg); }
[data-status="open"] .job-card { border-left-color: var(--open); }
[data-status="in-progress"] .job-card { border-left-color: var(--progress); }
[data-status="complete"] .job-card { border-left-color: var(--complete); }

.job-card-photo {
  position: relative;
  height: 110px;
  background-size: cover;
  background-position: center;
  background-color: var(--paper-dim);
  cursor: zoom-in;
}
.job-card-photo:empty::before {
  content: "";
}
.job-card-photo-count {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: rgba(10, 9, 7, 0.65);
  color: #fff;
  font-size: 10.5px;
  font-family: var(--font-mono);
  letter-spacing: 0.03em;
  padding: 2px 7px;
  border-radius: 999px;
}
.job-card-body { padding: 12px 14px 14px; }
.job-card-body h4 { font-size: 20px; margin-bottom: 5px; color: #221f1a; }
.job-card-body p {
  font-size: 15px;
  color: #5a5647;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.job-card-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #8a8371;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ---------------------------------------------------------------
   Modals
--------------------------------------------------------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 9, 7, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
  animation: fadeIn 0.15s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  position: relative;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 100%;
  max-width: 460px;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: var(--shadow-modal);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: none;
  color: var(--ink-faint);
  font-size: 24px;
  line-height: 1;
  padding: 4px;
}
.modal-close:hover { color: var(--ink); }

.ticket-modal { padding-top: 34px; max-width: 520px; }
.ticket-modal-hole {
  position: absolute;
  top: 16px;
  left: 24px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg-inset);
  border: 1px solid var(--line);
}

.status-picker { display: flex; gap: 8px; }
.status-pill {
  flex: 1;
  padding: 9px 6px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: transparent;
  color: var(--ink-dim);
  font-size: 12.5px;
  font-weight: 600;
  transition: all 0.12s ease;
}
.status-pill.status-open.is-active { background: var(--open-bg); border-color: var(--open); color: #f0a488; }
.status-pill.status-in-progress.is-active { background: var(--progress-bg); border-color: var(--progress); color: var(--progress); }
.status-pill.status-complete.is-active { background: var(--complete-bg); border-color: var(--complete); color: #8fc27f; }

.status-pill.priority-low.is-active { background: var(--bg-inset); border-color: var(--line); color: var(--ink-dim); }
.status-pill.priority-medium.is-active { background: var(--progress-bg); border-color: var(--progress); color: var(--progress); }
.status-pill.priority-high.is-active { background: var(--open-bg); border-color: var(--open); color: #f0a488; }

.job-card-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.priority-badge {
  flex-shrink: 0;
  margin-top: 3px;
  font-size: 10px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 999px;
  white-space: nowrap;
}
.priority-badge.priority-high { background: var(--open-bg); color: var(--open); }
.priority-badge.priority-low { background: var(--bg-inset); color: var(--ink-faint); border: 1px solid var(--line); }

.field-hint { font-family: var(--font-body, inherit); text-transform: none; letter-spacing: normal; font-size: 12px; color: var(--ink-faint); font-weight: 400; }
.field-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 8px;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.photo-slot {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-inset);
  border: 1px solid var(--line);
}
.photo-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: zoom-in;
  display: block;
}
.photo-slot.is-uploading img { opacity: 0.45; }
.photo-slot-spinner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-faint);
  font-size: 11px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.photo-slot-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(10, 9, 7, 0.65);
  color: #fff;
  font-size: 15px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.photo-slot-remove:hover { background: rgba(193, 80, 46, 0.85); }

.photo-add-tile {
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--line);
  background: transparent;
  color: var(--ink-faint);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.photo-add-tile:hover { border-color: var(--amber-dim); color: var(--ink); }
.photo-add-tile svg { opacity: 0.8; }
.photo-add-tile span { font-size: 10.5px; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.05em; }
.photo-add-actions { display: flex; gap: 4px; }
.photo-add-actions button {
  background: none;
  border: none;
  color: inherit;
  font-size: 10px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  padding: 2px 4px;
}
.photo-add-actions button:hover { color: var(--amber); }

.modal-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  gap: 10px;
}
.modal-actions-right { display: flex; gap: 8px; }

/* Notes & closing notes */
.notes-section {
  margin: 4px 0 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}
.notes-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; max-height: 220px; overflow-y: auto; }
.note-item {
  background: var(--bg-inset);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.note-item.is-closing { border-color: var(--complete); background: var(--complete-bg); }
.note-item-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}
.note-item-author { font-size: 12px; font-weight: 600; color: var(--ink); }
.note-item.is-closing .note-item-author::before { content: "✓ Closing note · "; color: var(--complete); font-weight: 700; }
.note-item-date { font-size: 10.5px; color: var(--ink-faint); font-family: var(--font-mono); white-space: nowrap; }
.note-item-body { font-size: 13.5px; color: var(--ink-dim); line-height: 1.45; white-space: pre-wrap; }
.note-item-remove {
  background: none;
  border: none;
  color: var(--ink-faint);
  font-size: 11px;
  cursor: pointer;
  margin-top: 6px;
  padding: 0;
}
.note-item-remove:hover { color: var(--open); }
.add-note-row { display: flex; gap: 8px; align-items: flex-start; }
.add-note-row textarea { flex: 1; resize: vertical; min-height: 40px; }

/* Camera */
.camera-modal { max-width: 480px; }
.camera-stage {
  background: #000;
  border-radius: var(--radius-sm);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 8px 0 14px;
}
.camera-stage video, .camera-stage img { width: 100%; height: 100%; object-fit: cover; }
.camera-actions { display: flex; justify-content: center; gap: 10px; }

/* Settings modal */
.settings-modal { max-width: 440px; }
.settings-modal h3 { font-size: 22px; margin: 4px 0 20px; }
.settings-section { margin-bottom: 22px; }
.settings-section h4 {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 10px;
  font-weight: 600;
}
.invite-code-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-inset);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 6px;
}
.invite-code-row code {
  font-family: var(--font-mono);
  font-size: 20px;
  letter-spacing: 0.2em;
  color: var(--amber);
  flex: 1;
}
.members-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.members-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13.5px;
  padding: 8px 10px;
  background: var(--bg-inset);
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-soft);
}
.members-list .member-role {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  color: var(--ink-faint);
  letter-spacing: 0.06em;
}
.pending-invites-list { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.pending-invite-chip {
  font-size: 12.5px;
  color: var(--ink-faint);
  background: var(--bg-inset);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
}

/* ---------------------------------------------------------------
   Toasts
--------------------------------------------------------------- */
.toast-stack {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-left: 4px solid var(--amber);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13.5px;
  color: var(--ink);
  box-shadow: var(--shadow-card);
  min-width: 220px;
  animation: slideIn 0.2s ease;
}
.toast.is-error { border-left-color: var(--open); }
@keyframes slideIn {
  from { opacity: 0; transform: translateX(16px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ---------------------------------------------------------------
   Empty states
--------------------------------------------------------------- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-faint);
}
.empty-state h3 { color: var(--ink-dim); margin-bottom: 8px; }

@media (max-width: 560px) {
  .topbar { padding: 10px 14px; }
  .main-view { padding: 22px 14px 50px; }
  .household-switch { font-size: 15px; }
  .user-chip span:last-child { display: none; }
}

/* ---------------------------------------------------------------
   Photo lightbox — pop-out zoomable viewer
--------------------------------------------------------------- */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 5, 4, 0.94);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  user-select: none;
}
.lightbox-stage {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: none;
}
.lightbox-stage img {
  max-width: 92vw;
  max-height: 86vh;
  object-fit: contain;
  will-change: transform;
  transform-origin: center center;
  cursor: grab;
  touch-action: none;
}
.lightbox-stage img:active { cursor: grabbing; }

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 18px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 2;
}
.lightbox-close:hover { background: rgba(255, 255, 255, 0.16); }

.lightbox-counter {
  position: absolute;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.7);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  z-index: 2;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}
.lightbox-nav:hover { background: rgba(255, 255, 255, 0.16); }
.lightbox-prev { left: 14px; }
.lightbox-next { right: 14px; }
.lightbox-nav:disabled { opacity: 0.25; cursor: default; }

.lightbox-hint {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.45);
  font-size: 11.5px;
  font-family: var(--font-mono);
  letter-spacing: 0.03em;
  text-align: center;
  white-space: nowrap;
}

@media (max-width: 560px) {
  .lightbox-hint { font-size: 10px; white-space: normal; padding: 0 20px; }
  .lightbox-nav { width: 38px; height: 38px; font-size: 20px; }
}
