/* Lawn Care — tokens and components from DESIGN.md. No inline styles anywhere (CSP). */

:root {
  --green-900: #0F3B29;
  --green-700: #1D5139;
  --green-500: #3E6E55;
  --green-400: #4E7A62;
  --green-300: #B9D3C3;
  --lime: #C6EE6B;
  --bg: #EEF1EC;
  --surface: #FFFFFF;
  --surface-soft: #F5F7F3;
  --ink: #121A15;
  --ink-soft: #333D36;
  --muted: #56635A;
  --line: #E6EBE5;
  --line-strong: #CFD8CF;
  --check-ring: #9AA89E;
  --danger: #A3271B;
  --aces-bg: #DCE8F7;
  --aces-ink: #1D4A85;
  --user-bg: #FDE7C2;
  --user-ink: #6B4200;
  --alarm: #B36A00;
  --alarm-ink: #8A5200;
  --locked: #667269;
  --locked-bg: #DCE3DB;
  /* Green used as text/outline on light surfaces, and as a solid fill there. */
  --accent: #0F3B29;
  --fill-strong: #0F3B29;
  --link-hover: #08261A;
  --danger-fill: #A3271B;
  --warn-bg: #FFF8EC;
  --warn-ink: #3A2509;
  --info-bg: #EEF3FA;
  --error-bg: #FCEDEB;
  --error-ink: #6E1A12;
  --ok-bg: #EAF4DA;
  --ok-ink: #23401A;
  --ok-line: #5C8A3A;
  --tabbar-line: #DCE3DB;
  --dashed-line: #A9B6AB;
  --cal-out: #B5BFB7;
  --radius-card: 18px;
  --tabbar-height: 84px;
  --shell-width: 480px;
  --font: "Gothic A1", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}

/* Dark mode follows the phone setting. The green header, dark cards and the
   sign-in screens are already dark and keep their colors. */
