:root {
  color-scheme: light;

  /* Surfaces & ink */
  --paper: #f6f1ea;
  --paper-deep: #ece3d8;
  --surface: #fffdf9;
  --surface-glass: rgba(255, 253, 249, 0.78);
  --ink: #263330;
  --ink-soft: #5d6a66;
  --ink-faint: #7d8783;
  --line: rgba(38, 51, 48, 0.1);
  --line-strong: rgba(38, 51, 48, 0.16);

  /* Accents (muted pastels) */
  --coral: #c44b45;
  --coral-deep: #a83a36;
  --rose: #f7dbd6;
  --rose-tint: #fbeeeb;
  --mint: #e2efe9;
  --mint-strong: #356b5f;
  --gold: #96712b;
  --gold-soft: #f4e7cc;
  --lavender: #e9e3f5;
  --sky: #e2ecf4;
  --electric: #7ae7ff;
  --electric-deep: #167d9b;
  --white: #fffdf9;

  --focus-ring: rgba(196, 75, 69, 0.16);

  /* One soft elevation scale */
  --shadow-soft: 0 8px 22px rgba(76, 55, 39, 0.07);
  --shadow-card: 0 14px 32px rgba(76, 55, 39, 0.1);
  --shadow-float: 0 24px 48px rgba(76, 55, 39, 0.16);
  --shadow-inset: inset 0 2px 6px rgba(76, 55, 39, 0.1);
  --shadow: var(--shadow-card);

  /* Shape */
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-xl: 26px;
  --radius-pill: 999px;

  /* Space & type scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
  --space-8: 48px;
  --text-xs: 0.6875rem;
  --text-sm: 0.8125rem;
  --text-base: 0.9375rem;
  --text-lg: 1.0625rem;
  --text-xl: clamp(1.35rem, 4vw, 1.6rem);
  --text-hero: clamp(2.4rem, 8vw, 4.2rem);

  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
  --ease-spring: cubic-bezier(0.2, 1.2, 0.35, 1);
  --dur: 180ms;
  --dur-slow: 260ms;
  --font: "Avenir Next", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;

  /* Button system tokens (soft-ui + pastel-ui) */
  --btn-min: 48px;
  --btn-radius: 18px;
  --btn-radius-pill: 999px;
  --btn-raised:
    0 10px 24px rgba(76, 55, 39, 0.1),
    0 2px 6px rgba(76, 55, 39, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
  --btn-raised-hover:
    0 16px 32px rgba(76, 55, 39, 0.14),
    0 4px 10px rgba(76, 55, 39, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  --btn-pressed:
    inset 0 3px 10px rgba(76, 55, 39, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  --coral-grad: linear-gradient(168deg, #d9615a 0%, var(--coral) 42%, var(--coral-deep) 100%);
  --mint-grad: linear-gradient(168deg, #7fc4b2 0%, var(--mint-strong) 100%);
  --beat-grad: linear-gradient(168deg, #e8836a 0%, #c25a49 100%);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
}

body {
  min-height: 100dvh;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(217, 93, 86, 0.28);
  outline-offset: 3px;
}

.ambient-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(32, 48, 45, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(32, 48, 45, 0.028) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, black, transparent 74%);
}

.is-hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--coral-deep);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.auth-view {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
}

.auth-shell {
  width: min(100%, 430px);
  animation: rise-in 500ms ease both;
}

.brand-lockup,
.brand-button {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-lockup {
  margin-bottom: 30px;
}

.brand-lockup h1,
.pair-copy h1,
.presence-row h1,
.settings-header h2 {
  margin: 0;
  font-size: clamp(2rem, 7vw, 3.4rem);
  line-height: 1;
  letter-spacing: 0;
}

.brand-mark {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--white);
  background: var(--coral);
  box-shadow: 0 13px 27px rgba(185, 67, 64, 0.22);
}

.brand-mark svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 1.8;
}

.brand-mark-small {
  width: 34px;
  height: 34px;
  box-shadow: none;
}

.brand-mark-small svg {
  width: 16px;
  height: 16px;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  margin-bottom: 26px;
  background: var(--paper-deep);
  border-radius: 8px;
}

.segment {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-soft);
  font-weight: 700;
  cursor: pointer;
}

.segment.is-active {
  color: var(--ink);
  background: var(--white);
  box-shadow: 0 5px 16px rgba(76, 55, 39, 0.1);
}

.auth-form,
.settings-form,
.pair-form {
  display: grid;
  gap: 17px;
}

.auth-form label,
.settings-form label,
.pair-form label {
  display: grid;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 0.84rem;
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: rgba(255, 253, 249, 0.78);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

input {
  min-height: 50px;
}

textarea {
  min-height: 126px;
  padding-block: 13px;
  line-height: 1.65;
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: rgba(217, 93, 86, 0.58);
  box-shadow: 0 0 0 4px rgba(217, 93, 86, 0.09);
  outline: 0;
}

.primary-button,
.quiet-button,
.danger-button {
  min-height: 46px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.primary-button {
  border: 1px solid var(--coral);
  color: var(--white);
  background: var(--coral);
  box-shadow: 0 10px 24px rgba(185, 67, 64, 0.18);
}

.primary-button:hover {
  background: var(--coral-deep);
  border-color: var(--coral-deep);
}

.primary-button:disabled,
.quiet-button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.primary-button svg,
.quiet-button svg,
.danger-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.primary-button.compact {
  min-height: 50px;
  white-space: nowrap;
}

.quiet-button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  background: var(--white);
}

.quiet-button:hover {
  border-color: rgba(63, 123, 109, 0.4);
  background: var(--mint);
}

.danger-button {
  width: 100%;
  margin-top: 24px;
  border: 1px solid rgba(185, 67, 64, 0.2);
  color: var(--coral-deep);
  background: rgba(217, 93, 86, 0.07);
}

.form-message {
  min-height: 18px;
  margin: -5px 0 0;
  color: var(--coral-deep);
  font-size: 0.82rem;
  line-height: 1.45;
}

.form-message.is-success {
  color: var(--mint-strong);
}

.app-view {
  width: min(100%, 980px);
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(24px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 44px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.board-button {
  position: relative;
}

.icon-badge {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 10px;
  height: 10px;
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: var(--coral);
}

.brand-button {
  padding: 0;
  border: 0;
  background: transparent;
  font-weight: 800;
  cursor: pointer;
}

.icon-button {
  width: 44px;
  height: 44px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 253, 249, 0.76);
  cursor: pointer;
}

.icon-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pair-layout {
  width: min(100%, 700px);
  margin: auto;
  display: grid;
  gap: 26px;
  padding: 40px 0;
  animation: rise-in 500ms ease both;
}

.pair-copy {
  max-width: 560px;
}

.pair-copy h1 {
  font-size: clamp(2.2rem, 8vw, 4.2rem);
}

.pair-copy > p:last-child {
  max-width: 440px;
  margin: 17px 0 0;
  color: var(--ink-soft);
  line-height: 1.75;
}

.invite-ticket {
  padding: 24px;
  border-block: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px 20px;
  align-items: center;
}

.invite-ticket > span {
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 700;
}

.invite-ticket strong {
  grid-row: 2;
  font-size: clamp(2rem, 8vw, 3.2rem);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.12em;
}

.invite-ticket .quiet-button {
  grid-row: 1 / 3;
  grid-column: 2;
}

.pair-form {
  width: min(100%, 580px);
}

.inline-field {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.inline-field input {
  text-transform: uppercase;
  letter-spacing: 0.13em;
}

.dashboard {
  width: min(100%, 720px);
  margin: 0 auto;
  padding: clamp(30px, 7vh, 70px) 0 34px;
  animation: rise-in 520ms ease both;
}

.presence-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.presence-row h1 {
  font-size: clamp(2.4rem, 8vw, 4.7rem);
}

.presence-pill {
  min-height: 34px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  background: rgba(255, 253, 249, 0.6);
  font-size: 0.77rem;
  font-weight: 700;
  white-space: nowrap;
}

.presence-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #a4aaa5;
}

.presence-pill.is-online .presence-dot {
  background: #4f9a7e;
  box-shadow: 0 0 0 5px rgba(79, 154, 126, 0.12);
}

.button-stage {
  position: relative;
  height: clamp(300px, 48vh, 430px);
  display: grid;
  place-items: center;
}

.orbit {
  position: absolute;
  border: 1px solid rgba(217, 93, 86, 0.15);
  border-radius: 50%;
  pointer-events: none;
}

.orbit-one {
  width: min(70vw, 330px);
  height: min(70vw, 330px);
}

.orbit-two {
  width: min(84vw, 398px);
  height: min(84vw, 398px);
  border-color: rgba(63, 123, 109, 0.1);
}

.miss-button {
  position: relative;
  z-index: 1;
  width: clamp(210px, 31vw, 280px);
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--white);
  background: var(--coral);
  box-shadow:
    0 24px 55px rgba(185, 67, 64, 0.24),
    inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.miss-button:hover {
  transform: translateY(-3px);
  background: var(--coral-deep);
  box-shadow:
    0 30px 64px rgba(185, 67, 64, 0.29),
    inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.miss-button:active {
  transform: scale(0.975);
}

.miss-button:disabled {
  cursor: wait;
  background: #c58f8a;
}

.miss-button-inner {
  display: grid;
  justify-items: center;
  gap: 9px;
}

.heart-icon {
  width: clamp(46px, 8vw, 68px);
  height: clamp(46px, 8vw, 68px);
  fill: rgba(255, 255, 255, 0.16);
  stroke: currentColor;
  stroke-width: 1.35;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.miss-button strong {
  font-size: clamp(1.5rem, 5vw, 2rem);
  letter-spacing: 0;
}

.miss-button small {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.77rem;
}

.miss-button.is-pulsing {
  animation: heartbeat 720ms ease;
}

.miss-button.is-pulsing .heart-icon {
  animation: heart-glow 720ms ease;
}

.hug-button {
  position: absolute;
  right: max(4vw, 18px);
  bottom: 31px;
  z-index: 2;
  min-height: 42px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(63, 123, 109, 0.24);
  border-radius: 999px;
  color: var(--mint-strong);
  background: rgba(255, 253, 249, 0.86);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(63, 123, 109, 0.08);
}

.hug-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hug-button.is-hugging {
  animation: hug-pulse 680ms ease;
}

.hug-button:disabled {
  opacity: 0.55;
  cursor: progress;
}

.last-thought {
  min-height: 24px;
  margin: 0;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.hug-summary {
  min-height: 18px;
  margin: 8px 0 0;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.76rem;
  letter-spacing: 0.01em;
}

.mood-strip,
.days-section,
.shared-peek {
  max-width: 620px;
  margin: 24px auto 0;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.mood-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 15px;
}

.mood-heading h2,
.shared-peek h2 {
  margin: 0;
  font-size: 1rem;
}

.mood-heading > p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.76rem;
  text-align: right;
}

.mood-choices {
  margin-top: 13px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
}

.mood-choice {
  min-height: 48px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 253, 249, 0.62);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.mood-choice::before {
  content: "";
  display: block;
  width: 10px;
  height: 10px;
  margin: 0 auto 6px;
  border-radius: 50%;
  background: var(--mood-color, var(--ink-soft));
}

.mood-choice[data-mood="happy"] { --mood-color: #d4a653; }
.mood-choice[data-mood="calm"] { --mood-color: #6ea69a; }
.mood-choice[data-mood="tired"] { --mood-color: #8495aa; }
.mood-choice[data-mood="hug"] { --mood-color: var(--coral); }

.mood-choice.is-active {
  border-color: rgba(63, 123, 109, 0.5);
  background: var(--mint);
  color: var(--mint-strong);
}

.day-metrics {
  margin-top: 15px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
}

.day-metrics > div {
  min-height: 92px;
  padding: 14px 10px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 5px;
  background: var(--paper);
  text-align: center;
}

.day-metrics strong {
  font-size: clamp(1.4rem, 5vw, 2rem);
}

.day-metrics span {
  color: var(--ink-soft);
  font-size: 0.7rem;
}

.anniversary-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
}

.anniversary-list li {
  min-height: 38px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  font-size: 0.78rem;
}

.anniversary-list small {
  color: var(--ink-soft);
}

.shared-peek {
  padding-bottom: 6px;
}

.board-peek {
  margin: 0 auto;
  padding: 20px 0 2px;
  border-top: 1px solid var(--line);
  max-width: 540px;
}

.board-peek-heading {
  margin-bottom: 7px;
  align-items: flex-end;
}

.board-peek-heading h2 {
  font-size: 1.1rem;
}

.board-preview {
  margin: 0;
  min-height: 24px;
  color: var(--ink-soft);
  font-size: 0.8rem;
  line-height: 1.6;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.history-section {
  margin-top: 52px;
  padding-top: 25px;
  border-top: 1px solid var(--line);
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.section-heading h2,
.setting-copy h3,
.settings-header h2 {
  margin: 0;
  letter-spacing: 0;
}

.section-heading h2 {
  font-size: 1rem;
}

.quiet-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--mint-strong);
  font-size: 0.74rem;
  font-weight: 700;
}

.quiet-badge svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

.history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
}

.history-item {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 12px;
  align-items: center;
  min-height: 58px;
  border-bottom: 1px solid var(--line);
}

.history-mark {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--coral-deep);
  background: rgba(217, 93, 86, 0.1);
}

.history-mark svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 1.6;
}

.history-copy strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
}

.history-copy span,
.history-time,
.empty-history {
  color: var(--ink-soft);
  font-size: 0.75rem;
}

.history-time {
  white-space: nowrap;
}

.empty-history {
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}

.app-footer {
  width: min(100%, 720px);
  margin: auto auto 0;
  padding-top: 34px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: var(--ink-soft);
  font-size: 0.7rem;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  padding: 20px;
  display: grid;
  place-items: end center;
  background: rgba(25, 35, 33, 0.34);
  backdrop-filter: blur(7px);
}

.settings-panel {
  width: min(100%, 520px);
  max-height: min(88dvh, 760px);
  overflow-y: auto;
  padding: 24px;
  border-radius: 8px 8px 0 0;
  background: var(--white);
  box-shadow: var(--shadow);
  animation: panel-in 260ms ease both;
}

.board-panel {
  width: min(100%, 620px);
  max-height: min(90dvh, 840px);
}

.board-header {
  margin-bottom: 20px;
}

.board-header h2 {
  font-size: clamp(2rem, 7vw, 2.6rem);
}

.board-form {
  display: grid;
  gap: 11px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.board-compose-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}

.board-tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.file-picker,
.schedule-picker {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}

.file-picker svg,
.schedule-picker svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.file-picker input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.schedule-picker input {
  width: auto;
  min-height: 36px;
  padding: 0 8px;
  font-size: 0.72rem;
}

.board-compose-footer .setting-note {
  margin: 0;
}

.board-form .form-message {
  margin: 0;
}

.board-list {
  list-style: none;
  display: grid;
  gap: 0;
  margin: 0;
  padding: 8px 0 0;
}

.board-note {
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

.board-note:last-child {
  border-bottom: 0;
}

.board-note-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 8px;
}

.board-note-meta strong {
  font-size: 0.84rem;
}

.board-note-meta time,
.board-reply-meta time {
  color: var(--ink-soft);
  font-size: 0.7rem;
  white-space: nowrap;
}

.board-note-body {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 0.94rem;
  line-height: 1.75;
}

.board-note-image {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  margin-top: 12px;
  border-radius: 7px;
  background: var(--paper-deep);
}

.scheduled-label {
  display: inline-flex;
  margin-left: 7px;
  padding: 2px 6px;
  border-radius: 999px;
  color: var(--mint-strong);
  background: var(--mint);
  font-size: 0.65rem;
  font-weight: 700;
}

.board-note.mine .board-note-body {
  color: var(--ink);
}

.board-replies {
  list-style: none;
  margin: 12px 0 0;
  padding: 0 0 0 15px;
  display: grid;
  gap: 11px;
  border-left: 2px solid var(--mint);
}

.board-reply {
  display: grid;
  gap: 3px;
}

.board-reply-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.board-reply-meta strong {
  color: var(--mint-strong);
  font-size: 0.74rem;
}

.board-reply p {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--ink-soft);
  font-size: 0.83rem;
  line-height: 1.65;
}

.reply-toggle {
  min-height: 30px;
  margin-top: 10px;
  padding: 0 5px;
  border: 0;
  background: transparent;
  color: var(--coral-deep);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}

.reply-form {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.reply-form input {
  min-height: 40px;
  font-size: 0.82rem;
}

.reply-form .quiet-button {
  min-height: 40px;
  padding-inline: 13px;
}

.empty-board {
  padding: 26px 0 16px;
  color: var(--ink-soft);
  font-size: 0.8rem;
  text-align: center;
}

.settings-stack {
  grid-template-columns: 1fr;
}

.settings-stack .setting-copy,
.settings-stack .totp-actions,
.settings-stack .form-message,
.settings-stack .setting-note {
  grid-column: 1 / -1;
}

.settings-inline-form {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 9px;
  align-items: end;
}

.settings-inline-form label,
.totp-setup label {
  display: grid;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 0.74rem;
  font-weight: 700;
}

.settings-inline-form input,
.totp-setup input {
  min-height: 42px;
  font-size: 0.8rem;
}

.totp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.totp-setup {
  display: grid;
  gap: 10px;
  padding: 15px;
  border-radius: 7px;
  background: var(--paper);
}

.totp-setup p,
.recovery-codes p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.76rem;
  line-height: 1.6;
}

.totp-setup code {
  overflow-wrap: anywhere;
  font-size: 0.82rem;
}

.recovery-codes {
  display: grid;
  gap: 9px;
}

.recovery-codes pre {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
  font-size: 0.78rem;
  line-height: 1.65;
  white-space: pre-wrap;
}

.shared-list-panel {
  width: min(100%, 560px);
}

.shared-item-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.shared-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
}

.shared-item {
  min-height: 52px;
  display: grid;
  grid-template-columns: 26px 1fr auto;
  align-items: center;
  gap: 9px;
  border-bottom: 1px solid var(--line);
}

.shared-item input {
  width: 19px;
  min-height: 19px;
  accent-color: var(--mint-strong);
}

.shared-item span {
  font-size: 0.85rem;
  line-height: 1.5;
}

.shared-item.is-done span {
  color: var(--ink-soft);
  text-decoration: line-through;
}

.shared-item button {
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
}


.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 27px;
}

.settings-header h2 {
  font-size: 1.9rem;
}

.settings-section {
  padding: 18px 0;
  border-block: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px 18px;
  align-items: center;
}

.setting-copy h3 {
  font-size: 0.95rem;
}

.setting-copy p,
.setting-note {
  margin: 5px 0 0;
  color: var(--ink-soft);
  font-size: 0.76rem;
  line-height: 1.55;
}

.ios-install-hint,
.setting-note {
  grid-column: 1 / -1;
}

.settings-form {
  padding-top: 22px;
}

.switch-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.switch {
  position: relative;
  width: 46px;
  height: 28px;
  flex: 0 0 auto;
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.switch > span:not(.sr-only) {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #c7cec9;
  transition: background 180ms ease;
}

.switch > span:not(.sr-only)::after {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 3px 8px rgba(32, 48, 45, 0.2);
  transition: transform 180ms ease;
}

.switch input:checked + span {
  background: var(--mint-strong);
}

.switch input:checked + span::after {
  transform: translateX(18px);
}

.time-grid {
  display: grid;
  grid-template-columns: 1fr 24px 1fr;
  gap: 10px;
  align-items: end;
}

.time-separator {
  min-height: 50px;
  display: grid;
  place-items: center;
  color: var(--ink-soft);
}

.time-separator::before {
  content: "";
  width: 12px;
  height: 1px;
  background: var(--line);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 30;
  max-width: calc(100% - 40px);
  padding: 12px 16px;
  border-radius: 7px;
  color: var(--white);
  background: var(--ink);
  box-shadow: var(--shadow);
  font-size: 0.82rem;
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

.zap-overlay {
  position: fixed;
  inset: 0;
  z-index: 25;
  display: grid;
  place-items: center;
  pointer-events: none;
  overflow: hidden;
}

.zap-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(210, 250, 255, 0.86);
  animation: zap-flash 760ms steps(2, end) both;
}

.zap-bolt {
  position: relative;
  z-index: 2;
  width: min(34vw, 180px);
  height: min(34vw, 180px);
  fill: var(--white);
  stroke: var(--electric);
  stroke-width: 1.2;
  filter:
    drop-shadow(0 0 12px var(--white))
    drop-shadow(0 0 32px var(--electric))
    drop-shadow(0 0 70px var(--electric-deep));
  animation: zap-bolt 760ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.zap-arc {
  position: absolute;
  width: min(82vw, 760px);
  height: 16px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--white) 14%,
    var(--electric) 34%,
    var(--white) 50%,
    var(--electric) 66%,
    var(--white) 84%,
    transparent 100%
  );
  clip-path: polygon(
    0 52%,
    16% 26%,
    30% 68%,
    43% 20%,
    57% 72%,
    70% 30%,
    84% 65%,
    100% 48%,
    100% 62%,
    84% 80%,
    70% 48%,
    57% 88%,
    43% 38%,
    30% 86%,
    16% 44%,
    0 70%
  );
  filter: drop-shadow(0 0 9px var(--electric));
  animation: zap-arc 640ms ease-out both;
}

.zap-arc-one { transform: rotate(12deg); }
.zap-arc-two { transform: rotate(102deg); animation-delay: 40ms; }
.zap-arc-three { transform: rotate(193deg); animation-delay: 20ms; }
.zap-arc-four { transform: rotate(284deg); animation-delay: 60ms; }

body.is-zapped .app-view {
  animation: screen-jolt 600ms steps(2, end);
}

body.is-zapped .miss-button {
  background: var(--electric-deep);
  box-shadow:
    0 0 0 12px rgba(122, 231, 255, 0.18),
    0 0 70px rgba(122, 231, 255, 0.85);
  animation: electrified 680ms steps(2, end);
}

.floating-heart {
  position: fixed;
  z-index: 15;
  color: var(--coral);
  pointer-events: none;
  animation: float-away 1000ms ease-out forwards;
}

.floating-heart svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

/* ==========================================================================
   Design system pass — Soft UI (primary) + Pastel UI (modifier)
   Tokens live in :root; this layer applies them as one coherent system.
   ========================================================================== */

html {
  font-size: 16px;
}

body {
  background:
    radial-gradient(120% 80% at 8% -12%, #fbe9e4 0%, rgba(251, 233, 228, 0) 55%),
    radial-gradient(110% 70% at 100% 0%, #f2ecdf 0%, rgba(242, 236, 223, 0) 58%),
    radial-gradient(90% 60% at 50% 112%, #e6f0ea 0%, rgba(230, 240, 234, 0) 62%),
    var(--paper);
  line-height: 1.55;
}

.ambient-grid {
  background-size: 48px 48px;
  opacity: 0.45;
  mask-image: linear-gradient(to bottom, black, transparent 55%);
}

::selection {
  color: var(--ink);
  background: var(--rose);
}

:focus-visible {
  outline: 2px solid var(--coral-deep);
  outline-offset: 3px;
}

h1,
h2,
h3 {
  letter-spacing: -0.02em;
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--coral-deep);
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Surfaces ---------------------------------------------------------------- */
.auth-shell {
  padding: 28px 26px 30px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-xl);
  background: var(--surface-glass);
  box-shadow: var(--shadow-card);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.brand-lockup {
  margin-bottom: 24px;
}

.brand-mark {
  width: 56px;
  height: 56px;
  background: linear-gradient(150deg, var(--coral) 0%, var(--coral-deep) 100%);
  box-shadow:
    0 14px 28px rgba(196, 75, 69, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.brand-lockup h1,
.pair-copy h1,
.presence-row h1 {
  font-weight: 800;
  letter-spacing: -0.035em;
}

/* Segmented control ------------------------------------------------------- */
.segmented {
  padding: 4px;
  border-radius: var(--radius-pill);
  background: var(--paper-deep);
  box-shadow: var(--shadow-inset);
}

.segment {
  min-height: 44px;
  border-radius: var(--radius-pill);
  color: var(--ink-soft);
  transition:
    background var(--dur) var(--ease),
    color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease);
}

.segment.is-active {
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

/* Fields ------------------------------------------------------------------ */
input,
textarea {
  padding: 0 var(--space-4);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 2px rgba(76, 55, 39, 0.04);
  transition:
    border-color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease),
    background var(--dur) var(--ease);
}

input {
  min-height: 48px;
}

input:focus,
textarea:focus {
  border-color: var(--coral);
  background: var(--surface);
  box-shadow: 0 0 0 4px var(--focus-ring);
  outline: 0;
}

::placeholder {
  color: var(--ink-faint);
}

/* Buttons ----------------------------------------------------------------- */
.primary-button,
.quiet-button,
.danger-button {
  min-height: 48px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  letter-spacing: 0.01em;
}

.primary-button {
  border: 1px solid transparent;
  background: linear-gradient(180deg, var(--coral) 0%, var(--coral-deep) 100%);
  box-shadow:
    0 12px 26px rgba(196, 75, 69, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.26);
}

.primary-button:hover {
  background: linear-gradient(180deg, #cf5751 0%, var(--coral) 100%);
  border-color: transparent;
  transform: translateY(-1px);
}

.primary-button:active {
  transform: translateY(0);
  box-shadow:
    0 6px 14px rgba(196, 75, 69, 0.18),
    inset 0 2px 6px rgba(90, 20, 18, 0.22);
}

.quiet-button {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  transition:
    transform var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    background var(--dur) var(--ease);
}

.quiet-button:hover {
  border-color: rgba(53, 107, 95, 0.32);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  transform: translateY(-1px);
}

.danger-button {
  border: 1px solid rgba(196, 75, 69, 0.22);
  background: var(--rose-tint);
  color: var(--coral-deep);
  box-shadow: none;
}

/* Top bar ----------------------------------------------------------------- */
.icon-button {
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  transition:
    transform var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease);
}

.icon-button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-card);
}

.icon-badge {
  border-color: var(--surface);
}

/* Presence ---------------------------------------------------------------- */
.presence-pill {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  font-size: 0.75rem;
}

/* Hero button ------------------------------------------------------------- */
.miss-button {
  background:
    radial-gradient(120% 120% at 30% 16%, #e07972 0%, var(--coral) 44%, var(--coral-deep) 100%);
  box-shadow:
    0 30px 58px rgba(196, 75, 69, 0.26),
    0 8px 18px rgba(196, 75, 69, 0.16),
    inset 0 2px 0 rgba(255, 255, 255, 0.32),
    inset 0 -12px 26px rgba(120, 30, 28, 0.16);
}

.miss-button:hover {
  background:
    radial-gradient(120% 120% at 30% 16%, #e6837c 0%, #cf5751 44%, var(--coral-deep) 100%);
  box-shadow:
    0 34px 66px rgba(196, 75, 69, 0.3),
    0 10px 22px rgba(196, 75, 69, 0.18),
    inset 0 2px 0 rgba(255, 255, 255, 0.32),
    inset 0 -12px 26px rgba(120, 30, 28, 0.16);
}

.miss-button:active {
  box-shadow:
    0 12px 26px rgba(196, 75, 69, 0.22),
    inset 0 6px 18px rgba(90, 20, 18, 0.3);
}

.miss-button strong {
  letter-spacing: -0.01em;
}

.miss-button small {
  color: rgba(255, 255, 255, 0.82);
}

.hug-button {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: var(--surface);
  color: var(--mint-strong);
  box-shadow: var(--shadow-soft);
  transition:
    transform var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease);
}

.hug-button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-card);
}

/* Beat action (mirrors the hug pill on the opposite corner) ----------------- */
.beat-button {
  position: absolute;
  left: max(4vw, 18px);
  bottom: 31px;
  z-index: 2;
  min-height: 44px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(196, 75, 69, 0.22);
  border-radius: var(--radius-pill);
  color: var(--coral-deep);
  background: var(--surface);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition:
    transform var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease);
}

.beat-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.beat-button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-card);
}

