/* mesto. checklist — colours and type from mesto.apartments */
:root {
  --bone: #f7f4ef;
  --paper: #fffdfa;
  --sand: #e3dacd;
  --ink: #14100d;
  --ink-3: #564e46;
  --oak: #b38a5e;
  --terra: #8f5440; /* darker than the site's terra so it passes as text */
  --rule: rgba(20, 16, 13, 0.14);
  --rule-soft: rgba(20, 16, 13, 0.1);
  --serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --sans: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  background: var(--bone);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 19px;
  line-height: 1.4;
  -webkit-tap-highlight-color: transparent;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

.app { max-width: 560px; margin: 0 auto; }

/* ---------- header ---------- */
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 20px; padding-top: max(12px, env(safe-area-inset-top));
  background: var(--bone);
  border-bottom: 1px solid var(--rule);
}
.wordmark { font-family: var(--serif); font-size: 30px; line-height: 1; letter-spacing: -0.01em; }
.status { display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--ink-3); }
.status::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--oak); }
.status[data-state='offline']::before { background: transparent; border: 1.5px solid var(--ink-3); }
.status[data-state='connecting']::before { background: var(--sand); }

.back {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 56px; padding: 0 12px; margin-left: -12px;
  background: none; border: 0; font-size: 18px; font-weight: 600;
}

main { display: flex; flex-direction: column; gap: 28px; padding: 24px 20px 48px; }

/* ---------- type ---------- */
.eyebrow { font-size: 14px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); }
.title { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 44px; line-height: 1.05; }
.h2 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 28px; line-height: 1.15; }
.muted { color: var(--ink-3); }
.small { font-size: 15px; }
.stack { display: flex; flex-direction: column; gap: 8px; }

/* ---------- next guest card ---------- */
.card {
  display: flex; flex-direction: column; gap: 16px; width: 100%;
  padding: 20px; text-align: left;
  background: var(--paper); border: 1px solid var(--rule); border-radius: 2px;
}
.card-head { display: flex; justify-content: space-between; align-items: center; }
.card-name { font-family: var(--serif); font-size: 32px; line-height: 1.05; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; font-size: 17px; }
.facts span { display: flex; flex-direction: column; gap: 2px; }
.facts small { font-size: 14px; color: var(--ink-3); }

/* ---------- progress ---------- */
.progress-head { display: flex; justify-content: space-between; align-items: baseline; }
.progress-head .count { font-weight: 600; font-variant-numeric: tabular-nums; }
.bar { height: 4px; background: var(--rule-soft); }
.bar > span { display: block; height: 4px; width: 0; background: var(--oak); transition: width 0.4s ease; }

/* ---------- section tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile {
  display: flex; flex-direction: column; gap: 6px; align-items: flex-start;
  min-height: 104px; padding: 14px; text-align: left;
  background: var(--paper); border: 1px solid var(--rule); border-radius: 2px;
}
.tile .num { font-size: 14px; letter-spacing: 0.1em; }
.tile .name { font-size: 18px; font-weight: 600; line-height: 1.2; }
.tile .frac { font-size: 16px; font-variant-numeric: tabular-nums; }
.tile.complete { background: var(--sand); border-color: var(--sand); }
.tile[aria-current='true'] { background: var(--ink); border-color: var(--ink); color: var(--bone); }

/* ---------- items ---------- */
.section-title { display: flex; gap: 12px; align-items: baseline; margin: 0 0 8px; }
.section-title .num { font-family: var(--sans); font-size: 15px; letter-spacing: 0.1em; color: var(--ink-3); }
.item {
  display: flex; gap: 16px; align-items: flex-start; width: 100%;
  min-height: 72px; padding: 18px 4px; text-align: left;
  background: none; border: 0; border-bottom: 1px solid var(--rule-soft);
}
.box {
  flex: none; display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--paper); border: 2px solid var(--ink-3);
}
.box svg { visibility: hidden; }
.item-text { padding-top: 2px; }
.item[aria-pressed='true'] .box { background: var(--ink); border-color: var(--ink); }
.item[aria-pressed='true'] .box svg { visibility: visible; }
.item[aria-pressed='true'] .item-text { color: var(--ink-3); }

/* ---------- buttons ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; width: 100%;
  min-height: 60px; padding: 0 20px;
  background: transparent; border: 1px solid rgba(20, 16, 13, 0.35); border-radius: 2px;
  font-size: 18px; font-weight: 600; text-decoration: none;
}
.btn-primary { background: var(--ink); border-color: var(--ink); color: var(--bone); }
.btn-quiet { border-color: transparent; font-weight: 400; min-height: 56px; }
.btn:disabled { opacity: 0.45; cursor: default; }
.actions { display: flex; flex-direction: column; gap: 10px; }

/* ---------- guest detail ---------- */
.dl { margin: 0; display: flex; flex-direction: column; border-top: 1px solid var(--rule); }
.dl > div {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 16px 0; border-bottom: 1px solid var(--rule-soft);
}
.dl dt { color: var(--ink-3); }
.dl dd { margin: 0; font-weight: 600; text-align: right; }
.quote { margin: 0; display: flex; flex-direction: column; gap: 10px; padding: 20px; background: var(--paper); border: 1px solid var(--rule); border-radius: 2px; }
.quote blockquote { margin: 0; font-family: var(--serif); font-style: italic; font-size: 24px; line-height: 1.3; white-space: pre-line; }
.hint { display: flex; gap: 14px; align-items: flex-start; padding: 16px; background: var(--sand); border-radius: 2px; font-size: 18px; }
.hint svg { flex: none; margin-top: 2px; }

/* ---------- upload ---------- */
.drop {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 28px 20px; text-align: center; cursor: pointer;
  background: var(--paper); border: 1px dashed rgba(20, 16, 13, 0.35); border-radius: 2px;
}
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop strong { font-size: 18px; }
.notice { padding: 14px 16px; border-radius: 2px; font-size: 17px; background: var(--paper); border: 1px solid var(--rule); }
.notice.error { border-color: var(--terra); color: var(--terra); }

/* ---------- dialog ---------- */
dialog {
  width: min(92vw, 420px); padding: 24px; border: 1px solid var(--rule); border-radius: 2px;
  background: var(--paper); color: var(--ink);
}
dialog::backdrop { background: rgba(20, 16, 13, 0.45); }
dialog .actions { margin-top: 20px; }

/* ---------- login ---------- */
.login {
  min-height: 100vh; max-width: 460px; margin: 0 auto;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 64px 24px 40px;
}
.login .wordmark { font-size: 40px; }
.login .title { font-size: 52px; line-height: 1; }
.login form { display: flex; flex-direction: column; gap: 14px; }
.login label { font-size: 16px; font-weight: 600; }
.login input {
  height: 64px; padding: 0 18px; font-size: 22px;
  background: var(--paper); border: 1px solid rgba(20, 16, 13, 0.35); border-radius: 2px;
}
.login .btn { min-height: 64px; font-size: 19px; }
.login-main { gap: 40px; }
.login-intro { gap: 12px; }
.flush { margin: 0; }
