/* =====================================================================
   MONSTAYNI Housekeeping — design system
   Mobile first. Desktop second. Calm above all.

   The anxiety rules from the plan are enforced here, not just documented:
   there is no red in the staff palette, no countdown styling, and every
   interactive target is at least 56px tall. If a future change needs a
   warning colour on a staff screen, that is a design conversation, not a
   CSS one.
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  /* Brand — sampled from logo2.png */
  --green-900: #0E241F;
  --green-700: #173A34;
  --green-500: #2E5C51;
  --green-300: #4F8A76;
  --green-100: #DCE8E3;
  --green-050: #F1F6F3;

  --cream:     #E7E7DD;
  --paper:     #FAFAF6;
  --surface:   #FFFFFF;
  --ink:       #12211D;
  --ink-soft:  #5A6B66;
  --ink-faint: #8A9691;
  --line:      #E6E9E5;

  /* Semantic — status only, never decoration */
  --ok:      #3E8E6B;
  --ok-bg:   #E8F3ED;
  --busy:    #C8A24A;
  --busy-bg: #FBF3E0;
  --calm:    #6E8FA6;
  --calm-bg: #EAF0F4;
  --sand:    #B79A63;
  --sand-bg: #F7F1E4;
  --muted:   #8A9691;
  --muted-bg:#F0F2F0;

  /* --alert is ADMIN ONLY. Never apply it to anything under /staff. */
  --alert:    #B8654F;
  --alert-bg: #F9EBE7;

  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 28px;
  --r-pill: 999px;

  --tap: 56px;
  --pad: 16px;
  --maxw: 720px;

  --shadow-sm: 0 1px 2px rgba(23,58,52,.05), 0 2px 8px rgba(23,58,52,.04);
  --shadow-md: 0 2px 6px rgba(23,58,52,.06), 0 8px 24px rgba(23,58,52,.07);
  --shadow-lg: 0 10px 40px rgba(23,58,52,.14);

  --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI',
          Roboto, 'Helvetica Neue', Arial, sans-serif;

  --fs-base: 17px;
  --ease: cubic-bezier(.22,.61,.36,1);
}

/* Explicitly requested for elderly and low-vision staff. One tap, persisted. */
body.large-text { --fs-base: 20px; --tap: 62px; }

/* ------------------------------------------------------------------ reset */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: contain;
}

h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.25; font-weight: 700; letter-spacing: -.015em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p  { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--green-500); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }

img { max-width: 100%; height: auto; display: block; }

button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible {
  outline: 3px solid var(--green-300);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ------------------------------------------------------------------ shell */

.shell { min-height: 100dvh; display: flex; flex-direction: column; }

.appbar {
  position: sticky; top: 0; z-index: 40;
  background: var(--green-700);
  color: var(--cream);
  padding: calc(env(safe-area-inset-top, 0px) + 12px) var(--pad) 12px;
  display: flex; align-items: center; gap: 12px;
}
.appbar__logo { height: 26px; width: auto; }
.appbar__title { font-size: .95rem; font-weight: 600; letter-spacing: .01em; opacity: .92; }
.appbar__spacer { margin-left: auto; }

.appbar__btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 42px; height: 42px; padding: 0 10px;
  background: rgba(231,231,221,.12);
  color: var(--cream);
  border: 0; border-radius: var(--r-sm);
  cursor: pointer; text-decoration: none;
  transition: background .16s var(--ease);
}
.appbar__btn:hover { background: rgba(231,231,221,.2); }
.appbar__btn svg { width: 20px; height: 20px; }

.main {
  flex: 1;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--pad) var(--pad) 120px;
}
.main--wide { max-width: 1240px; }

