/* ─────────────────────────────────────────────────────────────────────────
   app.css

   App-specific layout (nav, hero, features grid, footer, modal). Consumes
   only semantic tokens from design-tokens.css so theme/scale changes flow
   through automatically. Atomic UI primitives (buttons, inputs, cards,
   alerts, badges) live in components.css.
   ───────────────────────────────────────────────────────────────────────── */

/* ─── Reset & base ──────────────────────────────────────────────────────── */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }

.yat-icon {
  width: 1rem;
  height: 1rem;
  display: inline-block;
  color: currentColor;
  stroke-width: 2;
  flex-shrink: 0;
}

a:not([class^="btn-"]):not([class*=" btn-"]) {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--duration-base) var(--easing-standard);
}
a:not([class^="btn-"]):not([class*=" btn-"]):hover {
  color: var(--color-primary-hover);
}
a:focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ─── Nav ───────────────────────────────────────────────────────────────── */

.nav {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-6);
  background: color-mix(in srgb, var(--color-bg) 85%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
}
.nav__logo {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--color-text);
  letter-spacing: var(--tracking-tight);
}
.nav__logo:hover { color: var(--color-primary); }
.nav__actions {
  display: flex;
  gap: var(--space-3);
  align-items: center;
}

/* ─── Hero ──────────────────────────────────────────────────────────────── */

.hero {
  display: grid;
  align-items: center;
  padding: var(--space-16) var(--space-6) var(--space-12);
}
.hero__content {
  width: min(100%, 1120px);
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 28rem);
  align-items: center;
  gap: var(--space-12);
}
.hero__copy { max-width: 40rem; }
.hero__headline {
  font-size: clamp(var(--text-3xl), 6vw, var(--text-5xl));
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-display);
  background: linear-gradient(135deg, var(--color-text) 40%, var(--color-primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--space-6);
}
.hero__subheadline {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  max-width: 560px;
  margin-bottom: var(--space-10);
}
.hero__cta {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}
.hero__visual {
  min-width: 0;
}
.hero-preview {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}
.hero-preview__bar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--color-surface-alt);
  border-bottom: 1px solid var(--color-border);
}
.hero-preview__brand {
  font-weight: var(--weight-bold);
  font-size: var(--text-xl);
}
.hero-preview__room,
.hero-preview__status,
.hero-preview__pill {
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  white-space: nowrap;
}
.hero-preview__status {
  color: var(--yellow);
}
.hero-preview__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4);
}
.hero-preview__item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
}
.hero-preview__check {
  width: 0.875rem;
  height: 0.875rem;
  border: 2px solid var(--yellow);
  border-radius: var(--radius-sm);
}
.hero-preview__check--done {
  background: var(--yellow);
  box-shadow: inset 0 0 0 3px var(--color-surface-alt);
}
.hero-preview__pill {
  padding: 2px var(--space-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
}
.hero-preview__compose {
  margin: 0 var(--space-4) var(--space-4);
  padding: var(--space-3);
  color: var(--color-text-subtle);
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
}

/* ─── Features ──────────────────────────────────────────────────────────── */

.features {
  padding: var(--space-12) var(--space-6);
  border-top: 1px solid var(--color-border);
}
.features__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-6);
  max-width: 1120px;
  margin-inline: auto;
}
.feature__icon {
  width: 2.75rem;
  height: 2.75rem;
  display: inline-grid;
  place-items: center;
  margin-bottom: var(--space-4);
  color: var(--color-primary);
  background: var(--color-primary-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}
.feature__icon .yat-icon {
  width: 1.4rem;
  height: 1.4rem;
}
.feature__title {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  margin-bottom: var(--space-3);
  color: var(--color-text);
}
.feature__description {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: var(--leading-relaxed);
}

/* ─── Footer ────────────────────────────────────────────────────────────── */

.footer {
  padding: var(--space-8) var(--space-6);
  border-top: 1px solid var(--color-border);
  text-align: center;
}
.footer__copy {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.footer__version { color: var(--color-text-subtle); }

/* ─── Modal ─────────────────────────────────────────────────────────────── */

.modal-wrapper {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: var(--color-overlay);
  backdrop-filter: blur(4px);
  cursor: pointer;
}
.modal {
  position: relative;
  z-index: 1;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-xl);
}
.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
}
.modal__title {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-tight);
}
.modal__close {
  display: inline-grid;
  place-items: center;
  background: none;
  border: none;
  color: var(--color-text-subtle);
  cursor: pointer;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  transition: color var(--duration-base) var(--easing-standard);
}
.modal__close:hover { color: var(--color-text); }
.modal__close:focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 2px;
}
.modal__oauth {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}
.modal__divider {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-block: var(--space-5);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}
.modal__divider::before,
.modal__divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--color-border);
}
.modal__magic-link {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.modal__form {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.modal__form .label { margin-bottom: 0; }
.modal .input { max-width: none; }
.modal__form .btn-block { margin-top: var(--space-2); }

/* ─── Yat app ───────────────────────────────────────────────────────────── */

.yat-shell {
  min-height: calc(100vh - 4.5rem);
  padding: var(--space-6) var(--space-4);
  display: grid;
  place-items: start center;
}

.yat-gate {
  min-height: calc(100vh - 4.5rem);
  display: grid;
  place-items: center;
  padding: var(--space-8) var(--space-4);
}

.yat-gate__panel {
  width: min(100%, 30rem);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-8);
}

.yat-gate__eyebrow {
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-micro);
  text-transform: uppercase;
  margin-bottom: var(--space-3);
}

