@font-face { font-family: "Inter"; font-weight: 100 900; font-display: swap; src: url(fonts/inter-latin-wght-normal.woff2) format("woff2"); }
:root {
  color-scheme: light;
  --page: #F5F7F8;
  --surface: #FFFFFF;
  --ink: #16212B;
  --ink-2: #3A4650;
  --muted: #5A6772;
  --hair: #E1E6EA;
  --hair-2: #DCE2E6;
  --accent: #0E6B70;
  --accent-dark: #0A4F53;
  --accent-wash: #E4F1F1;
  --good: #2E7D4F;
  --warn: #A3501B;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r: 16px;
  --r-sm: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--page); color: var(--ink); font: 15px/1.45 var(--sans); -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }
a { color: var(--accent); }
a:hover { color: var(--accent-dark); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 46px; font: 600 15px var(--sans); color: #fff; background: var(--accent); border: 0; border-radius: var(--r-sm); padding: 0 16px; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--accent-dark); color: #fff; }
.btn-quiet { background: var(--surface); color: var(--accent); border: 1px solid var(--hair-2); }
.btn-quiet:hover { background: var(--accent-wash); color: var(--accent-dark); }
.link-btn { border: 0; background: none; color: var(--accent); font: 600 14px var(--sans); cursor: pointer; padding: 10px 4px; min-height: 44px; }

/* sign in */
.login { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 16px; }
.login-card { width: min(380px, 100%); background: var(--surface); border: 1px solid var(--hair); border-radius: var(--r); padding: 32px 24px; }
.login-title { font-size: 28px; font-weight: 700; margin: 0 0 20px; }
.login-or { color: var(--muted); font-size: 14px; margin: 22px 0 8px; }
.login-copy { color: var(--ink-2); margin: 0 0 18px; }
.login-links { display: flex; justify-content: space-between; margin: 10px 0 0; }
.login-msg { color: var(--ink-2); font-size: 14px; min-height: 1.4em; margin: 14px 0 0; }
.field-label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; }
input[type=email] { width: 100%; font: inherit; font-size: 16px; padding: 11px 12px; border: 1px solid var(--hair-2); border-radius: var(--r-sm); margin-bottom: 12px; }
#confirm .btn + .btn { margin-top: 10px; }

/* layout: one page, laid out by width */
.shell { min-height: 100vh; min-height: 100dvh; }
.side { display: none; }
.main { padding: 20px 16px 96px; max-width: 1120px; outline: none; }
.bottom { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; background: var(--surface); border-top: 1px solid var(--hair); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 6px 8px calc(10px + env(safe-area-inset-bottom)); }
.bottom a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 48px; text-decoration: none; color: var(--muted); font-size: 12px; font-weight: 500; }
.bottom a[aria-current=page] { color: var(--accent); font-weight: 600; }

@media (min-width: 900px) {
  .shell { display: flex; }
  .side { display: flex; flex-direction: column; gap: 2px; flex: 0 0 248px; position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--surface); border-right: 1px solid var(--hair); padding: 20px 12px; }
  .main { flex: 1; min-width: 0; padding: 28px 32px 48px; }
  .bottom { display: none; }
  .phone-only { display: none !important; }
}
@media (max-width: 899.98px) { .computer-only { display: none !important; } }