.beat-button:disabled {
  opacity: 0.55;
  cursor: progress;
}

.beat-button.is-hitting {
  animation: beat-punch 420ms cubic-bezier(0.3, 1.4, 0.5, 1);
}

.beat-summary {
  min-height: 18px;
  margin: 4px 0 0;
  text-align: center;
  color: var(--ink-faint);
  font-size: 0.75rem;
}

/* Week report ------------------------------------------------------------- */
.week-section {
  margin: 18px 0 0;
  padding: 18px 18px 16px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.week-badge {
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  color: var(--mint-strong);
  background: rgba(143, 211, 194, 0.22);
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
}

.week-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 14px 0 6px;
}

.week-metrics > div {
  display: grid;
  gap: 1px;
}

.week-metrics strong {
  font-size: 1.05rem;
  font-weight: 780;
  color: var(--ink);
  line-height: 1.1;
}

.week-metrics span {
  color: var(--ink-faint);
  font-size: 0.7rem;
}

.week-bars {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  height: 86px;
  margin: 12px 0 4px;
  align-items: end;
}

.week-bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  height: 100%;
  justify-content: flex-end;
}

.week-bar-stack {
  display: flex;
  flex-direction: column-reverse;
  width: 100%;
  border-radius: 6px;
  overflow: hidden;
  background: rgba(217, 93, 86, 0.06);
  transition: height 420ms cubic-bezier(0.2, 1.1, 0.4, 1);
}

