/* kèo. — v0.2 design refinement
   Warm paper, carbon ink, one lime signal (the wordmark dot).
   Structure comes from type, space and hairlines, not boxes. */

:root {
  --paper: #f7f6f2;
  --paper-2: #efede6;
  --paper-3: #e6e3da;
  --surface: #ffffff;

  --ink: #121211;
  --ink-2: #5d5b55;
  --ink-3: #95928a;

  --line: #e4e1d8;
  --line-strong: #cfcbbf;

  --lime: #c8f135;
  --lime-deep: #a9d114;

  --ok: #1d6b40;
  --warn: #9a5200;
  --danger: #b42318;
  --danger-tint: #fbeceb;

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 22px;

  --pad: 20px;
  --shell-max: 440px;
  --font: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* legacy aliases used by inline styles */
  --ink-primary: var(--ink);
  --ink-secondary: var(--ink-2);
  --ink-muted: var(--ink-3);
  --border: var(--line);
  --border-strong: var(--line-strong);
  --bg-subtle: var(--paper-2);
  --accent: var(--lime);
  --ok-ink: var(--ok);
  --danger-ink: var(--danger);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-padding-top: 76px;
  scroll-padding-bottom: 170px;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: transparent;
  padding: 0;
  text-align: inherit;
}

button:disabled,
select:disabled,
input:disabled {
  cursor: default;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  border-radius: 6px;
}