.yat-gate__title {
  font-size: var(--text-3xl);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  margin-bottom: var(--space-3);
}

.yat-gate__copy {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-6);
}

/* ─── Yat app — Option A · Minimal list ──────────────────────────────────
   Mobile-first single column. Divider-separated rows, circle checkboxes,
   inline pill compose bar. Color & typography stay on design tokens. */

.db {
  width: min(100%, 28rem);
  min-height: min(42rem, calc(100vh - 9rem));
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  font-family: var(--font-sans);
}

/* Header */
.db__header {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-5) var(--space-5) var(--space-4);
}

.db__header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-width: 0;
}

.db__avatar-wrap {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}

.db__avatar {
  position: relative;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: var(--color-primary-fg);
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  padding: 0;
  border: none;
  cursor: pointer;
  font: inherit;
  transition: filter 0.15s ease, transform 0.15s ease;
}

.db__avatar:hover { filter: brightness(1.1); }
.db__avatar:active { transform: scale(0.96); }
.db__avatar:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.db__avatar-letter {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.02em;
  user-select: none;
}

.db__avatar-dot {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 0.625rem;
  height: 0.625rem;
  border-radius: var(--radius-full);
  background: var(--color-success);
  border: 2px solid var(--color-surface);
}

.db__account-wrap {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}

.db__account-button {
  width: 2rem;
  height: 2rem;
  display: inline-grid;
  place-items: center;
  padding: 0;
  color: var(--color-text-muted);
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--easing-standard),
              color var(--duration-fast) var(--easing-standard),
              border-color var(--duration-fast) var(--easing-standard);
}
.db__account-button:hover {
  color: var(--color-text);
  background: var(--color-secondary-hover);
  border-color: var(--color-border-strong);
}
.db__account-button:focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 2px;
}

.db__account-menu {
  position: absolute;
  top: calc(100% + var(--space-2));
  right: 0;
  z-index: var(--z-overlay);
  min-width: 12rem;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-2);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.db__account-menu-item {
  appearance: none;
  background: transparent;
  border: none;
  font: inherit;
  text-align: left;
  color: var(--color-text);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--easing-standard);
}
.db__account-menu-item:hover { background: var(--color-secondary-hover); }
.db__account-menu-item:focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 1px;
}

.db__account-menu-version {
  margin-top: var(--space-1);
  padding: var(--space-2) var(--space-3) var(--space-1);
  color: var(--color-text-subtle);
  border-top: 1px solid var(--color-border);
  font-size: var(--text-xs);
  text-align: left;
  cursor: default;
  user-select: none;
}

.db__theme-switch {
  display: flex;
  gap: var(--space-1);
  padding: var(--space-1);
  background: var(--color-surface-alt);
  border-radius: var(--radius-md);
  margin-top: var(--space-1);
}

