* { box-sizing: border-box; }

[hidden] { display: none !important; }

:root {
  --ink: #1f2430;
  --muted: #6b7280;
  --accent: #2563eb;
  --bg: #f4f1ea;
  --card: #ffffff;
  --border: #e2ddd2;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

button {
  font: inherit;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--ink);
  border-radius: 8px;
  padding: 10px 16px;
  cursor: pointer;
}
button:hover { border-color: var(--accent); }
button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}
button.primary:hover { background: #1d4fd7; }
button.small { padding: 6px 12px; font-size: 14px; }

input[type="text"], textarea {
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  width: 100%;
}
input:focus, textarea:focus { outline: 2px solid #bfdbfe; border-color: var(--accent); }

.error { color: #dc2626; font-weight: 600; }
.hint { color: var(--muted); font-size: 14px; margin: 10px 0; }

/* ---------- landing ---------- */
#screen-landing {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.landing-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px;
  max-width: 460px;
  width: 100%;
  box-shadow: 0 10px 30px rgba(0,0,0,.06);
  text-align: center;
}
.landing-card h1 { margin: 0 0 4px; font-size: 26px; }
.subtitle { color: var(--muted); margin: 0 0 28px; }
.landing-form { display: flex; flex-direction: column; gap: 10px; text-align: left; }
.landing-form h2 { font-size: 16px; margin: 0 0 2px; }
.divider {
  display: flex; align-items: center; gap: 12px;
  color: var(--muted); margin: 22px 0;
}
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
#join-code { text-transform: uppercase; letter-spacing: 4px; font-weight: 700; }

/* ---------- room ---------- */
#screen-room { max-width: 1050px; margin: 0 auto; padding: 16px 16px 90px; }

.room-header {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 8px; margin-bottom: 12px;
}
.room-title { display: flex; align-items: baseline; gap: 12px; font-size: 18px; }
.room-code {
  font-size: 14px; color: var(--muted);
  background: #fff; border: 1px dashed var(--border);
  padding: 3px 10px; border-radius: 6px;
}
.room-code b { letter-spacing: 2px; color: var(--ink); }
.room-members { display: flex; gap: 6px; flex-wrap: wrap; }
.member-chip {
  font-size: 13px; padding: 3px 10px; border-radius: 999px;
  border: 1px solid rgba(0,0,0,.08);
}

.steps-nav {
  display: flex; gap: 6px; margin-bottom: 16px;
  overflow-x: auto;
}
.steps-nav button {
  flex: 1; min-width: 70px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 6px; border-radius: 10px;
}
.steps-nav button.active {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.steps-nav button.done .step-num::after { content: " ✓"; }
.step-num { font-weight: 700; font-size: 15px; }
.step-label { font-size: 12px; }

.step-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px; margin-bottom: 14px; flex-wrap: wrap;
}
.step-header h2 { margin: 0 0 4px; font-size: 20px; }
.step-header p { margin: 0; color: var(--muted); max-width: 640px; }
.timer-box { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.timer-suggest { color: var(--muted); font-size: 13px; }
.timer-display {
  font-variant-numeric: tabular-nums;
  font-weight: 700; font-size: 20px;
  color: var(--accent);
}
.timer-display.urgent { color: #dc2626; }

.add-note-row { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.add-note-row input { flex: 1; min-width: 180px; }
.add-note-row button { white-space: nowrap; }
.hmw-prefix { align-self: center; font-weight: 700; white-space: nowrap; }

/* ---------- sticky notes ---------- */
.sticky-wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
}
.small-wall { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.sticky {
  border-radius: 4px;
  padding: 12px 12px 8px;
  min-height: 90px;
  box-shadow: 1px 3px 8px rgba(0,0,0,.12);
  display: flex; flex-direction: column;
  transform: rotate(-.4deg);
  position: relative;
  word-break: break-word;
}
.sticky:nth-child(even) { transform: rotate(.5deg); }
.sticky-text { flex: 1; font-size: 15px; line-height: 1.35; white-space: pre-wrap; }
.sticky-meta {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 8px; font-size: 12px; color: rgba(0,0,0,.55);
}
.sticky-actions { display: flex; gap: 2px; }
.sticky-actions button {
  border: none; background: none; padding: 2px 4px; font-size: 13px;
  opacity: .55; border-radius: 4px;
}
.sticky-actions button:hover { opacity: 1; background: rgba(0,0,0,.08); }

/* voting */
.vote-status { font-weight: 600; margin-bottom: 12px; }
.sticky.votable { cursor: pointer; }
.sticky.votable:hover { outline: 2px solid var(--accent); }
.sticky.chosen { outline: 3px solid #f59e0b; }
.dots { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; min-height: 14px; }
.dot {
  width: 14px; height: 14px; border-radius: 50%;
  border: 1px solid rgba(0,0,0,.25);
}
.dot.mine { cursor: pointer; box-shadow: 0 0 0 2px #fff inset; }
.vote-count { font-weight: 700; }
.star-btn { font-size: 15px; }

/* ltg */
.chosen-banner {
  background: #fff7e0; border: 1px solid #f0d47a;
  padding: 10px 14px; border-radius: 8px; margin-bottom: 14px;
}
.ltg-label { display: block; font-weight: 700; font-size: 18px; margin-bottom: 8px; }
#ltg-input { font-size: 17px; }

/* research */
.research-row input:first-child { flex: 1; }
.research-list { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-direction: column; gap: 8px; }
.research-list li {
  background: #fff; border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 14px; display: flex; gap: 10px; align-items: baseline;
}
.research-list a { color: var(--accent); word-break: break-all; }
.research-note { flex: 1; }
.research-meta { font-size: 12px; color: var(--muted); white-space: nowrap; }

.recap { margin-top: 20px; color: var(--muted); }
.recap summary { cursor: pointer; margin-bottom: 10px; }

.room-footer {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: rgba(244,241,234,.95); border-top: 1px solid var(--border);
  display: flex; justify-content: space-between;
  padding: 12px 16px;
  backdrop-filter: blur(4px);
}

.toast {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 8px;
  font-size: 14px; z-index: 50;
}

/* ---------- facilitator ---------- */
.fac-wrap { max-width: 1100px; margin: 0 auto; padding: 24px 16px; }
.fac-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px; margin-top: 20px;
}
.fac-card {
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  padding: 16px;
}
.fac-card h3 { margin: 0 0 6px; display: flex; justify-content: space-between; }
.fac-card .code-tag { font-size: 13px; color: var(--muted); letter-spacing: 1px; }
.fac-stat { font-size: 14px; color: var(--muted); margin: 3px 0; }
.fac-stat b { color: var(--ink); }
.fac-section { margin-top: 10px; font-size: 14px; }
.fac-section h4 { margin: 8px 0 4px; font-size: 13px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.fac-note { background: #fffbe6; border-radius: 4px; padding: 4px 8px; margin: 3px 0; }
.fac-login { max-width: 360px; margin: 15vh auto; display: flex; flex-direction: column; gap: 10px; }

@media (max-width: 640px) {
  .step-header { flex-direction: column; }
  .sticky-wall { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}