.tnum {
  font-variant-numeric: tabular-nums;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ───────── Shell ───────── */
.app-viewport {
  min-height: 100dvh;
  display: flex;
  justify-content: center;
}

.shell {
  width: 100%;
  max-width: var(--shell-max);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* ───────── Wordmark ───────── */
.wordmark {
  font-weight: 800;
  letter-spacing: -0.055em;
  line-height: 1;
  color: var(--ink);
  display: inline-flex;
  align-items: baseline;
}
.wordmark-xl {
  font-size: 76px;
}
.wordmark-lg {
  font-size: 40px;
}
.wordmark-md {
  font-size: 24px;
}
.wordmark-sm {
  font-size: 19px;
}
.wordmark-dot {
  display: inline-block;
  width: 0.2em;
  height: 0.2em;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: inset 0 0 0 0.035em var(--ink);
  margin-left: 0.04em;
}
.slogan {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--ink-2);
  margin-top: 14px;
}

/* ───────── Top bar ───────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  padding: calc(12px + env(safe-area-inset-top, 0px)) var(--pad) 12px;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topbar-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}

.group-switcher {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  min-width: 0;
  max-width: 100%;
  border-radius: var(--r-sm);
}
.group-switcher-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.group-switcher-sep {
  width: 1px;
  height: 18px;
  background: var(--line-strong);
  flex-shrink: 0;
}
.chev {
  width: 10px;
  height: 10px;
  flex-shrink: 0;
  color: var(--ink-3);
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  flex-shrink: 0;
  transition: background 120ms ease;
}
.icon-btn:hover {
  background: var(--paper-2);
}
.icon-btn svg {
  width: 18px;
  height: 18px;
}
.icon-btn-ghost {
  background: transparent;
}

.text-btn {
  min-height: 36px;
  padding: 0 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 8px;
}
.text-btn-muted {
  color: var(--ink-3);
}
.text-btn:hover {
  color: var(--ink-2);
}

/* ───────── Screen body ───────── */
.screen-body {
  flex: 1;
  padding: 8px var(--pad) calc(112px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.screen-body-auth {
  flex: 1;
  padding: calc(18vh + env(safe-area-inset-top, 0px)) 28px 40px;
  display: flex;
  flex-direction: column;
}

/* ───────── Buttons ───────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 20px;
  border-radius: var(--r-md);
  font-weight: 650;
  font-size: 15px;
  letter-spacing: -0.015em;
  text-decoration: none;
  white-space: nowrap;
  transition: background 120ms ease, transform 90ms ease, color 120ms ease;
}
.btn:active {
  transform: scale(0.98);
}
.btn-full {
  width: 100%;
}
.btn-sm {
  min-height: 42px;
  padding: 0 16px;
  font-size: 14px;
  border-radius: 12px;
}
.btn-xs {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
  border-radius: 10px;
}

.btn-primary {
  background: var(--ink);
  color: var(--paper);
}
.btn-primary:hover {
  background: #2a2a28;
}
.btn-accent {
  background: var(--lime);
  color: var(--ink);
}
.btn-accent:hover {
  background: var(--lime-deep);
}
.btn-secondary {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
.btn-secondary:hover {
  background: var(--paper-2);
}
.btn-subtle {
  background: var(--paper-2);
  color: var(--ink);
}
.btn-subtle:hover {
  background: var(--paper-3);
}
.btn-danger {
  background: transparent;
  color: var(--danger);
}
.btn-danger:hover {
  background: var(--danger-tint);
}
.btn-on-dark {
  background: rgba(255, 255, 255, 0.1);
  color: var(--paper);
}
.btn-on-dark:hover {
  background: rgba(255, 255, 255, 0.16);
}

.action-row {
  display: flex;
  gap: 8px;
}
.action-row > .btn-grow {
  flex: 1;
}
@media (max-width: 359px) {
  .action-row {
    flex-wrap: wrap;
  }
  .action-row > .btn-grow {
    flex-basis: 100%;
  }
  .action-row > .btn:not(.btn-grow) {
    flex: 1;
    padding: 0 10px;
  }
}

/* ───────── Status text (replaces most badges) ───────── */
.st {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--ink-2);
}
.st-ok {
  color: var(--ok);
}
.st-warn {
  color: var(--warn);
}
.st-danger {
  color: var(--danger);
}
.st-muted {
  color: var(--ink-3);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.005em;
  white-space: nowrap;
  background: var(--paper-2);
  color: var(--ink);
}
.pill-lime {
  background: var(--lime);
}
.pill-ink {
  background: var(--ink);
  color: var(--paper);
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--lime);
  flex-shrink: 0;
  box-shadow: 0 0 0 0 rgba(200, 241, 53, 0.6);
  animation: live 2s ease-out infinite;
}
@keyframes live {
  0% { box-shadow: 0 0 0 0 rgba(200, 241, 53, 0.55); }
  70% { box-shadow: 0 0 0 7px rgba(200, 241, 53, 0); }
  100% { box-shadow: 0 0 0 0 rgba(200, 241, 53, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .live-dot { animation: none; }
  * { transition: none !important; }
}

/* Legacy badge classes (kept for any remaining use) */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  background: var(--paper-2);
  color: var(--ink-2);
}
.badge-lime { background: var(--lime); color: var(--ink); }
.badge-carbon { background: var(--ink); color: var(--paper); }

/* ───────── Sections ───────── */
.section {
  display: flex;
  flex-direction: column;
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  min-height: 34px;
}
.section-title {
  font-size: 16px;
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0;
}
.count {
  color: var(--ink-3);
  font-weight: 500;
  margin-left: 4px;
}

.hairline {
  border-top: 1px solid var(--line);
}

/* Dark "now" panel — the only filled surface in the workspace */
.now-panel {
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--r-lg);
  padding: 18px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.now-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  border-radius: 10px;
}
.now-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(247, 246, 242, 0.66);
}
.now-time {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-top: 6px;
}
.now-meta {
  font-size: 14px;
  color: rgba(247, 246, 242, 0.66);
  margin-top: 2px;
}
.now-arrow {
  color: rgba(247, 246, 242, 0.5);
}

/* ───────── Forms ───────── */
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
}
.input,
.select {
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 16px;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%2395928a' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
}
.input-sm,
.select-sm {
  min-height: 44px;
  font-size: 15px;
}
.input:focus,
.select:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(18, 18, 17, 0.06);
  outline: none;
}
.input::placeholder {
  color: var(--ink-3);
}
.input:disabled,
.select:disabled {
  background-color: transparent;
  border-color: var(--line);
  color: var(--ink);
  opacity: 1;
}

/* Settings sections */
.set-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.set-title {
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -0.03em;
  margin: 0;
  line-height: 1.2;
  min-height: 34px;
  display: flex;
  align-items: center;
}
.set-lead {
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.02em;
  margin-top: 6px;
}
.set-lead-sub {
  font-size: 15px;
  color: var(--ink-2);
}

