:root {
  --bg: #0a0a0c;
  --ink: #f4ecd8;
  --ink-soft: rgba(244, 236, 216, 0.7);
  --ink-faint: rgba(244, 236, 216, 0.45);
  --paper: #f6f1e6;
  --paper-ink: #1a1a1a;
  --paper-ink-soft: rgba(26, 26, 26, 0.65);
  --accent: #c9a96a;
  --yes: #4a7c4a;
  --maybe: #b58900;
  --no: #993333;
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  /* Make html the positioned ancestor so #rt-layer's absolute children
   * are anchored to the document — keeps cursor coordinates consistent
   * between Chrome and Firefox. */
  position: relative;
  overflow-x: hidden;
  width: 100%;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.55;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}

/* ---------- Foto-Wand ---------- */
.wall {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
  background: #050507;
}

.wall-item {
  position: absolute;
  display: block;
  opacity: 0;
  transition: opacity 700ms ease-out;
  filter: brightness(0.85) saturate(0.95);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.55),
    0 2px 8px rgba(0, 0, 0, 0.4);
  border-radius: 2px;
  pointer-events: none;
  transform-origin: center center;
  will-change: opacity, transform;
}

.wall-item.show {
  opacity: 0.92;
}

/* Slow Ken-Burns drift while alive */
@keyframes drift {
  from { transform: var(--rot) scale(1); }
  to   { transform: var(--rot) scale(1.06); }
}
.wall-item.show {
  animation: drift 12s linear forwards;
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, transparent 20%, rgba(10,10,12,0.55) 70%, rgba(10,10,12,0.85) 100%),
    linear-gradient(180deg, rgba(10,10,12,0.55) 0%, rgba(10,10,12,0.15) 30%, rgba(10,10,12,0.15) 70%, rgba(10,10,12,0.85) 100%);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 6vh 6vw;
  text-align: center;
}

.hero-inner {
  max-width: 720px;
}

.kicker {
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.25em;
  font-size: 0.82rem;
  color: var(--accent);
  margin: 0 0 1.2rem;
}

.hero h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.6rem, 7vw, 5.4rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0 0 1.4rem;
  color: var(--ink);
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.6);
}

.hero .lead {
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  color: var(--ink-soft);
  margin: 0 0 2.5rem;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7);
}

.cta {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  padding: 0.85rem 1.8rem;
  border: 1px solid var(--accent);
  background: rgba(10, 10, 12, 0.4);
  backdrop-filter: blur(6px);
  transition: background 200ms, color 200ms;
}
.cta:hover {
  background: var(--accent);
  color: var(--bg);
}

/* ---------- Picker ---------- */
.picker {
  position: relative;
  z-index: 2;
  background: var(--paper);
  color: var(--paper-ink);
  padding: 6rem 6vw;
}

.picker-inner {
  max-width: 880px;
  margin: 0 auto;
}

.picker h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2rem, 4vw, 3rem);
  margin: 0 0 1rem;
  letter-spacing: -0.01em;
}

.picker-intro {
  color: var(--paper-ink-soft);
  margin: 0 0 2.5rem;
  max-width: 56ch;
}

.name-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 2rem;
  max-width: 400px;
}
.name-field span {
  font-family: var(--sans);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--paper-ink-soft);
}
.name-field input {
  font-family: var(--serif);
  font-size: 1.2rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid rgba(26, 26, 26, 0.25);
  background: rgba(255, 255, 255, 0.5);
  color: var(--paper-ink);
  outline: none;
  transition: border-color 150ms;
}
.name-field input:focus {
  border-color: var(--accent);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1.6rem;
  margin-bottom: 2rem;
  font-family: var(--sans);
  font-size: 0.9rem;
  color: var(--paper-ink-soft);
}
.legend-item { display: inline-flex; align-items: center; gap: 0.5rem; }
.dot {
  width: 14px; height: 14px; border-radius: 50%;
  display: inline-block;
  border: 1px solid rgba(26, 26, 26, 0.3);
}
.dot-yes { background: var(--yes); }
.dot-maybe { background: var(--maybe); }
.dot-no { background: var(--no); }
.dot-empty { background: transparent; }