/* Bottom navigation — thumb reach is the whole point */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 45;
  display: flex;
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-shadow: 0 -2px 16px rgba(23,58,52,.05);
}
.tabbar a {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px;
  min-height: var(--tap);
  padding: 9px 4px;
  color: var(--ink-faint);
  text-decoration: none;
  font-size: .68rem; font-weight: 600;
}
.tabbar a svg { width: 22px; height: 22px; }
.tabbar a[aria-current="page"] { color: var(--green-700); }
.tabbar a[aria-current="page"] svg { stroke-width: 2.4; }

/* --------------------------------------------------------------- headings */

.page-head { margin-bottom: 18px; }
.page-head h1 { margin-bottom: 2px; }
.page-head .sub { color: var(--ink-soft); font-size: .95rem; }

.greeting { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; margin-bottom: 2px; }
.greeting + .sub { color: var(--ink-soft); font-size: .95rem; }

.section-label {
  font-size: .74rem; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; color: var(--ink-faint);
  margin: 26px 0 10px;
}
.section-label:first-child { margin-top: 0; }

/* ------------------------------------------------------------------ cards */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 12px; }
.card--flush { padding: 0; overflow: hidden; }
.card--tint  { background: var(--green-050); border-color: var(--green-100); }
.card--dark  { background: var(--green-700); color: var(--cream); border-color: transparent; }
.card--dark .card__meta, .card--dark .sub { color: rgba(231,231,221,.72); }

.card__row {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  text-decoration: none; color: inherit;
  min-height: var(--tap);
}
.card__row:last-child { border-bottom: 0; }
.card__row:active { background: var(--green-050); }
.card__row .grow { flex: 1; min-width: 0; }
.card__title { font-weight: 700; }
.card__meta  { color: var(--ink-soft); font-size: .875rem; }

/* -------------------------------------------------------------- room cards
   Colour carries meaning here, and the meaning is consistent everywhere:
   cream = waiting, amber = happening, green = finished, grey = left alone.
   Nothing on this screen is ever red. */

.room {
  display: block;
  position: relative;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-left: 6px solid var(--green-100);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  margin-bottom: 12px;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: transform .14s var(--ease), box-shadow .14s var(--ease);
}
.room:active { transform: scale(.985); }

.room__top { display: flex; align-items: baseline; gap: 10px; }
.room__number { font-size: 1.3rem; font-weight: 800; letter-spacing: -.02em; }
.room__type   { color: var(--ink-soft); font-size: .9rem; font-weight: 500; }
.room__note {
  margin-top: 10px; padding: 10px 12px;
  background: var(--busy-bg);
  border-radius: var(--r-sm);
  font-size: .875rem; line-height: 1.5;
}
.room__foot {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 12px;
}

.room.st-pending  { border-left-color: var(--green-300); }
.room.st-progress { border-left-color: var(--busy); background: linear-gradient(180deg, var(--busy-bg) 0%, var(--surface) 46%); }
.room.st-done     { border-left-color: var(--ok); background: var(--ok-bg); border-color: #CFE6DA; }
.room.st-done .room__number { color: var(--green-700); }
.room.st-skipped  { border-left-color: var(--muted); background: var(--muted-bg); opacity: .82; }
.room.st-rework   { border-left-color: var(--sand); background: var(--sand-bg); }

.room__tick {
  position: absolute; top: 16px; right: 16px;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--ok); color: #fff;
  display: grid; place-items: center;
}
.room__tick svg { width: 18px; height: 18px; }