/* Settings row: label left, control right */
.set-list {
  display: flex;
  flex-direction: column;
}
.set-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
  padding: 6px 0;
  border-top: 1px solid var(--line);
}
.set-row:first-child {
  border-top: none;
}
.set-row-label {
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  min-width: 0;
}
.set-row .select,
.set-row .input {
  width: auto;
  min-width: 0;
  min-height: 40px;
  font-size: 15px;
  font-weight: 600;
  border-color: transparent;
  background-color: var(--paper-2);
  text-align: right;
}
.set-row .select {
  max-width: 190px;
  text-align-last: right;
}
.set-row .input {
  width: 112px;
  padding: 0 12px;
}
.set-row .select:focus,
.set-row .input:focus {
  border-color: var(--ink);
  background-color: var(--surface);
}
.set-row .select:disabled,
.set-row .input:disabled {
  background-color: transparent;
  background-image: none;
  padding-right: 0;
}
.input-unit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.input-unit .unit {
  width: 44px;
  color: var(--ink-3);
  font-size: 14px;
  font-weight: 600;
}

.error-text {
  color: var(--danger);
  font-size: 14px;
  font-weight: 600;
  margin: 0;
}

/* OTP */
.otp-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}
.otp-box {
  width: 100%;
  min-width: 0;
  height: 58px;
  padding: 0;
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  caret-color: var(--ink);
}
.otp-box:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(18, 18, 17, 0.06);
  outline: none;
}

.auth-form {
  margin-top: 56px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.auth-phone-input {
  min-height: 58px;
  font-size: 22px;
  font-weight: 650;
  letter-spacing: 0.01em;
}
.auth-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 36px;
}

/* ───────── Calendar ───────── */
.cal {
  display: flex;
  flex-direction: column;
}
.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.cal-month {
  white-space: nowrap;
  font-size: clamp(24px, 8vw, 30px);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1;
}
.cal-year {
  white-space: nowrap;
  font-size: clamp(24px, 8vw, 30px);
  font-weight: 800;
  letter-spacing: -0.045em;
  color: var(--ink-3);
  margin-left: 8px;
}
.cal-nav {
  display: flex;
  gap: 2px;
  margin-right: -10px;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}
.cal-dow {
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
  padding-bottom: 6px;
}
.cal-cell {
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  position: relative;
  font-size: 16px;
  font-weight: 500;
  color: var(--ink-3);
  text-align: center;
  transition: background 120ms ease, color 120ms ease, transform 90ms ease;
}
.cal-cell-session {
  color: var(--ink);
  font-weight: 700;
  background: var(--paper-2);
}
button.cal-cell-session:hover {
  background: var(--paper-3);
}
button.cal-cell:active {
  transform: scale(0.94);
}
.cal-cell-registered {
  background: var(--ink);
  color: var(--paper);
}
button.cal-cell-registered:hover {
  background: #2a2a28;
}
.cal-cell-active {
  box-shadow: inset 0 0 0 2px var(--ink);
}
.cal-cell-today {
  box-shadow: inset 0 0 0 1.5px var(--line-strong);
}
.cal-cell-selected,
button.cal-cell-selected:hover {
  background: var(--lime);
  color: var(--ink);
  box-shadow: inset 0 0 0 2px var(--ink);
}
.cal-cell-past {
  opacity: 0.4;
}
.cal-mark {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: transparent;
}
.cal-mark-booked {
  background: currentColor;
}
.cal-cell-registered .cal-mark-booked {
  background: var(--lime);
}

/* Month session list */
.sess-list {
  display: flex;
  flex-direction: column;
}
.sess-row {
  width: 100%;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
  text-align: left;
  border-radius: 0;
  transition: background 120ms ease;
}
.sess-row:first-child {
  border-top: none;
}
@media (hover: hover) {
  .sess-row:hover .sess-time,
  .group-row:hover .group-row-name {
    text-decoration: underline;
    text-decoration-color: var(--line-strong);
    text-underline-offset: 3px;
  }
}
.sess-row-past {
  opacity: 0.45;
}
.sess-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--paper-2);
  line-height: 1;
}
.sess-date-num {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.sess-date-dow {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-3);
  margin-top: 3px;
}
.sess-row-mine .sess-date {
  background: var(--ink);
  color: var(--paper);
}
.sess-row-mine .sess-date-dow {
  color: rgba(247, 246, 242, 0.6);
}
.sess-row-selected .sess-date {
  background: var(--lime);
  color: var(--ink);
  box-shadow: inset 0 0 0 2px var(--ink);
}
.sess-row-selected .sess-date-dow {
  color: var(--ink);
}
.sess-time {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.sess-sub {
  font-size: 13px;
  color: var(--ink-3);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sess-sub-strong {
  color: var(--ink);
  font-weight: 600;
}
.sess-count {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}
.sess-count svg {
  width: 15px;
  height: 15px;
  color: var(--ink-3);
}

/* Floating multi-select bar */
.floating-bar {
  position: fixed;
  bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 2 * var(--pad));
  max-width: calc(var(--shell-max) - 2 * var(--pad));
  background: var(--ink);
  color: var(--paper);
  border-radius: 18px;
  padding: 8px 8px 8px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  z-index: 30;
  box-shadow: 0 14px 36px rgba(18, 18, 17, 0.22);
  animation: rise 180ms ease-out;
}
.floating-count {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.015em;
  flex: 1;
  min-width: 0;
}
.floating-bar .icon-btn {
  color: rgba(247, 246, 242, 0.7);
  width: 36px;
  height: 36px;
}
.floating-bar .icon-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}
@keyframes rise {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ───────── Bottom nav ───────── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--shell-max);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 4px 12px calc(6px + env(safe-area-inset-bottom, 0px));
  z-index: 25;
}
.nav-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 58px;
  border-radius: 12px;
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-align: center;
}
.nav-tab-active {
  color: var(--ink);
  font-weight: 700;
}
.nav-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: transparent;
}
.nav-tab-active .nav-indicator {
  background: var(--lime);
  box-shadow: inset 0 0 0 1px var(--ink);
}