/* ---- HvS Stundenplan-Stil ---- */
.picker {
  background: #f3f3f0;
}
.picker .picker-inner {
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
  color: #1a1a1a;
  max-width: 1100px;
}
.hvs-header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  border-bottom: 1px solid #1a1a1a;
  padding-bottom: 4px;
  font-size: 10.5pt;
  line-height: 1.25;
  align-items: end;
}
.hvs-school-name { font-weight: bold; font-size: 11pt; }
.hvs-school-addr { font-size: 10pt; }
.hvs-title { font-size: 10.5pt; line-height: 1.3; }
.hvs-class {
  display: flex;
  align-items: baseline;
  gap: 18px;
  margin: 10px 0 12px;
}
.hvs-class-code {
  font-size: 40pt;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -1px;
}
.hvs-class-full { font-size: 16pt; }
.hvs-name-field {
  margin: 0 0 14px;
  max-width: 360px;
}
.hvs-name-field span {
  font-size: 9pt;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #4a4a4a;
}
.hvs-name-field input {
  font-family: Arial, sans-serif;
  font-size: 11pt;
  padding: 5px 9px;
  border: 1px solid #1a1a1a;
  background: #fff;
  border-radius: 0;
}
.hvs-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 8px;
  font-size: 9pt;
  color: #1a1a1a;
}
.hvs-grid-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 18px;
  align-items: start;
  margin-bottom: 0.5rem;
}
.hvs-legend-block {
  font-family: Arial, sans-serif;
  font-size: 9.5pt;
  border: 1px solid #1a1a1a;
  background: #fff;
  padding: 10px 12px;
}
.hvs-legend-title {
  font-weight: 700;
  font-size: 10pt;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.15);
  padding-bottom: 6px;
}
.hvs-legend-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.hvs-legend-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 9pt;
  line-height: 1.2;
}
.hvs-legend-cell {
  position: relative;
  width: 140px;
  height: 78px;
  flex: none;
  border: 1px solid #1a1a1a;
  padding: 6px 10px 6px;
  font-family: Arial, sans-serif;
  cursor: default;
}
.hvs-legend-cell .hvs-cell-subj {
  font-size: 13pt;
  font-weight: 700;
  text-align: center;
  padding-top: 18px;
  letter-spacing: 0.5px;
}
.hvs-legend-cell .hvs-cell-meta {
  position: absolute;
  bottom: 5px;
  left: 10px;
  right: 10px;
  display: flex;
  justify-content: space-between;
  font-size: 9pt;
  font-weight: 500;
}
.hvs-legend-cell-empty {
  background: #fff;
  color: #1a1a1a;
}
.hvs-legend-end {
  font-size: 7.5pt;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #555;
  flex: 1;
  min-width: 0;
}
@media (max-width: 800px) {
  .hvs-grid-wrap { grid-template-columns: 1fr; }
  .hvs-legend-block { padding: 8px 10px; }
}

