/* Asher's tracker. Phone-first, one column; scoped under .apt so the
 * WordPress theme can't reach in. Palette follows Autism Recovery Game Plan:
 * plum-purple headings, mint buttons, butter yellow, soft lavender-to-mint
 * washes. */
.apt, .apt-overlay, .apt-toasts {
  --ink: #3a2c48; --muted: #7b6d88; --paper: #ffffff; --panel: #f8f4fc; --line: #ece4f3;
  --accent: #5e2f86; --accent-ink: #ffffff; --accent-soft: #f1e8f9;
  --mint: #a9e5c2; --mint-strong: #7fd3a4; --mint-ink: #1f5a3c; --butter: #fbf2a8;
  --ok: #2c7a52; --ok-soft: #e1f5e9; --warn: #8a5f10; --warn-soft: #fbf3cf; --bad: #a63a4a; --bad-soft: #fbe6ea;
  --font: 'Catamaran', 'Nunito', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --radius: 18px;
}
.apt { color: var(--ink); background: var(--paper); font: 16px/1.5 var(--font); max-width: 760px; margin: 0 auto; text-align: left; }
.apt *, .apt *::before, .apt *::after { box-sizing: border-box; }
.apt h2, .apt h3 { font-family: var(--font); color: var(--ink); margin: 0; letter-spacing: 0; text-transform: none; line-height: 1.25; text-wrap: balance; }
.apt h2 { font-size: 1.5rem; font-weight: 700; }
.apt h3 { font-size: 1.08rem; font-weight: 700; }
.apt p { margin: 0; }
.apt button { font: inherit; }
.apt :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.apt [hidden] { display: none !important; }

/* top bar */
.apt-top { position: sticky; top: 0; z-index: 20; background: var(--paper); border-bottom: 1px solid var(--line); padding: 10px 0 0; }
.apt-brand { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 700; font-size: 1.05rem; padding: 0 2px 8px; }
.apt-tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.apt-tabs::-webkit-scrollbar { display: none; }
.apt-tabs button { flex: 1 0 auto; background: none; border: 0; border-bottom: 3px solid transparent; padding: 10px 12px; color: var(--muted); font-weight: 600; cursor: pointer; white-space: nowrap; }
.apt-tabs button[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }
@media (max-width: 520px) { .apt-tabs button { flex: 1 1 0; padding: 10px 2px; font-size: .86rem; } }
.apt-datebar { display: flex; align-items: center; gap: 8px; padding: 8px 0; }
.apt-datebar-mid { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; }
.apt-brand-name { display: flex; align-items: center; gap: 14px; min-width: 0; }
.apt-page-title { display: flex; align-items: center; gap: 20px; }
.apt-page-title > h1 { margin-top: 0 !important; margin-bottom: 0 !important; min-width: 0; }
.apt-page-title .apt-cover { width: 110px; height: 110px; }
.apt-cover { flex: none; width: 76px; height: 76px; padding: 0; border: 3px solid #fff; border-radius: 50%; overflow: hidden; background: #f8f4fc; cursor: pointer; box-shadow: 0 1px 4px rgba(94, 47, 134, .25); }
.apt-cover[hidden] { display: none; }
.apt-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.apt-datebar-mid strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.apt-datebar-mid input { width: auto; max-width: 150px; margin-left: auto; padding: 6px 8px; }
.apt-main { padding: 14px 0 80px; }
.apt-view { display: grid; gap: 14px; }

/* cards and layout */
.apt-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; background: var(--paper); display: grid; gap: 12px; min-width: 0; }
.apt-card.is-due { border-color: var(--accent); background: var(--accent-soft); }
.apt-card.is-ill { border-color: #e2b8b3; background: #fdf6f5; }
.apt-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.apt-stack { display: grid; gap: 12px; min-width: 0; }
.apt-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.apt-grid2.top { align-items: start; }
.apt-grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 12px; }
.apt-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.apt-row.wrap { flex-wrap: wrap; }
.apt-grow { flex: 1 1 auto; min-width: 0; }
.apt-list { display: grid; }
.apt-list > .apt-row { padding: 10px 0; border-top: 1px solid var(--line); }
.apt-list > .apt-row:first-child { border-top: 0; padding-top: 0; }
.apt-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.apt-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.apt-controls .apt-input { width: auto; flex: 1 1 160px; }
.apt-bigbuttons .apt-btn { padding: 14px; }
@media (max-width: 520px) { .apt-grid2 { grid-template-columns: 1fr; } }