/* ───────── Weekday selector & segment ───────── */
.weekday-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}
.weekday-pill {
  height: 46px;
  border-radius: 12px;
  background: var(--paper-2);
  font-size: 14px;
  font-weight: 650;
  color: var(--ink-2);
  text-align: center;
  transition: background 120ms ease, color 120ms ease;
}
.weekday-pill-on {
  background: var(--ink);
  color: var(--paper);
}

.segment {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  background: var(--paper-2);
  padding: 3px;
  border-radius: 12px;
  gap: 2px;
}
.segment-btn {
  min-height: 38px;
  padding: 0 10px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
  text-align: center;
}
.segment-btn-on {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(18, 18, 17, 0.08), 0 0 0 1px rgba(18, 18, 17, 0.04);
}

/* ───────── Switch ───────── */
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
}
.switch {
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: var(--paper-3);
  position: relative;
  transition: background 160ms ease;
  flex-shrink: 0;
}
.switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(18, 18, 17, 0.18);
  transition: transform 160ms ease, background 160ms ease;
}
.switch[aria-checked='true'] {
  background: var(--ink);
}
.switch[aria-checked='true']::after {
  transform: translateX(20px);
  background: var(--lime);
}
.switch:disabled {
  opacity: 0.6;
}

/* ───────── Session detail ───────── */
.session-hero {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 4px;
}
.hero-time {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1;
}
.hero-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: 15px;
  color: var(--ink-2);
}
.hero-meta-sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--ink-3);
}
.hero-venue {
  font-size: 15px;
  color: var(--ink-3);
}
.hero-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.me-block {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.me-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.me-name {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.me-sub {
  font-size: 14px;
  color: var(--ink-2);
}
.guest-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

/* Photo strip */
.photo-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  margin: 0 calc(-1 * var(--pad));
  padding: 2px var(--pad) 4px;
  scrollbar-width: none;
}
.photo-strip::-webkit-scrollbar {
  display: none;
}
.photo-tile {
  flex: 0 0 84px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.photo-thumb {
  width: 84px;
  height: 104px;
  border-radius: 14px;
  object-fit: cover;
  background: var(--paper-2);
  display: block;
}
.photo-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  max-width: 84px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* People rows */
.person-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 60px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}
.person-row:first-child {
  border-top: none;
}
.person-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}
.person-name {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.person-sub {
  font-size: 13px;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.person-end {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.more-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-3);
  margin-right: -8px;
}
.more-btn:hover {
  background: var(--paper-2);
  color: var(--ink);
}
.more-btn svg {
  width: 18px;
  height: 18px;
}

.avatar-sm {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--paper-2);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.avatar-sm img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ───────── Groups ───────── */
.groups-head {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.045em;
  margin: 8px 0 0;
}
.group-list {
  display: flex;
  flex-direction: column;
}
.group-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  text-align: left;
}
.group-row:last-child {
  border-bottom: 1px solid var(--line);
}
.group-row-name {
  font-size: 19px;
  font-weight: 750;
  letter-spacing: -0.03em;
}
.group-row-sub {
  font-size: 14px;
  color: var(--ink-2);
  margin-top: 3px;
}
.group-row-next {
  text-align: right;
  flex-shrink: 0;
}
.group-row-next-label {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ───────── Settlement ───────── */
.settle-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.settle-picker {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23121211' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 4px center;
  padding: 0 22px 0 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  min-height: 40px;
  min-width: 0;
  max-width: 100%;
  border-radius: 8px;
  cursor: pointer;
}
.settle-state {
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.settle-hero {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.settle-hero-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
}
.settle-hero-amount {
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1.05;
}
.settle-hero-sub {
  font-size: 14px;
  color: var(--ink-2);
}
.progress {
  height: 4px;
  border-radius: 4px;
  background: var(--paper-3);
  overflow: hidden;
  margin-top: 10px;
}
.progress > span {
  display: block;
  height: 100%;
  background: var(--ink);
  border-radius: 4px;
}

.cost-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 4px 12px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.cost-row:first-child {
  border-top: none;
}
.cost-label,
.cost-amount {
  border: 1px solid transparent;
  background: transparent;
  min-height: 40px;
  border-radius: 8px;
  padding: 0 8px;
  margin-left: -8px;
  font-size: 15px;
  font-weight: 600;
  width: 100%;
  min-width: 0;
}
.cost-amount {
  width: 130px;
  margin-left: 0;
  margin-right: -8px;
  text-align: right;
  font-weight: 700;
  -moz-appearance: textfield;
}
.cost-amount::-webkit-outer-spin-button,
.cost-amount::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.cost-label:not(:disabled):hover,
.cost-amount:not(:disabled):hover {
  background: var(--paper-2);
}
.cost-label:focus,
.cost-amount:focus {
  outline: none;
  border-color: var(--ink);
  background: var(--surface);
}
.cost-label:disabled,
.cost-amount:disabled {
  color: var(--ink);
  min-height: 30px;
}
.cost-mode:disabled {
  min-height: 22px;
  color: var(--ink-3);
}
.cost-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  grid-column: 1 / -1;
  margin-left: -8px;
}
.cost-mode {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%2395928a' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 8px center;
  padding: 0 22px 0 8px;
  min-height: 30px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
}
.cost-mode:hover:not(:disabled) {
  background-color: var(--paper-2);
}
.cost-mode:disabled {
  background-image: none;
  cursor: default;
}
.cost-remove {
  margin-right: -10px;
  width: 36px;
  height: 36px;
  color: var(--ink-3);
}
.cost-remove svg {
  width: 16px;
  height: 16px;
}

.sum-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.sum-label {
  font-size: 13px;
  color: var(--ink-3);
  font-weight: 500;
}
.sum-value {
  font-size: 17px;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.line-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.line-row:first-child {
  border-top: none;
}
.line-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.line-who {
  min-width: 0;
  flex: 1;
  border-radius: 8px;
}
.line-who[data-action='toggle-settlement-row'] {
  cursor: pointer;
}
.line-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 8px;
  font-size: 13px;
  color: var(--ink-3);
  margin-top: 1px;
}
.line-pen {
  color: var(--danger);
  font-weight: 600;
}
.line-total {
  font-size: 16px;
  font-weight: 750;
  letter-spacing: -0.02em;
}
.line-end {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}
.line-total-paid {
  color: var(--ink-3);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}
.paid-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 10px 0 6px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-2);
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--line-strong);
  white-space: nowrap;
}
.paid-toggle .tick {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 1.5px var(--line-strong);
}
.paid-toggle .tick svg {
  width: 10px;
  height: 10px;
  opacity: 0;
}
.paid-toggle[aria-pressed='true'] {
  background: var(--ink);
  color: var(--paper);
  box-shadow: none;
}
.paid-toggle[aria-pressed='true'] .tick {
  background: var(--lime);
  box-shadow: none;
  color: var(--ink);
}
.paid-toggle[aria-pressed='true'] .tick svg {
  opacity: 1;
}
span.paid-toggle {
  cursor: default;
}
.override-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  background: var(--paper-2);
  padding: 12px;
  border-radius: 14px;
}