.week-bar-stack.is-empty {
  background: rgba(120, 110, 108, 0.1);
}

.week-bar-seg {
  display: block;
  width: 100%;
}

.week-bar-seg.press {
  background: linear-gradient(180deg, #ff8fa3, #e65069);
}

.week-bar-seg.hug {
  background: linear-gradient(180deg, #a6e0d0, #6fc3ab);
}

.week-bar-seg.beat {
  background: linear-gradient(180deg, #ffb066, #ff7a3d);
}

.week-bar-label {
  color: var(--ink-faint);
  font-size: 0.68rem;
}

.week-summary {
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 0.78rem;
  line-height: 1.5;
}

/* Achievements ------------------------------------------------------------ */
.achievement-section {
  margin: 18px 0 0;
  padding: 18px 18px 16px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.achievement-count {
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  color: #7a4a12;
  background: rgba(255, 209, 102, 0.24);
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
}

.achievement-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin-top: 14px;
}

.achievement-card {
  display: grid;
  gap: 2px;
  padding: 11px 8px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.6);
  text-align: center;
  opacity: 0.72;
}

.achievement-card.is-unlocked {
  border-color: rgba(255, 209, 102, 0.62);
  background: linear-gradient(
    150deg,
    rgba(255, 246, 220, 0.95),
    rgba(255, 232, 238, 0.9)
  );
  box-shadow: 0 8px 18px -14px rgba(178, 120, 40, 0.6);
  opacity: 1;
}

.achievement-icon {
  font-size: 1.5rem;
  line-height: 1.2;
}

.achievement-card strong {
  font-size: 0.76rem;
  font-weight: 740;
  line-height: 1.25;
}

.achievement-card small {
  color: var(--ink-faint);
  font-size: 0.64rem;
}

.achievement-card.is-unlocked small {
  color: #a0761f;
  font-weight: 700;
}

.achievement-progress {
  display: block;
  height: 5px;
  margin: 5px 0 2px;
  border-radius: 999px;
  background: rgba(120, 110, 108, 0.22);
  overflow: hidden;
}

.achievement-progress > span {
  display: block;
  height: 100%;
  min-width: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffa94d, #ff6b8a);
  transition: width 420ms cubic-bezier(0.2, 1.1, 0.4, 1);
}

.achievement-empty {
  grid-column: 1 / -1;
  margin: 8px 0;
  color: var(--ink-faint);
  font-size: 0.78rem;
  text-align: center;
}

@media (max-width: 380px) {
  .week-metrics {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .achievement-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Heatmap ----------------------------------------------------------------- */
.heatmap-section {
  margin: 18px 0 0;
  padding: 18px 18px 16px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.heatmap-streak {
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  color: #b03a33;
  background: rgba(255, 107, 138, 0.14);
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
}

.heatmap-streak strong {
  font-size: 0.9rem;
}

.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(15, 1fr);
  gap: 5px;
  margin: 14px 0 10px;
}

.heatmap-cell {
  display: block;
  aspect-ratio: 1;
  border-radius: 5px;
  background: rgba(217, 93, 86, 0.06);
}

.heatmap-cell.level-1 {
  background: rgba(255, 107, 138, 0.26);
}

.heatmap-cell.level-2 {
  background: rgba(255, 107, 138, 0.46);
}

.heatmap-cell.level-3 {
  background: rgba(230, 80, 105, 0.68);
}

.heatmap-cell.level-4 {
  background: rgba(200, 46, 74, 0.86);
  box-shadow: 0 0 0 1px rgba(200, 46, 74, 0.28);
}

.heatmap-grid .heatmap-cell:nth-child(15n + 1) {
  border-top-left-radius: 7px;
  border-bottom-left-radius: 7px;
}

.heatmap-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  color: var(--ink-faint);
  font-size: 0.7rem;
}

.heatmap-legend .heatmap-cell {
  width: 11px;
  aspect-ratio: 1;
  border-radius: 3px;
}

.heatmap-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.heatmap-stats > div {
  display: grid;
  gap: 2px;
}

.heatmap-stats strong {
  font-size: 0.95rem;
  font-weight: 760;
  color: var(--ink);
}

.heatmap-stats span {
  color: var(--ink-faint);
  font-size: 0.7rem;
}

@media (max-width: 400px) {
  .heatmap-grid {
    grid-template-columns: repeat(10, 1fr);
  }
}

/* Resonance --------------------------------------------------------------- */
.resonance-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 0 0;
  padding: 12px 14px;
  border: 1px solid rgba(255, 209, 102, 0.5);
  border-radius: var(--radius-lg);
  background: linear-gradient(
    118deg,
    rgba(255, 236, 200, 0.92) 0%,
    rgba(255, 245, 224, 0.86) 52%,
    rgba(255, 226, 234, 0.9) 100%
  );
  box-shadow: 0 10px 24px -18px rgba(178, 120, 40, 0.55);
  animation: resonance-strip-in 520ms cubic-bezier(0.2, 1.1, 0.4, 1) both;
}

@keyframes resonance-strip-in {
  0% { opacity: 0; transform: translateY(8px) scale(0.985); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.resonance-lead {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1;
  min-width: 0;
}

.resonance-spark {
  font-size: 1.3rem;
  line-height: 1;
  animation: resonance-twinkle 2400ms ease-in-out infinite;
}

@keyframes resonance-twinkle {
  0%, 100% { transform: scale(1) rotate(0); opacity: 0.9; }
  50% { transform: scale(1.16) rotate(9deg); opacity: 1; }
}

.resonance-lead strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 760;
  color: #7a4a12;
}

.resonance-lead small {
  display: block;
  margin-top: 2px;
  color: #98693a;
  font-size: 0.72rem;
  line-height: 1.35;
}

.resonance-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: flex-end;
}

.resonance-chip {
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  font-size: 0.68rem;
  font-weight: 700;
  white-space: nowrap;
}

.resonance-chip.press {
  color: #b03a33;
  background: rgba(255, 107, 138, 0.18);
}

.resonance-chip.hug {
  color: #1f7a67;
  background: rgba(143, 211, 194, 0.28);
}

.resonance-chip.beat {
  color: #8a3a20;
  background: rgba(255, 159, 67, 0.24);
}

/* Resonance overlay ------------------------------------------------------- */
.resonance-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  pointer-events: none;
  background: radial-gradient(
    circle at 50% 46%,
    rgba(255, 226, 160, 0.5) 0%,
    rgba(255, 200, 214, 0.28) 42%,
    rgba(255, 255, 255, 0) 72%
  );
  animation: resonance-veil 3600ms ease both;
}

@keyframes resonance-veil {
  0% { opacity: 0; }
  14% { opacity: 1; }
  78% { opacity: 1; }
  100% { opacity: 0; }
}

.resonance-scene {
  position: relative;
  display: grid;
  place-items: center;
  width: min(78vw, 300px);
  aspect-ratio: 1;
}

.resonance-halo {
  position: absolute;
  inset: 8%;
  border: 2px solid rgba(255, 209, 102, 0.85);
  border-radius: 50%;
  box-shadow: 0 0 40px rgba(255, 197, 92, 0.55) inset;
  animation: resonance-halo 2000ms cubic-bezier(0.22, 0.9, 0.3, 1) both;
}

.resonance-halo-two {
  animation-delay: 520ms;
  border-color: rgba(255, 183, 197, 0.8);
}

@keyframes resonance-halo {
  0% { transform: scale(0.25); opacity: 0; }
  40% { opacity: 1; }
  100% { transform: scale(1.55); opacity: 0; }
}

.resonance-core {
  position: relative;
  display: grid;
  place-items: center;
  width: 58%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 34%, #fff7e4, #ffd88a 58%, #ffb0c4 100%);
  box-shadow:
    0 0 46px rgba(255, 199, 102, 0.75),
    0 18px 36px -20px rgba(178, 100, 40, 0.65);
  animation: resonance-core 3600ms cubic-bezier(0.2, 1.2, 0.35, 1) both;
}

@keyframes resonance-core {
  0% { transform: scale(0.35) rotate(-8deg); opacity: 0; }
  16% { transform: scale(1.08) rotate(0); opacity: 1; }
  24% { transform: scale(0.97); }
  32% { transform: scale(1.02); }
  76% { transform: scale(1); opacity: 1; }
  100% { transform: scale(0.86); opacity: 0; }
}

.resonance-heart {
  position: absolute;
  font-size: clamp(1.8rem, 9vw, 2.6rem);
  animation: resonance-heart 1400ms ease-in-out infinite;
}

.resonance-heart-two {
  animation-delay: 700ms;
  filter: hue-rotate(-14deg);
}

@keyframes resonance-heart {
  0%, 100% { transform: translateY(0) scale(1); opacity: 0.85; }
  50% { transform: translateY(-7px) scale(1.12); opacity: 1; }
}

.resonance-orbit {
  position: absolute;
  font-size: clamp(1.1rem, 5vw, 1.5rem);
  line-height: 1;
  opacity: 0;
  animation: resonance-orbit 2000ms ease-out both;
}

.resonance-orbit-one {
  animation-delay: 120ms;
}

.resonance-orbit-two {
  animation-delay: 420ms;
}

.resonance-orbit-three {
  animation-delay: 760ms;
}

@keyframes resonance-orbit {
  0% { opacity: 0; transform: translate(0, 0) scale(0.4); }
  30% { opacity: 1; }
  100% { opacity: 0; transform: translate(0, -140%) scale(1.35); }
}

.resonance-caption {
  position: absolute;
  bottom: -9%;
  margin: 0;
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  color: #fff8ec;
  background: rgba(122, 74, 18, 0.86);
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
  animation: resonance-caption 3600ms ease both;
}

@keyframes resonance-caption {
  0% { opacity: 0; transform: translateY(10px); }
  18% { opacity: 1; transform: translateY(0); }
  80% { opacity: 1; }
  100% { opacity: 0; }
}

.resonance-count {
  position: absolute;
  top: -6%;
  color: #7a4a12;
  font-size: 0.76rem;
  font-weight: 760;
  letter-spacing: 0.04em;
  animation: resonance-caption 3600ms ease both;
}

body.is-resonating {
  animation: resonance-app-pulse 1200ms ease-out both;
}

@keyframes resonance-app-pulse {
  0% { filter: brightness(1); }
  22% { filter: brightness(1.1); }
  100% { filter: brightness(1); }
}

/* Beaten overlay ---------------------------------------------------------- */
.beat-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 45%, rgba(255, 92, 80, 0.24), transparent 58%),
    rgba(24, 16, 15, 0.74);
  backdrop-filter: blur(3px);
  overflow: hidden;
}

