:root {
  color-scheme: light;
  --ink: #213c32;
  --ink-soft: #50665c;
  --muted: #849087;
  --line: #e7e9e1;
  --paper: #fff;
  --canvas: #f5f6ef;
  --green: #286b4c;
  --green-dark: #20563d;
  --green-pale: #eaf2e9;
  --lime: #d3e0a8;
  --gold: #c68b3c;
  --gold-pale: #fbf4e7;
  --blue: #7597a6;
  --red: #ad5a50;
  --shadow: 0 18px 50px rgba(38, 57, 46, .06);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { width: 100%; min-width: 320px; max-width: 100%; }
body { margin: 0; overflow-x: clip; color: var(--ink); background: var(--canvas); }
button, input, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.app-frame { width: 100%; max-width: 1484px; min-width: 0; margin: 0 auto; padding-inline: 32px; }
.topbar { height: 86px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(68, 91, 73, .1); }
.brand { display: inline-flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; }
.brand-mark { width: 43px; height: 43px; display: grid; place-items: center; color: var(--green); }
.brand-mark svg { width: 43px; height: 43px; }
.brand-copy { display: grid; gap: 2px; }
.brand-copy strong { font-family: Georgia, "Times New Roman", serif; font-size: 21px; letter-spacing: -.5px; }
.brand-copy small { font-size: 10px; color: var(--muted); letter-spacing: .035em; }
.account-bar { display: flex; align-items: center; gap: 17px; }
.storage-pill { display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px; border-radius: 99px; background: #ecf2e8; color: #526d57; font-size: 11px; font-weight: 650; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: #65a172; }
.account-name { font-size: 13px; color: var(--ink-soft); font-weight: 600; }
.settings-button { display: inline-flex; align-items: center; gap: 5px; }
main { padding-bottom: 36px; }
#appView { padding-bottom: 76px; }
.auth-layout { min-height: calc(100vh - 115px); display: grid; grid-template-columns: 1.15fr .85fr; align-items: center; gap: 9%; padding: 44px 7% 75px; }
.auth-story { max-width: 570px; }
.eyebrow { margin: 0 0 10px; color: var(--green); text-transform: uppercase; font-size: 10px; font-weight: 750; letter-spacing: .15em; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { color: var(--ink); }
h1 { margin-bottom: 15px; font-family: Georgia, "Times New Roman", serif; font-weight: 500; font-size: clamp(38px, 4vw, 56px); line-height: 1.1; letter-spacing: -1.4px; }
h1 em { color: var(--green); font-weight: 500; }
.intro { max-width: 520px; color: var(--ink-soft); font-size: 15px; line-height: 1.75; }
.auth-highlights { display: grid; gap: 19px; margin-top: 42px; }
.auth-highlights > div { display: flex; align-items: center; gap: 14px; }
.highlight-icon { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: #e9efe4; color: var(--green); font-size: 19px; }
.auth-highlights strong, .auth-highlights small { display: block; }
.auth-highlights strong { font-size: 13px; margin-bottom: 3px; }
.auth-highlights small { color: var(--muted); font-size: 12px; }
.auth-card { width: min(100%, 410px); justify-self: center; background: var(--paper); border: 1px solid rgba(69, 92, 75, .09); border-radius: 22px; box-shadow: var(--shadow); padding: 30px; }
.auth-card-head { display: flex; gap: 12px; align-items: center; margin-bottom: 25px; }
.mini-mark { display: grid; place-items: center; width: 43px; height: 43px; border-radius: 14px; color: var(--green); background: var(--green-pale); font-family: Georgia, serif; font-weight: bold; font-size: 14px; }
.auth-card .eyebrow { margin-bottom: 4px; font-size: 9px; }
.auth-card h2 { margin: 0; font: 500 25px Georgia, serif; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.auth-tab { border: 0; background: transparent; padding: 11px 3px; color: var(--muted); border-bottom: 2px solid transparent; font-size: 12px; font-weight: 650; }
.auth-tab.active { color: var(--green); border-bottom-color: var(--green); }
.auth-card label, .field label, .year-select-wrap label { display: block; margin: 0 0 7px; color: #52645a; font-size: 11px; font-weight: 700; }
.auth-card input, .field input, .field select, .year-select-wrap select, .search-box input { width: 100%; border: 1px solid #dfe4da; border-radius: 9px; background: #fff; color: var(--ink); outline: none; transition: border-color .15s, box-shadow .15s; }
.auth-card input, .field input, .field select { height: 43px; padding: 0 12px; font-size: 13px; }
.auth-card input:focus, .field input:focus, .field select:focus, .year-select-wrap select:focus, .search-box input:focus { border-color: #79a187; box-shadow: 0 0 0 3px rgba(72, 125, 88, .1); }
.auth-card form > label:not(:first-child) { margin-top: 17px; }
.field-hint { margin: 6px 0 0; color: #98a096; font-size: 10px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 41px; padding: 0 17px; border: 1px solid transparent; border-radius: 9px; font-size: 12px; font-weight: 700; transition: background .15s, transform .15s, border-color .15s; }
.button:active { transform: translateY(1px); }
.button-primary { color: #fff; background: var(--green); }
.button-primary:hover { background: var(--green-dark); }
.button-wide { width: 100%; margin-top: 23px; height: 46px; }
.button-outline { border-color: #dce2d8; background: transparent; color: var(--ink-soft); }
.button-outline:hover, .button-quiet:hover { background: #eef2eb; }
.button-quiet { background: transparent; color: var(--ink-soft); }
.button-small { min-height: 33px; padding: 0 11px; font-size: 11px; }
.auth-footnote { margin: 20px 0 0; color: #8a968d; font-size: 10px; line-height: 1.6; text-align: center; }
.auth-extra-field { margin-top: 15px; }
.terms-agreement { margin-top: 15px; }
.terms-check { display: flex; align-items: start; gap: 9px; color: #68786d; font-size: 10px; font-weight: 500; line-height: 1.55; }
.terms-check input { flex: 0 0 16px; width: 16px; height: 16px; margin: 1px 0 0; accent-color: var(--green); }
.terms-check-copy > label { margin: 0; color: inherit; font-size: inherit; font-weight: inherit; line-height: inherit; }
.terms-links { margin-top: 4px; color: var(--green); font-size: 10px; }
.inline-link { display: inline; padding: 0; border: 0; background: none; color: var(--green); text-decoration: underline; font-size: inherit; cursor: pointer; }
.forgot-password { display: block; margin: 13px auto 0; color: var(--green); }
.auth-action-panel { margin-top: 18px; padding-top: 17px; border-top: 1px solid var(--line); }
.auth-action-panel h3 { margin-bottom: 7px; font: 500 18px Georgia, serif; }
.auth-action-panel > p { color: var(--muted); font-size: 11px; line-height: 1.55; }
.auth-action-panel form > label { display: block; margin: 12px 0 6px; color: #52645a; font-size: 11px; font-weight: 700; }
.auth-action-panel input { width: 100%; height: 42px; padding: 0 11px; border: 1px solid #dfe4da; border-radius: 9px; color: var(--ink); font-size: 12px; }
.form-message { padding: 9px 10px; border-radius: 7px; background: #edf4ed; color: var(--green); }
.verification-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 17px; padding: 12px 15px; border: 1px solid #eadfca; border-radius: 10px; background: #fbf6eb; color: #76613c; font-size: 11px; line-height: 1.5; }
.verification-banner .button { flex: 0 0 auto; }
.settings-email { margin: 16px 0; padding: 15px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.settings-email h3 { margin: 0 0 6px; font: 500 16px Georgia, serif; }
.settings-help { color: var(--muted); font-size: 10px; line-height: 1.5; }
.settings-email label { display: block; margin: 10px 0 6px; color: #52645a; font-size: 10px; font-weight: 700; }
.settings-email input { width: 100%; height: 39px; padding: 0 10px; border: 1px solid #dfe4da; border-radius: 8px; color: var(--ink); font-size: 12px; }
.settings-email form .button { margin-top: 9px; }
.settings-sharing { padding: 13px 0 17px; border-top: 1px solid var(--line); }
.settings-sharing h3 { margin: 0 0 6px; font: 500 16px Georgia, serif; }
.settings-sharing form > label:first-child { display: block; margin: 11px 0 6px; color: #52645a; font-size: 10px; font-weight: 700; }
.settings-sharing form > input { width: 100%; height: 39px; padding: 0 10px; border: 1px solid #dfe4da; border-radius: 8px; color: var(--ink); font-size: 12px; }
.share-consent { display: flex; align-items: start; gap: 8px; margin: 10px 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.share-consent input { flex: 0 0 15px; width: 15px; height: 15px; margin: 1px 0 0; accent-color: var(--green); }
.share-list { display: grid; gap: 8px; margin-top: 12px; }
.share-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: #fbfcf9; }
.share-row-copy { display: grid; min-width: 0; gap: 4px; }
.share-row-copy strong { overflow-wrap: anywhere; color: var(--ink); font-size: 11px; }
.share-row-copy small { color: var(--muted); font-size: 9px; line-height: 1.4; }
.share-row-actions { display: flex; flex-wrap: wrap; justify-content: end; gap: 5px; }
.share-row-actions .button { min-height: 31px; padding-inline: 9px; font-size: 9px; }
.notification-badge { display: inline-grid; place-items: center; min-width: 16px; height: 16px; margin-left: 2px; padding: 0 4px; border-radius: 99px; background: var(--red); color: #fff; font-size: 9px; font-weight: 800; }
.legal-card { max-height: min(88vh, 820px); overflow-y: auto; }
.legal-body { color: var(--ink-soft); font-size: 11px; line-height: 1.7; }
.legal-body h3 { margin: 0 0 8px; font: 500 20px Georgia, serif; }
.legal-body h4 { margin: 17px 0 5px; color: var(--ink); font-size: 11px; }
.legal-body p { margin-bottom: 8px; }
.legal-body a { color: var(--green); }
.legal-draft-note { margin: 16px 0; padding: 10px; border-radius: 8px; background: #fbf4e7; color: #886a39; font-size: 10px; }
.form-error { margin: 12px 0 0; color: var(--red); font-size: 12px; line-height: 1.5; }
.form-error.success-message { color: var(--green); }
.welcome-row { display: flex; align-items: end; justify-content: space-between; padding: 43px 0 27px; }
.welcome-row h1 { font-size: clamp(34px, 3.2vw, 45px); margin-bottom: 8px; }
.welcome-row .intro { margin: 0; font-size: 13px; }
.year-select-wrap { min-width: 142px; }
.year-select-wrap select { height: 39px; padding: 0 30px 0 12px; font-size: 12px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.metric-card { min-height: 145px; padding: 19px 20px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); box-shadow: 0 5px 16px rgba(35, 61, 45, .025); }
.metric-primary { background: var(--green); border-color: var(--green); color: white; }
.metric-primary .metric-top, .metric-primary .metric-sub { color: rgba(255,255,255,.78); }
.metric-primary .metric-value { color: white; }
.metric-top { display: flex; align-items: center; justify-content: space-between; color: #77847a; font-size: 11px; font-weight: 650; }
.metric-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: rgba(255,255,255,.16); color: #e0edcf; font-size: 16px; }
.metric-icon-cream { color: #bd8d51; background: #faf0df; }
.metric-icon-blue { color: #6e94a1; background: #edf4f5; }
.metric-icon-green { color: #62845f; background: #edf3e7; }
.metric-value { display: flex; align-items: baseline; gap: 7px; margin: 12px 0 4px; color: var(--ink); font: 500 35px Georgia, serif; letter-spacing: -.7px; }
.metric-value small { color: inherit; opacity: .72; font: 500 12px system-ui, sans-serif; letter-spacing: 0; }
.metric-sub { color: #98a098; font-size: 10px; }
.trend-value { font-size: 25px; }
.charts-heading { display: flex; align-items: end; justify-content: space-between; margin: 43px 0 17px; }
.charts-controls { display: flex; align-items: end; justify-content: end; gap: 18px; min-width: 0; }
.shared-select-control { display: grid; gap: 5px; min-width: 150px; color: var(--ink-soft); font-size: 10px; font-weight: 650; }
.shared-select-control select { width: 100%; max-width: 230px; min-width: 0; height: 34px; padding: 0 28px 0 10px; border: 1px solid #dfe4da; border-radius: 8px; background: white; color: var(--ink); font-size: 11px; }
.shared-select-control select:disabled { color: #9aa39b; background: #f6f7f3; }
.charts-heading h2, .section-heading h2 { margin: 0; font: 500 25px Georgia, serif; letter-spacing: -.3px; }
.charts-heading .eyebrow, .section-heading .eyebrow { margin-bottom: 7px; }
.check-control { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; color: var(--ink-soft); font-size: 11px; font-weight: 600; }
.check-control input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.check-box { display: grid; place-items: center; width: 17px; height: 17px; border: 1px solid #cbd4c8; border-radius: 5px; background: white; }
.check-control input:checked + .check-box { background: var(--green); border-color: var(--green); }
.check-control input:checked + .check-box::after { content: "✓"; color: white; font-size: 11px; font-weight: 700; }
.check-control input:focus-visible + .check-box { outline: 3px solid rgba(72, 125, 88, .2); }
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.chart-card { min-width: 0; padding: 20px 20px 13px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.chart-title-row { display: flex; justify-content: space-between; align-items: start; }
.chart-title-row h3 { margin: 0 0 5px; font: 500 17px Georgia, serif; }
.chart-title-row p { margin: 0; color: var(--muted); font-size: 10px; }
.unit-tag { padding: 6px 8px; border-radius: 6px; background: #edf4ed; color: var(--green); font-size: 9px; font-weight: 750; }
.unit-tag-sand { background: var(--gold-pale); color: #a6793d; }
.chart-legend { height: 22px; display: flex; gap: 14px; align-items: center; color: #79857c; font-size: 9px; }
.chart-options { min-height: 22px; margin-top: 6px; }
.chart-options-empty { visibility: hidden; }
.threshold-control { gap: 6px; font-size: 9px; }
.legend-item { display: inline-flex; gap: 6px; align-items: center; }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.legend-dot.previous { background: #b8c8a8; }
.legend-dot.liters { background: var(--gold); }
.legend-dot.liters.previous { background: #e6c78f; }
.legend-dot.shared { background: #6d76a8; }
.legend-dot.liters.shared { background: #a05c78; }
.chart { display: block; width: 100%; height: auto; overflow: visible; }
.chart-grid-line { stroke: #edf0e9; stroke-width: 1; }
.chart-axis-label { fill: #98a197; font: 9px system-ui, sans-serif; }
.chart-line { fill: none; stroke: var(--green); stroke-width: 2.6; stroke-linejoin: round; stroke-linecap: round; }
.chart-line.previous { stroke: #b8c8a8; stroke-dasharray: 5 5; stroke-width: 2; }
.chart-line.liters { stroke: var(--gold); }
.chart-line.liters.previous { stroke: #e6c78f; }
.chart-line.shared { stroke: #6d76a8; }
.chart-line.shared.previous { stroke-dasharray: 5 5; stroke-width: 2; }
.chart-line.liters.shared { stroke: #a05c78; }
.chart-line.liters.shared.previous { stroke: #d2a2b5; }
.chart-threshold-line { stroke: #c65b50; stroke-width: 2; stroke-dasharray: 7 5; }
.chart-point { fill: var(--green); stroke: white; stroke-width: 2; }
.chart-point.previous { fill: #b8c8a8; }
.chart-point.liters { fill: var(--gold); }
.chart-point.liters.previous { fill: #e6c78f; }
.chart-point.shared { fill: #6d76a8; }
.chart-point.shared.previous { fill: #6d76a8; }
.chart-point.liters.shared { fill: #a05c78; }
.chart-point.liters.shared.previous { fill: #a05c78; }
.chart-empty-text { fill: #a1aaa0; font: 12px system-ui, sans-serif; }
.cohort-card { display: flex; align-items: center; justify-content: space-between; gap: 25px; margin-top: 17px; padding: 21px 23px; border: 1px solid #e3e9dc; border-radius: 14px; background: #f0f4eb; }
.cohort-copy { display: flex; align-items: center; gap: 14px; min-width: 260px; }
.cohort-icon { flex: 0 0 39px; display: grid; place-items: center; width: 39px; height: 39px; border-radius: 12px; background: white; color: var(--green); font-size: 20px; }
.cohort-copy .eyebrow { margin-bottom: 5px; font-size: 9px; }
.cohort-copy h2 { margin: 0 0 5px; font: 500 17px Georgia, serif; }
.cohort-copy p:last-child { margin: 0; color: #7b887b; font-size: 10px; line-height: 1.5; }
.cohort-stats { display: flex; flex: 1; justify-content: center; gap: clamp(18px, 4vw, 56px); }
.cohort-stat strong { display: block; margin-bottom: 3px; color: var(--ink); font: 500 22px Georgia, serif; }
.cohort-stat span { color: #879286; font-size: 9px; }
.contribute-control { white-space: nowrap; font-size: 10px; }
.data-section { margin-top: 49px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 19px; }
.section-subtitle { margin: 6px 0 0; color: var(--muted); font-size: 11px; }
.table-actions { display: flex; gap: 9px; }
.editor-card { margin: 0 0 19px; padding: 21px; border: 1px solid #e0e8de; border-radius: 14px; background: #fbfcf8; box-shadow: 0 5px 18px rgba(35, 61, 45, .035); }
.editor-heading { display: flex; justify-content: space-between; align-items: start; margin-bottom: 17px; }
.editor-heading .eyebrow { margin-bottom: 4px; font-size: 9px; }
.editor-heading h3 { margin: 0; font: 500 20px Georgia, serif; }
.icon-button { display: grid; place-items: center; width: 29px; height: 29px; border: 0; border-radius: 7px; color: #7c897e; background: transparent; font-size: 21px; }
.icon-button:hover { background: #eef2eb; }
.form-grid { display: grid; gap: 13px; }
.form-grid-two { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 760px; }
.form-grid-four { grid-template-columns: repeat(4, 1fr); }
.form-grid-three { grid-template-columns: 1fr 1fr .8fr; }
.field input, .field select { height: 39px; font-size: 12px; }
.field label { font-size: 10px; margin-bottom: 6px; }
.input-suffix { position: relative; }
.input-suffix input { padding-right: 46px; }
.input-suffix > span { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); color: #919c92; font-size: 10px; pointer-events: none; }
.calf-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 19px; }
.calf-block { padding: 13px; border: 1px solid #e9ece5; border-radius: 10px; background: white; }
.calf-heading { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }
.calf-heading > div { display: grid; gap: 2px; }
.calf-heading strong { font-size: 11px; }
.calf-heading small { color: var(--muted); font-size: 9px; }
.calf-number { display: grid; place-items: center; width: 23px; height: 23px; border-radius: 8px; background: #edf3e8; color: var(--green); font-size: 10px; font-weight: 750; }
.calf-number-alt { background: #f8efdf; color: #a87836; }
.advanced-fields { display: grid; gap: 20px; margin-top: 20px; padding: 17px; border: 1px solid #e5e9df; border-radius: 12px; background: #fff; }
.field-label { display: block; margin: 0 0 7px; color: #52645a; font-size: 10px; font-weight: 700; }
.field-label small { margin-left: 5px; color: #99a297; font-size: 9px; font-weight: 500; }
.choice-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.choice-button { min-height: 42px; flex: 1 1 110px; padding: 0 15px; border: 1px solid #dfe4da; border-radius: 9px; background: #fff; color: var(--ink-soft); font-size: 12px; font-weight: 650; transition: .15s; }
.choice-button:hover { border-color: #98b19b; background: #f7faf5; }
.choice-button.active { border-color: var(--green); background: var(--green-pale); color: var(--green-dark); box-shadow: inset 0 0 0 1px var(--green); }
.choice-button:focus-visible { outline: 3px solid rgba(72, 125, 88, .2); }
.calves-editor-heading, .calf-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.calves-editor-heading { margin-bottom: 10px; }
.calves-editor-heading > div { display: grid; gap: 3px; }
.calves-editor-heading strong, .calf-card-heading strong { color: var(--ink); font-size: 11px; }
.calves-editor-heading small { color: var(--muted); font-size: 9px; }
.calves-list { display: grid; gap: 9px; }
.calf-card { padding: 13px; border: 1px solid #e9ece5; border-radius: 10px; background: #fbfcf9; }
.calf-card-heading { margin-bottom: 10px; }
.calf-remove { margin: 0; color: #a18d88; }
.calf-input-grid { display: grid; grid-template-columns: 1fr 1.3fr .7fr; gap: 10px; }
.calf-input-grid .field input { height: 39px; }
.sex-choices { gap: 6px; }
.sex-choices .choice-button { min-height: 39px; flex-basis: 80px; padding-inline: 8px; font-size: 10px; }
.editor-actions { display: flex; justify-content: end; gap: 7px; margin-top: 17px; }
.table-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 9px; }
.search-box { display: flex; align-items: center; gap: 7px; width: min(320px, 100%); color: #88948a; }
.search-box > span { font-size: 20px; transform: rotate(-20deg); }
.search-box input { height: 37px; padding: 0 11px; font-size: 11px; }
.table-count { color: #88948a; font-size: 10px; }
.table-wrap { max-width: 100%; min-width: 0; overflow-x: auto; overscroll-behavior-x: contain; border: 1px solid var(--line); border-radius: 13px; background: white; }
table { width: 100%; border-collapse: collapse; min-width: 780px; }
thead { background: #f9faf6; }
th { padding: 12px 14px; text-align: left; color: #90998f; border-bottom: 1px solid var(--line); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; font-weight: 750; }
td { padding: 12px 14px; border-bottom: 1px solid #f0f1ec; color: #455a4e; font-size: 11px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fcfdf9; }
.date-cell { color: #7c897e; white-space: nowrap; }
.cow-cell { font-weight: 750; color: var(--ink); }
.brix-cell { font-weight: 750; color: var(--green); }
.liter-cell { white-space: nowrap; }
.tag { display: inline-block; padding: 5px 7px; border-radius: 6px; background: #f0f3ed; color: #708071; font-size: 9px; white-space: nowrap; }
.time-tag { background: #f7f0e5; color: #94713e; }
.row-actions { display: flex; justify-content: end; gap: 4px; }
.row-action { border: 0; border-radius: 6px; background: transparent; padding: 6px 7px; color: #839086; font-size: 10px; }
.row-action:hover { background: #edf2ea; color: var(--green); }
.row-action.delete:hover { background: #f8ece9; color: var(--red); }
.empty-state { padding: 52px 18px; text-align: center; }
.empty-icon { display: grid; place-items: center; width: 47px; height: 47px; margin: 0 auto 14px; border-radius: 16px; background: #edf3e9; color: var(--green); font-size: 24px; }
.empty-state h3 { margin: 0 0 6px; font: 500 20px Georgia, serif; }
.empty-state p { margin: 0 auto 17px; max-width: 330px; color: #89948a; font-size: 11px; line-height: 1.6; }
.no-matches { padding: 28px; color: var(--muted); text-align: center; font-size: 12px; }
.page-footer { display: flex; align-items: center; gap: 18px; margin-top: 23px; color: #929b91; font-size: 10px; }
.page-footer > span:first-child { color: var(--green); font-family: Georgia, serif; font-weight: 700; }
.text-button { margin-left: auto; padding: 4px 0; border: 0; background: transparent; color: #a18d88; font-size: 10px; }
.text-button:hover { color: var(--red); text-decoration: underline; }
.toast { position: fixed; z-index: 5; right: 24px; bottom: 92px; max-width: min(390px, calc(100vw - 40px)); padding: 13px 17px; border: 1px solid #dfe7db; border-radius: 10px; background: #fff; color: var(--ink); box-shadow: 0 10px 35px rgba(24, 48, 32, .15); font-size: 12px; opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { border-color: #efd8d3; color: #984f47; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.quick-add { position: fixed; z-index: 25; right: max(24px, env(safe-area-inset-right, 0px)); bottom: max(22px, env(safe-area-inset-bottom, 0px)); display: inline-flex; align-items: center; gap: 10px; min-height: 58px; padding: 8px 19px 8px 9px; border: 0; border-radius: 999px; background: var(--green); color: #fff; box-shadow: 0 9px 24px rgba(32, 86, 61, .28); font-size: 12px; font-weight: 750; transition: transform .15s, background .15s; transform: translateZ(0); }
.quick-add:hover { background: var(--green-dark); transform: translateY(-2px); }
.quick-add-plus { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.17); font-size: 28px; font-weight: 400; line-height: 1; }
.modal-backdrop { position: fixed; z-index: 30; inset: 0; display: grid; place-items: center; padding: 18px; background: rgba(25, 45, 34, .4); }
.modal-card { width: min(100%, 440px); max-height: min(90vh, 820px); overflow-y: auto; padding: 24px; border: 1px solid rgba(69, 92, 75, .09); border-radius: 17px; background: white; box-shadow: 0 22px 70px rgba(21, 41, 29, .22); }
.modal-card h2 { margin: 0; font: 500 23px Georgia, serif; }
.settings-option { display: flex; align-items: start; gap: 11px; padding: 16px 0; cursor: pointer; }
.settings-option input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.settings-option strong, .settings-option small { display: block; }
.settings-option strong { margin-bottom: 5px; color: var(--ink); font-size: 12px; }
.settings-option small { max-width: 310px; color: var(--muted); font-size: 10px; line-height: 1.55; }
.settings-option input:checked + .check-box { background: var(--green); border-color: var(--green); }
.settings-option input:checked + .check-box::after { content: "✓"; color: white; font-size: 11px; font-weight: 700; }
.settings-option input:focus-visible + .check-box { outline: 3px solid rgba(72, 125, 88, .2); }

@media (max-width: 920px) {
  .app-frame { width: 100%; padding-inline: 20px; }
  .auth-layout { grid-template-columns: .9fr 1.1fr; gap: 5%; padding-inline: 2%; }
  .auth-story h1 { font-size: 39px; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .cohort-card { flex-wrap: wrap; }
  .cohort-copy { flex: 1 1 100%; }
  .cohort-stats { justify-content: start; padding-left: 53px; }
  .contribute-control { margin-left: auto; }
}
@media (max-width: 650px) {
  .app-frame { width: 100%; padding-inline: 15px; }
  main, #appView, .chart-grid, .chart-card, .data-section { width: 100%; min-width: 0; }
  .topbar { height: 72px; }
  .brand-mark, .brand-mark svg { width: 37px; height: 37px; }
  .brand-copy strong { font-size: 18px; }
  .brand-copy small { font-size: 9px; }
  .storage-pill { display: none; }
  .account-bar { gap: 8px; }
  .settings-button span { display: none; }
  .account-name { max-width: 90px; overflow: hidden; text-overflow: ellipsis; font-size: 11px; }
  .auth-layout { min-height: auto; grid-template-columns: 1fr; gap: 28px; padding: 44px 0 35px; }
  .auth-story { max-width: 500px; }
  .auth-story h1 { max-width: 450px; font-size: 39px; }
  .auth-story .intro { font-size: 13px; }
  .auth-highlights { display: flex; gap: 20px; margin-top: 21px; }
  .auth-highlights > div { gap: 8px; }
  .highlight-icon { width: 31px; height: 31px; border-radius: 9px; font-size: 15px; }
  .auth-highlights strong { font-size: 10px; }
  .auth-highlights small { max-width: 110px; font-size: 9px; line-height: 1.4; }
  .auth-card { padding: 23px; }
  .welcome-row { align-items: start; gap: 14px; padding: 32px 0 20px; }
  .welcome-row h1 { font-size: 34px; }
  .welcome-row .intro { max-width: 360px; font-size: 11px; }
  .year-select-wrap { min-width: 102px; margin-top: 21px; }
  .year-select-wrap label { font-size: 9px; }
  .year-select-wrap select { height: 36px; }
  .metric-grid { gap: 9px; }
  .metric-card { min-height: 123px; padding: 13px; }
  .metric-top { font-size: 9px; }
  .metric-icon { width: 24px; height: 24px; }
  .metric-value { margin-top: 14px; font-size: 29px; }
  .metric-value small { font-size: 10px; }
  .trend-value { font-size: 22px; }
  .metric-sub { font-size: 9px; }
  .charts-heading { align-items: start; flex-direction: column; gap: 12px; margin-top: 34px; }
  .charts-controls { width: 100%; align-items: center; justify-content: space-between; gap: 10px; }
  .shared-select-control { flex: 1; min-width: 0; max-width: 170px; font-size: 9px; }
  .shared-select-control select { max-width: none; height: 36px; font-size: 10px; }
  .charts-heading h2, .section-heading h2 { font-size: 22px; }
  .compare-control { max-width: 130px; font-size: 9px; line-height: 1.4; }
  .chart-grid { grid-template-columns: 1fr; gap: 10px; }
  .chart-card { padding: 16px 13px 10px; }
  .cohort-card { padding: 17px 14px; gap: 15px; }
  .cohort-copy { min-width: 0; gap: 10px; }
  .cohort-icon { flex-basis: 33px; width: 33px; height: 33px; }
  .cohort-copy h2 { font-size: 16px; }
  .cohort-copy p:last-child { max-width: 280px; }
  .cohort-stats { gap: 23px; padding-left: 43px; }
  .cohort-stat strong { font-size: 19px; }
  .contribute-control { margin-left: 43px; white-space: normal; font-size: 9px; }
  .data-section { margin-top: 36px; }
  .table-toolbar { gap: 8px; }
  .search-box { flex: 1 1 200px; width: auto; min-width: 0; }
  .table-count { white-space: nowrap; }
  .section-heading { align-items: start; gap: 13px; }
  .table-actions { flex-direction: column-reverse; gap: 6px; }
  .table-actions .button { min-height: 35px; padding: 0 10px; font-size: 10px; white-space: nowrap; }
  .form-grid-two { grid-template-columns: 1fr; gap: 10px; }
  .calf-input-grid { grid-template-columns: 1fr 1fr; }
  .calf-input-grid > .field:last-child { grid-column: 1 / -1; }
  .choice-buttons { gap: 6px; }
  .choice-button { min-height: 44px; flex-basis: 88px; padding-inline: 9px; font-size: 11px; }
  .quick-add { position: fixed !important; inset: auto 15px max(12px, env(safe-area-inset-bottom, 0px)) 15px; width: auto; height: 56px; min-height: 56px; padding: 0 16px; justify-content: center; transform: translateZ(0); }
  .quick-add-plus { width: 38px; height: 38px; background: rgba(255,255,255,.17); font-size: 30px; }
  .quick-add-label { position: static; width: auto; height: auto; padding: 0; margin: 0; overflow: visible; clip: auto; white-space: nowrap; border: 0; }
  .modal-card { padding: 19px; }
  .modal-backdrop { overflow-y: auto; }
  .field input, .field select { padding-inline: 9px; font-size: 11px; }
  .editor-card { padding: 15px 12px; }
  .page-footer { flex-wrap: wrap; gap: 8px 13px; }
  .page-footer > span:nth-child(2) { flex-basis: calc(100% - 80px); }
  .verification-banner { align-items: start; flex-direction: column; }
  .share-row { grid-template-columns: 1fr; }
  .share-row-actions { justify-content: start; }
}
@media (max-width: 390px) {
  .auth-highlights { gap: 10px; }
  .auth-highlights small { max-width: 86px; }
  .welcome-row { flex-direction: column; }
  .year-select-wrap { min-width: 120px; margin-top: 0; }
  .section-heading { flex-direction: column; }
  .table-actions { flex-direction: row; }
  .form-grid-three { grid-template-columns: 1fr; }
  .calf-input-grid { grid-template-columns: 1fr; }
  .calf-input-grid > .field:last-child { grid-column: auto; }
}
