/* Pomodoro room: shared styles for the landing page and the room page.
   Warm paper tones, one phase color that glides between work and breaks, soft depth.
   No external fonts: the system UI font, with rounded digits where the platform has them. */

/* The phase color is a registered property so that changing it animates smoothly. */
@property --phase {
  syntax: '<color>';
  inherits: true;
  initial-value: #c4453d;
}

:root {
  color-scheme: light dark;

  --bg: #f6f1ea;
  --bg-deep: #efe7dc;
  --card: #fffcf8;
  --card-raised: #ffffff;
  --field: #f8f3ec;
  --field-hover: #f3ece3;
  --text: #2b231d;
  --text-soft: #4a3f36;
  --muted: #75695d;
  --faint: #b3a799;
  --line: #e9dfd3;
  --line-strong: #dccfc0;

  --work: #c4453d;
  --short: #2b7d56;
  --long: #2a7488;
  --on-phase: #ffffff;
  --accent: #b06a1f;
  --ok: #2b7d56;
  --danger: #b3372f;
  --focus: #2563c9;
  --tomato: #d4574d;
  --tomato-empty: #ebe1d5;

  --shadow-rgb: 74 52 30;
  --shadow-sm: 0 1px 2px rgb(var(--shadow-rgb) / 0.06), 0 1px 1px rgb(var(--shadow-rgb) / 0.04);
  --shadow-md: 0 1px 2px rgb(var(--shadow-rgb) / 0.05), 0 6px 16px -6px rgb(var(--shadow-rgb) / 0.12), 0 18px 40px -24px rgb(var(--shadow-rgb) / 0.22);
  --shadow-lg: 0 2px 4px rgb(var(--shadow-rgb) / 0.05), 0 18px 48px -18px rgb(var(--shadow-rgb) / 0.3);
  --highlight: inset 0 1px 0 rgb(255 255 255 / 0.7);

  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 22px;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-digits: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --phase-ms: 900ms;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15120f;
    --bg-deep: #1b1713;
    --card: #211c18;
    --card-raised: #282219;
    --field: #1a1612;
    --field-hover: #1f1a15;
    --text: #f3ece4;
    --text-soft: #ddd3c7;
    --muted: #ab9f92;
    --faint: #6f655a;
    --line: #342d26;
    --line-strong: #463d34;

    --work: #f0806f;
    --short: #6cc79a;
    --long: #6ab9cf;
    --on-phase: #1b120d;
    --accent: #e3a85f;
    --ok: #6cc79a;
    --danger: #f08479;
    --focus: #8db4ff;
    --tomato: #e8705f;
    --tomato-empty: #3a322a;

    --shadow-rgb: 0 0 0;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.3);
    --shadow-md: 0 1px 2px rgb(0 0 0 / 0.3), 0 10px 28px -12px rgb(0 0 0 / 0.55);
    --shadow-lg: 0 2px 6px rgb(0 0 0 / 0.35), 0 24px 56px -20px rgb(0 0 0 / 0.7);
    --highlight: inset 0 1px 0 rgb(255 255 255 / 0.04);
  }
}

/* ---------- Base ---------- */

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

[hidden] { display: none !important; }

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

body {
  --phase: var(--work);
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(1100px 520px at 50% -140px, color-mix(in srgb, var(--phase) 13%, transparent), transparent 72%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
  background-repeat: no-repeat;
  font: 400 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: --phase var(--phase-ms) var(--ease-out);
}

body[data-phase="short"] { --phase: var(--short); }
body[data-phase="long"] { --phase: var(--long); }

h1, h2, h3, p { margin: 0; }

a { color: inherit; }

::selection { background: color-mix(in srgb, var(--phase) 24%, transparent); }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 6px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap; border: 0;
}

.icon {
  width: 18px; height: 18px;
  flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

.label {
  display: block;
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.hint { font-size: 13px; line-height: 1.45; color: var(--muted); }

/* ---------- Cards ---------- */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md), var(--highlight);
}

/* ---------- Buttons ---------- */

