:root {
  --bg-color: #FFFFFF;
  --panel-bg: #F5F5F7;
  --text-main: #1D1D1F;
  --text-muted: #86868B;
  --text-light: #A1A1A6;
  --pill-bg: #EAEAEB;
  --pill-active: #FFFFFF;
  --accent-color: #000000;
  --font-serif: 'Newsreader', 'Iowan Old Style', Georgia, serif;
  --font-sans: 'Inter', system-ui, sans-serif;
  --radius-card: 28px;
  --radius-pill: 999px;
  --shadow-subtle: 0 2px 12px rgba(0, 0, 0, 0.04);
  --shadow-float: 0 8px 32px rgba(0, 0, 0, 0.08);
  --hairline: rgba(0, 0, 0, 0.03);
  --tab-h: 64px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg-color); color: var(--text-main); font-family: var(--font-sans); font-weight: 400; }
body { min-height: 100vh; }
button, input, textarea, select { font-family: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
img, video { max-width: 100%; display: block; }
.num { font-variant-numeric: tabular-nums; font-family: var(--font-sans); font-weight: 500; }

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 80;
  opacity: 0.03;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

.shell { min-height: 100vh; }
.guest-col { width: min(100%, 480px); margin: 0 auto; }
.wide { width: min(100%, 980px); margin: 0 auto; padding: 0 20px 96px; }
.page-title { font-family: var(--font-serif); font-weight: 400; font-size: 42px; letter-spacing: -0.02em; line-height: 1.05; margin: 8px 0 18px; }
.lede { color: var(--text-muted); font-size: 15px; line-height: 1.45; margin: 0 0 22px; }
.home-line { font-family: var(--font-serif); font-weight: 400; font-size: 18px; letter-spacing: -0.02em; line-height: 1.35; margin: 0; }

.wordmark { font-family: var(--font-sans); font-weight: 500; letter-spacing: 0.14em; font-size: 13px; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 18px 18px 8px; }
.top-links { display: flex; gap: 14px; align-items: center; color: var(--text-muted); font-size: 13px; font-weight: 500; }

.impersonation {
  position: sticky; top: 0; z-index: 40;
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
  padding: 10px 16px; background: rgba(255,255,255,0.6);
  backdrop-filter: blur(20px); border-bottom: 1px solid var(--hairline);
  font-size: 13px;
}
.impersonation button { background: var(--accent-color); color: white; border: 0; border-radius: var(--radius-pill); padding: 8px 12px; font-size: 13px; font-weight: 500; }

.pills { display: none; }
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: rgba(255,255,255,0.72); backdrop-filter: blur(20px);
  border-top: 1px solid var(--hairline); height: var(--tab-h); padding-bottom: env(safe-area-inset-bottom);
}
.tabs a { display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 500; color: var(--text-muted); }
.tabs a.on { color: var(--text-main); }

.seg { display: flex; gap: 0; background: var(--pill-bg); padding: 4px; border-radius: var(--radius-pill); width: fit-content; max-width: 100%; }
.seg button, .seg a { border: 0; background: transparent; border-radius: var(--radius-pill); padding: 8px 14px; font-size: 13px; font-weight: 500; color: var(--text-muted); }
.seg button.on, .seg a.on { background: var(--pill-active); color: var(--text-main); box-shadow: var(--shadow-subtle); }

.card {
  position: relative; overflow: hidden;
  background: var(--panel-bg); border-radius: var(--radius-card); padding: 28px;
  box-shadow: var(--shadow-subtle);
}
.card::before {
  content: ""; position: absolute; width: 180px; height: 180px; right: -40px; top: -50px;
  background: radial-gradient(circle, rgba(0,0,0,0.05), transparent 70%); pointer-events: none;
}
.card > * { position: relative; }
.card.flat { background: var(--bg-color); }

