:root {
  color-scheme: light;
  --page: #fff1e8; --surface: #fffdf9; --soft: #f8ede6; --ink: #402a26;
  --muted: #796762; --teal: #286b6c; --teal-soft: #e4efeb;
  --berry: #773f50; --line: #eadcd3; --gold: #f4d49d;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--ink); background: var(--page);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; padding: 28px; display: grid; place-items: center; background: var(--page); }
main { width: min(100%, 640px); padding: 40px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); }
a { color: var(--teal); text-underline-offset: 4px; }
h1, h2, h3 { overflow-wrap: anywhere; }
h1 { margin: 22px 0; font-size: clamp(32px, 4.5vw, 50px); line-height: 1.13; letter-spacing: -.035em; font-weight: 750; }
h2 { margin: 28px 0 18px; font-size: 25px; letter-spacing: -.025em; }
h3 { margin: 22px 0 10px; font-size: 18px; letter-spacing: -.015em; }
p { max-width: 640px; font-size: 17px; line-height: 1.65; color: var(--muted); }
small { display: block; color: var(--muted); font-size: 13px; line-height: 1.55; }
.label, .eyebrow { display: inline-block; font-weight: 650; color: var(--teal); }
.eyebrow { font-size: 13px; letter-spacing: .06em; text-transform: uppercase; }
.ui-icon { width: 24px; height: 24px; display: block; flex-shrink: 0; }
nav { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; margin-top: 24px; }
form { display: grid; gap: 18px; margin-top: 22px; }
label { display: grid; gap: 8px; font-size: 14px; font-weight: 650; }
input, select, textarea { width: 100%; min-width: 0; min-height: 46px; padding: 12px 14px; border: 1px solid #d9c7bb; border-radius: 9px; font: inherit; font-weight: 400; color: var(--ink); background: #fff; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--teal); }
button, .button-link { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 46px; padding: 12px 18px; border: 1px solid transparent; border-radius: 10px; background: var(--teal); color: #fff; font: inherit; font-size: 14px; font-weight: 650; cursor: pointer; text-decoration: none; }
button:hover, .button-link:hover { background: #205b5c; }
button.secondary, .button-link.secondary { background: var(--surface); border-color: #dbcac0; color: var(--ink); }
button.secondary:hover, .button-link.secondary:hover { background: var(--soft); }
:focus-visible { outline: 3px solid #ad6e30; outline-offset: 3px; }
.notice { margin-top: 24px; padding: 14px 18px; border: 1px solid #efddc2; border-radius: 12px; background: #fff6e5; color: #775c39; line-height: 1.6; font-size: 14px; }
.feedback { margin: 0 0 22px; padding: 14px 18px; border-radius: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.feedback.error { background: #fbe7e1; color: #873c32; border: 1px solid #edc7bd; }
.feedback.success { background: var(--teal-soft); color: #255b53; border: 1px solid #c4dbd2; }
.auth-panel { max-width: 520px; box-shadow: 0 12px 40px #704b3510; }
.auth-panel h1 { font-size: clamp(28px, 4vw, 38px); }
.auth-panel p { overflow-wrap: anywhere; }
.form-note { margin: 0; font-size: 14px; line-height: 1.65; color: var(--muted); }
.local-note { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.checkbox { display: flex; align-items: flex-start; gap: 12px; font-weight: 400; line-height: 1.55; }
.checkbox input { width: 20px; height: 20px; min-height: 20px; flex-shrink: 0; margin-top: 2px; }
.details, details { margin-top: 16px; }
summary { cursor: pointer; color: var(--teal); font-size: 14px; font-weight: 650; padding: 12px 0; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip-path: inset(50%); white-space: nowrap; border: 0 !important; }
.ui-picture { display: block; width: 56px; height: 56px; flex-shrink: 0; }
.dashboard-body { display: block; place-items: normal; padding: 0; }
.dashboard-header { position: sticky; top: 0; z-index: 50; width: 100%; border-bottom: 1px solid var(--line); background: var(--surface); }
.dashboard-topline { max-width: 1280px; margin: 0 auto; min-height: 92px; padding: 12px 24px; display: flex; align-items: center; gap: 22px; }
.dashboard-brand { display: flex; align-items: center; gap: 12px; min-width: 140px; max-width: 220px; text-decoration: none; color: var(--ink); font-size: 20px; font-weight: 700; line-height: 1.25; }
.dashboard-brand > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.dashboard-brand small { margin-top: 5px; font-size: 15px; font-weight: 400; color: var(--ink); }
.brand-mark { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; background: #f6e8dc; flex-shrink: 0; }
.brand-mark .ui-icon { width: 29px; height: 29px; }
.initial-avatar { display: grid; place-items: center; width: 58px; height: 58px; background: #edd8cd; color: var(--berry); border: 3px solid var(--surface); border-radius: 50%; font-size: 26px; font-weight: 600; flex-shrink: 0; }
.dashboard-account { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-shrink: 0; }
.dashboard-account form { margin: 0; display: block; }
.dashboard-account button { min-height: 40px; padding: 8px; font-size: 12px; border: 0; background: transparent; color: var(--muted); }
.dashboard-menu { flex: 1; width: auto; margin: 0; padding: 0; gap: 4px; flex-wrap: nowrap; justify-content: center; align-items: stretch; align-self: stretch; }
.dashboard-menu a { display: flex; align-items: center; position: relative; padding: 0 12px; text-decoration: none; color: var(--ink); white-space: nowrap; font-size: 14px; font-weight: 500; }
.dashboard-menu a[aria-current] { color: var(--teal); font-weight: 700; }
.dashboard-menu a[aria-current]::after { content: ''; position: absolute; bottom: 10px; left: 10px; right: 10px; height: 3px; border-radius: 3px; background: var(--teal); }
.header-add { min-height: 48px; padding: 12px 18px; font-weight: 500; font-size: 15px; border-radius: 13px; }
.menu-toggle, .mobile-add { display: none; }
.dashboard-main { width: min(100%, 1280px); margin: 0 auto; padding: 24px 24px 40px; border: 0; border-radius: 0; background: transparent; }
.dashboard-main > h1 { margin: 0 0 24px; font-size: 27px; color: var(--berry); }
.dashboard-main h2 { margin: 0 0 22px; font-size: 24px; }
.dashboard-section { scroll-margin-top: 112px; padding: 24px; margin-bottom: 24px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.dashboard-section form { max-width: 620px; }
.dashboard-section p { max-width: 760px; }
.board-section, .family-overview { padding: 0; border: 0; border-radius: 0; background: transparent; }
.family-overview { display: flex; flex-direction: column; }
.family-overview > h2, .family-overview > .child-card, .family-overview > .dashboard-quick { display: none; }
.family-overview .overview-board { order: 1; }
.family-overview .family-strip { order: 2; }
.child-card { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.child-card h3 { margin: 0 0 4px; font-size: 21px; }
.family-strip { display: grid; grid-template-columns: 1fr 1.1fr 1.15fr; padding: 24px 0; margin: 22px 0 0; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.strip-block { display: flex; align-items: center; gap: 18px; padding: 0 24px; min-width: 0; }
.strip-block + .strip-block { border-left: 1px solid var(--line); }
.strip-block > div { min-width: 0; }
.strip-block strong { display: block; margin: 5px 0; font-size: 16px; line-height: 1.4; overflow-wrap: anywhere; }
.strip-block .strip-balance { font-size: 34px; line-height: 1.15; letter-spacing: -.04em; }
.strip-balance span { font-size: 22px; font-weight: 600; letter-spacing: -.03em; }
.strip-icon { display: grid; place-items: center; flex-shrink: 0; width: 66px; height: 66px; border-radius: 50%; color: var(--teal); background: #faf0e6; }
.strip-icon .ui-icon { width: 36px; height: 36px; }
.coin-icon { background: #fff1df; }
.grade-icon { background: #f9eee5; }
.grade-paper { display: grid; place-items: center; width: 38px; height: 48px; border: 2px solid #bca59b; border-radius: 4px; color: #ab3e3f; background: white; font-size: 27px; font-weight: 600; transform: rotate(9deg); }
.overview-board, .task-board { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; margin: 0; }
.board-column { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.board-column:not(.board-completed) { min-height: 350px; }
.board-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.board-heading h3 { margin: 0; font-size: 23px; line-height: 1.3; font-weight: 650; }
.board-heading a { margin-left: auto; font-size: 13px; white-space: nowrap; text-decoration: none; }
.count-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 29px; height: 27px; padding: 3px 8px; border-radius: 10px; background: #e2ece8; color: #356867; font-size: 14px; font-weight: 650; }
.board-empty { min-height: 260px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px; border-radius: 12px; background: #fffaf6; color: var(--muted); font-size: 14px; line-height: 1.6; text-align: center; }
.board-empty strong { color: var(--ink); font-weight: 600; }
.board-empty > span:last-child { max-width: 280px; }
.empty-art { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; background: #f9eadc; }
.preview-task { display: flex; gap: 14px; align-items: center; min-height: 108px; margin-top: 16px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); text-decoration: none; }
.preview-task > span:nth-child(2) { flex: 1; min-width: 0; }
.preview-task strong { display: block; margin-bottom: 6px; font-size: 17px; overflow-wrap: anywhere; }
.task-symbol { display: grid; place-items: center; flex-shrink: 0; width: 60px; height: 68px; border-radius: 15px; color: var(--teal); background: #fff0e5; }
.reward-label { color: var(--ink); font-weight: 700; white-space: nowrap; }
.task-card { display: grid; grid-template-columns: 60px minmax(0, 1fr) auto; column-gap: 14px; row-gap: 6px; align-items: center; min-height: 118px; margin-top: 16px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.task-card-heading, .task-meta { display: contents; }
.task-card-heading .task-symbol { grid-column: 1; grid-row: 1 / 3; }
.task-card h3 { grid-column: 2; grid-row: 1; align-self: end; margin: 0; font-size: 17px; line-height: 1.35; font-weight: 600; }
.task-card > small { grid-column: 2; grid-row: 2; align-self: start; font-size: 13px; }
.task-meta > span { display: none; }
.task-meta strong { grid-column: 3; grid-row: 1 / 3; color: var(--ink); font-size: 15px; font-weight: 700; white-space: nowrap; }
.reward-coin { display: inline-block; vertical-align: middle; margin: -2px 5px 0 0; }
.reward-coin .ui-icon { width: 23px; height: 23px; }
.task-submitted { grid-template-columns: 60px minmax(0, 1fr) auto 114px; }
.task-card form { margin-top: 0; gap: 12px; }
.task-submitted > form { grid-column: 4; grid-row: 1; }
.task-submitted > details { grid-column: 4; grid-row: 2; margin-top: 0; }
.task-submitted > details > summary { display: block; border: 1px solid #d7c7bd; border-radius: 9px; padding: 9px 6px; text-align: center; font-size: 11px; color: var(--ink); list-style: none; }
.task-submitted > details[open] { grid-column: 1 / -1; grid-row: auto; }
.task-submitted > details[open] form { margin-top: 16px; }
.task-card button { width: 100%; min-height: 40px; padding: 9px; font-size: 13px; font-weight: 500; }
.task-open > form { grid-column: 1 / -1; margin-top: 8px; }
.task-note { grid-column: 1 / -1; margin: 8px 0; padding: 12px; border-radius: 9px; background: #f5e8df; color: #79533f; }
.board-completed { grid-column: 1 / -1; }
.empty-completed { display: none; }
.board-filters { display: none; }
.task-create { padding: 4px 22px 20px; margin: 0 0 22px; border: 1px solid #c5d9d3; border-radius: 12px; background: #fffdf9; max-width: 620px; }
.dashboard-enhanced .task-create:not([open]) { display: none; }
.task-create form { margin-top: 12px; }
.dashboard-quick { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; margin-top: 24px; }
.coin-history { list-style: none; margin: 20px 0 0; padding: 0; }
.coin-history li { padding: 17px 0; border-bottom: 1px solid var(--line); font-size: 15px; overflow-wrap: anywhere; }
.coin-history strong { display: inline-block; min-width: 40px; margin-right: 12px; color: var(--teal); }
.coin-history small { margin-top: 6px; padding-left: 54px; }
.rules-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grade-award { float: right; color: var(--teal); font-size: 13px; }
#copy-child-link { margin: 12px 0; }
.welcome-body { display: block; place-items: normal; padding: 0; }
.welcome-header { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 24px 40px; background: var(--surface); border-bottom: 1px solid var(--line); }
.welcome-main { width: min(100%, 1240px); margin: 0 auto; padding: 76px 40px; display: grid; grid-template-columns: 1.1fr 1fr; align-items: center; gap: 64px; border: 0; border-radius: 0; background: transparent; }
.welcome-intro h1 { font-size: clamp(38px, 4vw, 58px); margin: 22px 0; }
.welcome-steps { padding: 30px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); }
.welcome-steps h2 { margin: 0 0 26px; font-size: 25px; }
.welcome-steps article { display: flex; align-items: flex-start; gap: 16px; margin-top: 24px; }
.welcome-steps h3 { margin: 0 0 8px; font-size: 17px; }
.welcome-steps p { margin: 0; font-size: 14px; }
@media (max-width: 1150px) and (min-width: 901px) {
  .dashboard-topline { gap: 10px; padding: 12px 20px; }
  .dashboard-brand { min-width: 120px; font-size: 17px; }
  .dashboard-menu { gap: 0; }
  .dashboard-menu a { padding: 0 9px; font-size: 13px; }
  .header-add { padding: 12px; font-size: 13px; }
  .strip-block { padding: 0 18px; gap: 12px; }
  .strip-icon { width: 52px; height: 52px; }
  .strip-block .strip-balance { font-size: 28px; }
  .task-submitted { grid-template-columns: 48px minmax(0, 1fr) auto; }
  .task-submitted > form { grid-column: 2; grid-row: 3; }
  .task-submitted > details { grid-column: 3; grid-row: 3; }
  .task-symbol { width: 48px; }
  .board-heading h3 { font-size: 21px; }
}
@media (max-width: 900px) {
  body { padding: 18px 12px; }
  main { padding: 26px 22px; }
  .dashboard-body, .welcome-body { padding: 0; }
  .dashboard-topline { min-height: 82px; padding: 12px 18px; gap: 10px; flex-wrap: wrap; }
  .dashboard-brand { max-width: none; min-width: 0; flex: 1; font-size: 18px; gap: 10px; }
  .dashboard-brand small { font-size: 14px; }
  .initial-avatar { width: 48px; height: 48px; font-size: 23px; }
  .brand-mark { width: 38px; height: 38px; }
  .dashboard-account { gap: 0; margin-left: 0; }
  .dashboard-account button { padding: 8px; font-size: 12px; }
  .header-add { display: none; }
  .menu-toggle { display: grid; place-items: center; width: 40px; min-height: 40px; padding: 8px; border-radius: 9px; background: transparent; color: var(--teal); }
  .menu-toggle:hover { background: #e4efeb; }
  .menu-toggle span { font-size: 25px; }
  .dashboard-menu { order: 4; flex: 0 0 100%; display: none; flex-direction: column; align-items: stretch; gap: 4px; padding-top: 8px; }
  .dashboard-header.menu-open .dashboard-menu { display: flex; }
  .dashboard-menu a { min-height: 44px; padding: 12px; border-radius: 9px; }
  .dashboard-menu a[aria-current] { background: var(--teal-soft); }
  .dashboard-menu a[aria-current]::after { display: none; }
  .dashboard-main { padding: 18px 16px 30px; }
  .dashboard-section { padding: 20px 16px; border-radius: 13px; }
  .board-section, .family-overview { padding: 0; }
  .family-strip { grid-template-columns: 1fr; padding: 0; margin-top: 20px; }
  .strip-block { padding: 16px; gap: 16px; }
  .strip-block + .strip-block { border-left: 0; border-top: 1px solid var(--line); }
  .strip-icon { width: 48px; height: 48px; }
  .strip-icon .ui-picture { width: 44px; height: 44px; }
  .strip-block .strip-balance { font-size: 28px; }
  .strip-balance span { font-size: 18px; }
  .grade-paper { width: 30px; height: 38px; font-size: 21px; }
  .overview-board, .task-board { grid-template-columns: 1fr; gap: 16px; }
  .board-column { padding: 18px; }
  .task-board .board-column { padding: 0; border: 0; background: transparent; }
  .task-board .board-heading { display: none; }
  .board-column:not(.board-completed) { min-height: 0; }
  .board-completed { grid-column: auto; }
  .empty-completed { display: block; }
  .board-heading { margin-bottom: 18px; }
  .board-heading h3 { font-size: 21px; }
  .board-filters { display: flex; gap: 0; margin: 0 0 18px; border-bottom: 1px solid var(--line); }
  .board-filter { flex: 1; min-width: 0; gap: 5px; min-height: 46px; padding: 9px 2px; border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: transparent; color: var(--muted); font-size: 13px; font-weight: 500; white-space: nowrap; }
  .board-filter:hover { background: var(--surface); }
  .board-filter[aria-pressed="true"] { color: var(--teal); border-bottom-color: var(--teal); background: transparent; font-weight: 700; }
  .board-filter .count-badge { min-width: 22px; height: 22px; padding: 2px 5px; font-size: 12px; }
  .task-card { padding: 14px; column-gap: 12px; min-height: 106px; grid-template-columns: 52px minmax(0, 1fr) auto; }
  .task-card h3 { font-size: 16px; }
  .task-symbol { width: 52px; height: 62px; }
  .ui-picture { width: 48px; height: 48px; }
  .task-meta strong { font-size: 13px; }
  .reward-coin { margin-right: 3px; }
  .reward-coin .ui-icon { width: 18px; height: 18px; }
  .task-submitted > form { grid-column: 2; grid-row: 3; margin-top: 6px; }
  .task-submitted > details { grid-column: 3; grid-row: 3; margin-top: 6px; }
  .preview-task { padding: 14px; min-height: 106px; gap: 12px; }
  .preview-task strong { font-size: 16px; }
  .board-heading a { font-size: 12px; }
  .mobile-add { display: flex; width: 100%; min-height: 50px; margin-top: 18px; font-size: 16px; font-weight: 500; }
  .rules-grid { gap: 12px; }
  .grade-award { float: none; display: block; margin-top: 8px; }
  .welcome-header { padding: 18px 16px; }
  .welcome-main { display: block; padding: 36px 20px; }
  .welcome-intro h1 { font-size: 39px; }
  .welcome-steps { padding: 24px; margin-top: 36px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