.btn {
  --btn-bg: var(--card-raised);
  --btn-fg: var(--text);
  --btn-border: var(--line-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--btn-border);
  border-radius: 12px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font: inherit;
  font-size: 15px;
  font-weight: 560;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  box-shadow: var(--shadow-sm), var(--highlight);
  transition:
    transform 140ms var(--ease-out),
    box-shadow 140ms var(--ease-out),
    background-color 200ms ease,
    border-color 200ms ease,
    color 200ms ease;
}

.btn:hover { --btn-bg: var(--field-hover); }
.btn:active {
  transform: translateY(1px) scale(0.98);
  box-shadow: inset 0 1px 3px rgb(var(--shadow-rgb) / 0.16);
}
.btn[aria-disabled="true"],
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-sm { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn-block { width: 100%; }

.btn-primary {
  --btn-bg: var(--phase);
  --btn-fg: var(--on-phase);
  --btn-border: transparent;
  font-weight: 650;
  box-shadow:
    0 1px 2px rgb(var(--shadow-rgb) / 0.12),
    0 8px 20px -8px color-mix(in srgb, var(--phase) 70%, transparent),
    inset 0 1px 0 rgb(255 255 255 / 0.22);
}
.btn-primary:hover { --btn-bg: color-mix(in srgb, var(--phase) 90%, var(--text)); }
.btn-primary:active {
  box-shadow: inset 0 2px 4px rgb(0 0 0 / 0.22);
}

.btn-xl {
  min-height: 56px;
  padding: 0 26px;
  border-radius: 999px;
  font-size: 17px;
}
.btn-primary.btn-xl { min-width: 168px; letter-spacing: 0.01em; }

.btn-secondary { --btn-bg: var(--card); color: var(--text-soft); }

.btn-quiet {
  --btn-bg: transparent;
  --btn-border: transparent;
  box-shadow: none;
  color: var(--muted);
}
.btn-quiet:hover { --btn-bg: var(--field); color: var(--text); }

.btn-ok {
  --btn-bg: var(--ok);
  --btn-fg: var(--on-phase);
  --btn-border: transparent;
  font-weight: 650;
}
.btn-ok:hover { --btn-bg: color-mix(in srgb, var(--ok) 88%, var(--text)); }

.btn-danger {
  --btn-bg: var(--danger);
  --btn-fg: var(--on-phase);
  --btn-border: transparent;
  font-weight: 650;
}

.btn.is-done { --btn-border: color-mix(in srgb, var(--ok) 60%, transparent); color: var(--ok); }

.link-btn {
  border: 0; padding: 2px 4px; background: none;
  color: inherit; font: inherit; font-weight: 600;
  text-decoration: underline; text-underline-offset: 3px;
  cursor: pointer;
}

.icon-btn {
  display: inline-grid; place-items: center;
  width: 36px; height: 36px; flex: none;
  border: 0; border-radius: 10px;
  background: transparent; color: var(--muted);
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease, transform 140ms var(--ease-out);
}
.icon-btn:hover { background: var(--field); color: var(--text); }
.icon-btn:active { transform: scale(0.94); }

/* Segmented EN | RU switch */
.seg {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--field);
}
.seg button {
  min-width: 38px; min-height: 30px;
  padding: 0 8px;
  border: 0; border-radius: 8px;
  background: transparent; color: var(--muted);
  font: inherit; font-size: 13px; font-weight: 650; letter-spacing: 0.04em;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] {
  background: var(--card-raised);
  color: var(--text);
  box-shadow: var(--shadow-sm), var(--highlight);
}

/* ---------- Inputs ---------- */

.input,
.name-input {
  width: 100%;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--field);
  color: var(--text);
  font: inherit;
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}
.input { padding: 9px 12px; }
.input::placeholder,
.name-input::placeholder { color: var(--faint); }
.input:hover { background: var(--field-hover); }
.input:focus,
.name-input:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--focus) 70%, transparent);
  background: var(--card-raised);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent);
}
.input-lg { padding: 12px 14px; font-size: 17px; }
.input[aria-invalid="true"] { border-color: var(--danger); }

.form-error { min-height: 1.4em; font-size: 14px; color: var(--danger); }

/* ---------- Full-page views (loading, join, message) ---------- */

.center-view {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 16px;
  padding: 72px 16px 40px;
}