.grid-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.tile { background: var(--panel-bg); border-radius: 20px; min-height: 140px; padding: 16px; display: flex; flex-direction: column; justify-content: flex-end; }
.tile .label { font-size: 13px; font-weight: 500; margin-top: 8px; }
.tile img, .tile .swatch { width: 100%; height: 88px; object-fit: cover; border-radius: 14px; background: #ececee; }

.btn { border: 0; background: var(--accent-color); color: white; border-radius: var(--radius-pill); padding: 12px 18px; font-size: 14px; font-weight: 500; }
.btn.light { background: white; color: var(--accent-color); }
.btn.ghost { background: transparent; color: var(--text-main); }
.btn:disabled { opacity: 0.35; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.btn.slim { padding: 8px 12px; font-size: 13px; }

.sleek {
  display: inline-flex; align-items: center; gap: 6px;
  border: 0; background: transparent; color: var(--text-muted);
  font-size: 13px; font-weight: 500; padding: 0;
}
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 22px 0 10px; }
.section-head h2 { font-family: var(--font-serif); font-weight: 400; font-size: 28px; letter-spacing: -0.02em; margin: 0; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: var(--pill-bg); border-radius: var(--radius-pill); padding: 6px 10px; font-size: 12px; font-weight: 500; color: var(--text-muted); border: 0; }
.chip.on { background: var(--accent-color); color: white; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field span { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.field input, .field textarea, .field select {
  border: 0; background: var(--panel-bg); border-radius: 16px; padding: 14px 16px; font-size: 16px; outline: none;
}
.field textarea { min-height: 96px; resize: vertical; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; line-height: 1.4; margin: 10px 0; }
.check input { margin-top: 2px; }

.auth { min-height: 100vh; display: flex; flex-direction: column; }
.auth-card { width: min(100% - 32px, 420px); margin: 28px auto; }

.feed { height: calc(100vh - var(--tab-h)); scroll-snap-type: y mandatory; overflow-y: auto; }
.feed-item { position: relative; height: calc(100vh - var(--tab-h)); scroll-snap-align: start; background: #111; color: white; }
.feed-item video, .feed-item .poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.feed-shade { position: absolute; inset: auto 0 0 0; padding: 18px 16px 22px; background: linear-gradient(transparent, rgba(0,0,0,0.72)); }
.feed-shade h1 { font-family: var(--font-serif); font-weight: 400; font-size: 34px; letter-spacing: -0.02em; margin: 6px 0; }
.feed-shade p { margin: 0 0 10px; font-size: 14px; }
.feed-top { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; padding: 16px; z-index: 2; }
.feed-top .wordmark, .feed-top a, .feed-top button { color: white; }
.sky-line { font-size: 12px; color: rgba(255,255,255,0.8); margin-top: 8px; }
.timeline { position: relative; height: 3px; background: rgba(255,255,255,0.35); border-radius: 99px; margin: 10px 0; }
.timeline .fill { position: absolute; left: 0; top: 0; bottom: 0; background: white; border-radius: 99px; }
.timeline .lock { position: absolute; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: white; }

.catalog-search { display: flex; gap: 8px; margin-bottom: 14px; }
.catalog-search input { flex: 1; border: 0; background: var(--panel-bg); border-radius: var(--radius-pill); padding: 12px 16px; font-size: 15px; }
.reader-card { display: grid; grid-template-columns: 84px 1fr; gap: 14px; align-items: center; margin-bottom: 12px; }
.reader-card img, .avatar { width: 84px; height: 84px; border-radius: 24px; object-fit: cover; background: #e7e7ea; }
.avatar { display: grid; place-items: center; font-family: var(--font-serif); font-size: 28px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #111; display: inline-block; margin-right: 6px; }
.muted { color: var(--text-muted); }
.small { font-size: 13px; line-height: 1.45; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row-between { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
hr.hair { border: 0; border-top: 1px solid var(--hairline); margin: 18px 0; }

.desk-hero { padding: 8px 18px 120px; }
.desk-photo { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-card); background: var(--panel-bg); }
.sticky-book {
  position: fixed; left: 0; right: 0; bottom: var(--tab-h); z-index: 25;
  display: flex; gap: 8px; padding: 10px 16px;
  background: rgba(255,255,255,0.6); backdrop-filter: blur(20px);
}
.menu-line, .plan-line, .list-line { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--hairline); }
.lock-mark { font-size: 12px; color: var(--text-muted); }

.ring-wrap { width: 180px; height: 180px; margin: 8px auto 12px; position: relative; }
.ring-wrap svg { width: 180px; height: 180px; transform: rotate(-90deg); }
.ring-wrap circle { fill: none; stroke-width: 8; }
.ring-wrap .track { stroke: var(--pill-bg); }
.ring-wrap .val { stroke: var(--accent-color); stroke-linecap: round; }
.ring-num { position: absolute; inset: 0; display: grid; place-items: center; font-size: 42px; font-weight: 500; letter-spacing: -0.03em; }

.slot-day { margin: 14px 0; }
.slot-day h3 { font-size: 13px; font-weight: 500; color: var(--text-muted); margin: 0 0 8px; }
.slot-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.slot-grid button { border: 0; background: var(--panel-bg); border-radius: var(--radius-pill); padding: 8px 12px; font-size: 13px; font-weight: 500; }
.slot-grid button.on { background: var(--accent-color); color: white; }

.sheet, .modal, .editor {
  position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,0.28);
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet .panel, .modal .panel, .editor .panel {
  width: min(100%, 520px); background: white; border-radius: 28px 28px 0 0;
  padding: 22px 20px 28px; max-height: 92vh; overflow: auto;
  box-shadow: var(--shadow-float);
}
.amount { font-family: var(--font-serif); font-weight: 400; font-size: 48px; letter-spacing: -0.03em; margin: 4px 0 12px; }
.receipt { font-family: var(--font-serif); font-size: 32px; letter-spacing: -0.02em; }

.player { background: black; color: white; min-height: 70vh; position: relative; }
.player video { width: 100%; max-height: 70vh; object-fit: cover; background: black; }
.player-copy { background: white; color: var(--text-main); padding: 18px 18px 120px; }
.lock-card { margin-top: 12px; }

.room { height: 100vh; height: 100dvh; background: var(--bg-color); display: flex; flex-direction: column; }
.room-stage { flex: 1; min-height: 0; background: #111; margin: 12px; border-radius: var(--radius-card); position: relative; overflow: hidden; }
.room-stage iframe { position: absolute; inset: 0; width: 100% !important; height: 100% !important; border: 0; }
.room-stage video { width: 100%; height: 100%; object-fit: cover; background: #111; }
.tile video { width: 100%; height: 92px; object-fit: cover; border-radius: 16px; background: #111; }
.content-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.content-tile { display: flex; flex-direction: column; gap: 6px; background: var(--panel-bg); border-radius: 20px; padding: 10px; color: inherit; }
.content-tile img, .content-tile video { width: 100%; height: 120px; object-fit: cover; border-radius: 14px; background: #111; }
.story-face { border: 0; background: transparent; padding: 0; border-radius: 999px; display: inline-flex; }
.story-face .avatar, .story-face img { border-radius: 50%; }
.story-face .desk-photo { width: 168px; height: 168px; border-radius: 50%; }
.story-face.live { box-shadow: 0 0 0 3px #fff, 0 0 0 6px #F5C518; }
.story-face.seen { box-shadow: 0 0 0 3px #fff, 0 0 0 6px #d2d2d7; }
.story-face.mini { display: inline-flex; }
.story-tray { position: absolute; z-index: 3; top: 64px; left: 0; right: 0; display: flex; gap: 12px; overflow-x: auto; padding: 8px 16px 12px; }
.story-tray-item { border: 0; background: transparent; color: white; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; min-width: 64px; }
.story-player { position: fixed; inset: 0; z-index: 50; background: #000; color: white; }
.story-player video { width: 100%; height: 100%; object-fit: cover; }
.story-bars { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; gap: 4px; z-index: 2; }
.story-bars span { flex: 1; height: 3px; background: rgba(255,255,255,.35); border-radius: 99px; }
.story-bars span.done, .story-bars span.now { background: #fff; }
.story-top { position: absolute; top: 24px; left: 16px; right: 16px; z-index: 2; display: flex; justify-content: space-between; align-items: center; }
.story-top button { background: transparent; color: white; border: 0; }
.story-hit { position: absolute; top: 0; bottom: 0; width: 40%; background: transparent; border: 0; z-index: 2; }
.story-hit.right { right: 0; }
.thumb { width: 36px; height: 36px; border-radius: 999px; border: 0; background: var(--pill-bg); color: var(--text-main); }
.thumb.on { background: #000; color: #fff; }
.ring { width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(#000 calc(var(--p) * 1%), #e7e7ea 0); }
.ring span { width: 74px; height: 74px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-variant-numeric: tabular-nums; font-weight: 500; }
.ring.missing { background: #e7e7ea; }
.hygiene-head { display: flex; gap: 16px; align-items: center; }
.pin { margin-bottom: 12px; }
.landing { background: var(--bg-color); }
.land-bar { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; }
.land-bar nav { display: flex; gap: 16px; align-items: center; }
.land-hero { max-width: 720px; margin: 0 auto; padding: 28px 22px 8px; }
.land-price { font-size: 28px; margin: 8px 0 16px; }
.land-cta { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.land-faces { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; padding: 8px 22px 24px; max-width: 980px; margin: 0 auto; }
.land-face { background: var(--panel-bg); border-radius: 28px; overflow: hidden; }
.land-face video { width: 100%; height: 220px; object-fit: cover; background: #111; }
.land-face div { padding: 16px 18px 20px; }
.steps, .proofs { padding-left: 18px; line-height: 1.7; }
.owner-bar { margin: 12px 18px 0; padding: 10px 14px; background: var(--panel-bg); border-radius: 999px; font-size: 13px; }
.admin-shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.admin-nav { padding: 18px 12px; background: rgba(255,255,255,.6); border-right: 1px solid rgba(0,0,0,.06); }
.admin-nav a { display: block; padding: 8px 10px; border-radius: 999px; color: var(--text-muted); font-size: 14px; }
.admin-nav a.on { background: #fff; color: var(--text-main); }
.admin-main { padding: 18px 22px 48px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th, .admin-table td { text-align: left; padding: 12px 8px; border-bottom: 1px solid rgba(0,0,0,.06); height: 44px; font-variant-numeric: tabular-nums; }
.admin-table th { position: sticky; top: 0; background: #fff; }
@media (max-width: 800px) { .admin-shell { grid-template-columns: 1fr; } }
.room-local { position: absolute; width: 120px; height: 160px; right: 12px; bottom: 12px; border-radius: 18px; object-fit: cover; background: #222; }
.room-bar { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px 24px; }
.room-bar h1 { font-family: var(--font-serif); font-weight: 400; font-size: 32px; margin: 0; letter-spacing: -0.02em; }

.stars button { border: 0; background: var(--panel-bg); border-radius: var(--radius-pill); width: 42px; height: 42px; font-weight: 500; }
.stars button.on { background: var(--accent-color); color: white; }

.footer { padding: 28px 18px 28px; color: var(--text-muted); font-size: 12px; line-height: 1.6; }
.footer nav { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 8px; }
.footer nav a { color: var(--text-muted); }

.rail { display: none; }
.with-rail { display: block; }

.legal h2 { font-family: var(--font-serif); font-weight: 400; font-size: 28px; letter-spacing: -0.02em; }
.legal p { font-size: 15px; line-height: 1.55; color: var(--text-main); }

.error { color: var(--text-main); background: var(--panel-bg); border-radius: 14px; padding: 10px 12px; font-size: 13px; }

@media (min-width: 860px) {
  .tabs { display: none; }
  .sticky-book { bottom: 0; left: 50%; transform: translateX(-50%); width: min(480px, 100%); border-radius: 24px 24px 0 0; }
  .pills { display: flex; margin: 0 auto 8px; }
  .feed { height: 100vh; }
  .feed-item { height: 100vh; }
  .shell.reader { display: grid; grid-template-columns: 240px 1fr; }
  .rail {
    display: flex; flex-direction: column; gap: 8px; position: sticky; top: 0; height: 100vh; padding: 22px 16px;
    background: rgba(255,255,255,0.6); backdrop-filter: blur(20px); border-right: 1px solid var(--hairline);
  }
  .rail a { padding: 10px 12px; border-radius: var(--radius-pill); font-size: 14px; font-weight: 500; color: var(--text-muted); }
  .rail a.on { background: var(--pill-active); color: var(--text-main); box-shadow: var(--shadow-subtle); }
  .sheet, .modal, .editor { align-items: center; }
  .sheet .panel, .modal .panel, .editor .panel { border-radius: 28px; }
  .wide { padding-bottom: 48px; }
}

/* VESTA Phase 1: vertical two-part readings (Part 1 public, Part 2 extended) */
.player.vertical { display: flex; flex-direction: column; align-items: center; }
.player.vertical video, .player-locked { display: block; width: 100%; max-width: calc(78vh * 9 / 16); aspect-ratio: 9 / 16; max-height: 78vh; object-fit: contain; background: black; margin: 0 auto; }
.player.vertical .timeline { width: 100%; max-width: calc(78vh * 9 / 16); }
.player-locked { position: relative; overflow: hidden; }
.player-locked img { width: 100%; height: 100%; object-fit: cover; filter: blur(14px) brightness(0.7); transform: scale(1.08); }
.player-locked .lock-mark { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); color: white; font-size: 14px; letter-spacing: 0.04em; }
.end-card { position: absolute; left: 0; right: 0; bottom: 48px; display: flex; flex-direction: column; align-items: center; gap: 10px; color: white; text-align: center; padding: 0 16px; }
.end-card p { margin: 0; }
.end-card[hidden], .feed-end[hidden] { display: none !important; }
.feed-end { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.reading-list { display: flex; flex-direction: column; gap: 12px; margin: 8px 0 16px; }
.reading-row { display: grid; grid-template-columns: 72px 1fr; gap: 12px; background: var(--panel-bg); border-radius: 20px; padding: 10px; color: inherit; }
.reading-row img { width: 72px; height: 128px; object-fit: cover; border-radius: 14px; background: #111; }
.reading-row > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.reading-parts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.reading-line > span:last-child { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