/* text */
.apt-muted { color: var(--muted); font-size: .92rem; }
.apt-hint { color: var(--muted); font-size: .85rem; }
.apt-label { font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.apt-empty { color: var(--muted); font-style: italic; }
.apt-msg { min-height: 1.4em; color: var(--bad); }
.apt-ok { color: var(--ok); font-weight: 600; }
.apt-pre { white-space: pre-wrap; }
.apt-scale { display: flex; justify-content: space-between; font-size: .8rem; color: var(--muted); border-bottom: 1px dashed var(--line); padding-bottom: 4px; }

/* controls */
.apt-field { display: grid; gap: 5px; min-width: 0; }
.apt-input { width: 100%; font: inherit; color: var(--ink); background: var(--paper); border: 1px solid #c4d0cc; border-radius: 8px; padding: 10px 12px; min-height: 44px; margin: 0; box-shadow: none; }
.apt-input.short { width: 110px; }
textarea.apt-input { min-height: 0; resize: vertical; }
.apt-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 10px 16px; border-radius: 8px; border: 1px solid #c4d0cc; background: var(--paper); color: var(--ink); font-weight: 600; cursor: pointer; text-decoration: none; line-height: 1.2; text-transform: none; letter-spacing: 0; box-shadow: none; }
.apt-btn:hover { border-color: var(--accent); color: var(--accent); }
.apt-btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.apt-btn.primary:hover { filter: brightness(1.08); color: var(--accent-ink); }
.apt-btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.apt-btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.apt-btn.ghost:hover { color: var(--accent); }
.apt-btn.small { min-height: 34px; padding: 6px 12px; font-size: .9rem; }
.apt-btn.icon { min-width: 44px; padding: 6px; font-size: 1.3rem; }
.apt-btn.link { border: 0; background: none; padding: 0; min-height: 0; color: var(--accent); text-decoration: underline; font-weight: 600; }
.apt-btn.wide { width: 100%; }
.apt-btn.big { min-height: 64px; font-size: 1.2rem; }
.apt-btn:disabled { opacity: .5; cursor: default; }
.apt-seg { display: flex; flex-wrap: wrap; gap: 4px; }
.apt-seg button { flex: 1 0 auto; min-width: 36px; min-height: 40px; padding: 6px 10px; border: 1px solid #c4d0cc; background: var(--paper); color: var(--ink); border-radius: 8px; cursor: pointer; font-weight: 600; font-variant-numeric: tabular-nums; }
.apt-seg button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.apt-score { display: grid; gap: 6px; }
.apt-score-label { font-weight: 600; }
.apt-score .apt-seg button { min-width: 0; flex: 1 1 0; padding: 6px 0; }
.apt-range-wrap { display: grid; gap: 2px; }
.apt-range-line { display: flex; align-items: center; gap: 12px; }
.apt-range { flex: 1; min-width: 0; height: 28px; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer;
  --pct: 0%; --fill: var(--accent); }
.apt-range::-webkit-slider-runnable-track { height: 8px; border-radius: 999px; background: linear-gradient(to right, var(--fill) var(--pct), var(--line) var(--pct)); }
.apt-range::-moz-range-track { height: 8px; border-radius: 999px; background: linear-gradient(to right, var(--fill) var(--pct), var(--line) var(--pct)); }
.apt-range::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; margin-top: -9px; border-radius: 50%; background: #fff; border: 3px solid var(--accent); box-shadow: 0 1px 4px rgba(94, 47, 134, .3); }
.apt-range::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 3px solid var(--accent); box-shadow: 0 1px 4px rgba(94, 47, 134, .3); }
.apt-range-wrap.unset .apt-range::-webkit-slider-thumb { border-color: #c9bcd6; box-shadow: none; }
.apt-range-wrap.unset .apt-range::-moz-range-thumb { border-color: #c9bcd6; box-shadow: none; }
.apt-range-val { flex: none; width: 84px; text-align: right; font-weight: 700; color: var(--accent); }
.apt-range-wrap.unset .apt-range-val { font-weight: 400; color: var(--muted); }
.apt-range-ticks { display: flex; justify-content: space-between; padding: 0 13px; margin-right: 96px; font-size: .75rem; color: var(--muted); }
.apt-range-ticks span { width: 0; display: flex; justify-content: center; }
.apt-range-clear { justify-self: start; background: none; border: 0; padding: 2px 0; color: var(--muted); font-size: .85rem; text-decoration: underline; cursor: pointer; }
.apt-incident { display: grid; gap: 2px; }
.apt-incident-new { display: grid; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.apt-incident-new > .apt-btn { justify-self: start; }
.apt-todo { display: grid; gap: 8px; }
.apt-todo-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; }
.apt-todo-row input { width: 22px; height: 22px; margin: 1px 0 0; flex: none; accent-color: var(--accent); }
.apt-todo-row > span, .apt-todo-row > label { display: grid; gap: 2px; }
.apt-todo-row > label { cursor: pointer; }
.apt-todo-row > .apt-btn { flex: none; align-self: center; }
.apt-entry { display: flex; align-items: flex-start; gap: 8px; border-top: 1px solid var(--line); }
.apt-entry:first-child { border-top: 0; }
.apt-entry > .apt-rowbtn { border-top: 0; flex: 1; min-width: 0; }
.apt-entry > .apt-btn { flex: none; margin-top: 10px; }
.apt-entry-todos { display: grid; gap: 2px; margin-top: 6px; padding: 8px 10px; background: var(--panel); border-radius: 10px; }
.apt-entry-todos .is-done { text-decoration: line-through; color: var(--muted); }
.apt-todo-text { font-weight: 600; }
.apt-todo-row.done .apt-todo-text { text-decoration: line-through; color: var(--muted); }
.apt-stepper { display: inline-flex; align-items: center; border: 1px solid #c4d0cc; border-radius: 8px; overflow: hidden; }
.apt-stepper button { width: 44px; height: 42px; border: 0; background: var(--panel); font-size: 1.3rem; cursor: pointer; color: var(--ink); }
.apt-stepper output { min-width: 40px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.apt-counts { display: grid; }
.apt-count { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.apt-count:first-child { border-top: 0; }
.apt-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.apt-chip { border: 1px solid #c4d0cc; background: var(--paper); border-radius: 999px; padding: 6px 12px; cursor: pointer; color: var(--ink); min-height: 36px; }
.apt-chip[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.apt-addrow { display: grid; gap: 8px; }
.apt-chip.is-light { background: var(--panel); }
.apt-chip.is-heavy { background: var(--warn-soft); border-color: #e4c690; color: var(--warn); }
.apt-chip.is-very_heavy { background: var(--bad-soft); border-color: #e2b8b3; color: var(--bad); }

/* pills and status */
.apt-pill { display: inline-block; font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--panel); color: var(--muted); white-space: nowrap; }
.apt-pill.ok { background: var(--ok-soft); color: var(--ok); }
.apt-pill.warn { background: var(--warn-soft); color: var(--warn); }
.apt-pill.bad { background: var(--bad-soft); color: var(--bad); }
.apt-pills { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.apt-banners { display: grid; gap: 8px; }
.apt-banners:empty { display: none; }
.apt-banner { border-radius: var(--radius); padding: 10px 12px; background: var(--accent-soft); color: var(--ink); font-size: .95rem; }
.apt-banner.ill { background: var(--bad-soft); }
.apt-banner.due { background: var(--warn-soft); }
.apt-banner.soft { background: var(--panel); }
.apt-banner.moon { background: #eceaf6; }
.apt-warnbox { background: var(--warn-soft); border-radius: 8px; padding: 10px 12px; color: var(--ink); }
.apt-warnbox ul { margin: 6px 0; padding-left: 20px; }
.apt-savebar { position: sticky; bottom: 0; background: var(--paper); border-top: 1px solid var(--line); padding: 10px 0; text-align: center; }
.apt-save-status { color: var(--muted); font-size: .9rem; }

/* doses, meals, events */
.apt-doses { display: grid; gap: 14px; }
.apt-dose { display: grid; gap: 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.apt-dose:first-child { border-top: 0; padding-top: 0; }
.apt-dose-name { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.apt-totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.apt-totals > div { background: var(--paper); padding: 10px 12px; display: grid; gap: 2px; }
.apt-totals strong { font-size: 1.5rem; font-variant-numeric: tabular-nums; line-height: 1.1; }
.apt-meal { border-top: 1px solid var(--line); padding-top: 12px; display: grid; gap: 8px; }
.apt-meal:first-child { border-top: 0; padding-top: 0; }
.apt-meal-head { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.apt-meal-items { margin: 0; padding-left: 18px; }
.apt-photo { max-width: 100%; max-height: 220px; border-radius: 8px; display: block; }
.apt-flags { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: .92rem; }
.apt-flags li { display: flex; gap: 8px; align-items: baseline; }
.apt-dot { flex: 0 0 10px; height: 10px; border-radius: 50%; background: var(--muted); transform: translateY(1px); }
.apt-flags .is-red .apt-dot { background: var(--bad); }
.apt-flags .is-amber .apt-dot { background: #d39b2a; }
.apt-items { display: grid; gap: 10px; }
.apt-item { border: 1px solid var(--line); border-radius: 8px; padding: 10px; display: grid; gap: 8px; }
.apt-item-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.apt-picker { display: grid; gap: 6px; }
.apt-picklist { display: grid; gap: 4px; }
.apt-pick { text-align: left; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 10px 12px; cursor: pointer; color: var(--ink); min-height: 44px; }
.apt-pick.new { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.apt-event { border-top: 1px solid var(--line); padding-top: 10px; display: grid; gap: 4px; }
.apt-event:first-of-type { border-top: 0; padding-top: 0; }
.apt-cause { display: grid; gap: 6px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
.apt-cause label { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; cursor: pointer; }
.apt-day { border-top: 1px solid var(--line); padding-top: 8px; display: grid; gap: 2px; }
.apt-details > summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; flex-wrap: wrap; }
.apt-details > summary::-webkit-details-marker { display: none; }
.apt-details[open] > summary { margin-bottom: 10px; }
.apt-rowbtn { width: 100%; text-align: left; background: none; border: 0; border-top: 1px solid var(--line); padding: 12px 0; cursor: pointer; color: var(--ink); }
.apt-subnav { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.apt-subnav button { flex: 0 0 auto; border: 1px solid #c4d0cc; background: var(--paper); color: var(--ink); border-radius: 999px; padding: 6px 14px; cursor: pointer; font-weight: 600; min-height: 38px; }
.apt-subnav button[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* tables and charts */
.apt-scroll { overflow-x: auto; }
.apt-table { width: 100%; border-collapse: collapse; font-size: .92rem; margin: 0; }
.apt-table th { text-align: left; font-size: .74rem; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding: 6px 8px; border: 0; border-bottom: 1px solid var(--line); background: none; white-space: nowrap; }
.apt-table td { padding: 8px; border: 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; vertical-align: top; background: none; }
.apt-table.compact td, .apt-table.compact th { padding: 6px; }
.apt-table .is-better { color: var(--ok); font-weight: 700; }
.apt-table .is-worse { color: var(--bad); font-weight: 700; }
.apt-chart-wrap { display: grid; gap: 6px; }
.apt-chart { width: 100%; height: auto; display: block; }
.apt-chart .grid { stroke: var(--line); stroke-width: 1; }
.apt-chart .tick { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.apt-chart .band { fill: var(--bad-soft); }
.apt-chart .marker { stroke: var(--warn); stroke-width: 1.5; stroke-dasharray: 4 3; }
.apt-chart .marker-label { fill: var(--warn); font-size: 11px; font-family: var(--font); font-weight: 600; }
.apt-chart .dot { fill: #9fb3ad; }
.apt-chart .mean { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; }
.apt-chart .end { fill: var(--accent); stroke: #fff; stroke-width: 2; }
.apt-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .8rem; color: var(--muted); }
.apt-legend span::before { content: ''; display: inline-block; width: 12px; height: 12px; margin-right: 5px; vertical-align: -1px; border-radius: 2px; }
.apt-legend .k-dot::before { background: #9fb3ad; border-radius: 50%; width: 8px; height: 8px; }
.apt-legend .k-mean::before { background: var(--accent); height: 3px; vertical-align: 3px; }
.apt-legend .k-marker::before { border-left: 2px dashed var(--warn); width: 0; }
.apt-legend .k-band::before { background: var(--bad-soft); }

/* sign-in */
.apt-gate { max-width: 420px; margin: 24px auto; display: grid; gap: 16px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); }

/* sheets and toasts (outside .apt in the DOM) */
.apt-overlay { position: fixed; inset: 0; z-index: 100000; background: rgba(20, 30, 35, .45); display: flex; align-items: flex-end; justify-content: center; padding: 0; }
.apt-sheet { background: var(--paper); width: 100%; max-width: 620px; max-height: 92vh; border-radius: 14px 14px 0 0; display: flex; flex-direction: column; box-shadow: 0 -8px 30px rgba(0, 0, 0, .2); }
@media (min-width: 700px) { .apt-overlay { align-items: center; padding: 24px; } .apt-sheet { border-radius: 14px; } }
.apt-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.apt-x { border: 0; background: none; font-size: 1.6rem; line-height: 1; cursor: pointer; color: var(--muted); width: 44px; height: 44px; }
.apt-sheet-body { padding: 16px; overflow-y: auto; }
.apt-sheet-foot { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); }
.apt-sheet-foot .apt-btn { flex: 1 1 auto; }
.apt-toasts { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 100001; display: grid; gap: 8px; width: min(92vw, 460px); pointer-events: none; }
.apt-toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 10px; font: 15px/1.4 var(--font); box-shadow: 0 6px 20px rgba(0, 0, 0, .25); transition: opacity .35s, transform .35s; }
.apt-toast.is-error { background: var(--bad); }
.apt-toast.is-out { opacity: 0; transform: translateY(8px); }
@media (prefers-reduced-motion: reduce) { .apt-toast { transition: none; } }

/* ───────────── Fed and Sorted look: softer shapes and the pastel palette.
 * Kept as one block after the layout rules so it wins without !important,
 * except where the WordPress theme styles buttons itself. */
.apt { background: linear-gradient(165deg, #fcf9ff 0%, #f6f1fb 45%, #f1faf5 100%); border-radius: 24px; padding: 0 max(12px, env(safe-area-inset-right, 0px)) 0 max(12px, env(safe-area-inset-left, 0px)); }
.apt h2, .apt h3 { color: var(--accent); font-weight: 800; }
.apt-brand span { color: var(--accent); font-size: 1.15rem; font-weight: 800; }

/* tabs: a soft lavender pill marks where you are; no boxes or underlines */
.apt-top { background: rgba(252, 249, 255, .92); backdrop-filter: blur(6px); border-bottom: 0; padding-top: 12px; }
.apt .apt-tabs { gap: 4px; padding: 4px; background: rgba(255, 255, 255, .7); border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line); }
.apt .apt-tabs button { border: 0 !important; box-shadow: none !important; outline: none; border-radius: 999px; padding: 9px 14px; color: var(--muted); background: transparent; font-weight: 700; transition: background-color .2s, color .2s; }
.apt .apt-tabs button:hover { color: var(--accent); background: rgba(241, 232, 249, .6); }
.apt .apt-tabs button[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
.apt .apt-tabs button:focus { outline: none; }
.apt .apt-tabs button:focus-visible { box-shadow: 0 0 0 2px #d7c3ea !important; }
@media (max-width: 520px) { .apt .apt-tabs { gap: 0; padding: 3px; } .apt .apt-tabs button { padding: 8px 0; font-size: .78rem; letter-spacing: -.01em; } }
.apt-datebar { padding: 10px 2px; }

/* cards: white, rounded, a soft shadow instead of a grey border */
.apt-card { border: 1px solid rgba(236, 228, 243, .9); box-shadow: 0 6px 22px rgba(94, 47, 134, .07); padding: 16px 18px; }
.apt-card.is-due { background: var(--butter); border-color: #f1e27a; }
.apt-card.is-ill { background: var(--bad-soft); border-color: #f2c9d1; }

/* controls */
.apt-input { border-color: #e2d6ee; border-radius: 12px; background: #fff; }
.apt-input:focus { border-color: #c9b0e0; box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }
.apt .apt-btn { border-radius: 999px; border-color: #e2d6ee; font-weight: 700; }
.apt .apt-btn:hover { border-color: #c9b0e0; color: var(--accent); }
.apt .apt-btn.primary, .apt-sheet .apt-btn.primary { background: var(--mint); border-color: var(--mint); color: var(--mint-ink); }
.apt .apt-btn.primary:hover, .apt-sheet .apt-btn.primary:hover { background: var(--mint-strong); border-color: var(--mint-strong); color: var(--mint-ink); filter: none; }
.apt .apt-btn.ghost { border-color: transparent; }
.apt .apt-btn.link { color: var(--accent); }
.apt-seg button { border-color: #e2d6ee; border-radius: 12px; background: #fff; }
.apt-seg button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.apt-stepper { border-color: #e2d6ee; border-radius: 12px; }
.apt-stepper button { background: var(--panel); }
.apt-chip { border-color: #e2d6ee; }
.apt-chip[aria-pressed="true"] { background: var(--accent-soft); border-color: #c9b0e0; color: var(--accent); }
.apt-subnav button { border-color: #e2d6ee; }
.apt-subnav button[aria-current="page"] { background: var(--accent-soft); border-color: #c9b0e0; color: var(--accent); }
.apt-pick { border-radius: 12px; }
.apt-pick.new { background: #e8f8ee; color: var(--mint-ink); }
.apt-item, .apt-cause { border-radius: 14px; border-color: var(--line); }

/* banners and status */
.apt-banner { border-radius: 14px; background: var(--accent-soft); }
.apt-banner.due { background: var(--butter); }
.apt-banner.moon { background: #ece6fb; }
.apt-savebar { background: rgba(252, 249, 255, .92); border-top-color: var(--line); color: var(--muted); }
.apt-scale { border-bottom-color: #e2d6ee; }

/* sheets, toasts, chart */
.apt-sheet { border-radius: 22px 22px 0 0; }
@media (min-width: 700px) { .apt-sheet { border-radius: 22px; } }
.apt-sheet-head h3 { color: var(--accent); }
.apt-overlay { background: rgba(58, 44, 72, .38); }
.apt-toast { background: var(--accent); border-radius: 14px; }
.apt-chart .mean { stroke: var(--accent); }
.apt-chart .end { fill: var(--accent); }
.apt-chart .dot { fill: #c9b7da; }
.apt-legend .k-dot::before { background: #c9b7da; }
.apt-legend .k-mean::before { background: var(--accent); }
.apt-gate { background: #fff; border-color: var(--line); box-shadow: 0 6px 22px rgba(94, 47, 134, .08); border-radius: 22px; }
.apt-card.is-due .apt-pill.warn, .apt-banner.due .apt-pill.warn { background: #efd970; color: #6b4a08; }


/* photos and videos for a day */
.apt-media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.apt-media-grid > .apt-empty { grid-column: 1 / -1; }
.apt-media-tile { position: relative; aspect-ratio: 1; border: 0; padding: 0; border-radius: 14px; overflow: hidden; background: var(--panel); cursor: pointer; }
.apt-media-tile img, .apt-media-tile video { width: 100%; height: 100%; object-fit: cover; display: block; }
.apt-media-play { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 1.6rem; text-shadow: 0 2px 8px rgba(0, 0, 0, .45); pointer-events: none; }
.apt-media-star { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: var(--accent); font-size: .85rem; box-shadow: 0 1px 4px rgba(0, 0, 0, .2); pointer-events: none; }
.apt-media-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 6px 5px; font-size: .74rem; line-height: 1.2; color: #fff; text-align: left;
  background: linear-gradient(transparent, rgba(40, 24, 56, .7)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.apt-media-missing { display: grid; place-items: center; height: 100%; font-size: .8rem; color: var(--muted); }
.apt-media-view img, .apt-media-view video { width: 100%; max-height: 62vh; object-fit: contain; border-radius: 14px; background: #1d1424; display: block; }
.apt-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
label.apt-btn { cursor: pointer; }
