:root {
  --bg: #F4F5F8;
  --card: #FFFFFF;
  --ink: #16172B;
  --muted: #5D6078;
  --line: #E4E6EE;
  --violet: #5B3FF0; --violet-soft: #E4DFFF; --violet-ink: #3F25C9; --violet-deep: #4A30D6; --violet-light: #7A63FF;
  --orange: #FF7A2F; --orange-soft: #FFE1CF; --orange-ink: #7A2E00; --orange-text: #3D1600;
  --mint: #1FB57A; --mint-soft: #D2F4E5; --mint-ink: #05583A; --mint-text: #053D27;
  --yellow: #FFD24D; --yellow-soft: #FFF1C2; --yellow-ink: #5A4000; --yellow-text: #3D2B00;
  --sky: #3B82F6; --sky-soft: #DCEBFF; --sky-ink: #1D4F91;
  --pink: #FF5C93; --pink-soft: #FFDDEA; --pink-ink: #8A1F4B;
  --red: #B2391F; --now: #E5484D;
  --display: 'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif;
  --body: 'DM Sans', 'Segoe UI', system-ui, sans-serif;
}
:root[data-theme="clinic"] {
  --violet: #0E7C72; --violet-soft: #DDF1EE; --violet-ink: #075049; --violet-deep: #0A645C; --violet-light: #3AA99D;
  --bg: #F4F6F6; --line: #E2E7E7;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 15px; }
@media (min-width: 560px) { body { background: #DCDFEC; } #shell { box-shadow: 0 0 0 1px var(--line); } }
#shell { max-width: 480px; min-height: 100vh; min-height: 100dvh; margin: 0 auto; background: var(--bg); position: relative; padding-top: env(safe-area-inset-top); padding-bottom: calc(104px + env(safe-area-inset-bottom)); }
a { color: var(--violet-ink); }
button, input, select, textarea { font-family: var(--body); font-size: 15px; color: var(--ink); }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--violet-light); outline-offset: 2px; }

.scr { padding: 20px 18px 8px; display: flex; flex-direction: column; gap: 16px; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.top-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.kicker { font-size: 13px; color: var(--muted); }
.title { font-family: var(--display); font-size: 30px; font-weight: 800; letter-spacing: -0.5px; line-height: 1.1; margin: 0; }
.h2 { font-family: var(--display); font-size: 19px; font-weight: 700; margin: 0; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; }
.muted { color: var(--muted); font-size: 13px; }
.small { font-size: 12px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; align-items: center; gap: 10px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hidden { display: none !important; }

.icon-btn { width: 44px; height: 44px; border-radius: 14px; border: none; background: var(--card); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; text-decoration: none; }
.avatar { width: 46px; height: 46px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.avatar.sq { border-radius: 16px; }
.avatar.lg { width: 64px; height: 64px; border-radius: 22px; font-family: var(--display); font-size: 24px; font-weight: 800; }

.hero { position: relative; overflow: hidden; background: var(--violet); color: #fff; border-radius: 24px; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.hero > * { position: relative; z-index: 1; }
.hero .label { font-size: 14px; color: rgba(255, 255, 255, .82); font-weight: 500; }
.hero .soft { color: rgba(255, 255, 255, .82); }
.hero .big { font-family: var(--display); font-size: 40px; font-weight: 800; letter-spacing: -1px; line-height: 1; }
.meter { height: 8px; border-radius: 999px; background: rgba(255, 255, 255, .22); overflow: hidden; }
.meter > span { display: block; height: 100%; background: #fff; border-radius: 999px; }

.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; padding: 6px 12px; border-radius: 999px; background: var(--card); color: var(--ink); border: 1px solid var(--line); white-space: nowrap; }
.chip.on { background: var(--violet); border-color: var(--violet); color: #fff; }
.chip.white { background: #fff; color: var(--violet-ink); }
.chip.glass { background: rgba(255, 255, 255, .16); color: #fff; }
.chip.yellow { background: rgba(255, 255, 255, .16); color: #fff; }
.chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 -18px; padding: 0 18px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips .chip { min-height: 40px; padding: 0 14px; }
.pill { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tile { text-decoration: none; border: 1px solid var(--line); text-align: left; border-radius: 20px; padding: 16px; min-height: 112px; background: var(--card); color: var(--ink); display: flex; flex-direction: column; justify-content: space-between; gap: 10px; }
.tile .t { font-family: var(--display); font-size: 18px; font-weight: 700; line-height: 1.2; }
.tile > span[aria-hidden] { width: 42px !important; height: 42px !important; border-radius: 13px; align-items: center; justify-content: center; background: var(--tint, var(--violet-soft)); color: var(--tint-ink, var(--violet-ink)); }
.tile > span[aria-hidden] svg { width: 22px; height: 22px; }
.tile .s { font-size: 13px; color: var(--muted); }
/* Tones: only a tint on the icon (tiles) or a stripe and number (banners). */
.t-orange { --tint: var(--orange-soft); --tint-ink: var(--orange-ink); --stripe: var(--orange); }
.t-mint { --tint: var(--mint-soft); --tint-ink: var(--mint-ink); --stripe: var(--mint); }
.t-yellow { --tint: var(--yellow-soft); --tint-ink: var(--yellow-ink); --stripe: var(--yellow); }
.t-sky { --tint: var(--sky-soft); --tint-ink: var(--sky-ink); --stripe: var(--sky); }
.t-white { --stripe: transparent; }
.t-violet { --tint: var(--violet-soft); --tint-ink: var(--violet-ink); --stripe: var(--violet); }

.card { background: var(--card); border-radius: 20px; padding: 16px; border: 1px solid var(--line); }
.card.flush { padding: 4px 14px; }
.banner { text-decoration: none; border-radius: 18px; padding: 14px 16px; display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); text-align: left; width: 100%; background: var(--card); color: var(--ink); box-shadow: inset 4px 0 0 var(--stripe, transparent); }
.banner .small { color: var(--muted); }
.banner > span[aria-hidden] { color: var(--muted); }
.banner.urgent { background: #FDF0EE; border-color: #F3C9C1; --stripe: var(--red); }
.banner.urgent .n, .banner.urgent b { color: var(--red); }
.banner .n { font-family: var(--display); font-size: 28px; font-weight: 800; color: var(--tint-ink, var(--ink)); min-width: 22px; text-align: center; }
.list-item { text-decoration: none; color: var(--ink); display: flex; align-items: center; gap: 12px; min-height: 66px; border-bottom: 1px solid #EEF0F6; background: none; border-left: none; border-right: none; border-top: none; width: 100%; text-align: left; padding: 8px 0; }
.list-item:last-child { border-bottom: none; }
.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stat { background: var(--card); border-radius: 18px; padding: 12px; border: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.stat b { font-family: var(--display); font-size: 20px; font-weight: 800; }
.hscroll { display: flex; gap: 10px; overflow-x: auto; margin: 0 -18px; padding: 0 18px 4px; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }
.next-card { flex: 0 0 210px; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 14px; display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--ink); }
.next-card .time { font-family: var(--display); font-size: 18px; font-weight: 800; }

.btn { min-height: 48px; padding: 0 18px; border-radius: 999px; border: none; font-weight: 700; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; background: var(--card); color: var(--ink); }
.btn.primary { background: var(--violet); color: #fff; }
.btn.dark { background: var(--ink); color: #fff; }
.btn.yellow { background: #fff; color: var(--violet-ink); }
.btn.mint { background: #1F9D61; color: #fff; }
.btn.ghost { background: transparent; border: 1.5px solid var(--line); }
.btn.danger { background: transparent; border: 1.5px solid #F1C4BE; color: var(--red); }
.btn.full { width: 100%; min-height: 56px; font-family: var(--display); font-size: 17px; font-weight: 700; }
.btn.sm { min-height: 38px; padding: 0 14px; font-size: 13px; }

.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
.input, .field input, .field select, .field textarea { min-height: 50px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--card); padding: 0 14px; font-size: 15px; font-weight: 400; color: var(--ink); width: 100%; }
.field textarea { padding: 12px 14px; min-height: 90px; resize: vertical; }
.search { display: flex; align-items: center; gap: 10px; min-height: 50px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); padding: 0 16px; color: var(--muted); }
.search input { flex: 1; border: none; outline: none; background: transparent; font-size: 15px; }
.err { color: var(--red); font-size: 13px; font-weight: 700; }

.switch { width: 58px; height: 34px; border-radius: 999px; border: none; padding: 3px; display: flex; flex-shrink: 0; }
.switch span { width: 28px; height: 28px; border-radius: 50%; background: #fff; }
.switch[aria-checked="true"] { background: var(--mint); justify-content: flex-end; }
.switch[aria-checked="false"] { background: #C9CBE0; justify-content: flex-start; }

#tabbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: max(16px, env(safe-area-inset-bottom)); width: min(444px, calc(100% - 36px)); height: 66px; border-radius: 999px; background: var(--ink); display: flex; align-items: center; justify-content: space-between; padding: 0 8px; z-index: 20; }
#tabbar a { width: 50px; height: 50px; white-space: nowrap; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: #C9CBE0; border-radius: 999px; text-decoration: none; font-weight: 700; font-size: 14px; gap: 8px; }
#tabbar a.on { width: auto; padding: 0 16px; background: #fff; color: var(--ink); }
#tabbar a.fab { background: var(--violet); color: #fff; }

.sheet-bg { position: fixed; inset: 0; background: rgba(22, 23, 43, 0.45); z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--bg); width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto; border-radius: 28px 28px 0 0; padding: 10px 18px calc(28px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; }
.sheet .grip { width: 44px; height: 5px; border-radius: 3px; background: #C9CBE0; align-self: center; }

.cal-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-day { min-width: 0; padding: 9px 0 8px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); color: var(--ink); display: flex; flex-direction: column; align-items: center; gap: 4px; }
.cal-day .wd { font-size: 11px; font-weight: 700; color: var(--muted); line-height: 1; }
.cal-day b { font-family: var(--display); font-size: 20px; font-weight: 800; line-height: 1; }
.cal-day .n { min-width: 20px; height: 18px; padding: 0 5px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; line-height: 1; background: var(--violet-soft); color: var(--violet-ink); }
.cal-day .n.zero { background: transparent; color: #B4B7CB; }
.cal-day.today:not([aria-pressed="true"]) b, .cal-day.today:not([aria-pressed="true"]) .wd { color: var(--violet); }
.cal-day[aria-pressed="true"] { background: var(--violet); border-color: var(--violet); color: #fff; }
.cal-day[aria-pressed="true"] .wd { color: rgba(255, 255, 255, .8); }
.cal-day[aria-pressed="true"] .n { background: #fff; color: var(--violet-ink); }
.cal-day[aria-pressed="true"] .n.zero { background: transparent; color: rgba(255, 255, 255, .6); }
.cal-board { background: var(--card); border: 1px solid var(--line); border-radius: 20px; overflow-x: auto; }
.cal-head, .cal-body { display: grid; gap: 4px; padding: 0 8px 0 0; }
.cal-head { padding-top: 12px; padding-bottom: 8px; border-bottom: 1px solid #EEF0F6; position: sticky; top: 0; background: var(--card); z-index: 2; }
.cal-col { position: relative; background: repeating-linear-gradient(#FFFFFF 0 49px, #EEF0F6 49px 50px); }
.cal-block { position: absolute; left: 0; right: 0; border-radius: 10px; padding: 4px 6px; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-start; gap: 2px; border: 1.5px solid; text-align: left; font-size: 11px; line-height: 1.25; }
.cal-block > * { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-block b { font-size: 12px; }
.cal-block .t { font-size: 10px; font-weight: 700; opacity: .8; }
.cal-block.short { justify-content: center; padding-top: 0; padding-bottom: 0; }
.cal-time { position: sticky; left: 0; z-index: 3; background: var(--card); }
.cal-head > .cal-time { align-self: stretch; }
.cal-now { position: absolute; left: 8px; right: 8px; display: flex; align-items: center; pointer-events: none; z-index: 1; }
.cal-now span { font-size: 10px; font-weight: 700; color: #fff; background: var(--now); padding: 2px 5px; border-radius: 6px; }
.cal-now i { flex: 1; height: 2px; background: var(--now); }

.wa { background: #EFEAE2; border-radius: 22px; padding: 12px; }
.wa-chat-head { display: flex; align-items: center; gap: 10px; padding: 2px 2px 12px; font-size: 14px; }
.wa-bubble { background: #fff; border-radius: 4px 12px 12px 12px; overflow: hidden; max-width: 300px; box-shadow: 0 1px 1px rgba(0, 0, 0, .08); }
.wa-text { padding: 8px 10px 6px; font-size: 14px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; color: #111B21; }
.wa-time { display: block; text-align: right; font-size: 11px; color: #667781; margin-top: 2px; }
.step { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-size: 17px; font-weight: 700; margin-top: 4px; }
.step > span { width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.wa-head { background: var(--orange); color: var(--orange-text); padding: 14px; }
.wa-head b { font-family: var(--display); font-size: 21px; font-weight: 800; display: block; }
.wa-btn { border-top: 1px solid #E9EDEF; min-height: 42px; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; color: #0B6E63; }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 96px; background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 999px; font-weight: 700; font-size: 14px; z-index: 60; opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast.show { opacity: 1; }
.pick-head { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; padding: 14px 0 4px; }
.pick { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 10px 0; border: none; border-bottom: 1px solid #EEF0F6; background: none; text-align: left; color: var(--ink); }
.pick:last-child { border-bottom: none; }
.pick .tick { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 14px; font-weight: 800; color: #fff; }
.pick[aria-pressed="true"] .tick { background: var(--violet); border-color: var(--violet); }
.pick[aria-pressed="true"] > .grow b { color: var(--violet-ink); }
.time-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.time-grid .chip { min-height: 44px; justify-content: center; background: var(--bg); }
.time-grid .chip.on { background: var(--violet); color: #fff; }
.confirm-bar { position: fixed; z-index: 21; left: 50%; transform: translateX(-50%); width: min(444px, calc(100% - 36px)); bottom: calc(max(16px, env(safe-area-inset-bottom)) + 76px); }
.confirm-bar .btn.full { min-height: 60px; box-shadow: 0 8px 24px rgba(91, 63, 240, .35); }
.who { border: none; background: none; padding: 0; text-align: left; color: var(--ink); min-width: 0; }
.who .chev { display: inline-flex; color: var(--muted); transition: transform .15s; }
.who[aria-expanded="true"] .chev { transform: rotate(90deg); }
.day-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.day-row .chip { min-height: 40px; padding: 0; justify-content: center; background: var(--bg); }
.day-row .chip.on { background: var(--violet); color: #fff; }
.sit-dots { display: flex; gap: 6px; }
.sit-dots span { flex: 1; max-width: 48px; height: 8px; border-radius: 4px; background: var(--line); }
.sit-dots span.booked { background: var(--mint-soft); box-shadow: inset 0 0 0 2px var(--mint); }
.sit-dots span.done { background: var(--mint); }
.empty { text-align: center; padding: 26px 12px; color: var(--muted); }

/* Small Android phones (360px wide and below) */
@media (max-width: 380px) {
  .scr { padding-left: 16px; padding-right: 16px; }
  .chips, .hscroll { margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
  .title { font-size: 27px; }
  .hero { padding: 20px; }
  .hero .big { font-size: 40px; }
  .tile { padding: 14px; }
  .tile .t { font-size: 18px; }
  .tiles { gap: 10px; }
  .stat b { font-size: 20px; }
  #tabbar { padding: 0 6px; }
  #tabbar a { width: 44px; }
  #tabbar a.on { padding: 0 12px; font-size: 13px; gap: 6px; }
}

.profile-head { background: var(--card); border-bottom: 1px solid var(--line); padding: 14px 18px 18px; display: flex; flex-direction: column; gap: 14px; }
.profile-head .icon-btn { background: var(--bg); }
.profile-head .name { font-family: var(--display); font-size: 24px; font-weight: 800; line-height: 1.15; }
.profile-head .chip { background: var(--bg); }
.next-patient { display: flex; align-items: center; gap: 12px; background: rgba(255, 255, 255, .14); border-radius: 16px; padding: 10px 12px; text-decoration: none; color: #fff; }
.next-patient b { display: block; font-size: 16px; }
/* Booking screen: a person's day, booked times and free gaps */
.plan { padding: 0; overflow: hidden; }
.plan-head { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 14px 8px; border-bottom: 1px solid var(--line); }
.plan-row { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 50px; padding: 8px 14px; border: none; border-bottom: 1px solid #EEF0F3; background: none; text-align: left; font-size: 14px; color: var(--ink); }
.plan-row:last-child { border-bottom: none; }
.plan-row .when { flex: 0 0 116px; font-weight: 700; font-size: 13px; white-space: nowrap; }
.plan-row.busy { background: #F6F7F9; color: var(--muted); }
.plan-row.busy .when { color: var(--muted); }
.plan-row.free { color: var(--violet-ink); }
.plan-row.free .grow { font-weight: 600; }
.plan-row.free:disabled { color: #A3A7B5; cursor: default; }
.plan-row.free.on { background: var(--violet-soft); }
.pick-pill { flex-shrink: 0; font-size: 12px; font-weight: 700; padding: 5px 12px; border-radius: 999px; border: 1.5px solid var(--violet); color: var(--violet-ink); }
.plan-row.free.on .pick-pill { background: var(--violet); color: #fff; }
.time-status { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border-radius: 12px; background: var(--bg); font-size: 14px; }
.time-status.ok { background: #E6F5EE; color: #0F5B3A; }
.time-status.bad { background: #FDF0EE; color: var(--red); }
.dayline-wrap { padding: 10px 14px 6px; border-bottom: 1px solid var(--line); }
.dayline { position: relative; height: 22px; border-radius: 7px; background: #E3F3EC; overflow: hidden; }
.dayline .b { position: absolute; top: 0; bottom: 0; background: #C3C8D2; border-left: 1px solid #fff; border-right: 1px solid #fff; }
.dayline .sel { position: absolute; top: 0; bottom: 0; background: var(--violet); border-radius: 4px; box-shadow: 0 0 0 2px #fff inset; }
.dayline-ticks { display: flex; justify-content: space-between; font-size: 11px; font-weight: 700; color: var(--muted); margin-top: 4px; }
.dayline .sel.bad { background: var(--red); }
/* Patient file: health alerts, last visit, history */
.health-strip { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border-radius: 16px; padding: 12px 14px; border: 1px solid #F3C9C1; background: #FDF0EE; color: var(--red); }
.health-strip b { font-size: 15px; }
.health-strip .small { color: #8C3A29; }
.health-strip .mark { width: 28px; height: 28px; border-radius: 50%; background: var(--red); color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.health-strip .add { font-size: 13px; font-weight: 700; flex-shrink: 0; }
.health-strip.empty { background: var(--card); border: 1px dashed var(--line); color: var(--ink); }
.health-strip.empty .small { color: var(--muted); }
.health-strip.empty .add { color: var(--violet-ink); }
.chip.alert-on { background: #FDF0EE; border-color: var(--red); color: var(--red); }
.last-visit { border-left: 4px solid var(--violet); }
.note-line { display: grid; grid-template-columns: 92px 1fr; gap: 8px; font-size: 14px; line-height: 1.4; }
.note-line .k { font-size: 12px; font-weight: 700; color: var(--muted); padding-top: 1px; }
.note-line.fix { background: #FFF8E6; border-radius: 8px; padding: 6px 8px; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; }
.quick .chip { font-size: 12px; font-weight: 600; padding: 5px 10px; min-height: 32px; color: var(--muted); }
.quick .chip.on { color: #fff; }
.field .quick { margin-top: 2px; }
.readings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.med { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 0; border: none; border-bottom: 1px solid #EEF0F3; background: none; text-align: left; color: var(--ink); }
.med .n { width: 26px; height: 26px; border-radius: 50%; background: var(--violet-soft); color: var(--violet-ink); font-weight: 800; font-size: 13px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.rx-mark { font-size: 24px; font-weight: 800; color: var(--violet); line-height: 1; }
.chip.progress-better.on { background: #1F9D61; border-color: #1F9D61; }
.chip.progress-worse.on { background: var(--red); border-color: var(--red); }
.chip.progress-same.on { background: #5D6078; border-color: #5D6078; }
.timeline { display: flex; flex-direction: column; position: relative; padding-left: 18px; }
.timeline::before { content: ''; position: absolute; left: 5px; top: 10px; bottom: 10px; width: 2px; background: var(--line); }
.tl-item { position: relative; display: block; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; margin-bottom: 10px; text-decoration: none; color: var(--ink); }
.tl-dot { position: absolute; left: -18px; top: 18px; width: 12px; height: 12px; border-radius: 50%; background: var(--card); border: 2px solid #B4B9C6; }
.tl-item.has-note .tl-dot { background: var(--violet); border-color: var(--violet); }
.tl-item.faded { opacity: .6; }
.card .field textarea { min-height: 64px; }
.med-warn { color: var(--red); font-size: 12px; font-weight: 800; background: #FDF0EE; border-radius: 6px; padding: 3px 6px; align-self: flex-start; }
.closed-tag { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .3px; color: var(--red); } .chip.on .closed-tag { color: #fff; }
/* Running late, payments, photos */
.late-btn { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 50px; padding: 0 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font-weight: 700; text-align: left; }
.late-btn > span:first-child { color: var(--orange-ink); }
.pay-row { gap: 10px; }
.thumbs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.thumb { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--bg); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; text-decoration: none; color: var(--ink); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .pdf { font-weight: 800; color: var(--red); font-size: 14px; }
.thumb .src { position: absolute; left: 4px; bottom: 4px; font-size: 9px; font-weight: 800; background: #1F9D61; color: #fff; border-radius: 6px; padding: 1px 5px; }
.thumb.add { flex-direction: column; gap: 2px; border-style: dashed; color: var(--violet-ink); cursor: pointer; }
/* Plan and billing */
.plan-status.trial { border-left: 4px solid var(--sky); }
.plan-status.ok { border-left: 4px solid #1F9D61; }
.plan-status.warn { border-left: 4px solid var(--orange); }
.plan-status.bad { border-left: 4px solid var(--red); background: #FDF0EE; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); }
.seg button { min-height: 40px; border: none; border-radius: 999px; background: none; font-weight: 700; font-size: 13px; color: var(--muted); }
.seg button.on { background: var(--violet); color: #fff; }
.plan-card .price { font-family: var(--display); font-size: 24px; font-weight: 800; }
.plan-card.founding { border: 2px solid var(--yellow); }
.ticks { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.ticks li { padding-left: 24px; position: relative; }
.ticks li::before { content: '✓'; position: absolute; left: 2px; color: #1F9D61; font-weight: 800; }
/* Voice notes */
.voice-card { gap: 10px; border: 1.5px solid var(--violet-soft); }
.mic-btn { display: flex; align-items: center; gap: 14px; width: 100%; border: none; background: none; padding: 0; color: var(--ink); text-align: left; }
.mic-btn .small { color: var(--muted); }
.mic { width: 52px; height: 52px; border-radius: 50%; background: var(--violet); flex-shrink: 0; position: relative; }
.mic::before { content: ''; position: absolute; left: 50%; top: 13px; width: 12px; height: 18px; margin-left: -6px; border-radius: 6px; background: #fff; }
.mic::after { content: ''; position: absolute; left: 50%; top: 24px; width: 20px; height: 12px; margin-left: -10px; border: 2.5px solid #fff; border-top: none; border-radius: 0 0 12px 12px; }
.consent { color: var(--muted); font-weight: 600; }
.consent input { width: 18px; height: 18px; flex-shrink: 0; }
.rec-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--now); animation: pulse 1.2s infinite; flex-shrink: 0; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .4; transform: scale(.8); } }
.rec-clock { font-family: var(--display); font-size: 20px; font-variant-numeric: tabular-nums; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--violet-soft); border-top-color: var(--violet); animation: spin .8s linear infinite; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
.heard summary { font-size: 13px; font-weight: 700; color: var(--violet-ink); cursor: pointer; }
.heard p { margin: 6px 0 0; font-size: 13px; color: var(--muted); line-height: 1.5; }
textarea.just-filled { background: #EAF7F3; transition: background .3s; }
@media (prefers-reduced-motion: reduce) { .rec-dot, .spinner { animation: none; } }

/* Our own controls (ui.js): fields that open a panel, the time and date pickers, choices, files */
.pick-field { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; cursor: pointer; font-family: var(--body); font-size: 15px; font-weight: 400; color: var(--ink); }
.pick-field .placeholder { color: #9A9DB0; }
.pick-chev { width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg) translate(-2px, -2px); flex-shrink: 0; }
.pick-field:focus-visible, .input:focus, .field input:focus, .field textarea:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 3px var(--violet-soft); }
.choice { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 54px; padding: 0 2px; border: none; border-bottom: 1px solid #EEF0F3; background: none; text-align: left; font-size: 15px; color: var(--ink); }
.choice:last-child { border-bottom: none; }
.choice[aria-pressed="true"] { font-weight: 700; color: var(--violet-ink); }
.choice-tick { width: 24px; height: 24px; border-radius: 50%; background: var(--violet); color: #fff; font-size: 13px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.time-big { font-family: var(--display); font-size: 24px; font-weight: 800; color: var(--violet-ink); }
.time-hours { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.time-mins { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.time-hours .chip, .time-mins .chip { justify-content: center; min-height: 42px; padding: 0; background: var(--card); }
.time-hours .chip.on, .time-mins .chip.on { background: var(--violet); color: #fff; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-wd { text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); padding-bottom: 2px; }
.cal-cell { position: relative; aspect-ratio: 1; border-radius: 12px; border: 1px solid var(--line); background: var(--card); font-weight: 700; font-size: 15px; color: var(--ink); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; padding: 0; }
.cal-cell.today { border-color: var(--violet); color: var(--violet-ink); }
.cal-cell.on { background: var(--violet); border-color: var(--violet); color: #fff; }
.cal-mo { font-size: 9px; font-weight: 800; text-transform: uppercase; line-height: 1; opacity: .8; }
.sheet-text { margin: 0; font-size: 15px; line-height: 1.5; color: var(--muted); }
.btn.danger-solid { background: var(--red); color: #fff; }
.file-row { gap: 12px; }
input[type="checkbox"] { accent-color: var(--violet); width: 20px; height: 20px; }
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
textarea { resize: none; }
.btn:disabled { opacity: .45; cursor: default; }
.btn, .chip, .pick, .choice, .plan-row, .cal-cell, .list-item, .tile, .banner { transition: transform .08s ease, background-color .15s ease; }
.btn:active:not(:disabled), .chip:active, .choice:active, .plan-row:active:not(:disabled), .cal-cell:active, .tile:active, .banner:active { transform: scale(.98); }
@media (prefers-reduced-motion: reduce) { .btn, .chip, .pick, .choice, .plan-row, .cal-cell, .list-item, .tile, .banner { transition: none; } }
.sheet-bg { animation: fade-in .15s ease; }
.sheet { animation: slide-up .2s ease; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes slide-up { from { transform: translateY(28px); } }
@media (prefers-reduced-motion: reduce) { .sheet-bg, .sheet { animation: none; } }
.time-big.empty { font-size: 15px; color: var(--muted); font-family: var(--body); }
#loadbar { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--violet); z-index: 70; opacity: 0; transition: opacity .2s; pointer-events: none; }
#loadbar.on { opacity: 1; animation: loading 1.2s ease-out forwards; }
@keyframes loading { from { width: 0; } to { width: 85%; } }