.side-brand { font-size: 18px; font-weight: 700; padding: 4px 12px 16px; }
.side-link { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 12px; border-radius: var(--r-sm); text-decoration: none; font-size: 14px; font-weight: 500; color: var(--ink); }
.side-link:hover { background: var(--page); color: var(--ink); }
.side-link[aria-current=page] { background: var(--accent-wash); color: var(--accent-dark); font-weight: 700; }
.dot { width: 10px; height: 10px; border-radius: 3px; flex: none; background: var(--c, var(--muted)); }
.dot-home { background: transparent; border: 2px solid var(--hair-2); }
.dot-shared { background: #9AA7B0; }
.side-upload { margin-top: 16px; }
.side-foot { margin-top: auto; padding: 16px 12px 0; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; border-top: 1px solid var(--hair); }
.side-who { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }

/* page header and search */
.top { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.top-titles { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.top-app { font-size: 13px; color: var(--muted); font-weight: 500; }
.top h1 { margin: 0; font-size: 22px; font-weight: 700; }
.round-upload { width: 44px; height: 44px; border-radius: 22px; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; flex: none; }
.round-upload:hover { background: var(--accent-dark); color: #fff; }
.search { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--hair-2); border-radius: 12px; padding: 0 14px; height: 48px; width: 100%; }
.search input { border: 0; outline: none; font: inherit; font-size: 16px; flex: 1; min-width: 0; background: transparent; color: var(--ink); }
.search:focus-within { border-color: var(--accent); }
@media (min-width: 900px) {
  .top h1 { font-size: 24px; }
  .top .search { flex: 0 1 420px; width: auto; height: 44px; }
}

/* home cards */
.cards { display: grid; gap: 12px; }
@media (min-width: 900px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; } }
@media (min-width: 1500px) { .cards { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.card { background: var(--surface); border: 1px solid var(--hair); border-radius: var(--r); padding: 14px 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-open { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); min-height: 44px; min-width: 0; }
.card-open:hover { color: var(--ink); }
.card-icon { width: 32px; height: 32px; border-radius: 9px; background: var(--c); display: flex; align-items: center; justify-content: center; flex: none; }
.card-name { display: block; font-size: 17px; font-weight: 600; }
.card-count { display: block; font-size: 12px; color: var(--muted); }
.card-choose { border: 0; background: transparent; color: var(--accent); font: 600 13px var(--sans); min-height: 44px; padding: 0 4px; cursor: pointer; flex: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 44px; padding: 0 14px; display: flex; align-items: center; border-radius: var(--r-sm); background: var(--t); color: var(--ink); font-size: 14px; font-weight: 500; text-decoration: none; }
.chip:hover { color: var(--ink); filter: brightness(0.97); }
@media (min-width: 900px) { .card .chips { flex-direction: column; } .card .chip { min-height: 40px; } }
.empty { color: var(--muted); font-size: 14px; margin: 0; }

/* panels: recent notes, CME */
.panels { display: grid; gap: 16px; margin-top: 16px; }
@media (min-width: 900px) { .panels { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); } }
.panel { background: var(--surface); border: 1px solid var(--hair); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.panel h2 { margin: 0; font-size: 15px; font-weight: 600; }
.panel-row { font-size: 14px; color: var(--ink-2); text-decoration: none; }
.meter-label { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.meter { height: 8px; border-radius: 4px; background: var(--hair); overflow: hidden; }
.meter > span { display: block; height: 8px; border-radius: 4px; background: var(--accent); }
.meter > span.done { background: var(--good); }

/* category page */
.back { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; color: var(--ink); margin-left: -12px; }
.cat-head { display: flex; align-items: center; gap: 4px; margin-bottom: 12px; }
.cat-head h1 { margin: 0 0 0 8px; font-size: 21px; font-weight: 700; }
.cat-head + .panel { margin-bottom: 4px; }
.cat-swatch { width: 28px; height: 28px; border-radius: 8px; background: var(--c); flex: none; }
@media (min-width: 900px) { .back { display: none; } .cat-head h1 { margin: 0 0 0 4px; font-size: 24px; } }
.filters { display: flex; gap: 8px; overflow-x: auto; margin: 12px 0 4px; padding-bottom: 2px; }
.filter { min-height: 36px; padding: 0 14px; border-radius: 18px; border: 1px solid var(--hair-2); background: var(--surface); color: var(--ink); font: 600 13px var(--sans); white-space: nowrap; cursor: pointer; }
.filter[aria-pressed=true] { background: var(--accent); border-color: var(--accent); color: #fff; }
.section-label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; margin: 18px 0 8px; }
.list { display: flex; flex-direction: column; gap: 8px; }
.row { background: var(--surface); border: 1px solid var(--hair); border-radius: 12px; padding: 12px 14px; display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); min-height: 44px; }
.row:hover { color: var(--ink); border-color: var(--hair-2); }
.row-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.row-title { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.row-meta { font-size: 12px; color: var(--muted); }
.row-type { font-size: 11px; font-weight: 600; color: var(--muted); border: 1px solid var(--hair-2); border-radius: 6px; padding: 2px 6px; flex: none; }
.star { flex: none; color: var(--accent); }
.empty-box { background: var(--surface); border: 1px dashed var(--hair-2); border-radius: 12px; padding: 20px 16px; color: var(--ink-2); font-size: 14px; }
.empty-box a { font-weight: 600; }
.notice { background: var(--surface); border: 1px solid var(--hair); border-radius: var(--r); padding: 20px 16px; }
.notice h1 { margin: 0 0 8px; font-size: 21px; }
.notice p { margin: 0 0 8px; color: var(--ink-2); }
.more-list .row { font-weight: 600; }
.error { color: #A8321F; }

/* Choose 5 */
.choose { border: 0; border-radius: var(--r); padding: 0; width: min(460px, calc(100% - 24px)); max-height: calc(100dvh - 48px); color: var(--ink); }
.choose::backdrop { background: rgb(22 33 43 / 0.45); }
.choose-form { padding: 20px; display: flex; flex-direction: column; max-height: calc(100dvh - 48px); }
.choose-title { margin: 0 0 4px; font-size: 19px; }
.choose-copy { margin: 0 0 12px; color: var(--ink-2); font-size: 14px; }
.choose-list { overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.pick { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 8px 12px; border: 1px solid var(--hair); border-radius: 12px; background: var(--surface); font: 500 15px var(--sans); color: var(--ink); text-align: left; cursor: pointer; width: 100%; }
.pick[aria-pressed=true] { border-color: var(--accent); background: var(--accent-wash); }
.pick-num { width: 26px; height: 26px; border-radius: 13px; border: 1px solid var(--hair-2); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex: none; }
.pick[aria-pressed=true] .pick-num { background: var(--accent); border-color: var(--accent); color: #fff; }
.choose-actions { display: flex; gap: 10px; margin-top: 12px; }

/* category colors (classes, so the page needs no inline styles) */
.k-teal   { --c: #0E6B70; --t: #E4F1F1; }
.k-rust   { --c: #A3501B; --t: #F8EBE2; }
.k-blue   { --c: #2F5DA8; --t: #E6EDF8; }
.k-violet { --c: #5E4396; --t: #EEE9F6; }
.k-slate  { --c: #5A6772; --t: #EEF1F3; }
.k-green  { --c: #2E7D4F; --t: #E5F2EA; }
.k-plum   { --c: #8A3D6B; --t: #F5E8EF; }
.k-olive  { --c: #5F6B1F; --t: #EFF1E1; }