.beat-overlay.is-hidden {
  display: none;
}

.beat-scene {
  position: relative;
  width: min(88vw, 360px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.beat-ring {
  position: absolute;
  width: 62%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 3px solid rgba(255, 210, 120, 0.55);
  box-shadow: 0 0 44px rgba(255, 120, 90, 0.45);
  animation: beat-ring 700ms ease-out 2;
}

.beat-victim {
  position: relative;
  width: 46%;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 35% 28%, #ffe6cf, #f4b183 62%, #dd8a5c);
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.35),
    inset -10px -12px 26px rgba(150, 70, 40, 0.35),
    inset 8px 10px 22px rgba(255, 240, 220, 0.5);
  animation: beat-victim 900ms cubic-bezier(0.3, 0.9, 0.4, 1) both;
}

.beat-face {
  font-size: clamp(3.4rem, 12vw, 5rem);
  line-height: 1;
  filter: drop-shadow(0 3px 6px rgba(90, 30, 20, 0.35));
  animation: beat-face 620ms ease-in-out 2;
}

.beat-bruise {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(150, 60, 140, 0.55), transparent 70%);
}

.beat-bruise-one {
  width: 22%;
  aspect-ratio: 1;
  top: 22%;
  left: 14%;
}

.beat-bruise-two {
  width: 18%;
  aspect-ratio: 1;
  bottom: 20%;
  right: 16%;
}

.beat-fist {
  position: absolute;
  font-size: clamp(3rem, 11vw, 4.4rem);
  line-height: 1;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.45));
  opacity: 0;
}

.beat-fist-left {
  left: 2%;
  top: 42%;
  transform: translate(-60%, 0) scale(0.7) rotate(-25deg);
  animation: beat-fist-left 900ms cubic-bezier(0.2, 1.1, 0.35, 1) both;
}