.hvs-plan {
  border-collapse: collapse;
  width: 100%;
  table-layout: fixed;
  font-family: Arial, sans-serif;
  margin-bottom: 0;
  background: #fff;
}
.hvs-cell.neutral {
  cursor: pointer;
}
.hvs-plan th, .hvs-plan td {
  border: 1px solid #1a1a1a;
  padding: 0;
  vertical-align: middle;
}
.hvs-plan thead th {
  background: #d6d6d6;
  font-weight: bold;
  font-size: 13pt;
  text-align: center;
  padding: 9px 0 8px;
}
.hvs-plan thead th:first-child {
  width: 42px;
}
.hvs-plan tbody th {
  background: #d6d6d6;
  font-size: 16pt;
  font-weight: 700;
  text-align: center;
  width: 42px;
}
.hvs-plan tbody td { height: 78px; }
.hvs-cell {
  position: relative;
  height: 100%;
  padding: 4px 8px 6px;
  cursor: pointer;
  user-select: none;
  display: block;
}
.hvs-cell-time {
  position: absolute;
  top: 4px; left: 8px;
  font-size: 9pt;
  font-weight: 700;
  letter-spacing: 0.2px;
}
.hvs-cell-subj {
  font-size: 13pt;
  font-weight: 700;
  text-align: center;
  padding-top: 22px;
  letter-spacing: 0.5px;
}
.hvs-cell-meta {
  position: absolute;
  bottom: 4px;
  left: 8px;
  right: 8px;
  display: flex;
  justify-content: space-between;
  font-size: 9pt;
  font-weight: 500;
  letter-spacing: 0.2px;
}
.hvs-cell-counts {
  position: absolute;
  top: 4px;
  right: 8px;
  font-size: 8pt;
  font-weight: 500;
  opacity: 0.7;
  font-variant-numeric: tabular-nums;
}
.hvs-cell.top                { outline: 3px solid #1a1a1a; outline-offset: -3px; }
/* Vote pill sits in the centre of the lehrer/raum bottom row, between the
 * teacher initial on the left and the room on the right. */
.hvs-cell-vote-pill {
  flex: 0 0 auto;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 8pt;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  color: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  margin: 0 6px;
}
.hvs-cell-vote-pill[data-vote="yes"]   { background: #2c5e2c; }
.hvs-cell-vote-pill[data-vote="maybe"] { background: #b58900; color: #1a1a1a; }
.hvs-cell-vote-pill[data-vote="no"]    { background: #6b1f1f; }
.hvs-cell-meta {
  align-items: center;
}
.hvs-cell-lehrer, .hvs-cell-raum { flex: 0 0 auto; }
.hvs-foot-line {
  text-align: center;
  font-size: 9pt;
  font-style: italic;
  border-top: 1px solid #1a1a1a;
  padding: 5px 0 4px;
  margin-bottom: 2.5rem;
  color: #2a2a2a;
}
.summary { font-family: Arial, sans-serif; }
.summary h3 { font-family: Arial, sans-serif; font-weight: bold; font-size: 12pt; margin: 0 0 0.5rem; }
@media (max-width: 800px) {
  .hvs-class-code { font-size: 30pt; }
  .hvs-class-full { font-size: 13pt; }
  .hvs-plan thead th { font-size: 11pt; }
  .hvs-plan tbody th { font-size: 13pt; width: 30px; }
  .hvs-plan thead th:first-child { width: 30px; }
  .hvs-cell { padding: 3px 4px 4px; }
  .hvs-cell-time { font-size: 7.5pt; left: 4px; top: 3px; }
  .hvs-cell-subj { font-size: 10pt; padding-top: 16px; letter-spacing: 0; }
  .hvs-cell-meta { font-size: 7.5pt; left: 4px; right: 4px; gap: 2px; }
  .hvs-cell-counts { font-size: 7pt; right: 4px; top: 3px; }
  .hvs-plan tbody td { height: 64px; }
  .hvs-cell-vote-pill {
    font-size: 0;
    width: 12px;
    height: 12px;
    padding: 0;
    margin: 0 4px;
    border-radius: 50%;
    line-height: 0;
  }
  .hvs-legend-cell { width: 120px; height: 64px; padding: 4px 8px 5px; }
  .hvs-legend-cell .hvs-cell-subj { font-size: 11pt; padding-top: 14px; letter-spacing: 0.3px; }
  .hvs-legend-cell .hvs-cell-meta { font-size: 7.5pt; left: 8px; right: 8px; }
  .hvs-legend-list li { gap: 8px; }
  .hvs-legend-end { font-size: 7pt; }
}

/* legacy .slots grid retained for backward compat in case anyone references it */
.slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 3rem;
}

.slot {
  position: relative;
  padding: 0.9rem 1rem 1rem;
  border: 1px solid rgba(26, 26, 26, 0.18);
  background: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  user-select: none;
  transition: background 150ms, border-color 150ms, transform 80ms;
  font-family: var(--sans);
}
.slot:hover { background: rgba(255, 255, 255, 0.85); }
.slot:active { transform: translateY(1px); }
.slot.disabled { cursor: default; opacity: 0.5; }

.slot-weekday {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--paper-ink-soft);
}
.slot-date {
  font-family: var(--serif);
  font-size: 1.55rem;
  margin: 0.15rem 0 0.55rem;
  letter-spacing: -0.01em;
}
.slot-bar {
  display: flex;
  height: 4px;
  background: rgba(26, 26, 26, 0.1);
  border-radius: 2px;
  overflow: hidden;
}
.slot-bar > span {
  display: block;
  height: 100%;
  transition: width 250ms;
}
.slot-bar .b-yes { background: var(--yes); }
.slot-bar .b-maybe { background: var(--maybe); }
.slot-bar .b-no { background: var(--no); }
.slot-counts {
  margin-top: 0.55rem;
  font-size: 0.78rem;
  color: var(--paper-ink-soft);
  display: flex;
  gap: 0.7rem;
}

.slot-mark {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(26, 26, 26, 0.25);
  background: transparent;
}
.slot[data-vote="yes"] { border-color: var(--yes); background: rgba(74, 124, 74, 0.08); }
.slot[data-vote="yes"] .slot-mark { background: var(--yes); border-color: var(--yes); }
.slot[data-vote="maybe"] { border-color: var(--maybe); background: rgba(181, 137, 0, 0.08); }
.slot[data-vote="maybe"] .slot-mark { background: var(--maybe); border-color: var(--maybe); }
.slot[data-vote="no"] { border-color: var(--no); background: rgba(153, 51, 51, 0.06); }
.slot[data-vote="no"] .slot-mark { background: var(--no); border-color: var(--no); }

/* Top-Slot indicator */
.slot.top {
  box-shadow: 0 0 0 2px var(--accent);
}
.slot.top::after {
  content: "Top";
  position: absolute;
  top: -10px;
  left: 12px;
  background: var(--accent);
  color: var(--bg);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 2px 8px;
}

.summary h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.5rem;
  margin: 0 0 0.8rem;
}
.participants {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-family: var(--sans);
  font-size: 0.9rem;
}
.participants li {
  padding: 0.3rem 0.7rem;
  border: 1px solid rgba(26, 26, 26, 0.2);
  background: rgba(255, 255, 255, 0.6);
  border-radius: 999px;
}
.participants .empty { color: var(--paper-ink-soft); border: none; background: none; padding: 0; }

/* ---------- Contribute ---------- */
.contribute {
  position: relative;
  z-index: 2;
  background: var(--paper);
  color: var(--paper-ink);
  padding: 0 6vw 5rem;
  border-top: 1px solid rgba(26, 26, 26, 0.08);
  margin-top: 0;
}
.contribute-inner {
  max-width: 880px;
  margin: 0 auto;
  padding-top: 5rem;
}
.contribute h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.7rem, 3.2vw, 2.4rem);
  margin: 0 0 0.8rem;
  letter-spacing: -0.01em;
}
.contribute-intro {
  color: var(--paper-ink-soft);
  margin: 0 0 2rem;
  max-width: 56ch;
}
.upload-zone {
  display: block;
  border: 2px dashed rgba(26, 26, 26, 0.25);
  background: rgba(255, 255, 255, 0.4);
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: background 150ms, border-color 150ms;
  font-family: var(--sans);
}
.upload-zone:hover { background: rgba(255, 255, 255, 0.7); border-color: var(--accent); }
.upload-zone.drag { background: rgba(201, 169, 106, 0.18); border-color: var(--accent); border-style: solid; }
.upload-prompt { display: flex; flex-direction: column; gap: 0.5rem; align-items: center; }
.upload-icon {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--accent); color: var(--bg);
  font-size: 2rem; line-height: 48px;
  margin-bottom: 0.6rem;
  font-weight: 300;
}
.upload-main {
  font-size: 1.05rem;
  color: var(--paper-ink);
}
.upload-hint {
  font-size: 0.82rem;
  color: var(--paper-ink-soft);
}
.upload-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}
.upload-list li {
  position: relative;
  aspect-ratio: 1;
  background: rgba(0, 0, 0, 0.06);
  overflow: hidden;
  border: 1px solid rgba(26, 26, 26, 0.15);
}
.upload-list img {
  width: 100%; height: 100%; object-fit: cover;
  transition: opacity 250ms;
}
.upload-list li.uploading img { opacity: 0.4; }
.upload-list li.done::after {
  content: "✓";
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(74, 124, 74, 0.7);
  color: white; font-size: 2rem;
}
.upload-list li.failed::after {
  content: "✕";
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(153, 51, 51, 0.7);
  color: white; font-size: 2rem;
}
.upload-list li .upload-progress {
  position: absolute; left: 0; bottom: 0; height: 3px;
  background: var(--accent);
  transition: width 200ms;
}
.upload-actions {
  margin-top: 1.5rem;
  display: flex; align-items: center; gap: 1rem;
  font-family: var(--sans);
}
.upload-btn {
  background: var(--accent);
  color: var(--bg);
  border: 0;
  padding: 0.8rem 1.6rem;
  font-family: var(--sans);
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: filter 150ms, transform 80ms;
}
.upload-btn:disabled {
  background: rgba(26, 26, 26, 0.18);
  color: rgba(26, 26, 26, 0.4);
  cursor: not-allowed;
}
.upload-btn:not(:disabled):hover { filter: brightness(1.1); }
.upload-btn:not(:disabled):active { transform: translateY(1px); }
.upload-status { color: var(--paper-ink-soft); font-size: 0.9rem; }