.corner-lang { position: fixed; top: 14px; right: 16px; z-index: 5; }
body[data-view="room"] .corner-lang { display: none; }

.loader { display: flex; gap: 8px; }
.loader span {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--phase);
  animation: bob 1.1s var(--ease-out) infinite;
}
.loader span:nth-child(2) { animation-delay: 0.15s; }
.loader span:nth-child(3) { animation-delay: 0.3s; }
@keyframes bob {
  0%, 100% { transform: translateY(0); opacity: 0.45; }
  40% { transform: translateY(-7px); opacity: 1; }
}
.loading-text { color: var(--muted); }

.join-card,
.message-card {
  width: min(100%, 400px);
  padding: 32px 28px 28px;
  display: grid;
  gap: 14px;
  text-align: center;
  animation: rise 520ms var(--ease-out) both;
}
.join-card .field { text-align: left; display: grid; gap: 6px; margin-top: 6px; }
.join-title,
.message-title { font-size: 23px; font-weight: 680; letter-spacing: -0.01em; line-height: 1.25; }
.join-body,
.message-body { color: var(--muted); }
.message-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 6px; }

.join-art,
.message-art { width: 104px; height: 104px; margin: 0 auto 2px; }
.art-track { fill: none; stroke: var(--tomato-empty); stroke-width: 6; }
.art-arc {
  fill: none; stroke: var(--phase); stroke-width: 6; stroke-linecap: round;
  stroke-dasharray: 326.7; stroke-dashoffset: 92;
  animation: art-sweep 2.4s var(--ease-out) both;
}
@keyframes art-sweep { from { stroke-dashoffset: 326.7; } }
.art-tomato { fill: var(--tomato); }
.art-leaf { fill: none; stroke: var(--short); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.art-stem { stroke: var(--short); stroke-width: 3.2; stroke-linecap: round; }
.art-mark { stroke: var(--muted); stroke-width: 7; stroke-linecap: round; }
.art-dot { fill: var(--muted); }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px) scale(0.99); }
  to { opacity: 1; transform: none; }
}

/* ---------- Room layout ---------- */

.room {
  max-width: 960px;
  margin: 0 auto;
  padding: 14px 16px calc(32px + env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  padding: 4px 0 18px;
}

.brand {
  display: grid; place-items: center;
  width: 42px; height: 42px; flex: none;
  border-radius: 13px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm), var(--highlight);
  transition: transform 160ms var(--ease-out);
}
.brand:hover { transform: rotate(-6deg); }
.brand svg { width: 26px; height: 26px; }
.brand-tomato { fill: var(--tomato); }
.brand-leaf { fill: none; stroke: var(--short); stroke-width: 2.4; stroke-linecap: round; }

.room-title { flex: 1 1 auto; min-width: 0; display: grid; }
.eyebrow { font-size: 11.5px; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.room-label {
  font-size: 18px; font-weight: 680; letter-spacing: -0.01em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.top-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.conn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 14%, var(--card));
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  color: var(--text);
  font-size: 13.5px; font-weight: 560;
  animation: rise 300ms var(--ease-out) both;
}
.conn-spinner {
  width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-top-color: var(--accent);
  animation: spin 900ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.room-main { display: grid; gap: 16px; }

/* ---------- Banner (while you were away) ---------- */

.banner {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 14px 14px 18px;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--phase) 9%, var(--card));
  border: 1px solid color-mix(in srgb, var(--phase) 28%, transparent);
  box-shadow: var(--shadow-sm);
  animation: rise 380ms var(--ease-out) both;
}
.banner-body { flex: 1; min-width: 0; }
.banner-title { display: block; font-weight: 650; margin-bottom: 2px; }
.banner-list { margin: 0; padding-left: 18px; color: var(--text-soft); }

/* ---------- Timer card ---------- */

.timer-card {
  display: grid;
  justify-items: center;
  gap: 18px;
  padding: 22px 18px 18px;
  overflow: hidden;
}

