:root {
  color-scheme: light;
  --ink: #151313;
  --ink-soft: #403836;
  --paper: #f7f3ea;
  --paper-2: #ebece4;
  --line: rgba(21, 19, 19, 0.16);
  --rose: #f35f6b;
  --rose-dark: #bf3544;
  --mint: #7dd3b0;
  --gold: #d39b36;
  --panel-h: 76px;
  --bottom-h: 96px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(243, 95, 107, 0.16), transparent 34%),
    linear-gradient(315deg, rgba(125, 211, 176, 0.18), transparent 34%),
    var(--paper-2);
  color: var(--ink);
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.date-app {
  position: relative;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
}

.top-panel,
.bottom-panel {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  border-color: rgba(21, 19, 19, 0.14);
  background: rgba(247, 243, 234, 0.91);
  backdrop-filter: blur(22px);
}

.top-panel {
  top: 0;
  min-height: calc(var(--panel-h) + var(--safe-top));
  padding: calc(12px + var(--safe-top)) clamp(14px, 3vw, 28px) 12px;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(21, 19, 19, 0.12);
  border-radius: 8px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 800;
  letter-spacing: 0;
}

.brand__copy {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.brand__copy strong {
  font-size: 18px;
  line-height: 1.05;
}

.brand__copy small {
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
}

.top-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.pill {
  min-height: 34px;
  max-width: 150px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--ink-soft);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pill--wallet {
  color: var(--ink);
  background: rgba(125, 211, 176, 0.24);
}

.workspace,
.auth-screen {
  height: 100dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: calc(var(--panel-h) + var(--safe-top) + 18px) clamp(14px, 3vw, 28px) calc(var(--bottom-h) + var(--safe-bottom) + 22px);
}

.screen,
.auth-box {
  width: min(1040px, 100%);
  margin: 0 auto;
}

.auth-screen {
  display: grid;
  place-items: center;
}

.auth-box {
  max-width: 420px;
  display: grid;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(247, 243, 234, 0.94);
}

.auth-box h1,
.screen--loading h1,
.screen--complete h1 {
  margin: 0;
  font-size: clamp(26px, 4vw, 42px);
  line-height: 1;
  letter-spacing: 0;
}

.people-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.person-block,
.settings-block {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(247, 243, 234, 0.88);
  box-shadow: 0 18px 56px rgba(21, 19, 19, 0.08);
}

.person-block {
  padding: 16px;
}

.settings-block {
  margin-top: 14px;
  padding: 16px;
}

.block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink-soft);
  font-size: 13px;
  text-transform: uppercase;
}

.block-head b {
  color: var(--ink);
  font-size: 12px;
}

label {
  display: grid;
  gap: 7px;
}

label span,
.setting-row strong {
  font-size: 14px;
  line-height: 1.2;
}

label small,
.setting-row small,
.category-option small {
  color: rgba(64, 56, 54, 0.72);
  font-size: 12px;
  line-height: 1.2;
}

input,
textarea {
  width: 100%;
  border: 1px solid rgba(21, 19, 19, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.66);
  color: var(--ink);
  outline: none;
}

input {
  min-height: 44px;
  padding: 0 12px;
}

textarea {
  min-height: 128px;
  resize: vertical;
  padding: 12px;
  line-height: 1.45;
}

input:focus,
textarea:focus,
button:focus-visible {
  border-color: var(--rose);
  box-shadow: 0 0 0 3px rgba(243, 95, 107, 0.18);
}

.setting-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  align-items: center;
  gap: 18px;
  padding-top: 2px;
}

.setting-row--slider input {
  accent-color: var(--rose);
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(21, 19, 19, 0.05);
}

.segmented button {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-soft);
  font-weight: 700;
}

.segmented button.is-active {
  background: var(--ink);
  color: var(--paper);
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.category-option {
  min-height: 84px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 12px;
  border: 1px solid rgba(21, 19, 19, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.42);
}

.category-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.category-option.is-checked {
  border-color: rgba(243, 95, 107, 0.58);
  background: rgba(243, 95, 107, 0.1);
}

.category-option span {
  font-weight: 800;
}

.notice-band {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid rgba(21, 19, 19, 0.14);
  border-radius: 8px;
  background: rgba(125, 211, 176, 0.13);
}

.notice-band p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.35;
}

.screen--loading,
.screen--complete {
  min-height: calc(100dvh - var(--panel-h) - var(--bottom-h) - 80px);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 16px;
  text-align: center;
}

