@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Fredoka:wght@400;500;600;700&display=swap');

:root {
  color-scheme: light;
  --ink: #3b2b30;
  --muted: #827477;
  --paper: #f7f0ed;
  --white: #fffaf8;
  --green: #718675;
  --green-dark: #4b6554;
  --green-pale: #e7eee7;
  --coral: #c76f72;
  --line: #eadfdd;
  --shadow: 0 20px 55px rgb(85 57 62 / 9%);
  font-family: 'DM Sans', sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; color: var(--ink); background-color: var(--paper); background-image: repeating-linear-gradient(135deg, rgb(110 79 82 / 2%) 0, rgb(110 79 82 / 2%) 1px, transparent 1px, transparent 8px); }
button, input { font: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }

.shell { width: min(100% - 40px, 1040px); min-height: 100vh; margin: 0 auto; padding: 24px 0 48px; }
.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 58px; }
.brand { display: inline-flex; gap: 11px; align-items: center; color: inherit; text-decoration: none; }
.brand-mark { display: grid; width: 42px; aspect-ratio: 1; place-items: center; border-radius: 15px 15px 15px 5px; background: var(--coral); color: white; font: 700 21px 'DM Sans', sans-serif; }
.brand-copy { display: grid; gap: 1px; }
.brand-copy strong { font: 600 19px Fredoka, sans-serif; }
.brand-copy small { color: var(--muted); font-size: 11px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.privacy-label { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.privacy-dot, .live-label i { width: 7px; aspect-ratio: 1; border-radius: 50%; background: #62a777; }
.icon-button, .text-button { border: 1px solid var(--line); background: var(--white); cursor: pointer; }
.icon-button { width: 44px; aspect-ratio: 1; border-radius: 50%; font-size: 18px; }
.text-button { padding: 8px 12px; border-radius: 18px; font-size: 12px; }

.auth-view { display: grid; grid-template-columns: 1fr minmax(290px, 390px); align-items: center; gap: clamp(32px, 8vw, 110px); max-width: 890px; min-height: min(690px, calc(100vh - 120px)); margin: 14px auto 0; }
.auth-intro { position: relative; padding: 58px 10px 58px 0; }
.auth-intro::before { position: absolute; z-index: -1; top: 10px; left: -32px; width: 210px; height: 210px; border: 1px dashed #e5c9c8; border-radius: 46% 54% 61% 39%; content: ''; transform: rotate(-12deg); }
.auth-intro::after { position: absolute; top: 7px; right: 13%; color: var(--coral); content: '♥'; font-size: 20px; transform: rotate(12deg); }
.eyebrow { margin: 0 0 9px; color: var(--green-dark); font-size: 10px; font-weight: 700; letter-spacing: 1.2px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 15px; font: 600 56px/1.05 Fredoka, 'Trebuchet MS', sans-serif; letter-spacing: 0; }
.intro-copy { max-width: 395px; margin-bottom: 26px; color: var(--muted); font-size: 15px; line-height: 1.7; }
.intimacy-note { display: flex; align-items: center; gap: 9px; color: var(--green-dark); font-size: 12px; }
.intimacy-note span:first-child { display: grid; width: 23px; aspect-ratio: 1; place-items: center; border-radius: 50%; background: var(--green-pale); }
.form-panel { display: grid; gap: 11px; padding: 30px; border: 1px solid #eadcda; border-radius: 12px; background: var(--white); box-shadow: var(--shadow); }
label { color: #454e48; font-size: 12px; font-weight: 600; }
input[type='email'], input[type='password'], input[type='text'], select { width: 100%; min-height: 48px; padding: 0 13px; border: 1px solid #dcd8cf; border-radius: 8px; outline: none; background: #fff; color: var(--ink); }
input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgb(66 107 87 / 12%); }
select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgb(66 107 87 / 12%); }
.primary-button { display: inline-flex; min-height: 45px; align-items: center; justify-content: center; gap: 18px; padding: 0 17px; border: 0; border-radius: 8px; background: #76535d; color: #fff; font-size: 13px; font-weight: 700; cursor: pointer; transition: background 140ms ease, transform 140ms ease; }
.primary-button:hover { transform: translateY(-1px); background: #573c45; }
.form-error { min-height: 14px; margin: 0; color: #a94435; font-size: 12px; }
.form-footnote { margin: 3px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }

.status-view { padding-top: 46px; }
.welcome-row { display: flex; align-items: end; justify-content: space-between; margin-bottom: 28px; }
.welcome-row h1 { margin-bottom: 0; font-size: 43px; }
.today-label { padding-bottom: 5px; color: var(--muted); font-size: 12px; }
.partner-band { position: relative; display: flex; align-items: center; gap: 19px; min-height: 164px; overflow: hidden; padding: 26px 32px; border-radius: 7px; background: #e6eee6; }
.partner-band::after { position: absolute; top: -60px; right: 3%; width: 250px; height: 250px; border: 1px solid rgb(66 107 87 / 17%); border-radius: 50%; content: ''; }
.partner-avatar { z-index: 1; display: grid; width: 57px; flex: 0 0 57px; aspect-ratio: 1; place-items: center; border: 1px solid rgb(113 134 117 / 27%); border-radius: 50%; color: var(--coral); font-size: 20px; }
.partner-details { z-index: 1; min-width: 0; }
.partner-meta { display: flex; align-items: center; gap: 12px; }
.partner-meta h2 { margin: 0; font: 600 23px Fredoka, 'Trebuchet MS', sans-serif; }
.live-label { display: inline-flex; align-items: center; gap: 5px; color: var(--green-dark); font-size: 9px; font-weight: 700; letter-spacing: .8px; }
.live-label i { width: 6px; }
.partner-current { display: flex; align-items: center; gap: 10px; margin: 13px 0 3px; }
.status-emoji { font-size: 24px; }
.partner-current p { overflow-wrap: anywhere; margin: 0; font: 500 24px Fredoka, 'Trebuchet MS', sans-serif; }
.updated-label { margin: 0; color: #66736a; font-size: 11px; }
.sparkle { position: absolute; z-index: 1; right: 9%; bottom: 18px; color: var(--coral); font-size: 20px; }

.my-status-section { padding: 34px 0 30px; border-bottom: 1px solid var(--line); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 17px; }
.section-heading h2, .settings-row h2 { margin: 0; font: 600 25px Fredoka, 'Trebuchet MS', sans-serif; }
.section-heading .eyebrow, .settings-row .eyebrow { margin-bottom: 6px; }
.my-status-summary { max-width: 45%; overflow: hidden; margin: 0 0 2px; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.preset-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.preset { display: flex; min-height: 74px; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 8px 4px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); cursor: pointer; transition: border-color 140ms ease, background 140ms ease; }
.preset span:first-child { font-size: 20px; }
.preset span:last-child { max-width: 100%; overflow-wrap: anywhere; color: #59635b; font-size: 10px; text-align: center; }
.preset[aria-pressed='true'] { border-color: var(--green); background: var(--green-pale); }
.preset[aria-pressed='true'] span:last-child { color: var(--green-dark); font-weight: 700; }
.custom-row { margin-top: 12px; }
.custom-button { min-height: 44px; padding: 0; border: 0; background: none; color: var(--green-dark); font-size: 12px; font-weight: 700; cursor: pointer; }
.custom-button span { margin-right: 3px; font-size: 16px; }
.custom-fields { display: grid; gap: 9px; max-width: 550px; margin-top: 16px; }
.custom-fields label { display: flex; justify-content: space-between; }
.custom-fields label span, .picker-label { color: var(--muted); font-size: 10px; font-weight: 400; }
.picker-label { margin: 0; }
.emoji-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.emoji-choice { width: 42px; aspect-ratio: 1; border: 1px solid var(--line); border-radius: 8px; background: var(--white); font-size: 17px; cursor: pointer; }
.emoji-choice[aria-pressed='true'] { border-color: var(--green); background: var(--green-pale); }
.save-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 22px; }
.save-row p { margin: 0; color: var(--muted); font-size: 11px; }
.history-section { padding: 28px 0 26px; border-bottom: 1px solid var(--line); }
.history-limit { color: var(--muted); font-size: 11px; }
.history-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.history-list li { display: flex; align-items: center; gap: 11px; min-height: 42px; border-bottom: 1px solid #eae4d9; font-size: 12px; }
.history-list li:last-child { border-bottom: 0; }
.history-item-emoji { font-size: 17px; }
.history-item-text { flex: 1; font-weight: 600; }
.history-item-time { color: var(--muted); font-size: 10px; }
.empty-history { color: var(--muted); }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 27px 0 18px; }
.settings-row h2 { font-size: 21px; }
.settings-copy { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.switch-label { display: inline-flex; align-items: center; gap: 9px; color: var(--muted); cursor: pointer; }
.switch-label > span:first-child { min-width: 22px; font-size: 11px; }
.switch-label input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.switch-track { display: flex; width: 40px; height: 23px; align-items: center; padding: 3px; border-radius: 15px; background: #c7c8be; transition: background 150ms; }
.switch-track span { width: 17px; aspect-ratio: 1; border-radius: 50%; background: white; transition: transform 150ms; }
.switch-label input:checked + .switch-track { background: var(--green); }
.switch-label input:checked + .switch-track span { transform: translateX(17px); }
.switch-label input:focus-visible + .switch-track { outline: 3px solid rgb(66 107 87 / 25%); outline-offset: 2px; }
.app-footer { padding-top: 17px; color: #898c80; font-size: 10px; text-align: center; }
.toast { position: fixed; z-index: 5; right: max(20px, env(safe-area-inset-right)); bottom: max(20px, env(safe-area-inset-bottom)); max-width: min(400px, calc(100vw - 40px)); padding: 13px 17px; border-radius: 5px; background: var(--ink); color: white; box-shadow: var(--shadow); font-size: 13px; line-height: 1.45; }

@media (max-width: 700px) {
  .shell { width: min(100% - 28px, 540px); padding: max(12px, env(safe-area-inset-top)) 0 max(24px, env(safe-area-inset-bottom)); }
  .auth-view { grid-template-columns: 1fr; gap: 18px; min-height: auto; margin-top: 25px; }
  .auth-intro { padding: 14px 0 0; }
  .auth-intro::before { top: -5px; left: -20px; width: 170px; height: 170px; }
  .auth-intro h1 { font-size: 44px; }
  .intro-copy { max-width: 430px; margin-bottom: 16px; font-size: 14px; }
  .form-panel { padding: 23px; }
  .status-view { padding-top: 24px; }
  .welcome-row { margin-bottom: 19px; }
  .partner-band { min-height: 132px; gap: 13px; padding: 18px 15px; }
  .partner-band::after { top: -34px; right: -16px; width: 145px; height: 145px; }
  .partner-avatar { width: 48px; flex-basis: 48px; }
  .partner-current p { font-size: 18px; }
  .preset-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .preset { min-height: 72px; }
  .my-status-section { padding-top: 26px; }
}

@media (max-width: 400px) {
  .shell { width: min(100% - 24px, 540px); }
  .privacy-label { font-size: 10px; }
  .topbar-actions { gap: 7px; }
  .brand { gap: 8px; }
  .brand-mark { width: 38px; }
  .brand-copy small { font-size: 10px; }
  .welcome-row { align-items: start; flex-direction: column; gap: 4px; }
  .welcome-row h1 { font-size: 37px; }
  .today-label { max-width: none; padding: 0; text-align: left; }
  .section-heading { align-items: start; flex-direction: column; gap: 8px; }
  .my-status-summary { max-width: 100%; }
  .save-row { align-items: stretch; flex-direction: column; }
  .save-row .primary-button { width: 100%; }
}

@media (max-width: 340px) {
  .brand-copy small { max-width: 120px; }
  .privacy-label { gap: 5px; font-size: 9px; }
  .topbar-actions { gap: 5px; }
  .partner-avatar { width: 42px; flex-basis: 42px; }
  .partner-meta { gap: 7px; }
  .partner-meta h2 { font-size: 21px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}