.db__theme-switch-button {
  flex: 1;
  appearance: none;
  background: transparent;
  border: none;
  font: inherit;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--easing-standard),
              color var(--duration-fast) var(--easing-standard);
}
.db__theme-switch-button:hover { color: var(--color-text); }
.db__theme-switch-button:focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 1px;
}
.db__theme-switch-button--active {
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: var(--shadow-sm);
}

.db__follow-system {
  appearance: none;
  background: transparent;
  border: none;
  font: inherit;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-align: left;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-sm);
  cursor: pointer;
  margin-top: var(--space-1);
}
.db__follow-system:hover { color: var(--color-text); }
.db__follow-system:focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 1px;
}

.db__header-meta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}

.db__live-dot {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: var(--radius-full);
  background: var(--color-success);
  box-shadow: 0 0 0 3px var(--color-success-soft);
  animation: db-live-pulse 1.8s ease-in-out infinite;
}

.db__live-dot--off {
  background: var(--color-text-subtle);
  box-shadow: none;
  animation: none;
}

@keyframes db-live-pulse {
  0%, 100% { transform: scale(1);    opacity: 1; }
  50%      { transform: scale(0.75); opacity: 0.5; }
}

.db__email {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 9rem;
}

.db__sync-badge {
  display: inline-flex;
  align-items: center;
  min-height: 1.25rem;
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
  background: var(--color-warning-soft);
  color: var(--color-warning-text);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  white-space: nowrap;
}

.db__signout {
  font: inherit;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-text-muted);
  background: none;
  border: 1px solid var(--color-border-strong);
  padding: 4px var(--space-3);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: color var(--duration-base) var(--easing-standard),
              border-color var(--duration-base) var(--easing-standard);
}
.db__signout:hover {
  color: var(--color-text);
  border-color: var(--color-text);
}

.db__title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: var(--space-3);
}

.db__title {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-display);
  line-height: var(--leading-tight);
  color: var(--color-text);
  min-width: 0;
  overflow-wrap: anywhere;
}

.db__space-heading {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.db__space-heading-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.db__space-title {
  min-width: 0;
}

.db__space-select-wrap {
  position: relative;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  cursor: pointer;
}

.db__space-select--header {
  display: block;
  width: 100%;
  min-width: 0;
  height: auto;
  padding: 0 1.75rem 0 0;
  color: inherit;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-display);
  line-height: var(--leading-tight);
  text-overflow: ellipsis;
  white-space: nowrap;
  appearance: none;
  cursor: pointer;
}

.db__space-chevron {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  flex-shrink: 0;
  pointer-events: none;
  color: var(--color-text-subtle);
}

.db__space-select-wrap:hover .db__space-select--header,
.db__space-select-wrap:hover .db__space-chevron {
  color: var(--color-primary);
}

.db__space-select--header:focus {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 3px;
}

.db__space-settings {
  width: 2rem;
  height: 2rem;
  border-color: transparent;
  background: transparent;
}

.db__space-subline {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.db__tag {
  align-self: center;
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
  background: var(--color-secondary);
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-micro);
  text-transform: lowercase;
}

.db__counts {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  white-space: nowrap;
}

.db__space-note {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
}

/* Body — list */
.db__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  border-top: 1px solid var(--color-border);
}

.db__space-form {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-5);
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}

.db__space-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-text-subtle);
  letter-spacing: var(--tracking-micro);
  text-transform: uppercase;
}

.db__space-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.db__space-prefix {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.db__space-input {
  flex: 1;
  min-width: 0;
  height: 2.75rem;
  padding: 0 var(--space-3);
  font: inherit;
  font-size: var(--text-sm);
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color var(--duration-base) var(--easing-standard),
              box-shadow var(--duration-base) var(--easing-standard);
}
.db__space-input:focus {
  border-color: var(--color-focus-ring);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
}

.db__space-select {
  flex: 1;
  min-width: 0;
  height: 2.75rem;
  padding: 0 var(--space-2) 0 var(--space-3);
  font: inherit;
  font-size: var(--text-sm);
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  outline: none;
}

.db__space-select:focus {
  border-color: var(--color-focus-ring);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
}

.db__space-button {
  flex-shrink: 0;
  height: 2.75rem;
  padding: 0 var(--space-3);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-primary-fg);
  background: var(--color-primary);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--duration-base) var(--easing-standard),
              opacity var(--duration-base) var(--easing-standard);
}
.db__space-button:hover { background: var(--color-primary-hover); }
.db__space-button:disabled {
  cursor: default;
  opacity: 0.65;
}