.pulse-ring {
  width: 96px;
  height: 96px;
  border: 2px solid rgba(243, 95, 107, 0.24);
  border-top-color: var(--rose);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.screen--evening {
  min-height: calc(100dvh - var(--panel-h) - var(--bottom-h) - 54px);
  display: grid;
  align-content: center;
  gap: 18px;
}

.question-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink-soft);
  font-size: 14px;
}

.heat-meter {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 5px;
  height: 12px;
}

.heat-meter span {
  border-radius: 4px;
  background: rgba(21, 19, 19, 0.12);
}

.heat-meter span.is-hot {
  background: linear-gradient(90deg, var(--mint), var(--rose));
}

.question-surface {
  min-height: min(480px, 58dvh);
  display: grid;
  align-content: center;
  gap: 18px;
  padding: clamp(22px, 5vw, 54px);
  border: 1px solid rgba(21, 19, 19, 0.14);
  border-radius: 8px;
  background:
    radial-gradient(circle at 0% 0%, rgba(243, 95, 107, 0.16), transparent 32%),
    radial-gradient(circle at 100% 100%, rgba(125, 211, 176, 0.2), transparent 32%),
    rgba(247, 243, 234, 0.92);
}

.target {
  margin: 0;
  color: var(--rose-dark);
  font-size: clamp(18px, 4vw, 30px);
  font-weight: 900;
}

.question-surface h1 {
  max-width: 900px;
  margin: 0;
  font-size: clamp(32px, 6.5vw, 72px);
  line-height: 0.98;
  letter-spacing: 0;
  text-wrap: balance;
}

.bottom-panel {
  bottom: 0;
  min-height: calc(var(--bottom-h) + var(--safe-bottom));
  padding: 12px clamp(14px, 3vw, 28px) calc(12px + var(--safe-bottom));
  justify-content: space-between;
  gap: 14px;
  border-top: 1px solid var(--line);
}

.bottom-meta {
  min-width: 120px;
  color: var(--ink-soft);
  font-size: 14px;
}

.bottom-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.primary-action,
.secondary-action,
.tertiary-action,
.primary-inline,
.quiet-inline {
  min-height: 48px;
  border-radius: 8px;
  padding: 0 18px;
  border: 1px solid transparent;
  font-weight: 850;
}

.primary-action,
.primary-inline {
  background: var(--ink);
  color: var(--paper);
}

.secondary-action,
.tertiary-action,
.quiet-inline {
  background: rgba(255, 255, 255, 0.44);
  border-color: var(--line);
  color: var(--ink);
}

.primary-action {
  min-width: 178px;
}

.inline-error {
  min-height: 18px;
  margin: 0;
  color: var(--rose-dark);
  font-size: 13px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--bottom-h) + var(--safe-bottom) + 16px);
  z-index: 40;
  width: min(420px, calc(100vw - 28px));
  transform: translateX(-50%);
  border: 1px solid rgba(21, 19, 19, 0.18);
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--ink);
  color: var(--paper);
  font-size: 14px;
  box-shadow: 0 20px 50px rgba(21, 19, 19, 0.22);
}

[hidden] {
  display: none !important;
}

@media (max-width: 760px) {
  :root {
    --panel-h: 72px;
    --bottom-h: 112px;
  }

  .brand__mark {
    width: 40px;
    height: 40px;
  }

  .brand__copy small {
    max-width: 150px;
    white-space: normal;
  }

  .top-meta .pill:first-child {
    display: none;
  }

  .people-grid,
  .category-grid {
    grid-template-columns: 1fr;
  }

  .setting-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .bottom-panel {
    align-items: stretch;
    flex-direction: column;
    justify-content: center;
  }

  .bottom-meta {
    min-width: 0;
    font-size: 13px;
  }

  .bottom-actions {
    display: grid;
    grid-template-columns: minmax(94px, 0.9fr) minmax(150px, 1.4fr);
    width: 100%;
  }

  .bottom-actions.has-tertiary {
    grid-template-columns: minmax(84px, 0.8fr) minmax(92px, 0.9fr) minmax(134px, 1.2fr);
  }

  .primary-action,
  .secondary-action,
  .tertiary-action {
    width: 100%;
    min-width: 0;
    padding: 0 12px;
  }

  .question-surface {
    min-height: 50dvh;
  }
}