/* ───────── Sheets ───────── */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(18, 18, 17, 0.38);
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fade 160ms ease-out;
}
.sheet {
  width: 100%;
  max-width: var(--shell-max);
  max-height: 92dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--paper);
  border-radius: 26px 26px 0 0;
  padding: 10px 22px calc(22px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: sheet-up 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes sheet-up {
  from { transform: translateY(24px); opacity: 0.6; }
  to { transform: translateY(0); opacity: 1; }
}
.sheet-handle {
  width: 38px;
  height: 4px;
  border-radius: 4px;
  background: var(--line-strong);
  margin: 0 auto;
}
.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-right: -8px;
}
.sheet-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.035em;
  margin: 0;
  line-height: 1.15;
}
.sheet-kicker {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-3);
  margin-top: 4px;
}
.sheet-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sheet-sub-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.guest-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-left: 2px;
  padding-left: 14px;
  border-left: 2px solid var(--line);
}
.invite-code {
  font-size: clamp(34px, 11vw, 44px);
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1;
}

/* ───────── Utilities ───────── */
.card {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 16px;
}
.card-compact {
  padding: 14px;
  border-radius: var(--r-md);
}
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 6px; }
.gap-2 { gap: 10px; }
.gap-3 { gap: 14px; }
.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.stack-sm {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.text-sm { font-size: 14px; }
.text-xs { font-size: 13px; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.min-0 { min-width: 0; }
.divider {
  height: 1px;
  background: var(--line);
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ───────── Toast ───────── */
.toast {
  position: fixed;
  /* Below the sticky top bar (60px), never over it */
  top: calc(68px + env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100% - 40px);
  background: var(--ink);
  color: var(--paper);
  padding: 11px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  z-index: 80;
  box-shadow: 0 10px 28px rgba(18, 18, 17, 0.22);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  animation: toast-in 200ms ease-out;
}
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, -6px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}


/* ───────── v0.3: roles, grouping, interaction ───────── */

/* Toast */
.toast-error {
  background: var(--danger);
}

/* Floating selection bar never covers the end of the list */
.has-floating .screen-body {
  padding-bottom: calc(196px + env(safe-area-inset-bottom, 0px));
}

/* Calendar: registered + selected keeps the carbon fill, gains a lime ring */
.cal-cell-registered.cal-cell-selected,
button.cal-cell-registered.cal-cell-selected:hover {
  background: var(--ink);
  color: var(--lime);
  box-shadow: inset 0 0 0 3px var(--lime), inset 0 0 0 5px var(--ink);
}
/* Only your guests are going: carbon outline, paper fill */
.cal-cell-guests {
  box-shadow: inset 0 0 0 1.5px var(--ink);
}
.cal-cell-guests.cal-cell-selected {
  box-shadow: inset 0 0 0 2px var(--ink);
}
.sess-row-guests .sess-date {
  box-shadow: inset 0 0 0 1.5px var(--ink);
}
.sess-sub-off {
  color: var(--ink-3);
  font-weight: 600;
}

/* Của bạn: one block per person; guests nested under you */
.mine {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.mine-person {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.guest-group {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-left: 2px;
  padding-left: 16px;
  border-left: 2px solid var(--line);
}
.guest-person {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.guest-person-off .guest-name {
  color: var(--ink-3);
}
.guest-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.015em;
}
.guest-tag {
  margin-left: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
}
.guest-add {
  align-self: flex-start;
  min-height: 36px;
}

/* Read-only rules (participants) */
.rule-list {
  display: flex;
  flex-direction: column;
}
.rule-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  min-height: 48px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
}
.rule-row:first-child {
  border-top: none;
}
.rule-label {
  font-size: 15px;
  color: var(--ink-2);
  min-width: 0;
}
.rule-value {
  font-size: 15px;
  font-weight: 650;
  color: var(--ink);
  text-align: right;
}
.rule-off {
  font-size: 15px;
  font-weight: 650;
  color: var(--ink-3);
}
.invite-pill {
  min-height: 34px;
  padding: 0 14px;
  font-size: 14px;
  letter-spacing: 0.06em;
}

/* Chi phí */
.settle-seg {
  max-width: 280px;
}
.settle-back {
  margin-left: -10px;
  flex-shrink: 0;
}
.settle-date {
  flex: 1;
  min-width: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.hist-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  min-height: 54px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  text-align: left;
}
.hist-row:first-child {
  border-top: none;
}
.hist-date {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-2);
}
.hist-amount {
  font-size: 15px;
  font-weight: 700;
  min-width: 92px;
  text-align: right;
}
.hist-row-on .hist-date {
  color: var(--ink);
  font-weight: 750;
}
.hist-row-on .hist-date::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: inset 0 0 0 1px var(--ink);
  margin-right: 8px;
  vertical-align: middle;
}

/* Sheet guest rows: enter / leave */
.guest-item-enter {
  animation: guest-in 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.guest-item-leave {
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 150ms ease, transform 150ms ease;
  pointer-events: none;
}
@keyframes guest-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.lab-field .field-label {
  color: var(--warn);
}
@media (prefers-reduced-motion: reduce) {
  .guest-item-enter { animation: none; }
}

/* ───────── Desktop ───────── */
@media (min-width: 720px) {
  :root {
    --pad: 32px;
  }
  .shell-wide {
    --shell-max: 1080px;
  }
  .shell-wide .bottom-nav {
    max-width: 420px;
    bottom: 20px;
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 4px 8px;
    box-shadow: 0 10px 30px rgba(18, 18, 17, 0.08);
  }
  .shell-wide .floating-bar {
    max-width: 420px;
    bottom: 104px;
  }
  .shell-wide .screen-body {
    padding-bottom: 140px;
  }
  .shell-wide.has-floating .screen-body {
    padding-bottom: 220px;
  }
  .narrow {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
  }
  .now-panel .action-row > .btn-grow {
    flex: 0 0 auto;
    min-width: 200px;
  }
  .sheet-backdrop {
    align-items: center;
  }
  .sheet {
    max-width: 460px;
    border-radius: 26px;
    max-height: 86dvh;
    padding-bottom: 24px;
  }
  .sheet-handle {
    display: none;
  }
  .screen-body-auth {
    padding-top: 22vh;
    max-width: 440px;
    margin: 0 auto;
    width: 100%;
  }
}

@media (min-width: 960px) {
  .cal-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 28px 64px;
    align-items: start;
  }
  .cal-layout > .now-panel {
    grid-column: 1 / -1;
  }
  .cal-layout .sess-panel {
    position: sticky;
    top: 76px;
  }
}


/* ───────── Stage 3C.1: minimal loading / empty / error-retry states ───────── */
.state-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 20px 0;
}
.state-msg {
  margin: 0;
  font-size: 15px;
  color: var(--ink-2);
}
.state-msg-error {
  color: var(--danger);
  font-weight: 600;
}
.btn[disabled] {
  opacity: 0.55;
  pointer-events: none;
}

