/* Source Serif 4 (SIL Open Font License), self-hosted so no visitor data goes to Google. latin + latin-ext only. */
@font-face { font-family: 'Source Serif 4'; font-style: normal; font-weight: 500 600; font-display: swap; src: url(fonts/source-serif-4-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Source Serif 4'; font-style: normal; font-weight: 500 600; font-display: swap; src: url(fonts/source-serif-4-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --green: #006747;
  --green-dark: #014a34;
  --green-deep: #0b2e22;
  --green-soft: #e6efe7;
  --yellow: #fdd023;
  --yellow-soft: #fbf1c2;
  --paper: #f6f4ec;
  --card: #ffffff;
  --ink: #17261e;
  --muted: #566a5f;
  --line: #e2dfd2;
  --danger: #a8352a;
  --r: 8px;
  --serif: 'Source Serif 4', 'Source Serif Pro', Georgia, 'Times New Roman', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --stripe: repeating-linear-gradient(100deg, #0b5a3f 0 26px, #0e6a49 26px 52px);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--sans); color: var(--ink); background: var(--paper); line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; margin: 0; color: var(--green-deep); letter-spacing: -0.005em; line-height: 1.2; }
h1 { font-size: 30px; } h2 { font-size: 22px; } h3 { font-size: 17px; }
a { color: var(--green); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.muted { color: var(--muted); } .small { font-size: 14px; } .tiny { font-size: 12.5px; }
.row { display: flex; align-items: center; gap: 10px; } .row.wrap { flex-wrap: wrap; } .between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.grow { flex: 1; min-width: 0; }
.hidden { display: none !important; }
.eyebrow { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--green); font-weight: 700; margin-bottom: 6px; }

/* Icons */
.i { width: 1.2em; height: 1.2em; flex: none; vertical-align: -0.22em; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.i.fill { fill: currentColor; }

/* Shell */
.app { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; background: var(--green-deep); color: #fff; padding: 26px 0 20px; display: flex; flex-direction: column; gap: 4px; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 22px 26px; font-family: var(--serif); font-size: 24px; font-weight: 600; color: #fff; text-decoration: none; line-height: 1.1; }
.brand svg { flex: none; }
.brand small { display: block; font-family: var(--sans); font-size: 10.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--yellow); margin-top: 3px; }
.nav { display: flex; flex-direction: column; }
.nav a { display: flex; align-items: center; gap: 14px; padding: 12px 22px; color: #bcd4c7; text-decoration: none; font-weight: 500; font-size: 15px; border-left: 3px solid transparent; }
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav a.active { color: #fff; font-weight: 600; border-left-color: var(--yellow); background: rgba(255, 255, 255, .08); }
.nav a.active .i { color: var(--yellow); }
.nav .i { width: 21px; height: 21px; }
.side .me { margin: auto 14px 10px; display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: var(--r); border: 1px solid rgba(255, 255, 255, .14); text-decoration: none; color: #fff; }
.side .me .small { color: #b5cfc2; font-size: 13px; }
.side > .btn { margin: 0 14px; }
.main { padding: 32px 36px 64px; max-width: 1180px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.page-head p { margin: 6px 0 0; color: var(--muted); max-width: 52ch; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 316px; gap: 28px; align-items: start; }

/* Cards & controls */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush.feed { overflow: visible; }
.card-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 10px; }
.card-title a { font-size: 14px; font-weight: 600; }
.btn { border: 1px solid var(--green); background: var(--green); color: #fff; padding: 0 18px; min-height: 42px; border-radius: 6px; font-weight: 600; font-size: 15px; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; line-height: 1.2; }
.btn:hover { background: var(--green-dark); border-color: var(--green-dark); }
.btn.alt { background: var(--yellow); border-color: var(--yellow); color: var(--green-deep); }
.btn.alt:hover { background: #f0c10f; border-color: #f0c10f; }
.btn.ghost { background: transparent; color: var(--green); border-color: #b9cfc2; }
.btn.ghost:hover { background: var(--green-soft); border-color: var(--green); }
.btn.danger { background: transparent; color: var(--danger); border-color: #e3c2bd; }
.btn.sm { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn.on { background: var(--green-soft); color: var(--green-dark); border-color: var(--green); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 4px; font-size: 13px; font-weight: 600; background: var(--green-soft); color: var(--green-dark); white-space: nowrap; }
.chip.yellow { background: var(--yellow-soft); color: #5a4300; }
.chip.gray { background: #ecebe2; color: #4b5d53; }
.chip.red { background: #f6e1de; color: var(--danger); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search], select, textarea { width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid #c9d1c6; border-radius: 6px; background: #fff; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--yellow); outline-offset: 0; border-color: var(--green); }
textarea { resize: vertical; min-height: 80px; }
label { display: block; font-size: 14px; font-weight: 600; color: var(--green-deep); margin-bottom: 5px; }
.field { margin-bottom: 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.empty { text-align: center; padding: 30px; color: var(--muted); }

/* Avatar */
.av { border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 600; flex: none; object-fit: cover; font-family: var(--serif); }

/* Stories */
.stories { display: flex; gap: 16px; overflow-x: auto; padding: 4px 2px 10px; }
.story { display: flex; flex-direction: column; align-items: center; gap: 6px; background: none; border: 0; padding: 0; width: 68px; flex: none; font-size: 13px; color: var(--ink); }
.story .ring { padding: 2px; border-radius: 50%; border: 2px solid var(--green); display: inline-flex; }
.story .ring .av { border: 2px solid var(--paper); }
.story.add .ring { border-style: dashed; border-color: #9fb8a9; }
.story.add .plus { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; color: var(--green); }
.story-view { border-radius: var(--r); min-height: 360px; display: grid; place-items: center; text-align: center; padding: 28px; }
.story-view span { background: rgba(11, 46, 34, .88); color: #fff; padding: 12px 18px; font-family: var(--serif); font-size: 24px; font-weight: 600; border-radius: 4px; }

/* Posts */
.composer textarea { border: 0; padding: 4px 0; min-height: 66px; font-size: 16px; }
.composer textarea:focus { outline: none; }
.preview { position: relative; border-radius: var(--r); overflow: hidden; margin: 8px 0; max-width: 320px; }
.preview img, .preview video { width: 100%; display: block; }
.post { padding: 18px 20px; border-bottom: 1px solid var(--line); }
.post:last-child { border-bottom: 0; }
.post .body { margin: 10px 0 10px; font-size: 16px; white-space: pre-wrap; word-wrap: break-word; }
.media { border-radius: 6px; overflow: hidden; margin: 6px 0 10px; }
.media img, .media video { width: 100%; display: block; max-height: 460px; object-fit: cover; }
.media.art { aspect-ratio: 16/8; display: flex; align-items: flex-end; }
.media.art span { background: rgba(11, 46, 34, .88); color: #fff; padding: 6px 12px; font-size: 12.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.actions { display: flex; gap: 4px; margin-left: -10px; }
.actions button { background: none; border: 0; color: var(--muted); min-height: 36px; padding: 0 10px; border-radius: 6px; font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.actions button:hover { background: var(--green-soft); color: var(--green-dark); }
.actions button.liked { color: #b3382c; }
.comments { margin-top: 8px; padding-left: 14px; border-left: 2px solid var(--yellow); display: flex; flex-direction: column; gap: 8px; }
.comment { font-size: 14.5px; }

/* Profile */
.banner { height: 104px; background: var(--stripe); }
.profile-top { padding: 0 24px 22px; margin-top: -46px; position: relative; z-index: 1; }
.profile-top .av { border: 4px solid #fff; }
.profile-top .after { margin-top: 56px; }
.hcp-badge { text-align: center; background: var(--green-deep); color: #fff; border-radius: 6px; padding: 10px 20px; }
.hcp-badge b { display: block; font-family: var(--serif); font-weight: 600; font-size: 32px; color: var(--yellow); line-height: 1.1; }
.hcp-badge span { font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: #b9d3c5; }
.kv { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.bag { list-style: none; margin: 0; padding: 0; }
.bag li { padding: 9px 0; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: center; font-size: 15px; }
.bag li:last-child { border-bottom: 0; }
.dot { width: 6px; height: 6px; background: var(--yellow); border: 1px solid var(--green); border-radius: 50%; flex: none; }
.media-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.media-grid .tile { aspect-ratio: 1; border-radius: 4px; overflow: hidden; display: flex; align-items: flex-end; background-size: cover; background-position: center; }
.media-grid .tile span { background: rgba(11, 46, 34, .88); color: #fff; padding: 3px 7px; font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.score-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.score-row:last-child { border-bottom: 0; }
.score-num { font-family: var(--serif); font-size: 24px; font-weight: 600; color: var(--green-dark); width: 44px; text-align: center; }

/* People */
.person { display: flex; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.person:last-child { border-bottom: 0; }
.person a.name { color: var(--green-deep); font-weight: 600; text-decoration: none; }
.person a.name:hover, .post a.name:hover { text-decoration: underline; }
.post a.name { color: var(--green-deep); font-weight: 600; text-decoration: none; }
.filters { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 16px; align-items: end; }

/* Handicap */
.big-index { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; background: repeating-linear-gradient(100deg, #0b2e22 0 40px, #0d3427 40px 80px); color: #fff; border-radius: var(--r); padding: 26px 30px; }
.big-index .num { font-family: var(--serif); font-size: 68px; font-weight: 600; color: var(--yellow); line-height: 1; }
.big-index .lbl { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: #b9d3c5; }
.stat { text-align: center; padding: 0 12px; }
.stat b { display: block; font-family: var(--serif); font-weight: 600; font-size: 24px; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); padding: 8px 10px; border-bottom: 2px solid var(--line); }
td { padding: 10px; border-bottom: 1px solid var(--line); }
tr.counted td { background: var(--yellow-soft); }
tr.counted td:first-child { box-shadow: inset 3px 0 0 var(--yellow); }
.tbl-wrap { overflow-x: auto; }
details { border: 1px solid var(--line); border-radius: var(--r); padding: 14px 18px; background: #fff; }
details summary { cursor: pointer; font-weight: 600; font-family: var(--serif); font-size: 17px; color: var(--green-deep); }
details p, details li { font-size: 14.5px; color: #34453c; }
.formula { font-family: ui-monospace, Menlo, monospace; background: var(--green-soft); padding: 8px 12px; border-radius: 4px; font-size: 13px; display: block; margin: 8px 0; }

/* Calendar */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: #fff; }
.cal .dow { background: var(--green-deep); color: #fff; font-size: 12px; text-align: center; padding: 9px 0; letter-spacing: .12em; text-transform: uppercase; }
.cal .day { min-height: 96px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); padding: 6px; font-size: 12.5px; background: #fff; }
.cal .day:nth-child(7n+1) { border-left: 0; }
.cal .day.off { background: #f3f1e8; color: #8d9a92; }
.cal .day.today .dn { background: var(--yellow); color: var(--green-deep); }
.cal .dn { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-weight: 600; }
.cal .ev { display: block; width: 100%; text-align: left; margin-top: 3px; padding: 4px 6px; border-radius: 3px; background: var(--green); color: #fff; border: 0; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal .ev.past { background: #6c7f74; }
.event-card { display: flex; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.event-card:last-child { border-bottom: 0; }
.date-box { width: 54px; text-align: center; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); flex: none; background: #fff; }
.date-box b { display: block; background: var(--green); color: #fff; font-size: 11.5px; text-transform: uppercase; letter-spacing: .1em; padding: 2px 0; }
.date-box span { display: block; font-family: var(--serif); font-weight: 600; font-size: 24px; padding: 3px 0; }
.vote { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; margin-bottom: 8px; }
.vote .bar { height: 5px; background: var(--green-soft); border-radius: 3px; overflow: hidden; margin-top: 6px; }
.vote .bar i { display: block; height: 100%; background: var(--green); }
.vote.chosen { border-color: var(--green); background: var(--green-soft); }
.team { border: 1px solid var(--line); border-radius: 6px; padding: 14px; }
.team.a { border-top: 4px solid var(--green); } .team.b { border-top: 4px solid var(--yellow); }
.team .p { display: flex; justify-content: space-between; padding: 5px 0; font-size: 14.5px; }

/* Communities & market */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.comm-card { display: flex; flex-direction: column; gap: 12px; }
.mono { width: 48px; height: 48px; border-radius: 6px; display: grid; place-items: center; font-family: var(--serif); font-weight: 600; font-size: 24px; color: #fff; flex: none; text-shadow: 0 1px 3px rgba(0, 0, 0, .45); }
.listing .thumb { height: 132px; display: flex; align-items: flex-end; }
.listing .thumb span { background: rgba(11, 46, 34, .88); color: #fff; padding: 5px 11px; font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.listing .info { padding: 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.price { font-family: var(--serif); font-size: 24px; font-weight: 600; color: var(--green-dark); }
.fair { font-size: 13px; font-weight: 600; padding: 3px 8px; border-radius: 4px; align-self: flex-start; }
.fair.good { background: #dcefe1; color: #17602f; } .fair.high { background: #f7e8cf; color: #7d520d; } .fair.even { background: #ecebe2; color: var(--muted); }
.cres { display: flex; flex-direction: column; align-items: flex-start; width: 100%; text-align: left; padding: 10px 12px; margin-top: 6px; background: #fff; border: 1px solid var(--line); border-radius: 6px; gap: 1px; }
.cres:hover { border-color: var(--green); background: var(--green-soft); }

/* Modal & toast */
#modal { position: fixed; inset: 0; background: rgba(11, 46, 34, .6); display: none; align-items: flex-start; justify-content: center; padding: 5vh 14px; overflow-y: auto; z-index: 50; }
#modal.open { display: flex; }
.sheet { background: #fff; border-radius: var(--r); width: 100%; max-width: 520px; box-shadow: 0 24px 60px rgba(0, 0, 0, .35); overflow: hidden; }
.sheet.wide { max-width: 720px; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; background: var(--green-deep); color: #fff; }
.sheet-head h3 { color: #fff; }
.sheet-head button { background: none; border: 0; color: #fff; font-size: 28px; line-height: 1; min-width: 44px; min-height: 44px; margin-right: -10px; }
.sheet-body { padding: 22px; }
#toast { position: fixed; bottom: 86px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--green-deep); color: #fff; padding: 11px 18px; border-radius: 6px; font-size: 14.5px; opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; z-index: 60; border-left: 4px solid var(--yellow); }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (prefers-reduced-motion: reduce) { #toast { transition: none; } }

/* ---------- Motion components ----------
   CSS ports of Subframe Motion examples (sliding-tabs, slider-detents, optic-toggle, filter-builder, press-depth).
   One motion language: --ease-out for things that enter/respond, 120-200ms; exits ~1/3 faster. */
:root { --ease-out: cubic-bezier(.22, 1, .36, 1); }

/* Press + hover feedback (press-depth, simplified to a flat press) */
.btn, .icon-btn, .actions button, .story, .cres, .nav a, .seg button, .menu-pop > * {
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, transform 120ms var(--ease-out), box-shadow 140ms ease;
}
.btn:active:not([disabled]), .icon-btn:active, .actions button:active, .cres:active { transform: scale(.97); }
.story:active .ring { transform: scale(.95); }
.story .ring { transition: transform 120ms var(--ease-out); }
@media (hover: hover) { .btn:hover:not([disabled]):not(.on) { box-shadow: 0 1px 0 rgba(11, 46, 34, .16); } }

/* Switch (optic-toggle): thumb slides 200ms ease-out, grows slightly while pressed */
.switch-row { display: flex; align-items: center; gap: 12px; min-height: 44px; margin: 0; font-weight: 500; font-size: 15px; color: var(--ink); cursor: pointer; }
.switch-row.split { justify-content: space-between; }
.switch-row .muted { font-weight: 400; }
input.sw { appearance: none; -webkit-appearance: none; position: relative; flex: none; width: 46px; height: 28px; margin: 0; border-radius: 14px; background: #cdd5ca; border: 1px solid #b4bfb3; cursor: pointer; transition: background-color 180ms ease, border-color 180ms ease; }
input.sw::before { content: ''; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 11px; background: #fff; box-shadow: 0 1px 2px rgba(11, 46, 34, .35); transition: transform 200ms var(--ease-out), width 120ms var(--ease-out); }
input.sw::after { content: ''; position: absolute; top: 10px; left: 10px; width: 6px; height: 6px; border-radius: 50%; background: #9aa89d; transition: transform 200ms var(--ease-out), background-color 180ms ease; }
input.sw:checked { background: var(--green); border-color: var(--green-dark); }
input.sw:checked::before { transform: translateX(18px); }
input.sw:checked::after { transform: translateX(18px); background: var(--yellow); }
input.sw:active::before { width: 26px; }
input.sw:checked:active::before { transform: translateX(14px); }
input.sw:focus, input.sw:focus-visible { outline: none; border-color: inherit; }
input.sw:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
input.sw:checked:focus-visible { border-color: var(--green-dark); }

/* Range slider (slider-detents): native input restyled, ticks mark the stops it snaps to while dragging */
.range { position: relative; padding-bottom: 20px; }
input[type=range] { appearance: none; -webkit-appearance: none; display: block; width: 100%; height: 36px; margin: 0; padding: 0; background: transparent; cursor: grab; border: 0; min-height: 0; border-radius: 0; touch-action: pan-y; }
input[type=range]:active { cursor: grabbing; }
input[type=range]::-webkit-slider-runnable-track { height: 8px; border-radius: 4px; background: linear-gradient(to right, var(--green) calc(10px + (100% - 20px) * var(--p)), #dfe4d9 calc(10px + (100% - 20px) * var(--p))); }
input[type=range]::-moz-range-track { height: 8px; border-radius: 4px; background: #dfe4d9; }
input[type=range]::-moz-range-progress { height: 8px; border-radius: 4px; background: var(--green); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 24px; margin-top: -8px; border-radius: 7px; background: var(--green); border: 2px solid #fff; box-shadow: 0 1px 3px rgba(11, 46, 34, .45); transition: transform 120ms var(--ease-out); }
input[type=range]::-moz-range-thumb { width: 18px; height: 20px; border-radius: 7px; background: var(--green); border: 2px solid #fff; box-shadow: 0 1px 3px rgba(11, 46, 34, .45); transition: transform 120ms var(--ease-out); }
input[type=range]:active::-webkit-slider-thumb { transform: scale(1.1); }
input[type=range]:active::-moz-range-thumb { transform: scale(1.1); }
input[type=range]:focus { outline: none; }
input[type=range]:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; border-radius: 6px; }
.ticks { position: absolute; left: 0; right: 0; bottom: 0; height: 18px; pointer-events: none; font-size: 11.5px; color: var(--muted); }
.ticks span { position: absolute; left: calc(11px + (100% - 22px) * var(--p)); top: 0; transform: translateX(-50%); padding-top: 7px; font-variant-numeric: tabular-nums; transition: color 140ms ease; }
.ticks span::before { content: ''; position: absolute; top: 0; left: 50%; width: 2px; height: 5px; margin-left: -1px; background: #9fb3a6; transition: background-color 140ms ease; }
.ticks span:first-child { transform: none; margin-left: 0; left: 4px; }
.ticks span:first-child::before { left: 7px; margin-left: 0; }
.ticks span:last-child { transform: translateX(-100%); left: calc(100% - 4px); }
.ticks span:last-child::before { left: auto; right: 7px; margin: 0; }
.ticks span.hit { color: var(--green-deep); font-weight: 700; }
.ticks span.hit::before { background: var(--green); }

/* Segmented control (sliding-tabs): one pill that slides between options */
.seg { display: flex; width: fit-content; max-width: 100%; position: relative; margin-bottom: 12px; padding: 3px; gap: 2px; background: #ecebe2; border: 1px solid var(--line); border-radius: 9px; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.sheet .seg { margin-bottom: 0; }
.seg-pill { position: absolute; top: 3px; bottom: 3px; left: 0; width: 0; background: #fff; border: 1px solid var(--line); border-radius: 6px; box-shadow: inset 0 -2px 0 var(--yellow), 0 1px 2px rgba(11, 46, 34, .1); pointer-events: none; transition: transform 260ms var(--ease-out), width 260ms var(--ease-out); }
.seg button { position: relative; z-index: 1; flex: none; background: none; border: 0; min-height: 36px; padding: 0 14px; border-radius: 6px; font-size: 14.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.seg button[aria-checked="true"] { color: var(--green-deep); }
@media (hover: hover) { .seg button[aria-checked="false"]:hover { color: var(--green-deep); } }
.seg button:focus-visible { outline-offset: -2px; }

/* Action menu (filter-builder popover): grows from its trigger, 4-6px travel, scale from .97; exit is faster */
.menu { position: relative; flex: none; }
.menu.open { z-index: 30; }
.icon-btn { width: 40px; height: 40px; display: inline-grid; place-items: center; background: none; border: 0; border-radius: 6px; color: var(--muted); padding: 0; margin: -4px -6px -4px 0; }
.icon-btn:hover { background: var(--green-soft); color: var(--green-dark); }
.menu.open > .icon-btn { background: var(--green-soft); color: var(--green-dark); }
.menu-pop { position: absolute; right: 0; top: calc(100% + 4px); min-width: 196px; padding: 5px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 12px 28px rgba(11, 46, 34, .16); transform-origin: top right; opacity: 0; visibility: hidden; transform: translateY(-6px) scale(.97); transition: opacity 120ms ease, transform 120ms ease, visibility 0s linear 120ms; }
.menu.open > .menu-pop { opacity: 1; visibility: visible; transform: none; transition: opacity 150ms ease-out, transform 180ms var(--ease-out), visibility 0s; }
.menu-pop > * { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 0 10px; border: 0; border-radius: 5px; background: none; text-align: left; font-size: 14.5px; font-weight: 500; color: var(--ink); text-decoration: none; }
.menu-pop > *:hover, .menu-pop > *:focus-visible { background: var(--green-soft); color: var(--green-deep); }
.menu-pop > *:focus-visible { outline: 2px solid var(--green); outline-offset: -2px; }
.menu-pop > *:active { transform: scale(.98); }
.menu-pop > .danger { color: var(--danger); }
.menu-pop > .danger:hover, .menu-pop > .danger:focus-visible { background: #f6e1de; color: var(--danger); }
.menu-pop .i { color: var(--muted); }
.menu-pop > .danger .i { color: inherit; }

/* Modal entrance (200ms, only when opened, not when refreshed in place) */
@keyframes fade-in { from { opacity: 0; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }
#modal.open { animation: fade-in 160ms ease-out; }
.sheet.pop { animation: pop-in 220ms var(--ease-out); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; transition-delay: 0s !important; animation-duration: .01ms !important; animation-delay: 0s !important; }
  .btn:active:not([disabled]), .icon-btn:active, .actions button:active, .cres:active, .menu-pop > *:active, .story:active .ring { transform: none; }
}

.mobile-top { display: none; align-items: center; gap: 10px; margin-bottom: 14px; font-family: var(--serif); font-weight: 600; font-size: 22px; color: var(--green-deep); }

/* Responsive */
@media (max-width: 960px) {
  .cols { grid-template-columns: 1fr; }
  .filters { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .app { display: block; }
  .side { position: fixed; bottom: 0; top: auto; left: 0; right: 0; height: auto; flex-direction: row; padding: 0 0 env(safe-area-inset-bottom); z-index: 40; justify-content: space-around; gap: 0; border-top: 1px solid rgba(255, 255, 255, .12); }
  .brand, .side .me, .side > .btn { display: none; }
  .nav { flex-direction: row; width: 100%; justify-content: space-around; }
  .nav a { flex-direction: column; gap: 3px; padding: 9px 2px 8px; font-size: 11px; flex: 1; justify-content: center; border-left: 0; border-top: 3px solid transparent; min-height: 54px; }
  .nav a.active { border-top-color: var(--yellow); background: none; }
  .nav .i { width: 22px; height: 22px; }
  .main { padding: 18px 16px 110px; }
  h1 { font-size: 26px; }
  .cal .day { min-height: 64px; padding: 3px; }
  .cal .ev { font-size: 10.5px; padding: 3px; }
  .grid2 { grid-template-columns: 1fr; }
  .big-index { padding: 20px; }
  .big-index .num { font-size: 56px; }
  .mobile-top { display: flex; }
  .page-head { padding-bottom: 14px; }
  .card { padding: 16px; }
  .profile-top { padding: 0 16px 18px; }
}
@media (max-width: 560px) {
  .filters { grid-template-columns: 1fr; gap: 12px; }
  .filters > div:empty { display: none; }
}

/* Accounts: sign up, log in, onboarding */
body.auth-mode .app { display: none; }
#auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 32px 16px; background: var(--paper); }
#auth[hidden] { display: none; }
.auth-card { width: 100%; max-width: 420px; background: var(--card); border: 1px solid var(--line); border-top: 6px solid var(--green); border-radius: var(--r); padding: 28px 28px 24px; }
.auth-brand { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-weight: 600; font-size: 22px; color: var(--green-deep); margin-bottom: 20px; }
.auth-card h1 { font-size: 26px; margin-bottom: 6px; }
.auth-card > p.muted { margin: 0 0 18px; }
.auth-msg:empty { display: none; }
.auth-msg { margin: 0 0 14px; padding: 10px 12px; border-radius: 6px; font-size: 14px; line-height: 1.45; background: #f9e7e4; color: var(--danger); border: 1px solid #e3c2bd; }
.auth-msg.ok { background: var(--green-soft); color: var(--green-dark); border-color: #b9cfc2; }
.auth-submit { width: 100%; margin-top: 4px; }
.auth-foot { margin: 18px 0 0; text-align: center; color: var(--muted); line-height: 2; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--green); font: inherit; text-decoration: underline; cursor: pointer; }
.linkbtn:hover { color: var(--green-dark); }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; margin: 0 0 14px; }
.check input { margin-top: 4px; flex: none; }
.field .hint { display: block; font-size: 13px; color: var(--muted); margin-top: 4px; font-weight: 400; }
@media (max-width: 480px) { .auth-card { padding: 22px 18px 20px; } #auth { align-items: flex-start; padding-top: 20px; } }