/* ----------------------------------------------------------------- chips */

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px;
  border-radius: var(--r-pill);
  font-size: .78rem; font-weight: 700;
  letter-spacing: .01em;
  background: var(--muted-bg); color: var(--ink-soft);
  white-space: nowrap;
}
.chip svg { width: 14px; height: 14px; }
.chip--ok    { background: var(--ok-bg);   color: #2C6B4E; }
.chip--busy  { background: var(--busy-bg); color: #8A6C1F; }
.chip--calm  { background: var(--calm-bg); color: #3F6076; }
.chip--sand  { background: var(--sand-bg); color: #7A6231; }
.chip--green { background: var(--green-100); color: var(--green-700); }
.chip--alert { background: var(--alert-bg); color: #8E4635; }   /* admin only */
.chip--outline { background: transparent; border: 1.5px solid var(--line); }

/* --------------------------------------------------------------- buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: var(--tap);
  padding: 0 24px;
  border: 0; border-radius: var(--r-md);
  background: var(--green-700); color: var(--cream);
  font-size: 1rem; font-weight: 700; letter-spacing: .005em;
  text-decoration: none; cursor: pointer;
  transition: transform .12s var(--ease), background .16s var(--ease), opacity .16s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.975); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.btn svg { width: 20px; height: 20px; flex: none; }

.btn--block  { width: 100%; }
.btn--lg     { min-height: 64px; font-size: 1.1rem; border-radius: var(--r-lg); }
.btn--ghost  { background: transparent; color: var(--green-700); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn--ghost:hover { background: var(--green-050); }
.btn--soft   { background: var(--green-100); color: var(--green-700); }
.btn--ok     { background: var(--ok); color: #fff; }
.btn--quiet  { background: transparent; color: var(--ink-soft); min-height: 44px; padding: 0 12px; font-weight: 600; }
.btn--sm     { min-height: 42px; padding: 0 16px; font-size: .875rem; border-radius: var(--r-sm); }
.btn--danger { background: var(--alert); color: #fff; }          /* admin only */

/* The one primary action, parked where a thumb naturally rests */
.action-dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 44;
  padding: 14px var(--pad) calc(env(safe-area-inset-bottom, 0px) + 14px);
  background: linear-gradient(180deg, rgba(250,250,246,0) 0%, var(--paper) 34%);
  pointer-events: none;
}
.action-dock > * { pointer-events: auto; }
.action-dock .btn { box-shadow: var(--shadow-lg); }
.has-dock .main { padding-bottom: 140px; }
.has-dock.has-tabs .main { padding-bottom: 200px; }
.has-dock .tabbar { display: none; }

/* -------------------------------------------------------------- progress */

.progress {
  height: 12px; border-radius: var(--r-pill);
  background: var(--green-100); overflow: hidden;
}
.progress__fill {
  height: 100%; border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--green-300), var(--ok));
  transition: width .6s var(--ease);
}
.progress__label {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 8px;
}
.progress__label b { font-size: 1.05rem; }

/* Capacity bar — ADMIN board only. Amber past 100%, never red. */
.capacity { height: 8px; border-radius: var(--r-pill); background: var(--line); overflow: hidden; }
.capacity__fill { height: 100%; background: var(--green-300); transition: width .4s var(--ease); }
.capacity__fill.over { background: var(--busy); }

/* ------------------------------------------------------------- stat tiles */

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.stat {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 14px 16px;
}
.stat__value { font-size: 1.55rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.stat__label { font-size: .78rem; color: var(--ink-soft); font-weight: 600; margin-top: 2px; }
.stat--tint { background: var(--green-050); border-color: var(--green-100); }

/* ------------------------------------------------------------------ forms */

.field { margin-bottom: 18px; }
.field > label {
  display: block; font-weight: 700; font-size: .9rem;
  margin-bottom: 7px; color: var(--ink);
}
.field .hint { font-size: .84rem; color: var(--ink-soft); margin: -3px 0 8px; }

.input, .select, .textarea {
  width: 100%;
  min-height: var(--tap);
  padding: 14px 16px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  font-size: 1rem;
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
  -webkit-appearance: none; appearance: none;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--green-300);
  box-shadow: 0 0 0 4px var(--green-050);
  outline: none;
}
.textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%235A6B66' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
  padding-right: 44px;
}
.input--error { border-color: var(--alert); }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 420px) { .field-row { grid-template-columns: 1fr; } }

.check {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  cursor: pointer;
  min-height: var(--tap);
}
.check input { width: 24px; height: 24px; margin: 1px 0 0; accent-color: var(--green-700); flex: none; }
.check span { line-height: 1.45; }
.check:has(input:checked) { border-color: var(--green-300); background: var(--green-050); }