.phases {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px;
  margin: 0; padding: 4px;
  list-style: none;
  border-radius: 20px; /* still a pill on one row, and tidy when long Russian labels wrap */
  background: var(--field);
  border: 1px solid var(--line);
}
.phase-pill {
  padding: 5px 13px;
  border-radius: 999px;
  font-size: 13.5px; font-weight: 600;
  color: var(--muted);
  transition: background-color var(--phase-ms) var(--ease-out), color 300ms ease, box-shadow 300ms ease;
}
.phase-pill.is-current {
  background: var(--card-raised);
  color: var(--phase);
  box-shadow: var(--shadow-sm), var(--highlight);
}

.ring-wrap {
  position: relative;
  width: min(300px, 78vw);
  aspect-ratio: 1;
}
.ring { display: block; width: 100%; height: 100%; overflow: visible; }
.ring-halo {
  fill: color-mix(in srgb, var(--phase) 6%, transparent);
  stroke: none;
}
.ring-track {
  fill: none;
  stroke: var(--tomato-empty);
  stroke-width: 12;
}
.ring-progress {
  fill: none;
  stroke: var(--phase);
  stroke-width: 12;
  stroke-linecap: round;
  transition: stroke-opacity 300ms ease;
}
.ring-knob {
  fill: var(--card-raised);
  stroke: var(--phase);
  stroke-width: 3;
  transition: opacity 300ms ease;
}

.ring-center {
  position: absolute; inset: 0;
  display: grid; place-content: center; justify-items: center;
  gap: 2px;
  text-align: center;
  pointer-events: none;
}
.state-line {
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--phase);
  max-width: 190px;
}
.time {
  font-family: var(--font-digits);
  font-size: clamp(56px, 17vw, 80px);
  font-weight: 300;
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  color: var(--text);
}
.round { font-size: 13.5px; color: var(--muted); }

body[data-state="paused"] .time { animation: breathe 2.6s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: 0.45; } }

.controls { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }

.timer-foot {
  width: 100%;
  display: grid;
  gap: 10px;
  justify-items: center;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  text-align: center;
}
.summary { font-size: 13.5px; color: var(--muted); }
.alerts { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 2px 8px; }
#alerts.is-on { color: var(--ok); }
#alerts.is-on .icon { fill: color-mix(in srgb, var(--ok) 22%, transparent); }

/* ---------- Finish prompt ---------- */

.prompt {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px;
  padding: 16px 18px;
  background: color-mix(in srgb, var(--ok) 8%, var(--card));
  border-color: color-mix(in srgb, var(--ok) 30%, var(--line));
  animation: rise 420ms var(--ease-out) both;
}
.prompt-icon { width: 28px; height: 28px; flex: none; fill: none; stroke: var(--ok); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.prompt-q { flex: 1 1 220px; font-weight: 600; overflow-wrap: anywhere; }
.prompt-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- People ---------- */

.people {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 16px;
}

.person {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 18px 18px 16px;
  animation: rise 420ms var(--ease-out) both;
}
.person.is-me { border-color: color-mix(in srgb, var(--phase) 22%, var(--line)); }

.person-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.person-name {
  font-size: 18px; font-weight: 680; letter-spacing: -0.01em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.name-input {
  flex: 1 1 auto; min-width: 0;
  margin: -4px 0 -4px -8px;
  padding: 4px 8px;
  background: transparent;
  font-size: 18px; font-weight: 680; letter-spacing: -0.01em;
}
.name-input:hover { background: var(--field); }
.you-tag {
  flex: none;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--field);
  font-size: 12px; font-weight: 600; color: var(--muted);
}

.presence { position: relative; display: inline-grid; place-items: center; width: 12px; height: 12px; flex: none; }
.presence .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--faint);
  transition: background-color 400ms ease;
}
.presence.is-online .dot { background: var(--short); }
.presence.is-online::after {
  content: "";
  position: absolute; inset: -3px;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--short) 45%, transparent);
  animation: presence 2.8s ease-out infinite;
}
@keyframes presence {
  0% { transform: scale(0.6); opacity: 1; }
  80%, 100% { transform: scale(1.5); opacity: 0; }
}