/* ---------- Footer ---------- */
.foot {
  position: relative;
  z-index: 2;
  background: var(--paper);
  color: var(--paper-ink-soft);
  padding: 2rem 6vw 3rem;
  text-align: center;
  font-family: var(--sans);
  font-size: 0.82rem;
}
.foot p { margin: 0.3rem 0; }
.foot-links a {
  color: var(--paper-ink-soft);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.foot-links a:hover { color: var(--paper-ink); }

/* ---------- Realtime Layer ---------- */
/* Layer is anchored to the document, full height. Children use top/left
 * (in document px) so coords stay identical across browsers. */
#rt-layer {
  position: absolute;
  inset: 0;
  min-height: 100%;
  pointer-events: none;
  z-index: 9000;
}
/* Zero-size anchor at the exact (x, y); children render relative to it. */
.rt-cursor {
  position: absolute;
  width: 0; height: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 200ms, top 100ms linear, left 100ms linear;
}
.rt-cursor.show { opacity: 1; }
.rt-cursor-dot {
  position: absolute;
  left: -6px; top: -6px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px rgba(255,255,255,0.9), 0 2px 8px rgba(0,0,0,0.4);
}
.rt-cursor-label {
  position: absolute;
  left: 12px; top: -10px;
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: #1a1a1a;
  background: var(--accent);
  padding: 2px 7px;
  border-radius: 999px;
  white-space: nowrap;
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rt-cursor-label:empty { display: none; }
.rt-input {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: auto;
  background: rgba(15, 15, 18, 0.92);
  color: #fff;
  border: 0;
  outline: 0;
  border-left: 3px solid var(--note-accent, var(--accent));
  border-radius: 3px;
  font-family: var(--serif);
  font-size: 1.15rem;
  padding: 0.35rem 0.7rem;
  min-width: 12rem;
  max-width: 22rem;
  z-index: 9001;
  caret-color: #fff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}
.rt-input::placeholder { color: rgba(255, 255, 255, 0.55); font-style: italic; }
.rt-note {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  font-family: var(--serif);
  font-size: 1.15rem;
  line-height: 1.3;
  color: #fff;
  background: rgba(15, 15, 18, 0.92);
  border-left: 3px solid var(--note-accent, var(--accent));
  border-radius: 3px;
  padding: 0.35rem 0.7rem;
  white-space: pre-wrap;
  max-width: 22rem;
  word-wrap: break-word;
  opacity: 1;
  transition: opacity 1500ms ease-out;
  z-index: 9001;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}
.rt-note.fade { opacity: 0; }
.rt-note-by {
  display: block;
  font-family: var(--sans);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-top: 3px;
  color: var(--note-accent, var(--accent));
}

/* Persistent comment hint top-right */
.comment-hint {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 9500;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(15, 15, 18, 0.55);
  backdrop-filter: blur(6px);
  color: rgba(255, 255, 255, 0.82);
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  border-radius: 999px;
  pointer-events: none;
  user-select: none;
}
.comment-hint .hint-key {
  display: inline-block;
  padding: 1px 7px;
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-bottom-width: 2px;
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.95);
  background: rgba(255, 255, 255, 0.08);
}

/* Archive overlay toggle (under the comment hint) */
.archive-toggle {
  position: fixed;
  top: 56px;
  right: 14px;
  z-index: 9500;
  background: rgba(15, 15, 18, 0.55);
  backdrop-filter: blur(6px);
  color: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 150ms, color 150ms;
}
.archive-toggle:hover { background: rgba(15, 15, 18, 0.75); color: #fff; }
.archive-toggle.on {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

/* Long-press visual ring — uses a CSS animation that auto-starts when the
 * element is added to the DOM, so we don't have to coax the browser into
 * a delayed transition with reflow tricks. */
.long-press-ring {
  position: fixed;
  border: 3px solid var(--accent);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 9700;
  animation: lpr-grow 350ms linear forwards;
  background: rgba(201, 169, 106, 0.18);
}
@keyframes lpr-grow {
  from { width: 10px; height: 10px; opacity: 0.4; }
  to   { width: 64px; height: 64px; opacity: 1; }
}

.rt-archive-note {
  /* Persistent notes shown when the archive overlay is on */
  pointer-events: none;
  /* Slightly muted compared to a fresh note so they read as 'historical' */
  opacity: 0.92;
}

/* ---------- Comment badges on wall items ---------- */
.wall-item { position: absolute; }
.wall-comment {
  position: absolute;
  left: 0;
  bottom: calc(-2.4rem - var(--cm-offset, 0px));
  max-width: 100%;
  font-family: var(--serif);
  font-size: 0.95rem;
  color: var(--ink);
  background: rgba(10, 10, 12, 0.7);
  padding: 4px 10px;
  border-left: 2px solid var(--accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  text-shadow: none;
}
.wall-comment-name {
  font-family: var(--sans);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-right: 6px;
}

/* ---------- Comment Modal (legacy, unused) ---------- */
.comment-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4vh 4vw;
}
.cm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 8, 10, 0.85);
  backdrop-filter: blur(8px);
  cursor: pointer;
}
.cm-content {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: 24px;
  max-width: 1200px;
  width: 100%;
  max-height: 92vh;
  background: var(--paper);
  color: var(--paper-ink);
  padding: 24px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}
.cm-close {
  position: absolute;
  top: 8px; right: 12px;
  width: 36px; height: 36px;
  background: transparent;
  border: 0;
  color: var(--paper-ink);
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
  z-index: 1;
}
.cm-close:hover { color: var(--accent); }
.cm-media-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  min-height: 200px;
  max-height: calc(92vh - 48px);
}
.cm-media-wrap img, .cm-media-wrap video {
  max-width: 100%;
  max-height: calc(92vh - 48px);
  display: block;
  object-fit: contain;
}
.cm-side {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.cm-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.3rem;
  margin: 0 0 0.8rem;
}
.cm-list {
  flex: 1;
  overflow-y: auto;
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  border: 1px solid rgba(26, 26, 26, 0.12);
  background: rgba(255, 255, 255, 0.5);
}
.cm-list li {
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid rgba(26, 26, 26, 0.08);
}
.cm-list li:last-child { border-bottom: 0; }
.cm-name {
  font-family: var(--sans);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--paper-ink-soft);
  margin-bottom: 0.25rem;
}
.cm-text {
  font-family: var(--serif);
  font-size: 1.02rem;
  line-height: 1.45;
  word-wrap: break-word;
}
.cm-form {
  display: flex;
  gap: 8px;
}
.cm-form input {
  flex: 1;
  font-family: var(--serif);
  font-size: 1rem;
  padding: 0.6rem 0.8rem;
  border: 1px solid rgba(26, 26, 26, 0.25);
  background: white;
  outline: 0;
}
.cm-form input:focus { border-color: var(--accent); }
.cm-form button {
  background: var(--accent);
  color: var(--bg);
  border: 0;
  padding: 0 1.2rem;
  font-family: var(--sans);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}