/* Radio cards — used for clean type and skip reasons */
.choice { display: grid; gap: 10px; }
.choice label {
  display: flex; align-items: center; gap: 12px;
  padding: 15px 16px; min-height: var(--tap);
  background: var(--surface); border: 1.5px solid var(--line);
  border-radius: var(--r-md); cursor: pointer;
}
.choice input { width: 22px; height: 22px; accent-color: var(--green-700); flex: none; }
.choice label:has(input:checked) { border-color: var(--green-500); background: var(--green-050); box-shadow: 0 0 0 3px var(--green-050); }
.choice .t { font-weight: 700; }
.choice .d { font-size: .84rem; color: var(--ink-soft); }

/* ------------------------------------------------------------- OTP boxes */

.otp {
  display: flex; gap: 9px; justify-content: center;
  margin: 4px 0 8px;
}
.otp input {
  width: 100%; max-width: 56px; aspect-ratio: 1 / 1.18;
  text-align: center;
  font-size: 1.55rem; font-weight: 800;
  border: 2px solid var(--line); border-radius: var(--r-md);
  background: var(--surface);
  -webkit-appearance: none; appearance: none;
}
.otp input:focus { border-color: var(--green-500); box-shadow: 0 0 0 4px var(--green-050); outline: none; }
.otp input.filled { border-color: var(--green-300); background: var(--green-050); }

/* ------------------------------------------------------------------ auth */

.auth {
  min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px 20px calc(env(safe-area-inset-bottom,0px) + 24px);
  background:
    radial-gradient(1100px 460px at 50% -8%, var(--green-100) 0%, transparent 62%),
    var(--paper);
}
.auth__card {
  width: 100%; max-width: 400px;
  background: var(--surface);
  border-radius: var(--r-xl);
  padding: 30px 24px 26px;
  box-shadow: var(--shadow-md);
}
.auth__logo { height: 42px; width: auto; margin: 0 auto 22px; border-radius: 2rem; }
.auth h1 { font-size: 1.4rem; text-align: center; margin-bottom: 6px; }
.auth .sub { text-align: center; color: var(--ink-soft); font-size: .93rem; margin-bottom: 22px; }
.auth__foot { text-align: center; margin-top: 18px; font-size: .85rem; color: var(--ink-faint); }

/* ---------------------------------------------------------------- notices */

