/* The same tokens are used in records, action sheets and the family dashboard. */
:root {
  color-scheme: light;
  --ink: #173832;
  --muted: #526961;
  --primary: #075f56;
  --deep: #104940;
  --mint: #e4f1e9;
  --paper: #fafaf6;
  --line: #d6e1d9;
  --amber: #794508;
  --coral: #9e352d;
  --radius: 20px;
  font-family: "Source Sans 3", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  background: #f2f5ef;
  color: var(--ink);
  font-size: 17px;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; line-height: 1.65; background: linear-gradient(150deg,#eef4ed,#faf9f3 68%,#eef3ec); }
button, input, textarea, select { font: inherit; }
button, input, select, textarea, a { -webkit-tap-highlight-color: transparent; }
button, a, input, select, textarea { touch-action: manipulation; }
img, video { max-width: 100%; height: auto; }
:focus-visible { outline: 3px solid #bd700d; outline-offset: 3px; }
::selection { background: #c9e8da; color: var(--deep); }
h1, h2, h3, h4, p { margin: 0; overflow-wrap: anywhere; }
h1, h2, h3, h4 { line-height: 1.32; text-wrap: balance; }
h1 { font-size: clamp(1.8rem,3.3vw,2.65rem); letter-spacing: -.035em; }
h2 { font-size: clamp(1.32rem,2.2vw,1.7rem); letter-spacing: -.025em; }
h3 { font-size: 1.12rem; }
p + p { margin-top: .65rem; }
a { color: #086356; text-underline-offset: 3px; overflow-wrap: anywhere; }
small, .muted { color: var(--muted); }
small, .eyebrow { font-size: .85rem; }
.eyebrow { font-weight: 700; letter-spacing: .06em; color: #437461; }
.shell { width: min(1120px,100%); margin-inline: auto; padding: clamp(12px,3vw,36px) clamp(14px,3vw,36px) calc(98px + env(safe-area-inset-bottom)); }
.wrap { width: min(1060px,100%); margin-inline: auto; }
.top { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding-block: 10px 20px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--deep); font-size: 1.18rem; font-weight: 750; text-decoration: none; line-height: 1.3; }
.brand img, .brand svg { width: 42px; height: 42px; flex-shrink: 0; }
.hero { position: relative; isolation: isolate; overflow: hidden; background: #124c42; color: #fff; border-radius: 24px; padding: clamp(22px,3.3vw,40px); margin-bottom: 18px; }
.hero::after { content:""; z-index:-1; pointer-events:none; position:absolute; inset:0 0 0 58%; opacity:.55; background: radial-gradient(circle,#90c7a9 1.3px,transparent 1.7px) 0 0 / 16px 16px; mask-image: linear-gradient(90deg,transparent,#000); }
.hero h1, .hero h2 { color:#fff; }
.hero p, .hero small, .hero .muted, .hero .eyebrow { color:#d8e9df; }
.hero :is(h1,h2) + p { margin-top:8px; }
.hero .tag { color:#e8fff0; background:#2a6658; border-color:#57907b; }
.hero button:not(.secondary):not(.danger) { background:#e9f6e9; color:#164a3f; }
.grid { display:grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap:16px; align-items:start; }
.stack, form { display:grid; gap:14px; }
.card, .sheet { min-width:0; background:#fff; padding:clamp(17px,2.4vw,27px); border:1px solid var(--line); border-radius:var(--radius); box-shadow:0 2px 6px #17383207; }
.card > * + *, .sheet > * + * { margin-top:12px; }
.card > :is(h2,h3) + p { margin-top:6px; }
.card + .card { margin-top:14px; }
.grid > .card, .stack > .card { margin:0; }
.row, .actions { display:flex; align-items:center; flex-wrap:wrap; gap:10px; }
.actions { margin-top:14px; }
.row > *, .actions > * { min-width:0; }
.big, .stat { font-variant-numeric:tabular-nums; font-size:clamp(1.4rem,3vw,2rem); font-weight:740; line-height:1.35; }
.tag { display:inline-flex; align-items:center; padding:3px 10px; border:1px solid #cbded2; border-radius:99px; background:var(--mint); color:#285f4d; font-size:.83rem; font-weight:650; }
.tag.warn, .warn:not(button) { background:#fff2d6; color:var(--amber); border-color:#e6c888; }
.notice, .empty { padding:12px 15px; background:#edf5ef; border-radius:12px; color:#305748; overflow-wrap:anywhere; }
.empty { background:#f5f6f1; color:var(--muted); }
.feed { list-style:none; padding:0; margin:0; }
.feed > * { padding:12px 0; overflow-wrap:anywhere; }
.feed > * + * { border-top:1px solid var(--line); }
button, .button { display:inline-flex; align-items:center; justify-content:center; gap:6px; min-height:46px; max-width:100%; padding:9px 17px; background:var(--primary); color:#fff; border:1px solid transparent; border-radius:12px; font-weight:650; line-height:1.4; cursor:pointer; text-decoration:none; }
button:hover, .button:hover { filter:brightness(.96); }
button:active { transform:translateY(1px); }
button:disabled { opacity:.55; cursor:not-allowed; }
button.secondary, .button.secondary { background:#fff; color:var(--primary); border-color:#abc9ba; }
button.warn { background:#fff1cf; color:var(--amber); border-color:#e7c888; }
.danger { background:#fff1ed; color:var(--coral); border:1px solid #e4b3a9; }
.tabs, .bottom { display:flex; align-items:stretch; gap:4px; background:var(--paper); border:1px solid var(--line); border-radius:16px; padding:5px; }
.tabs { margin:0 0 18px; flex-wrap:wrap; }
.tabs :is(a,button), .bottom :is(a,button) { flex:1 1 auto; display:inline-flex; align-items:center; justify-content:center; gap:6px; min-height:44px; padding:6px 9px; border:0; border-radius:10px; color:var(--muted); background:transparent; font-weight:650; text-decoration:none; line-height:1.3; }
.tabs .active, .bottom .active, .tabs [aria-current="page"], .bottom [aria-current="page"] { background:#dceddf; color:#085a4b; }
.bottom { position:fixed; z-index:4; bottom:calc(10px + env(safe-area-inset-bottom)); left:50%; transform:translateX(-50%); width:min(calc(100% - 24px),760px); box-shadow:0 4px 24px #163f311c; }
label { display:grid; gap:5px; color:var(--ink); font-weight:640; }
input:not([type=checkbox]):not([type=radio]), select, textarea { width:100%; min-width:0; min-height:46px; border:1px solid #afc2b7; border-radius:10px; padding:9px 12px; background:#fff; color:var(--ink); font-weight:400; line-height:1.5; }
input[type=radio], input[type=checkbox] { width:20px; height:20px; accent-color:var(--primary); }
label:has(>input[type=radio]), label:has(>input[type=checkbox]) { display:flex; align-items:center; gap:8px; }
textarea { resize:vertical; min-height:96px; }
input[type=file] { overflow:hidden; }
fieldset { min-width:0; margin:0; padding:12px; border:1px solid var(--line); border-radius:12px; }
pre { white-space:pre-wrap; overflow-wrap:anywhere; font:inherit; }
dialog { width:min(560px,calc(100% - 24px)); max-height:85dvh; padding:clamp(18px,4vw,30px); color:var(--ink); border:1px solid var(--line); border-radius:20px; box-shadow:0 16px 70px #0d302c3b; }
dialog::backdrop { background:#15392e63; }
dialog h2 { margin-bottom:16px; }
.hide, [hidden] { display:none !important; }
@media(max-width:740px) {
  .grid { grid-template-columns:minmax(0,1fr); gap:12px; }
  .card, .sheet { border-radius:16px; }
  .top { padding-block:4px 14px; }
  .hero { border-radius:18px; }
  .bottom :is(a,button) { padding-inline:5px; font-size:.9rem; }
}
@media print {
  @page { size:A4; margin:16mm 18mm; }
  html, body { margin:0!important; padding:0!important; background:#fff!important; color:#000; }
  body * { visibility:hidden; }
  body :is(.top,.tabs,.bottom,.actions,button) { display:none!important; }
  body:has(#reportText) *:not(:has(#reportText)):not(#reportText):not(#reportText *) { display:none!important; }
  body *:has(#reportText) { display:block!important; position:static!important; width:auto!important; max-width:none!important; max-height:none!important; height:auto!important; padding:0!important; margin:0!important; border:0!important; box-shadow:none!important; overflow:visible!important; background:#fff!important; }
  dialog::backdrop { background:transparent; }
  #reportText, #reportText * { display:revert!important; visibility:visible!important; color:#000!important; }
  #reportText { display:block!important; white-space:pre-wrap; font-size:11pt; line-height:1.6; }
}

.profile-row { display:grid; grid-template-columns: minmax(100px,1fr) 2fr; gap:14px; border-bottom:1px solid var(--line); padding:9px 0; }
.profile-row strong { font-weight:500; overflow-wrap:anywhere; }
details { max-width:100%; } details pre { max-height:320px; overflow:auto; }