.db__secondary-button {
  flex-shrink: 0;
  height: 2.75rem;
  padding: 0 var(--space-3);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color var(--duration-base) var(--easing-standard),
              color var(--duration-base) var(--easing-standard),
              background var(--duration-base) var(--easing-standard);
}
.db__secondary-button:hover {
  color: var(--color-primary);
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
}

.db__icon-button {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  display: inline-grid;
  place-items: center;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color var(--duration-base) var(--easing-standard),
              color var(--duration-base) var(--easing-standard),
              background var(--duration-base) var(--easing-standard);
}
.db__icon-button:hover {
  color: var(--color-primary);
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
}

.db__danger-button {
  flex-shrink: 0;
  min-height: 2.75rem;
  padding: 0 var(--space-3);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-danger);
  background: var(--color-danger-soft);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
}
.db__danger-button:hover {
  border-color: var(--color-danger);
}
.db__danger-button:disabled {
  cursor: default;
  opacity: 0.65;
}

.db__settings {
  display: grid;
  gap: var(--space-5);
  padding: var(--space-5);
}

.db__settings-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

.db__settings-title {
  margin: 0;
  color: var(--color-text);
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
}

.db__settings-subtitle {
  margin: 0;
  color: var(--color-text);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}

.db__settings-copy {
  margin: var(--space-1) 0 0;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}

.db__settings-section {
  display: grid;
  gap: var(--space-3);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border);
}

.db__settings .db__space-row {
  align-items: stretch;
  flex-direction: column;
}

.db__settings .db__space-input,
.db__settings .db__space-select {
  flex: none;
  width: 100%;
  height: 3.25rem;
  padding-inline: var(--space-4);
  font-size: var(--text-base);
}

.db__settings .db__space-row .db__space-button,
.db__settings .db__space-row .db__secondary-button,
.db__settings .db__space-row .db__danger-button {
  width: 100%;
  min-height: 3rem;
}

.db__settings-section--danger {
  color: var(--color-danger-text);
}

.db__member-list {
  display: grid;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.db__member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}
.db__member-row:last-child { border-bottom: none; }

.db__member-row .db__danger-button {
  width: auto;
  align-self: center;
}

.db__member-meta {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.db__member-email {
  color: var(--color-text);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  overflow-wrap: anywhere;
}

.db__member-detail {
  color: var(--color-text-subtle);
  font-size: var(--text-xs);
}

.db__form-error,
.db__form-success {
  font-size: var(--text-xs);
  line-height: var(--leading-normal);
}
.db__form-error { color: var(--color-danger-text); }
.db__form-success { color: var(--color-success-text); }

.db__sync-warning {
  margin: var(--space-3) var(--space-4) 0;
  color: var(--color-warning-text);
  font-size: var(--text-xs);
  line-height: var(--leading-normal);
}

.db__notice {
  display: grid;
  justify-items: center;
  gap: var(--space-3);
}

.db__notice-title {
  color: var(--color-text);
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
}

.db__list {
  display: flex;
  flex-direction: column;
}

.db__row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0 var(--space-4) 0 var(--space-5);
  min-height: 3.5rem;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  transition: opacity var(--duration-base) var(--easing-standard);
}

.db__row-toggle {
  flex: 1;
  min-width: 0;
  align-self: stretch;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 0;
  font: inherit;
  text-align: left;
  background: transparent;
  border: none;
  cursor: pointer;
}

.db__check {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: var(--radius-full);
  border: 2px solid var(--color-border-strong);
  background: transparent;
  color: var(--color-primary-fg);
  display: inline-grid;
  place-items: center;
  padding: 0;
  flex-shrink: 0;
  transition: background var(--duration-fast) var(--easing-standard),
              border-color var(--duration-base) var(--easing-standard);
}
.db__row-toggle:hover .db__check { border-color: var(--color-text); }
.db__row-toggle:focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 2px;
  border-radius: var(--radius-md);
}