.notice {
  display: flex; gap: 11px; align-items: flex-start;
  padding: 14px 16px;
  border-radius: var(--r-md);
  font-size: .92rem; line-height: 1.5;
  margin-bottom: 14px;
}
.notice svg { width: 19px; height: 19px; flex: none; margin-top: 2px; }
.notice--ok    { background: var(--ok-bg);   color: #2A6349; }
.notice--info  { background: var(--calm-bg); color: #3A5A70; }
.notice--warn  { background: var(--busy-bg); color: #7E621B; }
.notice--error { background: var(--alert-bg);color: #8E4635; }

/* Empty states are warm, never blank or scolding */
.empty {
  text-align: center;
  padding: 44px 24px;
  color: var(--ink-soft);
}
.empty svg { width: 46px; height: 46px; color: var(--green-300); margin: 0 auto 14px; }
.empty h3 { color: var(--ink); margin-bottom: 6px; }
.empty p { font-size: .93rem; max-width: 34ch; margin: 0 auto; }

/* ----------------------------------------------------------------- toasts */

.toasts {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(env(safe-area-inset-bottom,0px) + 92px);
  z-index: 90; width: calc(100% - 32px); max-width: 440px;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  background: var(--green-700); color: var(--cream);
  padding: 14px 18px; border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  font-size: .93rem; font-weight: 600;
  animation: toast-in .28s var(--ease);
}
.toast svg { width: 18px; height: 18px; flex: none; }
.toast--ok   { background: var(--ok); color: #fff; }
.toast--warn { background: #7E621B; color: #fff; }
.toast--err  { background: #8E4635; color: #fff; }
.toast.leaving { animation: toast-out .22s var(--ease) forwards; }

@keyframes toast-in  { from { opacity: 0; transform: translateY(14px) scale(.97); } }
@keyframes toast-out { to   { opacity: 0; transform: translateY(10px) scale(.97); } }

/* ----------------------------------------------------------------- sheet */

.sheet-backdrop {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(14,36,31,.42);
  backdrop-filter: blur(2px);
  animation: fade-in .2s var(--ease);
}
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 81;
  background: var(--surface);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 10px var(--pad) calc(env(safe-area-inset-bottom,0px) + 20px);
  max-height: 88dvh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: sheet-up .3s var(--ease);
}
.sheet__grip {
  width: 40px; height: 4px; border-radius: var(--r-pill);
  background: var(--line); margin: 6px auto 16px;
}
.sheet h2 { margin-bottom: 14px; }

@keyframes fade-in { from { opacity: 0; } }
@keyframes sheet-up { from { transform: translateY(100%); } }

@media (min-width: 720px) {
  .sheet {
    left: 50%; right: auto; bottom: auto; top: 50%;
    transform: translate(-50%, -50%);
    width: min(560px, 92vw);
    border-radius: var(--r-xl);
    animation: fade-in .2s var(--ease);
  }
  .sheet__grip { display: none; }
}

/* --------------------------------------------------------------- timer */

.timer {
  font-variant-numeric: tabular-nums;
  font-size: 2.9rem; font-weight: 800; letter-spacing: -.03em;
  line-height: 1;
}
/* Counts UP. There is deliberately no "over time" state — the target is a
   guide, and styling an overrun would turn a guide into a reprimand. */
.timer__hint { color: var(--ink-soft); font-size: .9rem; margin-top: 6px; }

/* A steady status dot. It used to blink on a 2.4s loop; a marker that never
   stops moving pulls the eye back to it all day and reads as an alert, which
   is the opposite of what "in progress" should feel like. Colour alone carries
   the meaning perfectly well. */
.status-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--busy); display: inline-block; flex: none;
}
.status-dot--live { background: var(--ok); }

/* ----------------------------------------------------------------- photos */

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 9px; }
.photo-tile {
  position: relative; aspect-ratio: 1;
  border-radius: var(--r-md); overflow: hidden;
  background: var(--muted-bg);
  border: 1.5px solid var(--line);
}
.photo-tile img { width: 100%; height: 100%; object-fit: cover; }
.photo-tile__x {
  position: absolute; top: 5px; right: 5px;
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(14,36,31,.72); color: #fff; border: 0;
  display: grid; place-items: center; cursor: pointer;
}
.photo-tile__x svg { width: 15px; height: 15px; }
.photo-tile__bar {
  position: absolute; left: 0; right: 0; bottom: 0; height: 4px;
  background: rgba(255,255,255,.35);
}
.photo-tile__bar i { display: block; height: 100%; background: var(--ok); transition: width .3s var(--ease); }
/* Distance badge on a verification thumbnail: how far the staff member was
   from the property when that specific photo was taken. Admin screens only. */
.photo-tile__dist {
  position: absolute; left: 4px; bottom: 4px;
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 7px 2px 5px;
  border-radius: var(--r-pill);
  background: rgba(14, 36, 31, .82);
  color: var(--cream);
  font-size: .62rem; font-weight: 800; letter-spacing: .01em;
  line-height: 1.5;
  pointer-events: none;
  backdrop-filter: blur(2px);
}
.photo-tile__dist svg { width: 10px; height: 10px; opacity: .85; }
.photo-tile__dist.out  { background: rgba(184, 101, 79, .94); color: #fff; }
.photo-tile__dist.none { background: rgba(90, 107, 102, .82); }

.photo-tile.queued { opacity: .72; }
.photo-tile.queued::after {
  content: 'Waiting for signal';
  position: absolute; inset: auto 0 0 0;
  background: rgba(14,36,31,.78); color: #fff;
  font-size: .62rem; font-weight: 700; text-align: center; padding: 4px 2px;
}

.photo-add {
  aspect-ratio: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  border: 2px dashed var(--green-300);
  border-radius: var(--r-md);
  background: var(--green-050);
  color: var(--green-700);
  font-size: .74rem; font-weight: 700;
  cursor: pointer;
}
.photo-add svg { width: 24px; height: 24px; }

/* --------------------------------------------------------------- lightbox */

.lightbox {
  position: fixed; inset: 0; z-index: 95;
  background: rgba(8,20,17,.94);
  display: flex; flex-direction: column;
}
.lightbox__stage { flex: 1; display: grid; place-items: center; padding: 16px; min-height: 0; }
.lightbox__stage img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: var(--r-md); }
.lightbox__bar {
  display: flex; align-items: center; gap: 12px;
  padding: 14px var(--pad) calc(env(safe-area-inset-bottom,0px) + 14px);
  color: var(--cream); background: rgba(0,0,0,.35);
}
.lightbox__meta { flex: 1; font-size: .82rem; line-height: 1.5; opacity: .9; }
.lightbox__meta b { display: block; font-size: .95rem; opacity: 1; }
.lightbox__nav {
  width: 46px; height: 46px; border-radius: 50%; border: 0;
  background: rgba(231,231,221,.14); color: var(--cream);
  display: grid; place-items: center; cursor: pointer;
}
.lightbox__nav svg { width: 22px; height: 22px; }
.lightbox__close {
  position: absolute; top: calc(env(safe-area-inset-top,0px) + 12px); right: 12px;
  width: 44px; height: 44px; border-radius: 50%; border: 0;
  background: rgba(231,231,221,.16); color: var(--cream);
  display: grid; place-items: center; cursor: pointer; z-index: 2;
}

/* ------------------------------------------------------------------ misc */

.list-plain { list-style: none; margin: 0; padding: 0; }
.muted { color: var(--ink-soft); }
.faint { color: var(--ink-faint); }
.small { font-size: .85rem; }
.tiny  { font-size: .75rem; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.row { display: flex; align-items: center; gap: 10px; }
.row--between { justify-content: space-between; }
.row--wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.stack { display: grid; gap: 12px; }
.hidden { display: none !important; }

.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; flex: none;
  color: #fff; font-weight: 800; font-size: .82rem;
  letter-spacing: .02em;
}
.avatar--sm { width: 30px; height: 30px; font-size: .68rem; }
.avatar--lg { width: 58px; height: 58px; font-size: 1.1rem; }

.divider { height: 1px; background: var(--line); margin: 18px 0; border: 0; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: .9rem; }
.kv dt { color: var(--ink-soft); }
.kv dd { margin: 0; font-weight: 600; text-align: right; }

.skeleton {
  background: linear-gradient(90deg, var(--muted-bg) 25%, #F7F8F7 50%, var(--muted-bg) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite;
  border-radius: var(--r-sm);
}
@keyframes shimmer { to { background-position: -200% 0; } }

.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Screen-reader only */
.sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* --------------------------------------------------------------- desktop */

@media (min-width: 900px) {
  .main { padding: 28px 28px 60px; }
  .has-dock .main { padding-bottom: 60px; }

  .tabbar {
    position: sticky; top: 0; bottom: auto;
    border-top: 0; border-bottom: 1px solid var(--line);
    box-shadow: none;
    max-width: 1240px; margin: 0 auto;
  }
  .tabbar a { flex-direction: row; gap: 8px; font-size: .85rem; min-height: 52px; }

  .has-dock .tabbar { display: flex; }
  .action-dock {
    position: sticky; bottom: 20px;
    max-width: var(--maxw); margin: 20px auto 0;
    background: none; padding: 0;
  }
}