.beat-fist-right {
  right: 2%;
  top: 42%;
  transform: translate(60%, 0) scale(0.7) rotate(25deg) scaleX(-1);
  animation: beat-fist-right 900ms cubic-bezier(0.2, 1.1, 0.35, 1) 170ms both;
}

.beat-star {
  position: absolute;
  font-size: clamp(1.5rem, 6vw, 2.2rem);
  color: #ffd166;
  opacity: 0;
  text-shadow: 0 0 16px rgba(255, 209, 102, 0.75);
}

.beat-star-one {
  top: 12%;
  left: 18%;
  animation: beat-star 700ms ease-out 120ms both;
}

.beat-star-two {
  top: 18%;
  right: 14%;
  animation: beat-star 700ms ease-out 240ms both;
}

.beat-star-three {
  bottom: 24%;
  left: 12%;
  animation: beat-star 700ms ease-out 360ms both;
}

/* Dizzy stars circle the victim during phase two. */
.beat-dizzy {
  position: absolute;
  font-size: clamp(1.6rem, 7vw, 2.4rem);
  line-height: 1;
  opacity: 0;
  filter: drop-shadow(0 0 12px rgba(255, 210, 120, 0.8));
  animation: beat-dizzy 1600ms ease-in-out 1000ms infinite;
}

.beat-dizzy-one {
  top: 10%;
  left: 50%;
  margin-left: -1.2em;
}

.beat-dizzy-two {
  top: 26%;
  left: 20%;
  animation-delay: 1180ms;
}

.beat-dizzy-three {
  top: 26%;
  right: 20%;
  animation-delay: 1360ms;
}

/* Knockout stamp lands in the final phase. */
.beat-ko {
  position: absolute;
  top: 34%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-10deg) scale(0.6);
  color: #ffe14d;
  font-size: clamp(2.6rem, 13vw, 4rem);
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0.06em;
  text-shadow:
    0 4px 0 #a83a36,
    0 0 30px rgba(255, 190, 60, 0.85);
  opacity: 0;
  animation: beat-ko 1000ms cubic-bezier(0.2, 1.4, 0.4, 1) 2400ms both;
}

.beat-caption {
  position: absolute;
  bottom: -6%;
  margin: 0;
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  color: #fff5e6;
  background: rgba(52, 26, 22, 0.78);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  animation: beat-caption 900ms ease both;
}