@media (prefers-color-scheme: dark) {
  :root {
  --bg: #0D1310;
  --surface: #18211C;
  --surface-soft: #1F2A24;
  --ink: #E8EEE9;
  --ink-soft: #CDD6D0;
  --muted: #A0ADA5;
  --line: #29352E;
  --line-strong: #3A473F;
  --check-ring: #7A887F;
  --danger: #FF8F80;
  --aces-bg: #1C2F4A;
  --aces-ink: #A9C8F2;
  --user-bg: #4A3413;
  --user-ink: #F6CF8E;
  --alarm: #E0A040;
  --alarm-ink: #F0B860;
  --locked: #7F8C83;
  --locked-bg: #29352E;
  --accent: #C6EE6B;
  --fill-strong: #2F6B4B;
  --link-hover: #E2F8B0;
  --warn-bg: #2E2414;
  --warn-ink: #F6CF8E;
  --info-bg: #1A2638;
  --error-bg: #3A1B17;
  --error-ink: #FFB4A8;
  --ok-bg: #1F3317;
  --ok-ink: #CBE9A6;
  --ok-line: #7FB356;
  --tabbar-line: #29352E;
  --dashed-line: #4E5C53;
  --cal-out: #5E6A62;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: var(--header-height, 0px); }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
}

a { color: var(--accent); }
a:hover { color: var(--link-hover); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

/* Focus is never removed: one visible ring everywhere, lime on dark surfaces. */
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.on-dark :focus-visible, .on-dark:focus-visible { outline-color: var(--lime); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 8px; top: -60px; z-index: 50;
  display: inline-flex; align-items: center; min-height: 44px;
  padding: 0 14px; border-radius: 12px;
  background: var(--lime); color: var(--green-900); font-weight: 800;
}
.skip-link:focus { top: 8px; }

[hidden] { display: none !important; }

/* ---------- App shell ---------- */

.shell {
  position: relative;
  max-width: var(--shell-width);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}
.shell--tabs { padding-bottom: calc(var(--tabbar-height) + env(safe-area-inset-bottom)); }

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--green-900);
  color: #FFFFFF;
  padding: calc(20px + env(safe-area-inset-top)) 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.app-header--compact { padding: calc(12px + env(safe-area-inset-top)) 16px 18px; gap: 12px; }
.app-header__row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.app-header__titles { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.app-header__actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.app-header__back { display: flex; align-items: center; gap: 8px; }
.eyebrow { font-size: 13px; color: var(--green-300); }
.page-title { font-size: 24px; font-weight: 800; line-height: 1.25; }
.page-title--small { font-size: 20px; }

.icon-button {
  width: 44px; height: 44px; border-radius: 22px;
  border: none; background: var(--green-700); color: #FFFFFF;
  display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none; cursor: pointer; flex-shrink: 0;
}
.icon-button--ghost { background: transparent; }
.icon-button--light { background: var(--bg); color: var(--ink); }
.icon-button[aria-disabled="true"] { opacity: .45; cursor: default; }
a.icon-button:hover { color: #FFFFFF; }

.chip-link {
  min-height: 44px; padding: 0 12px; border-radius: 22px;
  background: var(--green-700); color: #FFFFFF;
  font-size: 13px; font-weight: 700;
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
}
.chip-link:hover { color: #FFFFFF; }
.chip-link svg { color: var(--lime); }

.avatar {
  width: 44px; height: 44px; border-radius: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 800; text-decoration: none; flex-shrink: 0;
}
.avatar--sm { width: 30px; height: 30px; font-size: 12px; border: 2px solid var(--surface); }
.avatar--md { width: 40px; height: 40px; font-size: 15px; }
.avatar--lg { width: 56px; height: 56px; border-radius: 28px; font-size: 22px; }
.avatar-0 { background: #A9D3F5; color: #0B2A44; }
.avatar-1 { background: #F2C38B; color: #3A2509; }
.avatar-2 { background: #E3C6F0; color: #3B1450; }
.avatar-3 { background: #DDE5DB; color: #121A15; }
.faces { display: flex; flex-shrink: 0; }
.faces .avatar + .avatar { margin-left: -8px; }
.faces--on-dark .avatar--sm { border-color: var(--green-700); }

.summary-card {
  background: var(--green-700);
  border-radius: 16px;
  padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.summary-card__row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.summary-card__title { font-size: 15px; font-weight: 700; }
.summary-card__value { font-size: 14px; font-weight: 800; color: var(--lime); white-space: nowrap; }
.summary-card__note { font-size: 12px; color: var(--green-300); }

/* Year progress: 12 month cells. State is also spelled out for screen readers. */
.months { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 4px; }
.month { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.month__bar { width: 100%; height: 22px; border-radius: 5px; background: var(--green-900); }
.month--none .month__bar { background: transparent; border: 1px dashed var(--green-400); }
.month--done .month__bar { background: var(--lime); }
.month--current .month__bar { background: transparent; border: 2px solid var(--lime); }
.month--missed .month__bar { background: repeating-linear-gradient(135deg, var(--green-900) 0 4px, var(--green-500) 4px 6px); }
.month__num { font-size: 10px; color: var(--green-300); }
.month--current .month__num { color: #FFFFFF; font-weight: 800; }

.status-banner {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; border-radius: 14px;
  background: var(--user-bg); color: var(--warn-ink);
}
.status-banner svg { flex-shrink: 0; margin-top: 1px; color: var(--user-ink); }
.status-banner__title { font-size: 14px; font-weight: 800; }
.status-banner__text { font-size: 13px; line-height: 1.45; }
.status-banner__link { display: inline-flex; align-items: center; min-height: 44px; font-weight: 800; color: var(--user-ink); }
.link-card--pending { background: var(--user-bg); color: var(--warn-ink); }
.link-card--pending:hover { color: var(--warn-ink); }
.link-card--pending svg { color: var(--user-ink); }

/* ---------- Content ---------- */

.content { flex-grow: 1; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.section { display: flex; flex-direction: column; gap: 8px; }
.section-title { margin: 0 4px; font-size: 13px; font-weight: 800; color: var(--muted); }
.section-help { padding: 0 4px; font-size: 13px; line-height: 1.5; color: var(--muted); }

.card {
  background: var(--surface);
  border-radius: var(--radius-card);
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.card--dark { background: var(--green-900); color: #FFFFFF; }
.card--flush { padding: 0; gap: 0; }
.card__title { font-size: 16px; font-weight: 800; line-height: 1.35; }
.card__text { font-size: 14px; line-height: 1.5; color: var(--ink-soft); }
.card__sub { font-size: 13px; color: var(--muted); }
.card--dark .card__sub { color: var(--green-300); }

.empty { text-align: center; padding: 22px 16px; color: var(--muted); }
.empty__title { font-size: 16px; font-weight: 800; color: var(--ink); }

.badge {
  display: inline-block; font-size: 13px; font-weight: 800;
  padding: 3px 8px; border-radius: 6px; line-height: 1.4; white-space: nowrap;
}
.badge--aces { background: var(--aces-bg); color: var(--aces-ink); }
.badge--user { background: var(--user-bg); color: var(--user-ink); }
.badge--count { background: var(--danger-fill); color: #FFFFFF; border-radius: 10px; min-width: 22px; text-align: center; }

.meta-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.meta-text { font-size: 14px; color: var(--muted); }

/* Task card */
.card.task { flex-direction: row; gap: 12px; align-items: flex-start; }
.task__check-form { flex-shrink: 0; }
.task__main { display: flex; flex-direction: column; gap: 6px; flex-grow: 1; min-width: 0; }
.task__title { font-size: 16px; font-weight: 800; line-height: 1.35; overflow-wrap: anywhere; }
.task__body { font-size: 16px; line-height: 1.55; color: var(--ink-soft); white-space: pre-line; overflow-wrap: anywhere; }
.task--done .task__title { color: var(--muted); text-decoration: line-through; font-weight: 700; font-size: 15px; }
.task__done-date { font-size: 14px; color: var(--muted); }
.task__sources { font-size: 13px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
/* Source links sit in a flex row, not a sentence: give them the full touch target. */
.task__sources a, .doc li a { display: inline-flex; align-items: center; min-height: 44px; }
.task__sources a { font-weight: 700; }
.task__footnote { font-size: 14px; color: var(--muted); }
.task__summary { font-size: 16px; line-height: 1.6; color: var(--ink); overflow-wrap: anywhere; }
.glossary__list { display: flex; flex-direction: column; gap: 10px; padding: 4px 0 8px; margin: 0; }
.glossary__item dt { font-size: 14px; font-weight: 800; color: var(--ink); }
.glossary__item dd { margin: 2px 0 0; font-size: 15px; line-height: 1.55; color: var(--ink-soft); }
.status-line { display: flex; gap: 6px; align-items: center; font-size: 14px; font-weight: 700; color: var(--ok-ink); background: var(--ok-bg); border-radius: 10px; padding: 8px 10px; }
.status-line svg { flex-shrink: 0; }
.task__more > summary { font-size: 13px; font-weight: 700; color: var(--accent); }

/* The 44px circle plus a visible word: the circle alone read as decoration (Step 6.5, 60s member). */
.check-button {
  display: inline-flex; flex-direction: column; align-items: center; gap: 4px;
  min-width: 48px; padding: 0; border: none; background: none; cursor: pointer;
}
.check-button__label { font-size: 13px; font-weight: 800; line-height: 1.2; color: var(--accent); white-space: nowrap; }
.check-button--done .check-button__label { color: var(--muted); font-weight: 700; }
.check {
  width: 44px; height: 44px; border-radius: 22px;
  border: 2px solid var(--check-ring); background: var(--surface);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0; color: var(--lime);
}
.check--done { border: none; background: var(--fill-strong); }
.check-button:hover .check:not(.check--done) { border-color: var(--accent); }

.region-note {
  font-size: 14px; line-height: 1.5; color: var(--aces-ink);
  background: var(--info-bg); border-radius: 10px; padding: 8px 10px;
}

/* <details> disclosure shared by notices and settings rows */
details > summary { cursor: pointer; list-style: none; min-height: 44px; display: flex; align-items: center; gap: 8px; }
details > summary::-webkit-details-marker { display: none; }
details > summary::after {
  content: ""; width: 8px; height: 8px; margin-left: auto; flex-shrink: 0;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg); transition: transform .15s ease;
}
details[open] > summary::after { transform: rotate(225deg); }

.notice {
  border: 1px solid var(--user-bg); background: var(--warn-bg); border-radius: 12px;
  padding: 0 12px; color: var(--warn-ink);
}
/* Safety text is never smaller than body text (legal advisory: >= 10pt). */
.notice > summary { font-size: 14px; font-weight: 700; line-height: 1.4; padding: 6px 0; }
.notice__list { padding: 0 0 10px 18px; list-style: disc; font-size: 14px; line-height: 1.55; }
.notice__list li + li { margin-top: 2px; }
.notice-line { font-size: 14px; line-height: 1.5; color: var(--warn-ink); background: var(--warn-bg); border-radius: 10px; padding: 8px 10px; }

.link-card {
  background: var(--surface); border-radius: var(--radius-card);
  padding: 12px 16px; min-height: 56px;
  display: flex; gap: 12px; align-items: center;
  text-decoration: none; color: var(--ink);
}
.link-card:hover { color: var(--ink); }
.link-card__text { font-size: 14px; line-height: 1.4; flex-grow: 1; min-width: 0; }
.link-card--dashed { background: transparent; border: 1px dashed var(--dashed-line); color: var(--ink-soft); }
.link-card--dark { background: var(--green-900); color: #FFFFFF; }
.link-card--dark:hover { color: #FFFFFF; }
.link-card--dark .card__sub { color: var(--green-300); }
.link-card__aside { font-size: 13px; color: var(--muted); white-space: nowrap; }
.link-card svg { flex-shrink: 0; }

.page-footer { padding: 4px 16px 16px; font-size: 13px; color: var(--muted); text-align: center; }
.page-footer a { color: var(--muted); font-weight: 700; display: inline-flex; min-height: 44px; align-items: center; padding: 0 6px; }

/* ---------- Buttons & forms ---------- */

.btn {
  min-height: 44px; padding: 0 16px; border-radius: 22px;
  border: none; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 14px; font-weight: 800; white-space: nowrap;
}
.btn--block { width: 100%; }
.btn--lg { min-height: 54px; border-radius: 27px; font-size: 17px; }
.btn--lime { background: var(--lime); color: var(--green-900); }
.btn--lime:hover { color: var(--green-900); }
.btn--dark { background: var(--fill-strong); color: var(--lime); }
.btn--dark:hover { color: var(--lime); }
.btn--outline { background: var(--surface); color: var(--ink); border: 1.5px solid var(--line-strong); font-weight: 700; }
.btn--outline-dark { background: transparent; color: #FFFFFF; border: 1.5px solid var(--green-400); font-weight: 700; }
.btn--outline-dark:hover { color: #FFFFFF; }
.btn--danger { background: var(--surface); color: var(--danger); border: 1.5px solid var(--line-strong); font-weight: 700; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-row .btn--grow { flex-grow: 1; }

.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: 14px; font-weight: 700; }
.field__help { font-size: 13px; color: var(--muted); }
.input, .select {
  width: 100%; min-height: 48px; border-radius: 14px;
  border: 1.5px solid var(--line-strong); background: var(--surface);
  padding: 0 14px; font-size: 16px; color: var(--ink);
}
.input[readonly] { background: var(--surface-soft); font-size: 13px; }
.input[aria-invalid="true"] { border-color: var(--danger); }

.choice-group { border: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.choice-group legend { font-size: 14px; font-weight: 700; margin-bottom: 6px; padding: 0; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice span {
  min-height: 48px; border-radius: 14px; display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--line-strong); background: var(--surface); font-weight: 700; cursor: pointer;
}
.choice input:checked + span { border-color: var(--fill-strong); background: var(--fill-strong); color: var(--lime); }
.choice input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }

.alert {
  display: flex; gap: 8px; align-items: flex-start;
  padding: 10px 12px; border-radius: 12px;
  background: var(--error-bg); color: var(--error-ink); border: 1.5px solid var(--danger);
  font-size: 14px; line-height: 1.45;
}
.alert svg { flex-shrink: 0; margin-top: 1px; }
.alert--ok { background: var(--ok-bg); color: var(--ok-ink); border-color: var(--ok-line); }

/* ---------- Settings list ---------- */

.rows { background: var(--surface); border-radius: var(--radius-card); display: flex; flex-direction: column; }
.row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  min-height: 52px; padding: 0 16px; font-size: 15px; color: var(--ink); text-decoration: none;
}
.row + .row, .rows > * + * { border-top: 1px solid var(--line); }
.row__value { font-weight: 800; }
.row--danger { color: var(--danger); font-weight: 700; }
.row-details > summary { padding: 0 16px; min-height: 52px; font-size: 15px; }
.row-details__body { padding: 0 16px 16px; display: flex; flex-direction: column; gap: 12px; }
button.row { width: 100%; border: none; background: transparent; cursor: pointer; text-align: left; }

/* ---------- Members ---------- */

.member { display: flex; gap: 12px; align-items: center; }
.member__text { display: flex; flex-direction: column; gap: 2px; flex-grow: 1; min-width: 0; }
.member__name { font-size: 15px; font-weight: 800; overflow-wrap: anywhere; }
.member__sub { font-size: 12px; color: var(--muted); }
.member-details > summary { padding: 8px 14px; min-height: 60px; }
.member-details__body { padding: 0 14px 14px; display: flex; flex-direction: column; gap: 12px; }

/* ---------- Group feed ---------- */

.progress { width: 100%; height: 10px; border-radius: 5px; overflow: hidden; appearance: none; border: none; background: var(--green-900); }
.progress::-webkit-progress-bar { background: var(--green-900); border-radius: 5px; }
.progress::-webkit-progress-value { background: var(--lime); border-radius: 5px; }
.progress::-moz-progress-bar { background: var(--lime); border-radius: 5px; }

.feed-item { display: flex; gap: 10px; align-items: center; }
.feed-item__text { display: flex; flex-direction: column; gap: 2px; flex-grow: 1; min-width: 0; font-size: 15px; line-height: 1.4; }

/* ---------- Calendar ---------- */

.cal { width: 100%; border-collapse: collapse; table-layout: fixed; text-align: center; }
.cal th { font-size: 11px; font-weight: 700; color: var(--muted); padding-bottom: 4px; }
.cal td { height: 42px; padding: 0; font-size: 14px; vertical-align: middle; }
.cal__day { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; width: 34px; height: 38px; }
.cal__day--out { color: var(--cal-out); }
.cal__day--task { font-weight: 800; }
.cal__day--today { background: var(--fill-strong); color: var(--lime); border-radius: 17px; font-weight: 800; }
.dot { width: 6px; height: 6px; border-radius: 3px; display: inline-block; }
.dot--task { background: var(--accent); }
.dot--alarm { border: 1.5px solid var(--alarm); }
.cal__day--today .dot--task { background: var(--lime); }
.legend { display: flex; gap: 14px; justify-content: center; font-size: 11px; color: var(--muted); padding-top: 6px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }

.event { display: flex; gap: 12px; align-items: center; }
.event__date { width: 44px; text-align: center; flex-shrink: 0; display: flex; flex-direction: column; }
.event__day { font-size: 18px; font-weight: 800; line-height: 1.2; }
.event__time { font-size: 11px; color: var(--muted); }
.event__main { display: flex; flex-direction: column; gap: 4px; flex-grow: 1; min-width: 0; }
.event__title { font-size: 15px; font-weight: 800; overflow-wrap: anywhere; }
.event__alarm { font-size: 12px; font-weight: 700; color: var(--alarm-ink); }

/* ---------- Tab bar ---------- */

.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: var(--shell-width); z-index: 20;
  height: calc(var(--tabbar-height) + env(safe-area-inset-bottom));
  padding: 6px 4px calc(18px + env(safe-area-inset-bottom));
  background: var(--surface); border-top: 1px solid var(--tabbar-line);
}
/* iOS home-screen apps (black-translucent status bar) lay the page out short by
   the status-bar height until the first scroll, so the fixed tab bar floats
   above the bottom edge. Making the document at least that much taller
   removes the gap on first paint. */
@media (display-mode: standalone) {
  html { min-height: calc(100% + env(safe-area-inset-top)); }
}
.tabbar__list { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); height: 100%; }
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: 44px; height: 100%; text-decoration: none; color: var(--muted); font-size: 13px;
}
.tab:hover { color: var(--accent); }
.tab[aria-current="page"] { color: var(--accent); font-weight: 800; }
.tab--locked { color: var(--locked); }
.tab-add { display: flex; align-items: center; justify-content: center; height: 100%; text-decoration: none; }
.tab-add__circle {
  width: 52px; height: 52px; border-radius: 26px; background: var(--fill-strong); color: var(--lime);
  display: flex; align-items: center; justify-content: center;
}
.tab-add--locked .tab-add__circle { background: var(--locked-bg); color: var(--muted); }

/* ---------- Bottom sheet (native <dialog>) ---------- */

.sheet {
  width: 100%; max-width: var(--shell-width); margin: auto auto 0; padding: 0;
  border: none; border-radius: 26px 26px 0 0; background: var(--surface); color: var(--ink);
  max-height: 90vh;
}
.sheet::backdrop { background: rgba(18, 26, 21, .55); }
.sheet[open] { animation: sheet-up .2s ease-out; }
.sheet__inner { padding: 12px 20px calc(34px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; }
.sheet__handle { width: 40px; height: 5px; border-radius: 3px; background: var(--line-strong); align-self: center; }
.sheet__head { display: flex; justify-content: space-between; align-items: center; }
.sheet__title { font-size: 20px; font-weight: 800; }
@keyframes sheet-up { from { transform: translateY(24px); } to { transform: none; } }

.add-primary {
  display: flex; gap: 14px; align-items: center; width: 100%; padding: 16px; border-radius: 18px;
  border: none; background: var(--green-900); color: #FFFFFF; text-align: left; cursor: not-allowed;
}
.add-primary__icon { width: 48px; height: 48px; border-radius: 14px; background: var(--lime); color: var(--green-900); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.add-primary__text { display: flex; flex-direction: column; gap: 3px; }
.add-primary__title { font-size: 16px; font-weight: 800; }
.add-primary__sub { font-size: 13px; color: var(--green-300); }
.add-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.add-tile {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 8px; border-radius: 18px;
  border: none; background: var(--bg); color: var(--ink); font-size: 14px; font-weight: 700; cursor: pointer;
  text-decoration: none; min-height: 44px; text-align: center;
}
a.add-tile:hover { color: var(--accent); }
.add-tile[aria-disabled="true"] { cursor: not-allowed; }
.add-tile svg { color: var(--accent); }
.soon { font-size: 13px; font-weight: 800; color: var(--muted); }
.add-primary .soon { color: var(--lime); }
.add-tile[aria-disabled="true"] { color: var(--muted); }

/* ---------- Auth screens (dark) ---------- */

.auth { background: var(--green-900); color: #FFFFFF; }
.auth .shell { background: var(--green-900); padding: calc(40px + env(safe-area-inset-top)) 24px calc(32px + env(safe-area-inset-bottom)); gap: 28px; }
.auth a { color: var(--lime); }
.auth a:hover { color: #E2F8B0; }
.auth .field__help { color: var(--green-300); }
.auth .input { background: var(--green-700); border-color: var(--green-500); color: #FFFFFF; }
.auth .choice span { background: var(--green-700); border-color: var(--green-500); color: #FFFFFF; }
.auth .choice input:checked + span { background: var(--lime); border-color: var(--lime); color: var(--green-900); }
.auth .choice input:focus-visible + span { outline-color: var(--lime); }
.auth :focus-visible { outline-color: var(--lime); }
.auth__brand { display: flex; flex-direction: column; gap: 18px; }
.auth__logo { width: 64px; height: 64px; border-radius: 20px; background: var(--lime); color: var(--green-900); display: flex; align-items: center; justify-content: center; }
.auth__title { font-size: 30px; font-weight: 800; line-height: 1.2; }
.auth__subtitle { font-size: 15px; color: var(--green-300); }
.auth__lead { font-size: 14px; line-height: 1.5; color: var(--green-300); }
.auth__hint { font-size: 13px; line-height: 1.5; color: var(--green-300); text-align: center; }
.auth__invited { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--green-700); font-size: 14px; line-height: 1.4; }
.auth__invited svg { color: var(--lime); flex-shrink: 0; }
.auth .alert { background: var(--error-bg); }
.auth .btn--outline-dark { min-height: 50px; border-radius: 25px; font-size: 15px; }
.auth .page-footer a { color: var(--green-300); }

/* ---------- Static documents ---------- */

.doc h2 { font-size: 16px; font-weight: 800; }
.doc p, .doc li { font-size: 14px; line-height: 1.6; color: var(--ink-soft); }
.doc ul { list-style: disc; padding-left: 18px; }
.doc dt { font-weight: 800; font-size: 13px; color: var(--muted); }
.doc dd { margin: 0 0 8px; font-size: 14px; line-height: 1.6; }

.invite-url { display: flex; flex-direction: column; gap: 8px; }

/* ---------- Products (Phase 2) ---------- */

.search { display: flex; gap: 8px; align-items: center; }
.search__input { flex-grow: 1; min-width: 0; }
.search .btn { flex-shrink: 0; min-height: 48px; }

.ingredient-list { display: flex; flex-direction: column; gap: 8px; }
.ingredient-name { font-size: 16px; font-weight: 800; overflow-wrap: anywhere; display: block; margin-bottom: 4px; }

.product-card { text-decoration: none; color: var(--ink); gap: 6px; }
.product-card:hover { color: var(--ink); }
.product-card__head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.product-card__name { font-size: 16px; font-weight: 800; line-height: 1.35; overflow-wrap: anywhere; min-width: 0; }
.product-card svg { flex-shrink: 0; color: var(--muted); }
.product-card__thumb { width: 56px; height: 56px; flex-shrink: 0; object-fit: contain; background: #FFFFFF; border: 1px solid var(--line); border-radius: 10px; }
.product-card__thumb + .product-card__name { flex: 1; }
/* Store photos are product shots on white; a white frame keeps them readable in dark mode too. */
.product-photo { margin: 0 0 4px; display: flex; flex-direction: column; gap: 6px; }
.product-photo__img { display: block; width: 100%; height: auto; max-height: 320px; object-fit: contain; background: #FFFFFF; border: 1px solid var(--line); border-radius: 12px; }
.product-photo--manage { gap: 8px; }
.input--file { padding: 10px 12px; font-size: 15px; }
.btn svg { flex-shrink: 0; }
.product-title { overflow-wrap: anywhere; }
.price-summary { font-size: 15px; line-height: 1.5; color: var(--ink); overflow-wrap: anywhere; }

.badge--hidden { background: var(--locked-bg); color: var(--ink); white-space: normal; }
.badge--plain { background: var(--surface-soft); color: var(--ink-soft); border: 1px solid var(--line-strong); }

.plain-list { display: flex; flex-direction: column; gap: 2px; font-size: 15px; line-height: 1.5; }
.plain-list li { overflow-wrap: anywhere; }
.plain-list a, .inline-link { font-weight: 700; }
.plain-list a { display: inline-flex; align-items: center; min-height: 44px; }
.inline-form { display: inline-flex; }
.btn--small { min-height: 44px; padding: 0 14px; font-size: 14px; }

.price-card { gap: 6px; }
.price-card__row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.price-card__price { font-size: 18px; font-weight: 800; }
.price-card__package { font-size: 15px; font-weight: 700; color: var(--ink-soft); }
.price-card__unit { font-size: 15px; font-weight: 800; color: var(--accent); white-space: nowrap; }
/* Old reports: muted text and a dashed edge, not opacity (keeps 4.5:1 contrast). */
.price-card--old { background: var(--surface-soft); border: 1px dashed var(--dashed-line); }
.price-card--old .price-card__price, .price-card--old .price-card__unit { color: var(--muted); }

.admin-details { border-top: 1px solid var(--line); }
.admin-details > summary { font-size: 14px; font-weight: 700; color: var(--danger); }
.admin-details .form { padding-bottom: 8px; }

.input-row { display: flex; gap: 8px; }
.input-row .input { flex-grow: 1; min-width: 0; }
.select--unit { width: auto; flex-shrink: 0; min-width: 96px; }
.field-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 8px; }
.textarea { min-height: 120px; padding: 12px 14px; line-height: 1.5; resize: vertical; }
.field__label--small { font-size: 13px; }

.fieldset { border: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.fieldset legend { padding: 0; margin-bottom: 4px; }
.fieldset__group { font-size: 13px; font-weight: 800; color: var(--muted); margin-top: 6px; }
.pick-list { display: flex; flex-direction: column; gap: 8px; }
.pick { display: flex; flex-direction: column; gap: 6px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.pick__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pick__name { font-weight: 700; }
.pick__role { font-size: 13px; color: var(--accent); font-weight: 700; }
.pick__alias { font-size: 13px; color: var(--muted); }
/* Strength box only for ticked ingredients (product form clutter fix). */
.pick:has(input[type="checkbox"]:not(:checked)) .input--small { display: none; }
.field__help--warn { background: var(--warn-bg); color: var(--warn-ink); border-radius: 8px; padding: 8px 10px; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.steps__item { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.steps__num { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--line-strong); font-size: 13px; font-weight: 800; flex-shrink: 0; }
.steps__item--current { color: var(--ink); font-weight: 800; }
.steps__item--current .steps__num { background: var(--fill-strong); border-color: var(--fill-strong); color: var(--lime); }
.steps__item--done .steps__num { border-color: var(--accent); color: var(--accent); }
.steps__note { font-weight: 400; font-size: 13px; color: var(--muted); }
.pick__check, .check-row { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 15px; cursor: pointer; overflow-wrap: anywhere; }
.pick__check input, .check-row input { width: 22px; height: 22px; flex-shrink: 0; accent-color: var(--fill-strong); }
.input--small { min-height: 44px; font-size: 15px; }
.other-ingredient { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }

.alert--warn { background: var(--warn-bg); color: var(--warn-ink); border-color: var(--alarm); }

.choice-group--rating { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.choice-group--rating legend { grid-column: 1 / -1; }

.calc-card { gap: 8px; }
.calc-card__date { font-size: 14px; font-weight: 800; }
.calc-card__changes { font-size: 14px; line-height: 1.5; color: var(--ink); background: var(--info-bg); border-radius: 10px; padding: 8px 10px; overflow-wrap: anywhere; }
.figures { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.figures div { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; line-height: 1.45; }
.figures dt { color: var(--muted); flex-shrink: 0; }
.figures dd { margin: 0; text-align: right; overflow-wrap: anywhere; min-width: 0; }

.review-card { gap: 6px; }
.review-card__head { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.review-card__stars { font-size: 16px; color: var(--alarm-ink); letter-spacing: 1px; }
.review-card__body { font-size: 15px; line-height: 1.55; white-space: pre-line; overflow-wrap: anywhere; }

/* Ingredient chips on task cards: links for approved members, plain text otherwise. */
.chips { display: flex; flex-direction: column; gap: 4px; }
.chips__label { font-size: 13px; font-weight: 700; color: var(--muted); }
.chips__list { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 22px;
  background: var(--aces-bg); color: var(--aces-ink); font-size: 14px; font-weight: 700; text-decoration: none;
}
.chip:hover { color: var(--aces-ink); text-decoration: underline; }
.chip--static { min-height: 32px; }

.doc__sub { font-size: 14px; font-weight: 800; margin-top: 4px; }

/* Persona-review additions (tokens only) */
.badge--warn { background: var(--warn-bg); color: var(--warn-ink); border: 1px solid var(--alarm); white-space: normal; }
.role-label { font-size: 14px; font-weight: 700; color: var(--muted); }
.chip__role { font-weight: 500; }
.chip--use { background: var(--user-bg); color: var(--user-ink); }
.chip--use:hover { color: var(--user-ink); }
.notice-stack { display: flex; flex-direction: column; gap: 4px; }
.section-title--sub { margin-top: 6px; }
.price-summary-block { display: flex; flex-direction: column; gap: 2px; }
.price-summary-block + .price-summary-block { border-top: 1px solid var(--line); padding-top: 8px; }
.product-card__ingredients { font-size: 14px; color: var(--ink-soft); overflow-wrap: anywhere; }
.saved-rate { font-size: 13px; font-weight: 700; color: var(--accent); }
.calc-card__main { font-size: 16px; line-height: 1.45; }
.calc-card__main b { font-size: 20px; font-weight: 800; margin-left: 4px; }
.link-card--use { border: 1px solid var(--line-strong); }
.title-link { display: inline-flex; align-items: center; min-height: 44px; }
.source-list { display: flex; flex-direction: column; gap: 8px; }
.source-list li { display: flex; flex-direction: column; gap: 2px; }
.source-list__month { font-size: 13px; font-weight: 800; color: var(--muted); }
.source-list__quote { font-size: 15px; line-height: 1.5; color: var(--ink-soft); overflow-wrap: anywhere; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Cost calculator: label-wording units and the folded price choice. */
.calc-howto { padding: 0; }
.calc-prices > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; }
.calc-prices[open] > summary { margin-bottom: 4px; }

/* Weed identification and treatment guide (tokens only). */
a.add-primary { cursor: pointer; text-decoration: none; }
a.add-primary:hover { color: #FFFFFF; }
.weed-list__en { margin-left: 8px; font-size: 13px; font-weight: 500; }
.weed-list { gap: 4px; }
.plain-list a.weed-list__link { display: flex; gap: 12px; min-height: 56px; }
.weed-list__thumb { flex: none; width: 56px; height: 56px; border-radius: 10px; object-fit: cover; background: var(--surface-soft); }
.weed-gallery { display: flex; flex-direction: column; gap: 10px; }
.weed-gallery__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.weed-gallery__item { margin: 0; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.weed-gallery__item > a { display: block; border-radius: 12px; }
.weed-gallery__img { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 12px; background: var(--surface-soft); }
.weed-gallery__credit { font-size: 12px; line-height: 1.4; color: var(--muted); overflow-wrap: anywhere; }
.weed-gallery__credit a { color: inherit; }
.photo-viewer {
  width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: none;
  background: transparent; color: #FFFFFF; cursor: zoom-out;
}
.photo-viewer[open] { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; }
.photo-viewer::backdrop { background: rgba(0, 0, 0, .92); }
.photo-viewer__img { display: block; max-width: 100%; max-height: calc(100vh - 140px); max-height: calc(100dvh - 140px); object-fit: contain; }
.photo-viewer__hint { font-size: 14px; color: #E6E6E6; }
.photo-viewer__close {
  position: absolute; top: calc(12px + env(safe-area-inset-top)); right: 12px; width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center; border: none; border-radius: 50%;
  background: rgba(255, 255, 255, .16); color: #FFFFFF; cursor: pointer;
}
.photo-viewer__close:focus-visible { outline: 3px solid var(--lime); outline-offset: 2px; }
.weed-photo { margin: 0; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.weed-photo__img { display: block; max-width: 100%; max-height: 240px; height: auto; border-radius: 12px; }
.candidate { display: flex; flex-direction: column; gap: 10px; }
.candidate__figure { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.candidate__img { display: block; width: 100%; height: 200px; object-fit: cover; border-radius: 12px; background: var(--surface-soft); }
.candidate__credit { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.candidate__body { display: flex; flex-direction: column; gap: 6px; }
.chip--current { background: var(--fill-strong); color: var(--lime); }
.chip--current:hover { color: var(--lime); }
.guide-list { display: flex; flex-direction: column; }
.guide-list__item { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; }
.guide-list__item + .guide-list__item { border-top: 1px solid var(--line); }
.guide-list__name { font-size: 16px; font-weight: 800; overflow-wrap: anywhere; }
.guide-list__name .inline-link { display: inline-flex; align-items: center; min-height: 44px; }
.guide-legend { font-size: 14px; }
.credit { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; padding: 8px 4px 0; }
.credit__logo { display: inline-flex; min-height: 44px; align-items: center; }
.credit__logo img { display: block; width: 172px; height: auto; }
.credit__text { font-size: 13px; line-height: 1.5; color: var(--muted); overflow-wrap: anywhere; }

/* Weed questions (그룹에 물어보기). */
.question-card { display: flex; flex-direction: row; gap: 12px; align-items: center; text-align: left; color: var(--ink); text-decoration: none; min-height: 44px; }
.question-card:hover { color: var(--ink); }
.question-card:hover .question-card__title { text-decoration: underline; }
.question-card__thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 12px; flex-shrink: 0; background: var(--surface-soft); }
.question-card__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.question-card__title { font-size: 15px; font-weight: 800; overflow-wrap: anywhere; }
.question-card__picks { font-size: 13px; color: var(--user-ink); font-weight: 700; }
.question-photo { display: block; width: 100%; height: auto; max-height: 420px; object-fit: contain; border-radius: 12px; background: var(--surface-soft); }
.question-note { overflow-wrap: anywhere; }
.question-link { display: inline-flex; align-items: center; min-height: 44px; }
.answer { gap: 6px; }
.answer__pick { font-size: 15px; overflow-wrap: anywhere; }
.answer__pick .inline-link { display: inline-flex; align-items: center; min-height: 44px; }
.answer__body { white-space: pre-line; overflow-wrap: anywhere; }

/* Member-added tasks. */
.member-task { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.member-task__edit { display: inline-flex; align-items: center; min-height: 44px; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 0 4px; }
.section-head .section-title { margin: 0; }
.section-head__link { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; font-size: 14px; }