.field { display: grid; gap: 5px; min-width: 0; }
.field-goal { padding-left: 12px; border-left: 3px solid var(--accent); }
.input-wrap { position: relative; }
.counter {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font-size: 11.5px; color: var(--muted);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.input-wrap .input { padding-right: 58px; }
.value { color: var(--text); overflow-wrap: anywhere; }
.value.is-empty { color: var(--faint); font-style: italic; }
.field-goal .value { font-weight: 600; }

.today {
  display: grid; gap: 6px;
  padding-top: 12px;
  border-top: 1px dashed var(--line-strong);
}
.today-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.tomatoes { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.t {
  width: 14px; height: 14px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgb(255 255 255 / 0.45), transparent 45%), var(--tomato);
  box-shadow: 0 1px 2px rgb(var(--shadow-rgb) / 0.2);
  animation: pop 420ms var(--ease-out) both;
}
.t.empty { background: var(--tomato-empty); box-shadow: inset 0 1px 2px rgb(var(--shadow-rgb) / 0.12); animation: none; }
.t-more { font-size: 12px; font-weight: 650; color: var(--muted); margin-left: 2px; }
@keyframes pop { from { transform: scale(0.4); opacity: 0; } }
.stats { font-size: 14px; color: var(--text-soft); }

.week { display: grid; gap: 4px; margin-top: 4px; }
.week-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 3px; }
.week-list li { display: flex; align-items: baseline; gap: 10px; font-size: 14px; }
.week-goal { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-soft); }
.week-count {
  flex: none;
  min-width: 26px; padding: 0 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--tomato) 14%, transparent);
  color: var(--text);
  font-size: 12.5px; font-weight: 650; text-align: center;
  font-variant-numeric: tabular-nums;
}

.free-seat { justify-self: start; }
.free-seat.is-armed { color: var(--danger); }

.empty-seat {
  place-content: center; justify-items: center;
  min-height: 240px;
  text-align: center;
  background: color-mix(in srgb, var(--card) 55%, transparent);
  border: 1.5px dashed var(--line-strong);
  box-shadow: none;
}
.seat-art {
  width: 52px; height: 52px; border-radius: 50%;
  background:
    radial-gradient(circle at 50% 40%, var(--faint) 0 9px, transparent 10px),
    radial-gradient(ellipse 18px 12px at 50% 100%, var(--faint) 0 99%, transparent 100%),
    var(--field);
  opacity: 0.8;
}
.seat-title { font-size: 16px; font-weight: 650; }
.seat-body { max-width: 280px; font-size: 14px; color: var(--muted); }

.footnote { font-size: 12.5px; color: var(--muted); text-align: center; max-width: 620px; margin: 6px auto 0; }

/* Offline: everything stays readable, controls look paused. */
body.is-offline .timer-card { filter: saturate(0.6); }
body.is-offline .presence .dot { background: var(--faint); }
body.is-offline .presence.is-online::after { display: none; }

/* ---------- Settings dialog ---------- */

.dialog {
  width: min(100% - 32px, 440px);
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
  color: var(--text);
  box-shadow: var(--shadow-lg);
}
.dialog[open] { animation: rise 280ms var(--ease-out) both; }
.dialog::backdrop {
  background: rgb(20 14 8 / 0.42);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.dialog-form { display: grid; gap: 16px; padding: 20px; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dialog-head h2 { font-size: 19px; font-weight: 680; }

.fields { display: grid; gap: 10px; }
.num-field {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 8px 8px 14px;
  border-radius: var(--radius);
  background: var(--field);
}
.num-label { font-weight: 560; }
.num-box { display: inline-flex; align-items: center; gap: 8px; flex: none; }
.num-box input {
  width: 72px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--card-raised);
  color: var(--text);
  font: inherit; font-weight: 650;
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.num-box input:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent); }
.num-box input:invalid { border-color: var(--danger); }
.unit { min-width: 64px; font-size: 13.5px; color: var(--muted); }
.hint-note { margin-top: -4px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; }