.db__row--done .db__check {
  background: var(--color-primary);
  border-color: var(--color-primary);
  animation: db-check-pop 0.38s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes db-check-pop {
  0%   { transform: scale(0.7);  }
  55%  { transform: scale(1.25); }
  75%  { transform: scale(0.95); }
  100% { transform: scale(1);    }
}

.db__row-text {
  flex: 1;
  min-width: 0;
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  color: var(--color-text);
  line-height: 1.35;
  overflow-wrap: anywhere;
  transition: color var(--duration-base) var(--easing-standard);
}

.db__row--done .db__row-text {
  color: var(--color-text-subtle);
  font-weight: var(--weight-regular);
  text-decoration: line-through;
  text-decoration-color: var(--color-border-strong);
}

.db__delete {
  width: 1.75rem;
  height: 1.75rem;
  display: inline-grid;
  place-items: center;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  color: var(--color-text-subtle);
  font-size: var(--text-xl);
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  flex-shrink: 0;
  transition: opacity var(--duration-base) var(--easing-standard),
              color var(--duration-base) var(--easing-standard),
              background var(--duration-base) var(--easing-standard);
}
.db__row:hover .db__delete,
.db__delete:focus-visible { opacity: 1; }
.db__delete:hover {
  color: var(--color-danger);
  background: var(--color-danger-soft);
}

/* Got it section */
.db__done-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.db__done-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-text-subtle);
  letter-spacing: var(--tracking-micro);
  text-transform: uppercase;
}

.db__done-icon {
  width: 0.8rem;
  height: 0.8rem;
}

.db__clear {
  font: inherit;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-text-subtle);
  background: none;
  border: none;
  cursor: pointer;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  transition: color var(--duration-base) var(--easing-standard);
}
.db__clear:hover { color: var(--color-danger); }

/* Status / empty */
.db__status,
.db__empty {
  padding: var(--space-12) var(--space-5);
  text-align: center;
  color: var(--color-text-subtle);
  font-size: var(--text-sm);
}
.db__status--error { color: var(--color-danger-text); }

/* Compose */
.db__compose {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
}

.db__input-pill {
  flex: 1;
  display: flex;
  align-items: center;
  height: 2.5rem;
  padding: 0 var(--space-4);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  transition: border-color var(--duration-base) var(--easing-standard),
              box-shadow var(--duration-base) var(--easing-standard);
}
.db__input-pill:focus-within {
  border-color: var(--color-focus-ring);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
}

.db__input {
  flex: 1;
  width: 100%;
  min-width: 0;
  font: inherit;
  font-size: var(--text-base);
  color: var(--color-text);
  background: transparent;
  border: none;
  outline: none;
  padding: 0;
}
.db__input::placeholder { color: var(--color-text-subtle); }

.db__add {
  width: 2.25rem;
  height: 2.25rem;
  display: inline-grid;
  place-items: center;
  background: var(--color-primary);
  color: var(--color-primary-fg);
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--duration-base) var(--easing-standard),
              transform var(--duration-fast) var(--easing-standard);
}
.db__add:hover { background: var(--color-primary-hover); }
.db__add:active { transform: scale(0.94); }
.db__add:focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 2px;
}

/* ─── Responsive & motion ───────────────────────────────────────────────── */

@media (max-width: 640px) {
  .nav      { padding: var(--space-3) var(--space-4); }
  .hero     { padding: var(--space-12) var(--space-4); }
  .hero__content { grid-template-columns: 1fr; gap: var(--space-8); }
  .hero__cta { flex-direction: column; align-items: stretch; }
  .features { padding: var(--space-10) var(--space-4); }
  .modal    { padding: var(--space-6); }
  .yat-shell {
    padding: 0;
    place-items: stretch;
    min-height: 100dvh;
  }
  .db {
    width: 100%;
    height: 100dvh;
    min-height: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
  }
  .db__compose {
    position: sticky;
    bottom: 0;
    padding-bottom: max(var(--space-3), env(safe-area-inset-bottom));
  }
  .db__title-row { grid-template-columns: minmax(0, 1fr) auto; }
  .db__space-select--header { font-size: var(--text-xl); }
  .db__space-row { align-items: stretch; flex-direction: column; }
  .db__settings-head,
  .db__member-row { align-items: stretch; flex-direction: column; }
  .db__member-row .db__danger-button { align-self: flex-start; }
  .db__space-prefix { align-self: flex-start; }
  .db__email { display: none; }
  .db__delete { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