@media (max-width: 800px) {
  .cm-content { grid-template-columns: 1fr; max-height: 95vh; }
  .cm-media-wrap { max-height: 50vh; }
}

body.modal-open { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .wall-item.show { animation: none; }
  .wall-item { transition: opacity 400ms; }
}

/* Mobile: cheaper compositing — less GPU work per frame */
@media (max-width: 800px), (pointer: coarse) and (hover: none) {
  .wall-item.show { animation: none; }
  .wall-item {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
    filter: none;
    transition: opacity 500ms ease-out;
  }
  .vignette {
    background:
      radial-gradient(ellipse at center, transparent 30%, rgba(10,10,12,0.7) 90%),
      linear-gradient(180deg, rgba(10,10,12,0.45) 0%, transparent 30%, transparent 70%, rgba(10,10,12,0.7) 100%);
    backdrop-filter: none;
  }
  .cta { backdrop-filter: none; }
  .hero h1 { text-shadow: 0 1px 6px rgba(0, 0, 0, 0.7); }
  .rt-cursor { transition: opacity 200ms; }
  .rt-note { font-size: 1.2rem; }
}

@media (max-width: 600px) {
  body { font-size: 17px; }
  .picker { padding: 4rem 5vw; }
  .slots { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .slot-date { font-size: 1.3rem; }
}