.danger-zone {
  display: grid; gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.danger-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.danger-row > div { display: grid; gap: 4px; justify-items: start; }

/* ---------- Toasts ---------- */

.toasts {
  position: fixed;
  left: 50%; bottom: calc(18px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 20;
  display: grid; gap: 8px; justify-items: center;
  width: min(100% - 32px, 420px);
  pointer-events: none;
}
.toast {
  padding: 11px 18px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-size: 14.5px; font-weight: 560;
  box-shadow: var(--shadow-lg);
  text-align: center;
  animation: toast-in 360ms var(--ease-out) both;
  transition: opacity 300ms ease, transform 300ms ease;
}
.toast-good::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 9px; border-radius: 50%; background: var(--ok); vertical-align: 1px; }
.toast-warn::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 9px; border-radius: 50%; background: var(--accent); vertical-align: 1px; }
.toast.leaving { opacity: 0; transform: translateY(8px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(0.97); } }
@media (prefers-color-scheme: dark) {
  .toast-good::before { background: #2b7d56; }
}

/* ---------- Landing page ---------- */

.landing {
  max-width: 1040px;
  margin: 0 auto;
  padding: 16px 16px calc(40px + env(safe-area-inset-bottom));
}
.landing-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 24px; }
.landing-brand { display: flex; align-items: center; gap: 10px; font-weight: 680; font-size: 17px; text-decoration: none; }
.landing-brand .brand { width: 38px; height: 38px; }

.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 40px;
  padding: 12px 0 28px;
}
.hero-copy { display: grid; gap: 16px; animation: rise 560ms var(--ease-out) both; }
.hero-eyebrow { color: var(--phase); }
.hero-title {
  font-size: clamp(34px, 6.4vw, 54px);
  font-weight: 720;
  line-height: 1.05;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.hero-lead { font-size: 18px; color: var(--text-soft); max-width: 34em; text-wrap: pretty; }

.points { margin: 6px 0 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.points li { display: flex; gap: 12px; align-items: flex-start; color: var(--text-soft); }
.point-icon {
  display: grid; place-items: center;
  width: 32px; height: 32px; flex: none;
  border-radius: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  color: var(--phase);
}
.point-icon .icon { width: 17px; height: 17px; }

.create-card {
  display: grid; gap: 16px;
  padding: 26px 24px 22px;
  animation: rise 640ms 80ms var(--ease-out) both;
}
.create-art { width: 148px; height: 148px; margin: -4px auto 0; }
.create-art .time-mini {
  font-family: var(--font-digits);
  font-size: 34px; font-weight: 300;
  letter-spacing: -0.03em;
  fill: var(--text);
  font-variant-numeric: tabular-nums;
}
.landing-track { stroke-width: 8; }
.landing-arc {
  fill: none; stroke: var(--phase); stroke-width: 8; stroke-linecap: round;
  stroke-dasharray: 389.6; stroke-dashoffset: 101;
  animation: landing-sweep 1.8s 200ms var(--ease-out) both;
}
@keyframes landing-sweep { from { stroke-dashoffset: 389.6; } }
.create-card h2 { font-size: 21px; font-weight: 680; text-align: center; }
.create-card .field { display: grid; gap: 6px; }

.recent { margin-top: 8px; display: grid; gap: 10px; }
.recent-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.recent-list a {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  font-weight: 600;
  transition: transform 160ms var(--ease-out), box-shadow 160ms var(--ease-out);
}
.recent-list a:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.recent-list .open { color: var(--muted); font-weight: 560; font-size: 14px; }

.landing-foot { margin-top: 28px; text-align: center; }

/* ---------- Small screens ---------- */

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; gap: 26px; }
}

@media (max-width: 560px) {
  .topbar { gap: 10px; }
  .top-actions { width: 100%; justify-content: space-between; }
  .top-actions .btn-sm { flex: 1 1 auto; }
  .conn { order: 3; width: 100%; justify-content: center; }
  .timer-card { padding: 18px 12px 14px; gap: 16px; }
  .phase-pill { padding: 5px 10px; font-size: 13px; }
  .btn-xl { min-height: 54px; padding: 0 22px; }
  .btn-primary.btn-xl { min-width: 148px; }
  .person { padding: 16px 14px 14px; }
  .join-card, .message-card { padding: 26px 20px 22px; }
  .num-field { padding-left: 12px; }
  .unit { min-width: 54px; }
}

@media (max-width: 380px) {
  .top-actions .btn-sm .btn-text { font-size: 13px; }
  .seg button { min-width: 34px; }
}

/* ---------- Motion preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  body { transition: none; }
  body[data-state="paused"] .time { animation: none; opacity: 0.7; }
  .presence.is-online::after { display: none; }
}