/* ───────── Stage 4.1 — UI/UX refinement ─────────
   Past vs upcoming dates, live ring, separate admin block, compact rules,
   compact guest rows, touch targets ≥ 40–44px. Same tokens, no new colours. */

/* Calendar states */
.cal-cell-gone {
  color: #bdb9ae;
}
.cal-cell-past {
  opacity: 1;
  background: transparent;
  color: var(--ink-3);
  font-weight: 600;
}
button.cal-cell-past:hover {
  background: var(--paper-2);
}
.cal-cell-past.cal-cell-registered {
  background: var(--paper-3);
  color: var(--ink-2);
}
.cal-cell-past.cal-cell-registered .cal-mark-booked {
  background: var(--ink-3);
}
.cal-cell-cancelled > span:first-child {
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
}
.cal-cell-today:not(.cal-cell-registered):not(.cal-cell-selected) {
  box-shadow: inset 0 0 0 1.5px var(--ink-3);
}
.cal-cell-active,
.cal-cell-active.cal-cell-today {
  box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--lime-deep);
}
.cal-cell-active .cal-mark {
  background: var(--lime);
}

/* Month list: live first, past folded */
.sess-row-past {
  opacity: 0.62;
}
.sess-row-live .sess-date {
  box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--lime-deep);
}
.sess-count > span {
  display: inline-flex;
  align-items: baseline;
}
.sess-fold {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  font-weight: 650;
  color: var(--ink-2);
}
.sess-fold .chev {
  width: 12px;
  height: 12px;
  transition: transform 160ms ease;
}
.sess-fold[aria-expanded='true'] .chev {
  transform: rotate(180deg);
}
.sess-past-group .sess-row:first-child {
  border-top: 1px solid var(--line);
}

