@charset "UTF-8";

:root {
  --canvas: #f5f4ec;
  --paper: #fffefa;
  --ink: #183a35;
  --muted: #65756e;
  --teal: #0b6259;
  --teal-dark: #07483f;
  --teal-soft: #e2f0e8;
  --line: #dedfd4;
  --gold: #ecd38a;
  --danger: #ae4739;
  --warning: #795819;
  --shadow: 0 10px 28px rgb(24 58 53 / 6%);
  --radius: 24px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 300px; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
a { color: var(--teal); text-underline-offset: 3px; }
svg { display: block; flex-shrink: 0; width: 24px; height: 24px; }
img { max-width: 100%; }
:focus-visible { outline: 3px solid #a35c0f; outline-offset: 4px; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(1.8rem, 7vw, 2.5rem); line-height: 1.13; letter-spacing: -.04em; font-weight: 680; }
h2 { font-size: 1.15rem; line-height: 1.35; letter-spacing: -.025em; font-weight: 680; }
h3 { font-size: 1rem; line-height: 1.4; }
p { line-height: 1.6; }
small { font-size: .78rem; line-height: 1.5; }

.app-shell { max-width: 560px; min-height: 100svh; margin: 0 auto; padding: max(20px, env(safe-area-inset-top)) 20px calc(116px + env(safe-area-inset-bottom)); }
.app-shell:focus { outline: none; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 52px; margin-bottom: 27px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: .97rem; font-weight: 750; letter-spacing: -.025em; text-decoration: none; color: var(--ink); }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 15px; background: var(--teal); color: #fffefa; font-size: 25px; font-weight: 500; }
.brand svg { width: 27px; height: 27px; color: var(--teal); }
.avatar { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: #e9e7d9; border: 1px solid #d9d9cb; color: var(--ink); font-weight: 700; object-fit: cover; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.eyebrow { margin-bottom: 10px; font-size: .67rem; font-weight: 750; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); }
.positive { color: #126449; }
.negative { color: var(--danger); }
.hero { position: relative; padding: 26px 24px; margin-bottom: 20px; overflow: hidden; border-radius: 28px; color: var(--paper); background: var(--teal); }
.hero .eyebrow, .hero .muted { color: #d4e7dc; }
.hero p:last-child { margin-bottom: 0; }
.hero-value { margin: 8px 0 14px; font-size: clamp(2.25rem, 9.4vw, 3.1rem); line-height: 1.12; letter-spacing: -.055em; font-weight: 630; font-variant-numeric: tabular-nums; }
.hero .badge { color: #e4f2e8; border-color: #528f7e; background: #1e7165; }
.card { padding: 21px; margin-bottom: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow); }
.card > :last-child { margin-bottom: 0; }
.card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
.card-grid > .card { margin-bottom: 0; padding: 18px; min-width: 0; }
.metric { min-width: 0; }
.metric .eyebrow { letter-spacing: .07em; font-size: .63rem; }
.metric strong { display: block; font-size: clamp(1.12rem, 4.5vw, 1.5rem); letter-spacing: -.04em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.metric small { display: block; margin-top: 7px; color: var(--muted); }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 27px 0 13px; }
.section-heading h2 { margin: 0; }
.section-heading .button { min-height: 44px; padding: 8px 11px; font-size: .8rem; }
.list { list-style: none; padding: 0; margin: 0; }
.card.list { padding: 21px; }
.list-row { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 16px 0; border-bottom: 1px solid var(--line); }
button.list-row { width: 100%; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; color: inherit; font: inherit; text-align: left; }
.list-row:first-child { padding-top: 1px; }
.list-row:last-child { border: 0; padding-bottom: 1px; }
.row-main { flex: 1; min-width: 0; }
.row-main strong { display: block; font-size: .9rem; line-height: 1.4; overflow-wrap: anywhere; }
.row-main small, .row-main p { display: block; margin: 4px 0 0; color: var(--muted); font-size: .77rem; line-height: 1.45; overflow-wrap: anywhere; }
.row-value { margin-left: auto; text-align: right; font-size: .95rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-value small { display: block; margin-top: 4px; color: var(--muted); font-size: .7rem; font-weight: 450; }
.row-icon { display: grid; place-items: center; width: 40px; height: 40px; flex: 0 0 40px; border-radius: 13px; background: var(--teal-soft); color: var(--teal); }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; border: 1px solid #d3e3d8; border-radius: 100px; background: var(--teal-soft); color: var(--teal-dark); font-size: .68rem; line-height: 1.3; font-weight: 650; }
.notice, .warning, .demo-banner { padding: 14px 16px; margin: 14px 0; border-radius: 16px; font-size: .82rem; line-height: 1.55; }
.notice { background: var(--teal-soft); color: var(--teal-dark); border: 1px solid #c7dece; }
.warning { color: var(--warning); background: #fbf1d8; border: 1px solid #e8d5a5; }
.demo-banner { background: #efeddf; border: 1px solid #d9d8c8; color: #56634e; }
.notice p:last-child, .warning p:last-child, .demo-banner p:last-child { margin-bottom: 0; }
.empty-state { padding: 32px 16px; text-align: center; color: var(--muted); }
.empty-state h2, .empty-state h3 { color: var(--ink); }
.empty-state svg { width: 40px; height: 40px; margin: 0 auto 16px; color: var(--teal); }
.empty-state p { font-size: .87rem; max-width: 32ch; margin-left: auto; margin-right: auto; }

.button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 48px; padding: 13px 20px; border: 1px solid transparent; border-radius: 15px; text-decoration: none; font-size: .88rem; line-height: 1.3; font-weight: 650; text-align: center; background: var(--teal-soft); color: var(--teal); transition: background-color .15s, transform .15s; }
.button:active:not(:disabled) { transform: translateY(1px); }
.button.primary { background: var(--teal); color: white; }
.button.primary:hover:not(:disabled) { background: var(--teal-dark); }
.button.secondary { background: var(--paper); color: var(--ink); border-color: var(--line); }
.button.ghost { background: transparent; color: var(--teal); }
.button.danger { color: var(--danger); background: #fbebe7; border-color: #ebcbc4; }
.button svg { width: 20px; height: 20px; }
.button-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0 0; }
.button-row > .button { flex: 1; }
.button-row > .button.ghost { flex-grow: 0; }
.icon-button { display: grid; place-items: center; width: 44px; height: 44px; padding: 10px; border-radius: 50%; border: 1px solid var(--line); background: var(--paper); color: var(--ink); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px 12px; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > label, .field > span { font-size: .8rem; font-weight: 650; line-height: 1.4; }
.field small { color: var(--muted); font-size: .74rem; }
.field input, .field select, .field textarea { width: 100%; min-width: 0; min-height: 49px; padding: 12px; border: 1px solid #cad3c7; border-radius: 12px; background: white; color: var(--ink); font-size: 16px; line-height: 1.4; }
.field input::placeholder, .field textarea::placeholder { color: #808a80; }
.field textarea { min-height: 95px; resize: vertical; }
.field input[type="checkbox"] { width: 22px; height: 22px; min-height: 22px; accent-color: var(--teal); }
.field input[aria-invalid="true"], .field select[aria-invalid="true"] { border-color: var(--danger); }
.full-width { grid-column: 1 / -1; width: 100%; }
.bottom-nav { position: fixed; z-index: 20; right: 0; bottom: 0; left: 0; display: flex; justify-content: space-around; align-items: stretch; max-width: 560px; margin: 0 auto; padding: 9px 10px max(10px, env(safe-area-inset-bottom)); border-top: 1px solid #e2e3d8; background: rgb(255 254 250 / 97%); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.bottom-nav button, .bottom-nav a { display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; gap: 5px; min-height: 54px; padding: 6px 3px; border: 0; border-radius: 15px; background: none; color: #778178; font-size: .63rem; font-weight: 600; line-height: 1.3; text-decoration: none; }
.bottom-nav svg { width: 22px; height: 22px; }
.bottom-nav .active { color: var(--teal); background: #e9f0e8; }
.fab { position: fixed; z-index: 21; right: max(22px, calc((100vw - 520px) / 2)); bottom: calc(90px + env(safe-area-inset-bottom)); display: flex; align-items: center; justify-content: center; gap: 9px; min-height: 55px; min-width: 55px; padding: 15px 19px; border: 0; border-radius: 19px; background: var(--teal); color: white; font-weight: 680; font-size: .9rem; box-shadow: 0 7px 24px rgb(11 98 89 / 25%); }
.chart { position: relative; width: 100%; min-height: 140px; margin: 18px 0 8px; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding: 10px 0 0; color: var(--muted); font-size: .72rem; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend > span::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--teal); }
.legend > span:nth-child(2)::before { background: #c79438; }
.legend i { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); }
.chart-labels { display: flex; justify-content: space-between; color: var(--muted); font-size: .65rem; }
.tabs { display: flex; gap: 5px; padding: 5px; margin: 15px 0 22px; border: 1px solid var(--line); border-radius: 15px; background: #eeeee4; }
.tabs button { flex: 1; min-height: 44px; padding: 9px 10px; border: 0; border-radius: 11px; background: none; color: var(--muted); font-size: .79rem; font-weight: 650; }
.tabs .active, .tabs [aria-selected="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 2px 8px rgb(24 58 53 / 6%); }
.signin, .onboarding { padding: 32px 4px; }
.signin { display: flex; flex-direction: column; align-items: flex-start; min-height: calc(100svh - 160px); justify-content: center; }
.signin.app-shell { padding: max(32px, env(safe-area-inset-top)) 20px calc(32px + env(safe-area-inset-bottom)); min-height: 100svh; }
.signin .brand { margin-bottom: 32px; }
.signin .brand-mark { width: 66px; height: 66px; border-radius: 22px; font-size: 38px; margin-bottom: 42px; }
.signin h1 { max-width: 16ch; margin-bottom: 18px; }
.signin > p { max-width: 36ch; }
.signin .button { width: 100%; }
.signin .button-row { width: 100%; }
.signin .eyebrow { font-size: .67rem; }
.signin .notice, .signin .warning { width: 100%; }
.onboarding h1 { font-size: 2rem; }
.footer-note { margin: 25px 0 0; color: var(--muted); font-size: .73rem; line-height: 1.6; text-align: center; }
.skeleton { width: 100%; height: 48px; margin: 10px 0; border-radius: 14px; background: linear-gradient(90deg, #e4e8dd 25%, #eff1e9 50%, #e4e8dd 75%); background-size: 200% 100%; animation: shimmer 1.5s ease-in-out infinite; }
.toast { position: fixed; z-index: 80; bottom: calc(94px + env(safe-area-inset-bottom)); left: 50%; width: max-content; max-width: min(90vw, 500px); padding: 14px 18px; border: 1px solid #496159; border-radius: 15px; background: #183a35; box-shadow: 0 8px 22px rgb(24 58 53 / 20%); color: white; font-size: .82rem; line-height: 1.5; transform: translateX(-50%); }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 100; padding: 12px 15px; background: white; border: 2px solid var(--teal); border-radius: 10px; transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }
dialog { position: fixed; inset: auto 0 0; width: 100%; max-width: 560px; max-height: calc(100dvh - max(25px, env(safe-area-inset-top))); margin: 0 auto; padding: 27px 22px max(25px, env(safe-area-inset-bottom)); border: 1px solid var(--line); border-bottom: 0; border-radius: 27px 27px 0 0; background: var(--paper); color: var(--ink); box-shadow: 0 -10px 50px rgb(24 58 53 / 12%); overflow-y: auto; overscroll-behavior: contain; }
dialog::backdrop { background: rgb(12 31 27 / 40%); backdrop-filter: blur(3px); }
dialog h2 { font-size: 1.4rem; margin-bottom: 9px; }
dialog .section-heading { margin-top: 0; }
dialog .button-row { margin-top: 24px; }
dialog p, dialog dd, dialog li { overflow-wrap: anywhere; }
dialog dd { margin: 3px 0 12px; }
dialog::before { content: ""; display: block; width: 38px; height: 4px; margin: -13px auto 22px; border-radius: 3px; background: #cbd2c7; }
details { padding: 13px 0; }
summary { min-height: 44px; padding: 12px 0; font-weight: 650; cursor: pointer; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
pre { max-width: 100%; padding: 14px; border-radius: 12px; background: #eeeee4; font-size: .73rem; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; overflow: auto; }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (min-width: 600px) {
  body { background: #e8eadf; }
  .app-shell { background: var(--canvas); box-shadow: 0 0 60px rgb(24 58 53 / 5%); padding-left: 26px; padding-right: 26px; }
  dialog { bottom: 25px; max-height: calc(100dvh - 50px); border-bottom: 1px solid var(--line); border-radius: 27px; }
}
@media (max-width: 350px) {
  .app-shell { padding-left: 15px; padding-right: 15px; }
  .card { padding: 16px; }
  .card-grid { gap: 9px; }
  .card-grid > .card { padding: 14px; }
  .form-grid { grid-template-columns: 1fr; }
  .row-value { font-size: .85rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