body.is-beaten .app-view {
  animation: beat-shake 1500ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

body.is-beaten .beat-victim {
  animation:
    beat-victim 1200ms cubic-bezier(0.3, 0.9, 0.4, 1) both,
    beat-stagger 900ms ease-in-out 1200ms both,
    beat-collapse 1200ms cubic-bezier(0.5, 0, 0.8, 0.4) 2300ms both;
}

@keyframes beat-punch {
  0% { transform: scale(1) rotate(0); }
  30% { transform: scale(0.9) rotate(-5deg); }
  60% { transform: scale(1.06) rotate(3deg); }
  100% { transform: scale(1) rotate(0); }
}

@keyframes beat-victim {
  0% { transform: translateY(0) rotate(0) scale(1); }
  12% { transform: translateY(-6%) rotate(-8deg) scale(1.04); }
  26% { transform: translateY(4%) rotate(9deg) scale(0.97); }
  42% { transform: translateY(-3%) rotate(-6deg) scale(1.02); }
  58% { transform: translateY(2%) rotate(5deg) scale(0.99); }
  76% { transform: translateY(-1%) rotate(-2deg) scale(1.01); }
  100% { transform: translateY(0) rotate(0) scale(1); }
}

@keyframes beat-face {
  0%, 100% { transform: scale(1) rotate(0); }
  35% { transform: scale(1.16) rotate(-8deg); }
  65% { transform: scale(0.94) rotate(6deg); }
}

@keyframes beat-fist-left {
  0% { opacity: 0; transform: translate(-160%, 30%) scale(0.7) rotate(-35deg); }
  35% { opacity: 1; }
  55% { opacity: 1; transform: translate(28%, -12%) scale(1.08) rotate(-8deg); }
  75% { opacity: 1; transform: translate(16%, -4%) scale(1) rotate(-14deg); }
  100% { opacity: 0; transform: translate(-40%, 18%) scale(0.85) rotate(-28deg); }
}

@keyframes beat-fist-right {
  0% { opacity: 0; transform: translate(160%, 30%) scale(0.7) rotate(35deg) scaleX(-1); }
  35% { opacity: 1; }
  55% { opacity: 1; transform: translate(-28%, -12%) scale(1.08) rotate(8deg) scaleX(-1); }
  75% { opacity: 1; transform: translate(-16%, -4%) scale(1) rotate(14deg) scaleX(-1); }
  100% { opacity: 0; transform: translate(40%, 18%) scale(0.85) rotate(28deg) scaleX(-1); }
}

@keyframes beat-star {
  0% { opacity: 0; transform: scale(0.4) rotate(0); }
  40% { opacity: 1; transform: scale(1.2) rotate(25deg); }
  100% { opacity: 0; transform: scale(0.7) rotate(60deg) translateY(-14px); }
}

@keyframes beat-ring {
  0% { transform: scale(0.55); opacity: 0.9; }
  100% { transform: scale(1.6); opacity: 0; }
}

@keyframes beat-caption {
  0% { opacity: 0; transform: translateY(14px); }
  30% { opacity: 1; transform: translateY(0); }
  85% { opacity: 1; }
  100% { opacity: 0.9; }
}

@keyframes beat-shake {
  0%, 100% { transform: translate(0, 0) rotate(0); }
  10% { transform: translate(-8px, 3px) rotate(-0.6deg); }
  20% { transform: translate(7px, -4px) rotate(0.5deg); }
  30% { transform: translate(-6px, 2px) rotate(-0.4deg); }
  45% { transform: translate(5px, -2px) rotate(0.3deg); }
  60% { transform: translate(-4px, 1px) rotate(-0.2deg); }
  80% { transform: translate(2px, -1px) rotate(0.1deg); }
}

/* Victim reels from the second wave, then staggers in place. */
@keyframes beat-stagger {
  0% { transform: translateY(0) rotate(0) scale(1); }
  20% { transform: translateY(-3%) rotate(-7deg) scale(1.02); }
  45% { transform: translateY(2%) rotate(5deg) scale(0.99); }
  70% { transform: translateY(-1%) rotate(-3deg) scale(1.01); }
  100% { transform: translateY(0) rotate(0) scale(1); }
}

/* Final knockout: the victim tips over and fades. */
@keyframes beat-collapse {
  0% { transform: translateY(0) rotate(0) scale(1); opacity: 1; }
  35% { transform: translateY(6%) rotate(14deg) scale(1.02); opacity: 1; }
  100% { transform: translateY(26%) rotate(78deg) scale(0.82); opacity: 0.35; }
}

@keyframes beat-dizzy {
  0% { opacity: 0; transform: scale(0.5) rotate(0); }
  25% { opacity: 1; transform: scale(1.1) rotate(120deg); }
  50% { opacity: 1; transform: scale(1) rotate(240deg); }
  75% { opacity: 0.8; transform: scale(1.1) rotate(300deg); }
  100% { opacity: 0; transform: scale(0.6) rotate(360deg); }
}

@keyframes beat-ko {
  0% { opacity: 0; transform: translate(-50%, -30%) rotate(-16deg) scale(0.5); }
  45% { opacity: 1; transform: translate(-50%, -50%) rotate(-10deg) scale(1.18); }
  70% { opacity: 1; transform: translate(-50%, -52%) rotate(-8deg) scale(1); }
  100% { opacity: 0.95; transform: translate(-50%, -54%) rotate(-10deg) scale(1); }
}

/* Sender-side punch effect ------------------------------------------------- */
.beat-send-overlay {
  position: fixed;
  inset: 0;
  z-index: 58;
  display: grid;
  place-items: center;
  pointer-events: none;
  background: radial-gradient(circle at 50% 48%, rgba(255, 120, 80, 0.2), transparent 55%);
  overflow: hidden;
}

.beat-send-scene {
  position: relative;
  width: min(86vw, 340px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.beat-send-flash {
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.95) 0%, rgba(255, 196, 120, 0.6) 28%, transparent 66%);
  animation: punch-flash 520ms ease-out both;
}

.impact-ring {
  position: absolute;
  border-radius: 50%;
  border: 3px solid rgba(255, 210, 140, 0.85);
  animation: punch-ring 620ms cubic-bezier(0.2, 0.8, 0.3, 1) both;
}

.impact-ring-one {
  width: 42%;
  aspect-ratio: 1;
}

.impact-ring-two {
  width: 62%;
  aspect-ratio: 1;
  animation-delay: 90ms;
  border-color: rgba(255, 120, 90, 0.55);
}

.impact-spark {
  position: absolute;
  color: #ffe09b;
  font-size: clamp(1.4rem, 6vw, 2rem);
  text-shadow: 0 0 14px rgba(255, 200, 110, 0.8);
  opacity: 0;
  animation: punch-spark 560ms ease-out both;
}

.impact-spark-one { top: 20%; left: 20%; animation-delay: 40ms; }
.impact-spark-two { top: 26%; right: 18%; animation-delay: 110ms; }
.impact-spark-three { bottom: 24%; right: 26%; animation-delay: 170ms; }

.punch-fist {
  position: relative;
  font-size: clamp(4.4rem, 18vw, 6.4rem);
  line-height: 1;
  filter: drop-shadow(0 12px 22px rgba(0, 0, 0, 0.45));
  animation: punch-fist 620ms cubic-bezier(0.2, 1.3, 0.35, 1) both;
}

.punch-word {
  position: absolute;
  top: 20%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff3d6;
  font-size: clamp(2rem, 9vw, 3rem);
  font-weight: 900;
  letter-spacing: 0.04em;
  text-shadow:
    0 3px 0 #b3403a,
    0 0 22px rgba(255, 160, 90, 0.9);
  opacity: 0;
  animation: punch-word 620ms cubic-bezier(0.2, 1.4, 0.4, 1) 90ms both;
}

.punch-caption {
  position: absolute;
  bottom: 2%;
  margin: 0;
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  color: #fff5e6;
  background: rgba(150, 45, 35, 0.82);
  font-size: 0.86rem;
  font-weight: 700;
  white-space: nowrap;
  animation: punch-caption 900ms ease both;
}

.punch-combo {
  position: absolute;
  top: 42%;
  left: 50%;
  transform: translateX(-50%);
  letter-spacing: 0.28em;
  color: #ffd166;
  font-size: clamp(0.9rem, 4vw, 1.2rem);
  text-shadow: 0 0 12px rgba(255, 209, 102, 0.8);
  animation: punch-combo 3000ms ease both;
}

body.is-punching .app-view {
  animation: punch-shake 460ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes punch-fist {
  0% { transform: translate(-46%, 34%) scale(0.55) rotate(-28deg); opacity: 0; }
  45% { transform: translate(4%, -4%) scale(1.16) rotate(-6deg); opacity: 1; }
  62% { transform: translate(0, 0) scale(1.02) rotate(0); opacity: 1; }
  100% { transform: translate(10%, 12%) scale(0.9) rotate(6deg); opacity: 0; }
}

@keyframes punch-flash {
  0% { opacity: 0; transform: scale(0.4); }
  22% { opacity: 1; transform: scale(1.05); }
  100% { opacity: 0; transform: scale(1.5); }
}

@keyframes punch-ring {
  0% { transform: scale(0.3); opacity: 0.95; }
  100% { transform: scale(1.9); opacity: 0; }
}

@keyframes punch-spark {
  0% { opacity: 0; transform: scale(0.4) rotate(0); }
  35% { opacity: 1; transform: scale(1.3) rotate(18deg); }
  100% { opacity: 0; transform: scale(0.8) rotate(48deg) translateY(-12px); }
}

@keyframes punch-word {
  0% { opacity: 0; transform: translate(-50%, -30%) scale(0.6) rotate(-8deg); }
  40% { opacity: 1; transform: translate(-50%, -50%) scale(1.12) rotate(3deg); }
  70% { opacity: 1; transform: translate(-50%, -52%) scale(1) rotate(0); }
  100% { opacity: 0; transform: translate(-50%, -74%) scale(0.94); }
}

@keyframes punch-caption {
  0% { opacity: 0; transform: translateY(10px); }
  25% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0.92; }
}

@keyframes punch-combo {
  0% { opacity: 0; transform: translateX(-50%) translateY(16px); }
  12% { opacity: 1; transform: translateX(-50%) translateY(0); }
  88% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes punch-shake {
  0%, 100% { transform: translate(0, 0) rotate(0); }
  18% { transform: translate(-5px, 2px) rotate(-0.35deg); }
  36% { transform: translate(4px, -2px) rotate(0.3deg); }
  54% { transform: translate(-3px, 1px) rotate(-0.2deg); }
  72% { transform: translate(2px, -1px) rotate(0.12deg); }
}

.last-thought {
  color: var(--ink-soft);
  font-size: 0.875rem;
}

.hug-summary {
  color: var(--ink-faint);
  font-size: 0.75rem;
}

/* Section cards ----------------------------------------------------------- */
.mood-strip,
.days-section,
.shared-peek,
.board-peek,
.history-section {
  max-width: 620px;
  margin: 16px auto 0;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: var(--radius-lg);
  background: var(--surface-glass);
  box-shadow: var(--shadow-soft);
}

.mood-heading h2,
.shared-peek h2,
.board-peek-heading h2,
.section-heading h2 {
  font-size: 1.0625rem;
  font-weight: 750;
  letter-spacing: -0.01em;
}

.mood-heading > p,
.board-preview,
.setting-note {
  color: var(--ink-soft);
}

.day-metrics {
  margin-top: 14px;
  gap: 8px;
  border: 0;
  background: transparent;
  overflow: visible;
}

.day-metrics > div {
  min-height: 88px;
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.day-metrics span {
  color: var(--ink-soft);
  font-size: 0.72rem;
}

.mood-choice {
  min-height: 56px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  transition:
    transform var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    background var(--dur) var(--ease);
}

.mood-choice:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-card);
}

.mood-choice.is-active {
  border-color: rgba(53, 107, 95, 0.45);
  background: var(--mint);
  color: var(--mint-strong);
  box-shadow: inset 0 2px 6px rgba(53, 107, 95, 0.14);
}

.mood-choice[data-mood="happy"] { --mood-color: #b98a2e; }
.mood-choice[data-mood="calm"] { --mood-color: #4f8a7d; }
.mood-choice[data-mood="tired"] { --mood-color: #6d7f96; }
.mood-choice[data-mood="hug"] { --mood-color: var(--coral); }

.anniversary-list li {
  border-bottom: 1px solid var(--line);
}

/* History ----------------------------------------------------------------- */
.history-groups {
  display: grid;
  gap: 18px;
  margin-top: 4px;
}

.history-group {
  padding: 14px 14px 6px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.5);
  box-shadow: var(--shadow-soft);
}

.history-group-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.history-group-head h3 {
  margin: 0;
  flex: 1;
  font-size: 0.95rem;
  font-weight: 750;
  letter-spacing: -0.01em;
}

.history-group-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 11px;
}

.history-group-mark svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.history-group-mark.press {
  color: var(--coral-deep);
  background: var(--rose-tint);
}

.history-group-mark.press svg {
  fill: currentColor;
}

.history-group-mark.hug {
  color: var(--mint-strong);
  background: var(--mint);
}

.history-group-mark.beat {
  color: #b03a33;
  background: #fbe0dc;
}

.history-group-count {
  color: var(--ink-faint);
  font-size: 0.72rem;
  white-space: nowrap;
}

.history-list {
  gap: 8px;
}

.history-item {
  min-height: 56px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: none;
}

.history-mark {
  width: 30px;
  height: 30px;
  border-radius: 11px;
  color: var(--coral-deep);
  background: var(--rose-tint);
}

/* Each group keeps its own icon colour, regardless of direction. */
.history-group[data-kind="press"] .history-mark {
  color: var(--coral-deep);
  background: var(--rose-tint);
}

.history-group[data-kind="hug"] .history-mark {
  color: var(--mint-strong);
  background: var(--mint);
}

.history-group[data-kind="beat"] .history-mark {
  color: #b03a33;
  background: #fbe0dc;
}

.history-copy strong {
  font-size: 0.9rem;
}

.history-copy span,
.history-time,
.empty-history {
  color: var(--ink-soft);
  font-size: 0.75rem;
}

.empty-history {
  padding: 14px 0;
  border-bottom: 0;
}

/* Modals & sheets --------------------------------------------------------- */
.modal-backdrop {
  background: rgba(38, 51, 48, 0.32);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.settings-panel {
  padding: 24px;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  background: var(--surface);
  box-shadow: 0 -18px 60px rgba(38, 51, 48, 0.18);
}

.board-note {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.board-note-image {
  border-radius: var(--radius-md);
}

.reply-toggle {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.reply-form input {
  min-height: 44px;
}

.reply-form .quiet-button {
  min-height: 44px;
}

.schedule-picker,
.file-picker {
  min-height: 44px;
}

.schedule-picker input {
  min-height: 38px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
}

/* Toast & footer ---------------------------------------------------------- */
.toast {
  border-radius: var(--radius-pill);
  background: rgba(38, 51, 48, 0.94);
  box-shadow: var(--shadow-float);
  font-size: 0.82rem;
}

.app-footer {
  color: var(--ink-faint);
  font-size: 0.7rem;
}

/* Pairing ---------------------------------------------------------------- */
.invite-ticket {
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: var(--radius-lg);
  background: var(--surface-glass);
  box-shadow: var(--shadow-soft);
}

/* Receipts & photo actions ------------------------------------------------ */
.history-receipt.seen {
  color: var(--coral-deep);
}

.history-receipt.responded {
  color: var(--mint-strong);
  font-weight: 700;
}

.board-photo-usage {
  margin: -10px 0 14px;
  color: var(--ink-faint);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.board-photo-usage.is-warning {
  color: var(--coral-deep);
  font-weight: 700;
}

.photo-remove {
  min-height: 36px;
  margin-top: 10px;
  padding: 0 14px;
  border: 1px solid rgba(196, 75, 69, 0.24);
  border-radius: var(--radius-pill);
  background: var(--rose-tint);
  color: var(--coral-deep);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}

.photo-remove:disabled {
  opacity: 0.55;
  cursor: progress;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  18% { transform: scale(0.96); }
  34% { transform: scale(1.045); }
  50% { transform: scale(0.985); }
  68% { transform: scale(1.02); }
}

@keyframes heart-glow {
  0%, 100% { transform: scale(1); fill: rgba(255, 255, 255, 0.16); }
  48% { transform: scale(1.13); fill: rgba(255, 255, 255, 0.72); }
}

@keyframes float-away {
  from {
    opacity: 0.9;
    transform: translate(-50%, 0) scale(0.7);
  }
  to {
    opacity: 0;
    transform: translate(calc(-50% + var(--drift)), -110px) scale(1.2) rotate(var(--rotate));
  }
}

@keyframes zap-flash {
  0%, 100% { opacity: 0; }
  8%, 18%, 34% { opacity: 1; }
  12%, 25%, 48% { opacity: 0.08; }
  62% { opacity: 0.24; }
}

@keyframes zap-bolt {
  0% { opacity: 0; transform: scale(0.45) rotate(-8deg); }
  15% { opacity: 1; transform: scale(1.08) rotate(3deg); }
  28% { opacity: 0.25; transform: scale(0.94) rotate(-2deg); }
  44% { opacity: 1; transform: scale(1.03) rotate(1deg); }
  72% { opacity: 0.75; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.25); }
}

@keyframes zap-arc {
  0% { opacity: 0; scale: 0.55; }
  20%, 55% { opacity: 0.95; scale: 1; }
  100% { opacity: 0; scale: 1.08; }
}

@keyframes screen-jolt {
  0%, 100% { transform: translate(0, 0); }
  12% { transform: translate(-9px, 3px); }
  20% { transform: translate(8px, -5px); }
  30% { transform: translate(-6px, -2px); }
  41% { transform: translate(5px, 4px); }
  55% { transform: translate(-3px, 1px); }
  72% { transform: translate(2px, -1px); }
}

@keyframes electrified {
  0%, 100% { transform: scale(1); }
  18% { transform: scale(0.93) rotate(-2deg); }
  32% { transform: scale(1.05) rotate(2deg); }
  48% { transform: scale(0.98) rotate(-1deg); }
  64% { transform: scale(1.02); }
}

@keyframes hug-pulse {
  0%, 100% { transform: scale(1); }
  35% { transform: scale(1.08); background: var(--mint); }
  65% { transform: scale(0.98); }
}

@media (max-width: 620px) {
  .app-view {
    padding-inline: 18px;
  }

  .presence-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .presence-row h1 {
    font-size: clamp(2.6rem, 14vw, 4rem);
  }

  .button-stage {
    height: clamp(330px, 52vh, 430px);
  }

  .miss-button {
    width: min(66vw, 260px);
  }

  .orbit-one {
    width: min(78vw, 310px);
    height: min(78vw, 310px);
  }

  .orbit-two {
    width: min(92vw, 370px);
    height: min(92vw, 370px);
  }

  .history-section {
    margin-top: 16px;
  }

  .mood-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .mood-heading > p {
    text-align: left;
  }

  .hug-button {
    right: 0;
    bottom: 12px;
  }

  .beat-button {
    left: 0;
    bottom: 12px;
  }

  .settings-inline-form {
    grid-template-columns: 1fr;
  }

  .history-item {
    grid-template-columns: 32px 1fr auto;
  }

  .app-footer {
    padding-top: 24px;
  }

  .board-peek {
    margin-top: 8px;
  }

  .modal-backdrop {
    padding: 0;
  }

  .settings-panel {
    max-height: 92dvh;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: 22px 18px max(22px, env(safe-area-inset-bottom));
  }

  .board-panel {
    max-height: 94dvh;
  }

  .invite-ticket {
    padding-inline: 14px;
  }
}

/* =========================================================================
   Word game (同词相遇)
   ========================================================================= */
.game-peek {
  margin: 18px 0 0;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.word-game-panel {
  max-height: min(88vh, 760px);
  overflow-y: auto;
}

.game-stage {
  display: grid;
  gap: 16px;
  margin-top: 8px;
}

.game-lead {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.84rem;
  line-height: 1.65;
}

.game-label {
  display: block;
  margin-bottom: 8px;
  color: var(--ink-faint);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.game-setup {
  margin-bottom: 4px;
}

.game-think-choices {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.game-think {
  min-height: var(--btn-min);
  border: 1px solid rgba(38, 51, 48, 0.12);
  border-radius: var(--radius-md);
  background: linear-gradient(168deg, #ffffff, var(--surface));
  box-shadow:
    0 8px 20px rgba(76, 55, 39, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  color: var(--ink-faint);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease),
    color var(--dur) var(--ease),
    background var(--dur) var(--ease);
}

.game-think:hover {
  transform: translateY(-2px);
  color: var(--mint-strong);
  box-shadow: 0 14px 28px rgba(76, 55, 39, 0.12);
}

.game-think.is-active {
  border-color: rgba(53, 107, 95, 0.42);
  background: linear-gradient(168deg, #ffffff, var(--mint));
  color: var(--mint-strong);
  box-shadow:
    inset 0 2px 8px rgba(53, 107, 95, 0.14),
    0 2px 6px rgba(76, 55, 39, 0.05);
  transform: translateY(1px);
}

.game-think:focus-visible {
  outline: 3px solid rgba(196, 75, 69, 0.3);
  outline-offset: 2px;
}

/* Playing ---------------------------------------------------------------- */
.game-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.game-round {
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  color: var(--coral-deep);
  background: var(--rose-tint);
  font-size: 0.8rem;
  font-weight: 760;
}

.game-timer {
  min-width: 54px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  color: var(--mint-strong);
  background: var(--mint);
  font-size: 0.9rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.game-timer.is-urgent {
  color: var(--coral-deep);
  background: var(--rose);
  animation: game-timer-pulse 900ms ease-in-out infinite;
}

@keyframes game-timer-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.game-input-block {
  display: grid;
}

.game-input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.game-input-row input {
  min-height: var(--btn-min);
  padding: 0 16px;
  border: 1px solid rgba(38, 51, 48, 0.14);
  border-radius: var(--radius-md);
  background: #ffffff;
  color: var(--ink);
  font-size: 1rem;
  transition:
    border-color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease);
}

.game-input-row input::placeholder {
  color: var(--ink-faint);
}

.game-input-row input:focus {
  border-color: rgba(53, 107, 95, 0.44);
  box-shadow: 0 0 0 3px rgba(53, 107, 95, 0.12);
  outline: none;
}

.game-input-row input:disabled {
  background: var(--paper-deep);
  color: var(--ink-faint);
  cursor: not-allowed;
}

.game-hint {
  margin: 9px 0 0;
  color: var(--ink-faint);
  font-size: 0.76rem;
}

.game-ready-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.game-ready-pill {
  padding: 10px 14px;
  border: 1px solid rgba(38, 51, 48, 0.1);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink-faint);
  font-size: 0.78rem;
  font-weight: 650;
  text-align: center;
  transition:
    background var(--dur) var(--ease),
    color var(--dur) var(--ease),
    border-color var(--dur) var(--ease);
}

.game-ready-pill.is-ready {
  border-color: rgba(53, 107, 95, 0.34);
  background: var(--mint);
  color: var(--mint-strong);
}

/* Reveal ----------------------------------------------------------------- */
.game-reveal {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid rgba(255, 209, 102, 0.5);
  border-radius: var(--radius-lg);
  background: linear-gradient(
    150deg,
    rgba(255, 248, 232, 0.95),
    rgba(255, 236, 240, 0.9)
  );
  animation: game-reveal-in 480ms cubic-bezier(0.2, 1.1, 0.4, 1) both;
}

@keyframes game-reveal-in {
  0% { opacity: 0; transform: translateY(10px) scale(0.985); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.game-reveal-word {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.8);
}

.game-reveal-word small {
  flex: 0 0 auto;
  color: var(--ink-faint);
  font-size: 0.72rem;
}

.game-reveal-word strong {
  flex: 1;
  font-size: 1.15rem;
  font-weight: 820;
  letter-spacing: 0.01em;
  word-break: break-all;
}

.game-reveal-word.mine strong {
  color: var(--coral-deep);
}

.game-reveal-word.theirs strong {
  color: var(--mint-strong);
}

.game-verdict {
  margin: 2px 0 0;
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 760;
  text-align: center;
}

.game-verdict.matched {
  color: #7a4a12;
  background: rgba(255, 209, 102, 0.28);
}

.game-verdict.missed {
  color: var(--ink-soft);
  background: rgba(120, 110, 108, 0.1);
}

/* History --------------------------------------------------------------- */
.game-history {
  display: grid;
  gap: 6px;
  margin: 2px 0 0;
  padding: 0;
  list-style: none;
}

.game-history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid var(--line);
}

.game-history-row.is-matched {
  border-color: rgba(255, 209, 102, 0.6);
  background: rgba(255, 246, 220, 0.8);
}

.game-history-round {
  flex: 0 0 auto;
  color: var(--ink-faint);
  font-size: 0.72rem;
}

.game-history-words {
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 650;
  word-break: break-all;
  text-align: right;
}

/* Finished -------------------------------------------------------------- */
.game-finished {
  display: grid;
  gap: 10px;
  justify-items: center;
  text-align: center;
}

.game-trophy {
  font-size: 2.6rem;
  line-height: 1;
  animation: game-trophy 1600ms ease-in-out infinite;
}

@keyframes game-trophy {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-6px) scale(1.06); }
}

.game-finish-title {
  margin: 4px 0 0;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--coral-deep);
}

.game-finish-copy {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.84rem;
}

@media (max-width: 360px) {
  .game-ready-row {
    grid-template-columns: 1fr;
  }
  .game-input-row {
    grid-template-columns: 1fr;
  }
  .game-input-row input,
  .game-input-row button {
    width: 100%;
  }
}

/* =========================================================================
   Button system (soft-ui + pastel-ui)
   One consistent language for every button in the app: shared touch target,
   radius, elevation, press feedback and focus ring. Placed last so it wins
   over the earlier ad-hoc button rules.
   ========================================================================= */

/* --- Shared foundation --------------------------------------------------- */
.primary-button,
.quiet-button,
.danger-button,
.hug-button,
.beat-button,
.icon-button,
.copy-button,
.miss-button {
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
  transition:
    transform var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease),
    background-color var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    color var(--dur) var(--ease);
}

.primary-button:focus-visible,
.quiet-button:focus-visible,
.danger-button:focus-visible,
.hug-button:focus-visible,
.beat-button:focus-visible,
.icon-button:focus-visible,
.copy-button:focus-visible,
.miss-button:focus-visible {
  outline: 3px solid rgba(196, 75, 69, 0.32);
  outline-offset: 3px;
}

.primary-button:active:not(:disabled),
.quiet-button:active:not(:disabled),
.danger-button:active:not(:disabled),
.hug-button:active:not(:disabled),
.beat-button:active:not(:disabled),
.icon-button:active:not(:disabled),
.copy-button:active:not(:disabled) {
  transform: translateY(1px) scale(0.985);
}

.primary-button:disabled,
.quiet-button:disabled,
.danger-button:disabled,
.hug-button:disabled,
.beat-button:disabled,
.copy-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
  box-shadow: none;
  filter: saturate(0.75);
}

/* --- Hero button (想你了) ------------------------------------------------- */
.miss-button {
  background:
    radial-gradient(118% 118% at 32% 14%, #e07972 0%, var(--coral) 46%, var(--coral-deep) 100%);
  box-shadow:
    0 30px 60px rgba(196, 75, 69, 0.24),
    0 10px 22px rgba(196, 75, 69, 0.16),
    inset 0 2px 0 rgba(255, 255, 255, 0.34),
    inset 0 -14px 30px rgba(120, 30, 28, 0.18);
  transition:
    transform var(--dur-slow) var(--ease-spring),
    box-shadow var(--dur-slow) var(--ease),
    background var(--dur-slow) var(--ease);
}

/* Soft breathing halo behind the hero button. */
.miss-button::before {
  content: "";
  position: absolute;
  inset: -18px;
  z-index: -1;
  border-radius: 50%;
  border: 1.5px solid rgba(196, 75, 69, 0.16);
  background: radial-gradient(
    circle,
    rgba(196, 75, 69, 0.2) 0%,
    rgba(196, 75, 69, 0.08) 48%,
    transparent 70%
  );
  animation: miss-halo 3600ms ease-in-out infinite;
  pointer-events: none;
}

/* A second, tighter ring that settles closer to the button face. */
.miss-button::after {
  content: "";
  position: absolute;
  inset: -6px;
  z-index: -1;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  animation: miss-ring 3600ms ease-in-out infinite;
  pointer-events: none;
}

@keyframes miss-halo {
  0%, 100% { transform: scale(0.94); opacity: 0.5; }
  50% { transform: scale(1.08); opacity: 0.92; }
}

@keyframes miss-ring {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.015); opacity: 0.85; }
}

.miss-button:hover {
  transform: translateY(-4px) scale(1.012);
  background:
    radial-gradient(118% 118% at 32% 14%, #e8847d 0%, #cf5751 46%, var(--coral-deep) 100%);
  box-shadow:
    0 36px 72px rgba(196, 75, 69, 0.3),
    0 12px 26px rgba(196, 75, 69, 0.2),
    inset 0 2px 0 rgba(255, 255, 255, 0.36),
    inset 0 -14px 30px rgba(120, 30, 28, 0.18);
}

.miss-button:active {
  transform: scale(0.972);
  box-shadow:
    0 10px 24px rgba(196, 75, 69, 0.2),
    inset 0 8px 22px rgba(90, 20, 18, 0.34);
}

/* Inner face lifts slightly on hover for a tactile convex feel. */
.miss-button-inner {
  transition: transform var(--dur-slow) var(--ease-spring);
}

.miss-button:hover .miss-button-inner {
  transform: translateY(-2px);
}

/* --- Pill actions (抱抱 / 殴打) ------------------------------------------- */
.hug-button,
.beat-button {
  min-height: var(--btn-min);
  padding: 0 18px;
  gap: 8px;
  border-radius: var(--btn-radius-pill);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  backdrop-filter: blur(8px);
}

.hug-button {
  border: 1px solid rgba(53, 107, 95, 0.26);
  color: var(--mint-strong);
  background:
    linear-gradient(168deg, rgba(255, 255, 255, 0.96), rgba(226, 239, 233, 0.92));
  box-shadow:
    0 10px 24px rgba(53, 107, 95, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.hug-button:hover {
  transform: translateY(-2px);
  border-color: rgba(53, 107, 95, 0.4);
  background:
    linear-gradient(168deg, #ffffff, rgba(214, 233, 225, 0.98));
  box-shadow:
    0 16px 32px rgba(53, 107, 95, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.hug-button:active:not(:disabled) {
  box-shadow:
    inset 0 3px 10px rgba(53, 107, 95, 0.18),
    0 4px 10px rgba(53, 107, 95, 0.08);
}

/* Steel-mint tint deepens with the icon so the pair reads as a family. */
.hug-button svg {
  transition: transform var(--dur) var(--ease-spring);
}

.hug-button:hover svg {
  transform: scale(1.08);
}

.beat-button {
  border: 1px solid rgba(196, 75, 69, 0.28);
  color: #9e3a33;
  background:
    linear-gradient(168deg, rgba(255, 255, 255, 0.96), rgba(251, 232, 228, 0.92));
  box-shadow:
    0 10px 24px rgba(196, 75, 69, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.beat-button:hover {
  transform: translateY(-2px);
  border-color: rgba(196, 75, 69, 0.44);
  background:
    linear-gradient(168deg, #ffffff, rgba(250, 222, 217, 0.98));
  box-shadow:
    0 16px 32px rgba(196, 75, 69, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.beat-button:active:not(:disabled) {
  box-shadow:
    inset 0 3px 10px rgba(150, 45, 35, 0.2),
    0 4px 10px rgba(196, 75, 69, 0.08);
}

.beat-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform var(--dur) var(--ease-spring);
}

.beat-button:hover svg {
  transform: scale(1.08) rotate(-4deg);
}

/* --- Standard buttons ---------------------------------------------------- */
.primary-button {
  min-height: var(--btn-min);
  border: 1px solid transparent;
  border-radius: var(--btn-radius-pill);
  background: var(--coral-grad);
  box-shadow:
    0 12px 26px rgba(196, 75, 69, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.primary-button:hover:not(:disabled) {
  transform: translateY(-2px);
  background: linear-gradient(168deg, #e06b64 0%, #d05b55 42%, var(--coral-deep) 100%);
  box-shadow:
    0 18px 34px rgba(196, 75, 69, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.primary-button:active:not(:disabled) {
  background: linear-gradient(168deg, var(--coral) 0%, var(--coral-deep) 100%);
  box-shadow:
    0 6px 14px rgba(196, 75, 69, 0.18),
    inset 0 3px 8px rgba(90, 20, 18, 0.28);
}

.primary-button svg {
  transition: transform var(--dur) var(--ease-spring);
}

.primary-button:hover:not(:disabled) svg {
  transform: scale(1.06);
}

.quiet-button {
  min-height: var(--btn-min);
  padding: 0 18px;
  border: 1px solid rgba(38, 51, 48, 0.12);
  border-radius: var(--btn-radius-pill);
  color: var(--ink);
  background: linear-gradient(168deg, #ffffff, var(--surface));
  box-shadow:
    0 8px 20px rgba(76, 55, 39, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  font-size: 0.82rem;
  font-weight: 650;
}

.quiet-button:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: rgba(53, 107, 95, 0.34);
  color: var(--mint-strong);
  background: linear-gradient(168deg, #ffffff, var(--mint));
  box-shadow:
    0 14px 28px rgba(53, 107, 95, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.quiet-button:active:not(:disabled) {
  box-shadow:
    inset 0 3px 8px rgba(76, 55, 39, 0.14),
    0 3px 8px rgba(76, 55, 39, 0.05);
}

.quiet-button svg {
  transition: transform var(--dur) var(--ease-spring);
}

.quiet-button:hover:not(:disabled) svg {
  transform: scale(1.07);
}

.danger-button {
  min-height: var(--btn-min);
  border: 1px solid rgba(196, 75, 69, 0.24);
  border-radius: var(--btn-radius-pill);
  color: var(--coral-deep);
  background: linear-gradient(168deg, #ffffff, var(--rose-tint));
  box-shadow:
    0 8px 20px rgba(196, 75, 69, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.danger-button:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: rgba(196, 75, 69, 0.4);
  background: linear-gradient(168deg, #fff8f7, var(--rose));
  box-shadow:
    0 14px 28px rgba(196, 75, 69, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

/* --- Icon buttons (top bar) ---------------------------------------------- */
.icon-button {
  width: var(--btn-min);
  height: var(--btn-min);
  min-height: var(--btn-min);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius-md);
  color: var(--ink);
  background: linear-gradient(168deg, #ffffff, var(--surface));
  box-shadow:
    0 8px 20px rgba(76, 55, 39, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.icon-button:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: rgba(53, 107, 95, 0.3);
  color: var(--mint-strong);
  box-shadow:
    0 14px 28px rgba(76, 55, 39, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.icon-button:active:not(:disabled) {
  box-shadow:
    inset 0 3px 8px rgba(76, 55, 39, 0.14),
    0 3px 8px rgba(76, 55, 39, 0.05);
}

.icon-button svg {
  transition: transform var(--dur) var(--ease-spring);
}

.icon-button:hover:not(:disabled) svg {
  transform: scale(1.08);
}

/* --- Small round copy button --------------------------------------------- */
.copy-button {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(38, 51, 48, 0.12);
  border-radius: 50%;
  color: var(--mint-strong);
  background: linear-gradient(168deg, #ffffff, var(--mint));
  box-shadow:
    0 6px 16px rgba(53, 107, 95, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.copy-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow:
    0 12px 24px rgba(53, 107, 95, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

/* --- Brand button (returns to top) -------------------------------------- */
.brand-button {
  min-height: var(--btn-min);
  border-radius: var(--radius-md);
  transition:
    transform var(--dur) var(--ease-spring),
    box-shadow var(--dur) var(--ease),
    background var(--dur) var(--ease);
}

.brand-button:hover {
  background: var(--rose-tint);
  box-shadow: 0 12px 26px rgba(196, 75, 69, 0.16);
}

.brand-button:active {
  transform: scale(0.97);
}

.brand-button:focus-visible {
  outline: 3px solid rgba(196, 75, 69, 0.32);
  outline-offset: 3px;
}

/* --- Auth segmented tabs ------------------------------------------------- */
.segment {
  min-height: var(--btn-min);
  border-radius: var(--radius-md);
  font-weight: 650;
  transition:
    background var(--dur) var(--ease),
    color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease),
    transform var(--dur) var(--ease);
}

.segment:hover:not(.is-active) {
  background: rgba(255, 255, 255, 0.72);
  color: var(--mint-strong);
}

.segment.is-active {
  background: linear-gradient(168deg, #ffffff, var(--mint));
  color: var(--mint-strong);
  box-shadow:
    0 8px 20px rgba(53, 107, 95, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.segment:active {
  transform: scale(0.985);
}

.segment:focus-visible {
  outline: 3px solid rgba(196, 75, 69, 0.32);
  outline-offset: 2px;
}

/* --- Mood choices -------------------------------------------------------- */
.mood-choice {
  min-height: var(--btn-min);
  border: 1px solid rgba(38, 51, 48, 0.12);
  border-radius: var(--radius-md);
  background: linear-gradient(168deg, #ffffff, var(--surface));
  box-shadow:
    0 8px 20px rgba(76, 55, 39, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition:
    transform var(--dur) var(--ease-spring),
    box-shadow var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    background var(--dur) var(--ease);
}

.mood-choice:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--mood-color, var(--mint-strong)) 42%, transparent);
  box-shadow:
    0 14px 28px rgba(76, 55, 39, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.mood-choice.is-active {
  border-color: color-mix(in srgb, var(--mood-color, var(--mint-strong)) 58%, transparent);
  background: color-mix(in srgb, var(--mood-color, var(--mint-strong)) 14%, #ffffff);
  color: var(--mood-color, var(--mint-strong));
  box-shadow:
    inset 0 3px 10px rgba(76, 55, 39, 0.12),
    0 2px 6px rgba(76, 55, 39, 0.05);
  transform: translateY(1px);
}

.mood-choice:active {
  transform: scale(0.985);
}

.mood-choice:focus-visible {
  outline: 3px solid rgba(196, 75, 69, 0.32);
  outline-offset: 2px;
}

/* --- Compact modifier keeps the pill language ---------------------------- */
.primary-button.compact,
.quiet-button.compact {
  min-height: 42px;
  padding: 0 16px;
  font-size: 0.8rem;
}

/* Keep every pill action reachable at 320px without crowding. */
@media (max-width: 360px) {
  .hug-button,
  .beat-button {
    padding: 0 13px;
    font-size: 0.76rem;
  }
  .miss-button::before {
    inset: -8px;
  }
}

/* =========================================================================
   Reduced motion — declared last so it always wins over the button system.
   Decorative animation is removed entirely; state changes stay instant.
   ========================================================================= */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    transition-delay: 0ms !important;
  }

  /* Hide purely decorative layers that only exist to animate. */
  .miss-button::before,
  .miss-button::after {
    animation: none !important;
    opacity: 0.35;
  }

  /* Button press feedback becomes an instant, non-motion state change. */
  .primary-button:hover:not(:disabled),
  .quiet-button:hover:not(:disabled),
  .hug-button:hover:not(:disabled),
  .beat-button:hover:not(:disabled),
  .icon-button:hover:not(:disabled),
  .miss-button:hover,
  .mood-choice:hover {
    transform: none;
  }
}