/* Session detail */
.session-body {
  padding-bottom: 48px;
  gap: 32px;
}
.hero-state {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 26px;
  padding: 0 10px;
  margin-bottom: 6px;
  border-radius: 999px;
  background: var(--paper-2);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.hero-state-live {
  background: var(--ink);
  color: var(--paper);
}
.hero-state-off {
  color: var(--danger);
  background: var(--danger-tint);
}
.section-aside {
  font-size: 13px;
  color: var(--ink-3);
}
.section-aside strong {
  color: var(--ink);
  font-weight: 700;
}

.admin-block {
  background: var(--paper-2);
  border-radius: var(--r-md);
  padding: 4px 16px;
}
.admin-title {
  margin: 0;
  padding: 12px 0 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.admin-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  border-top: 1px solid var(--line-strong);
  border-top-color: color-mix(in srgb, var(--line-strong) 60%, transparent);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  text-align: left;
}
.admin-title + .admin-row {
  border-top: none;
}
.admin-row svg {
  width: 16px;
  height: 16px;
  color: var(--ink-3);
  flex-shrink: 0;
}
.admin-row .switch {
  background: var(--paper-3);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
.admin-row .switch[aria-checked='true'] {
  background: var(--ink);
  box-shadow: none;
}

/* Rules: compact folding sections */
.policy-stack {
  gap: 0;
}
.policy-stack > .section {
  padding: 18px 0;
  border-top: 1px solid var(--line);
}
.policy-stack > .section:first-child {
  border-top: none;
  padding-top: 0;
}
.policy-stack > .section[aria-labelledby='pol-members'] {
  padding-top: 28px;
}
.fold-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.fold-btn {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  border-radius: 8px;
}
.fold-btn .set-title {
  margin: 0;
}
.fold-sum {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fold-btn .chev {
  width: 12px;
  height: 12px;
  transition: transform 160ms ease;
}
.fold-btn[aria-expanded='true'] .chev {
  transform: rotate(180deg);
}
.fold-body {
  margin-top: 6px;
}

/* Settlement */
.line-sub > span + span::before {
  content: '·';
  margin-right: 8px;
  color: var(--ink-3);
}
.line-total-zero {
  color: var(--ink-3);
}
.paid-none {
  display: inline-block;
  width: 72px;
}

/* Registration sheet: one row per guest */
.guest-item-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.guest-item-row .input {
  flex: 1;
  min-width: 0;
}
.time-chip {
  flex-shrink: 0;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 12px;
  background: var(--paper-2);
  font-size: 13px;
  font-weight: 650;
  color: var(--ink-2);
}
.time-chip[aria-expanded='true'] {
  background: var(--ink);
  color: var(--paper);
}
.time-chip-custom {
  color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--ink);
}

/* Touch targets — visual size kept, hit area raised */
.icon-btn {
  width: 44px;
  height: 44px;
}
.text-btn {
  min-height: 44px;
  padding: 0 8px;
  margin: 0 -4px;
}
.btn-xs {
  min-height: 40px;
}
.btn-sm {
  min-height: 44px;
}
.more-btn {
  width: 44px;
  height: 44px;
  margin-right: -10px;
}
.paid-toggle {
  min-height: 40px;
  padding: 0 12px 0 8px;
}
.segment-btn {
  min-height: 42px;
}
.switch {
  overflow: visible;
}
.switch::before {
  content: '';
  position: absolute;
  inset: -10px -4px;
}
.cost-mode {
  min-height: 40px;
}
.cost-label:disabled,
.cost-amount:disabled {
  min-height: 40px;
}
.cost-remove {
  width: 44px;
  height: 44px;
}
.floating-bar .icon-btn {
  width: 44px;
  height: 44px;
}
.line-who[data-action='toggle-settlement-row'] {
  min-height: 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Loading: quiet pulse instead of static text */
.state-block[role='status'] .state-msg::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 10px;
  border-radius: 50%;
  background: var(--lime-deep);
  vertical-align: 1px;
  animation: keo-pulse 1s ease-in-out infinite;
}
@keyframes keo-pulse {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .state-block[role='status'] .state-msg::before { animation: none; }
}

/* Desktop: keep calendar cells at a readable, not poster, size */
@media (min-width: 960px) {
  .cal-layout {
    grid-template-columns: minmax(0, 460px) minmax(0, 1fr);
  }
  .cal-layout > .now-panel {
    max-width: none;
  }
}
.invite-pill {
  min-height: 40px;
  padding: 0 14px;
}
@media (max-width: 359px) {
  .guest-item-row {
    gap: 6px;
  }
  .time-chip {
    padding: 0 8px;
    font-size: 12px;
  }
  .guest-item-row .icon-btn {
    width: 40px;
    margin-right: -6px;
  }
}
