/* Layout: one-column phone app, sticky top bar, fixed bottom tab bar with a big round Record button in the middle.
   Look = style (Calm Tide, Sunshine, Pebble, Clear Page) x palette (8) x Light/Dark/Auto. JS sets data-style, data-pal and the .dk class on #app. */
:root, #app {
  /* Calm Tide, light (default style) */
  --bg: #F5F8F8; --surface: #FFFFFF; --fg: #15211F; --muted: #55635F; --line: #DCE4E2; --nav-bg: #FFFFFF;
  --font-head: "Lexend", "Atkinson Hyperlegible", system-ui, sans-serif; --hw: 600; --ls: -.015em;
  --font-text: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
  --radius: 12px; --btn-r: 10px; --av-r: 10px; --bw: 1px; --shadow: none;
  --warn-soft: #FFF3D6; --warn-fg: #6B4A00; --tint2: var(--accent-soft); --tint3: var(--accent-soft);
  /* Sea palette, light (default) */
  --accent: #0F7C7A; --on-accent: #FFFFFF; --accent-soft: #DDF0EE; --accent-deep: #0B5F5D;
  --c-personal: #6d3fb0; --c-family: #b04f22; --c-supervisor: #2a5db0; --c-session: #2b7a4b; --danger: #b3261e;
  --fs: 17px; --tap: 52px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --bg: #0F1514; --fg: #EAF1EF; color-scheme: dark } }
:root[data-theme="dark"] { --bg: #0F1514; --fg: #EAF1EF; color-scheme: dark }
#app.dk { --bg: #0F1514; --surface: #182120; --fg: #EAF1EF; --muted: #9FB0AC; --line: #273332; --nav-bg: #131B1A; --warn-soft: #3A3015; --warn-fg: #FFD98A;
  --c-personal:#c9a8f5; --c-family:#f2a57e; --c-supervisor:#93b4f2; --c-session:#7fd0a0; --danger:#ff8a80; color-scheme: dark }
#app:not(.dk) { color-scheme: light }

/* Styles */
#app[data-style="sun"] { --bg:#FFFBF2; --surface:#FFFFFF; --fg:#2B2118; --muted:#75685A; --line:#F0E6D6; --nav-bg:#FFFFFF;
  --font-head:"Nunito", system-ui, sans-serif; --hw:800; --ls:-.01em; --radius:20px; --btn-r:16px; --av-r:50%; --bw:0px; --shadow:0 2px 10px rgba(120,80,20,.08); --warn-soft:#FFF0D1; --warn-fg:#6B4A00 }
#app[data-style="sun"].dk { --bg:#1C1813; --surface:#27211A; --fg:#F6EEE3; --muted:#BDAF9E; --line:#3A3127; --nav-bg:#221D17; --shadow:none; --warn-soft:#3D3115; --warn-fg:#FFD98A }
#app[data-style="peb"] { --bg:#FBFAF7; --surface:#F2EFEA; --fg:#221F2B; --muted:#655F70; --line:#E6E2DB; --nav-bg:#F2EFEA;
  --font-head:"Fredoka", system-ui, sans-serif; --hw:600; --ls:0; --font-text:"Nunito Sans", system-ui, sans-serif; --radius:26px; --btn-r:22px; --av-r:14px; --bw:0px; --shadow:none; --tint2:#DFF2E8; --tint3:#FDE7DA; --warn-soft:#FDE7DA; --warn-fg:#7A3B12 }
#app[data-style="peb"].dk { --bg:#17151F; --surface:#221F2C; --fg:#F1EEF7; --muted:#ABA5B8; --line:#2E2A3A; --nav-bg:#1D1A26; --tint2:#1D2D26; --tint3:#35251D; --warn-soft:#3A2A1E; --warn-fg:#F8C9A8 }
#app[data-style="clr"] { --bg:#FFFFFF; --surface:#FFFFFF; --fg:#111418; --muted:#464E58; --line:#C3C9D0; --nav-bg:#FFFFFF;
  --font-head:"Atkinson Hyperlegible", system-ui, sans-serif; --hw:700; --ls:0; --radius:6px; --btn-r:6px; --av-r:4px; --bw:2px; --shadow:none; --fs:18px; --warn-soft:#FFE9A8; --warn-fg:#4A3300 }
#app[data-style="clr"].dk { --bg:#0E1012; --surface:#0E1012; --fg:#F4F6F8; --muted:#B8C0C9; --line:#4A515A; --nav-bg:#0E1012; --warn-soft:#4A3B10; --warn-fg:#FFE08A }

/* Palettes */
#app[data-pal="sun"] { --accent:#F2B632; --on-accent:#2B1E00; --accent-soft:#FDF0CC; --accent-deep:#8A5A00 }
#app[data-pal="sea"] { --accent:#0F7C7A; --on-accent:#FFFFFF; --accent-soft:#DDF0EE; --accent-deep:#0B5F5D }
#app[data-pal="lav"] { --accent:#6E5BD0; --on-accent:#FFFFFF; --accent-soft:#ECE8FB; --accent-deep:#4F3FA8 }
#app[data-pal="mea"] { --accent:#3F8A4F; --on-accent:#FFFFFF; --accent-soft:#E2F1E3; --accent-deep:#2C6B3A }
#app[data-pal="ros"] { --accent:#C4566E; --on-accent:#FFFFFF; --accent-soft:#FBE5EA; --accent-deep:#9C3B52 }
#app[data-pal="sla"] { --accent:#3B5B8C; --on-accent:#FFFFFF; --accent-soft:#E3EAF4; --accent-deep:#2A4570 }
#app[data-pal="gry"] { --accent:#5F6670; --on-accent:#FFFFFF; --accent-soft:#ECEEF0; --accent-deep:#474D55 }
#app[data-pal="blk"] { --accent:#1F2328; --on-accent:#FFFFFF; --accent-soft:#E9EBEE; --accent-deep:#1F2328 }
#app.dk[data-pal="sun"] { --accent:#F5C451; --on-accent:#231800; --accent-soft:#3A2F17; --accent-deep:#F7D27A }
#app.dk[data-pal="sea"] { --accent:#4FC7C0; --on-accent:#062322; --accent-soft:#17302F; --accent-deep:#7FDCD6 }
#app.dk[data-pal="lav"] { --accent:#A99BF2; --on-accent:#17122E; --accent-soft:#2B2642; --accent-deep:#C4BAF7 }
#app.dk[data-pal="mea"] { --accent:#7CCB8C; --on-accent:#0C2312; --accent-soft:#1C2E20; --accent-deep:#A3DCB0 }
#app.dk[data-pal="ros"] { --accent:#F094A8; --on-accent:#2E0C15; --accent-soft:#3A2228; --accent-deep:#F5B3C1 }
#app.dk[data-pal="sla"] { --accent:#93B4F2; --on-accent:#0F1A2E; --accent-soft:#1E2633; --accent-deep:#B4CBF6 }
#app.dk[data-pal="gry"] { --accent:#B4BBC4; --on-accent:#15181B; --accent-soft:#262A2F; --accent-deep:#C9CFD6 }
#app.dk[data-pal="blk"] { --accent:#F2F4F6; --on-accent:#111315; --accent-soft:#2A2D31; --accent-deep:#F2F4F6 }
#app[data-size="large"] { --fs: 20px; --tap: 58px }

/* Style-specific shapes */
#app[data-style="sun"] .list, #app[data-style="peb"] .list { background: transparent; border: 0; overflow: visible; display: flex; flex-direction: column; gap: 8px }
#app[data-style="sun"] .list > .item, #app[data-style="peb"] .list > .item { border: 0; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow) }
#app[data-style="peb"] .list > .item:nth-child(3n+1) { background: var(--accent-soft) }
#app[data-style="peb"] .list > .item:nth-child(3n+2) { background: var(--tint2) }
#app[data-style="peb"] .list > .item:nth-child(3n) { background: var(--tint3) }
#app[data-style="peb"] .nav { border-top: 0; border-radius: 26px 26px 0 0 }
#app[data-style="sun"] .card, #app[data-style="sun"] .opt { box-shadow: var(--shadow) }
#app[data-style="clr"] h1 { border-bottom: 3px solid var(--accent); padding-bottom: 4px; align-self: flex-start }
#app[data-style="clr"] textarea.input { background-image: repeating-linear-gradient(to bottom, transparent 0 25px, var(--line) 25px 26px); line-height: 26px; background-attachment: local }
#app[data-style="clr"] .btn { border-color: var(--fg) }
#app[data-style="clr"] .btn.primary { border-color: var(--accent) }

html, body { height: 100% }
body { background: var(--bg); color: var(--fg); font-family: var(--font-text); }
#app { background: var(--bg); color: var(--fg); min-height: 100vh; font-size: var(--fs); line-height: 1.45; padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
* { box-sizing: border-box }
h1, h2, h3 { font-family: var(--font-head); font-weight: var(--hw); letter-spacing: var(--ls); line-height: 1.2; text-wrap: balance; margin: 0 }
h1 { font-size: 1.55em }
h2 { font-size: 1.15em }
h3 { font-size: 1em }
p { margin: 0 }
button, input, select, textarea { font: inherit; color: inherit }
button { cursor: pointer }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px }
.wrap { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); max-width: 680px; margin: 0 auto }
.stack { display: flex; flex-direction: column; gap: 12px }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap }
.grow { flex: 1; min-width: 0 }
.muted { color: var(--muted) }
.small { font-size: .86em }
.label { font-size: .78em; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 700 }

body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--bg) }
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--bg); border-bottom: 1px solid var(--line) }
.top .wrap { display: flex; align-items: center; gap: 12px; padding-block: 10px; min-height: 60px }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 }
.brand img { height: 34px; width: auto; max-width: 120px; object-fit: contain; border-radius: 6px }
.brand .mark { width: 34px; height: 34px; border-radius: var(--av-r); background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-family: var(--font-head); font-weight: 700 }
.brand .name { font-family: var(--font-head); font-weight: 600; font-size: 1.05em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.env { font-size: .72em; font-weight: 700; letter-spacing: .06em; padding: 3px 8px; border-radius: 99px; background: var(--warn-soft); color: var(--warn-fg) }
.back { border: 0; background: transparent; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; margin-left: -8px }
.back:hover { background: var(--accent-soft) }
.icon { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none }

main { padding-block: 18px }
.section { display: flex; flex-direction: column; gap: 12px; margin-bottom: 26px }

.btn { min-height: var(--tap); border-radius: var(--btn-r); border: max(var(--bw), 1.5px) solid var(--line); background: var(--surface); padding: 0 18px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; font-weight: 700; text-decoration: none; color: var(--fg) }
.btn:hover { border-color: var(--accent) }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent) }
.btn.soft { background: var(--accent-soft); border-color: transparent; color: var(--accent-deep) }
.btn.danger { color: var(--danger) }
.btn.block { width: 100% }
.btn.big { min-height: 76px; font-size: 1.15em; border-radius: 20px }
.btn[disabled] { opacity: .5; cursor: not-allowed }
.actions3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px }
.actions3.four { grid-template-columns: repeat(4, 1fr); gap: 8px }
.actions3.four .btn { font-size: .82em; padding: 6px }
.actions3 .btn { flex-direction: column; gap: 4px; min-height: 78px; padding: 8px; font-size: .9em; text-align: center }

.list { background: var(--surface); border: var(--bw) solid var(--line); border-radius: var(--radius); overflow: hidden }
.item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 0; border-top: 1px solid var(--line); background: transparent; width: 100%; text-align: left; min-height: 68px }
.item:first-child { border-top: 0 }
button.item:hover { background: var(--accent-soft) }
.avatar { width: 46px; height: 46px; border-radius: var(--av-r); display: grid; place-items: center; font-weight: 700; font-family: var(--font-head); background: var(--accent-soft); color: var(--accent-deep); flex: none }
.avatar.lg { width: 64px; height: 64px; font-size: 1.3em }
.time { font-variant-numeric: tabular-nums; font-weight: 700; min-width: 3.2em }
.chev { color: var(--muted) }

.pill { display: inline-flex; align-items: center; gap: 6px; font-size: .78em; font-weight: 700; padding: 3px 10px; border-radius: 99px; border: 1.5px solid currentColor; white-space: nowrap }
.pill.personal { color: var(--on-accent); background: var(--c-personal); font-weight: 700 } .pill.family { color: var(--c-family) } .pill.supervisor { color: var(--c-supervisor) } .pill.session { color: var(--c-session) }
.pill.draft { color: var(--warn-fg); background: var(--warn-soft); border-color: transparent }
.pill.signed { color: var(--muted) }
.pill.st-done { color: var(--c-session) } .pill.st-cancelled, .pill.st-no-show { color: var(--danger) } .pill.st-scheduled { color: var(--muted) }

.banner { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: var(--radius); background: var(--warn-soft); color: var(--warn-fg) }
.banner .btn { min-height: 44px; background: var(--surface); color: var(--fg); border-color: transparent }

.search { display: flex; align-items: center; gap: 10px; background: var(--surface); border: max(var(--bw), 1.5px) solid var(--line); border-radius: var(--btn-r); padding: 0 14px; min-height: var(--tap) }
.search input { border: 0; outline: 0; background: transparent; flex: 1; min-width: 0; min-height: 48px }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none }
.chip { border: 1.5px solid var(--line); background: var(--surface); border-radius: 99px; padding: 8px 14px; min-height: 42px; white-space: nowrap; font-weight: 700; font-size: .9em }
.chip[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg) }

.card { background: var(--surface); border: var(--bw) solid var(--line); border-radius: var(--radius); padding: 16px }
.timeline { display: flex; flex-direction: column; gap: 0 }
.tl { display: grid; grid-template-columns: 22px 1fr; gap: 12px; text-align: left; border: 0; background: transparent; padding: 0; width: 100% }
.tl .dot { position: relative; display: flex; justify-content: center }
.tl .dot::before { content: ""; position: absolute; top: 0; bottom: 0; width: 2px; background: var(--line) }
.tl .dot i { position: relative; margin-top: 18px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 3px solid var(--muted) }
.tl .dot i.personal { border-color: var(--c-personal) } .tl .dot i.family { border-color: var(--c-family) } .tl .dot i.supervisor { border-color: var(--c-supervisor) } .tl .dot i.session { border-color: var(--c-session) } .tl .dot i.appt { border-color: var(--accent); border-radius: 3px }
.tl .body { padding: 10px 0 14px; min-width: 0; display: flex; flex-direction: column; gap: 4px }
button.tl .body { border-radius: 10px }
button.tl:hover .body h3 { text-decoration: underline }
.clip { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden }

.cal-head { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-size: .78em; color: var(--muted); font-weight: 700 }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px }
.day { aspect-ratio: 1; max-width: 100%; border: 0; border-radius: 12px; background: transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-variant-numeric: tabular-nums; font-weight: 700 }
.day.out { color: var(--muted); opacity: .45 }
.day.today { outline: 2px solid var(--accent) }
.day[aria-pressed="true"] { background: var(--accent); color: var(--on-accent) }
.day .dots { display: flex; gap: 2px; height: 6px }
.day .dots b { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .7 }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--accent-soft); padding: 4px; border-radius: 14px; gap: 4px }
.seg.wrap { grid-auto-flow: row; grid-template-columns: repeat(3, 1fr) }
.seg button { border: 0; background: transparent; min-height: 44px; border-radius: 10px; font-weight: 700 }
.seg button[aria-pressed="true"] { background: var(--surface); box-shadow: 0 1px 3px rgb(0 0 0 / .15) }

.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; background: var(--nav-bg); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px) }
.nav .in { max-width: 680px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); align-items: end }
.nav a, .nav button.tab { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px 10px; text-decoration: none; color: var(--muted); font-size: .74em; font-weight: 700; border: 0; background: transparent }
.nav a[aria-current="page"] { color: var(--accent-deep) }
.nav .rec { justify-self: center; transform: translateY(-14px); width: 68px; height: 68px; border-radius: 50%; border: 4px solid var(--bg); background: var(--accent); color: var(--on-accent); display: grid; place-items: center; box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 40%, transparent) }
.nav .rec .icon { width: 30px; height: 30px }

.scrim { position: fixed; inset: 0; background: rgb(0 0 0 / .45); z-index: 20; display: flex; align-items: flex-end; justify-content: center }
.sheet { background: var(--bg); color: var(--fg); width: 100%; max-width: 680px; max-height: 92vh; max-height: calc(100dvh - max(12px, env(safe-area-inset-top, 0px))); overflow: auto; overscroll-behavior: contain; border-radius: 22px 22px 0 0; padding-block: 10px calc(22px + env(safe-area-inset-bottom, 0px)); padding-left: max(18px, env(safe-area-inset-left, 0px)); padding-right: max(18px, env(safe-area-inset-right, 0px)); display: flex; flex-direction: column; gap: 14px }
.sheet .grab { width: 44px; height: 5px; border-radius: 3px; background: var(--line); align-self: center }
.sheet-head { display: flex; align-items: center; gap: 10px; position: sticky; top: -10px; z-index: 2; background: var(--bg); margin-top: -10px; padding-block: 10px 6px; box-shadow: 0 1px 0 var(--line) }
.x { border: 0; background: var(--accent-soft); width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center }
.opt { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 14px 16px; min-height: 72px; border-radius: var(--radius); border: max(var(--bw), 1.5px) solid var(--line); background: var(--surface) }
.opt:hover { border-color: var(--accent) }
.opt .ic { width: 46px; height: 46px; border-radius: var(--av-r); background: var(--accent-soft); color: var(--accent-deep); display: grid; place-items: center; flex: none }
.cats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px }
.cat { border: 2px solid var(--line); background: var(--surface); border-radius: var(--radius); padding: 10px 12px; text-align: left; display: flex; flex-direction: column; gap: 2px; min-height: 64px }
.cat b { font-size: .95em }
.cat span { font-size: .78em; color: var(--muted) }
.cat[aria-pressed="true"].personal { border-color: var(--c-personal); background: color-mix(in srgb, var(--c-personal) 10%, var(--surface)) }
.cat[aria-pressed="true"].family { border-color: var(--c-family); background: color-mix(in srgb, var(--c-family) 10%, var(--surface)) }
.cat[aria-pressed="true"].supervisor { border-color: var(--c-supervisor); background: color-mix(in srgb, var(--c-supervisor) 10%, var(--surface)) }
.cat[aria-pressed="true"].session { border-color: var(--c-session); background: color-mix(in srgb, var(--c-session) 10%, var(--surface)) }

label.f { display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: .92em }
.input, textarea.input, select.input { width: 100%; min-height: var(--tap); border: max(var(--bw), 1.5px) solid var(--line); border-radius: var(--btn-r); background: var(--surface); padding: 10px 14px; font-weight: 400; font-size: 1em }
textarea.input { min-height: 120px; resize: vertical; line-height: 1.45 }
.check { display: flex; gap: 12px; align-items: center; min-height: 48px; font-weight: 400 }
.check input { width: 24px; height: 24px; accent-color: var(--accent) }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px }

.mic { width: 140px; height: 140px; border-radius: 50%; border: 0; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; align-self: center; position: relative }
.mic .icon { width: 54px; height: 54px }
.mic.on { background: var(--danger); color: #fff }
.mic.on::after { content: ""; position: absolute; inset: -10px; border-radius: 50%; border: 4px solid var(--danger); opacity: .5; animation: pulse 1.4s ease-out infinite }
@keyframes pulse { from { transform: scale(.9); opacity: .6 } to { transform: scale(1.2); opacity: 0 } }
@media (prefers-reduced-motion: reduce) { .mic.on::after { animation: none } }
.level { height: 8px; width: min(220px, 70%); margin: 0 auto; border-radius: 4px; background: var(--line); overflow: hidden }
.level span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .12s linear }
.timer { text-align: center; font-variant-numeric: tabular-nums; font-family: var(--font-head); font-size: 1.6em }
.transcript { background: var(--surface); border: 1px dashed var(--line); border-radius: 12px; padding: 12px 14px; min-height: 90px; white-space: pre-wrap }
mark.unsure { background: var(--warn-soft); color: var(--warn-fg); border-bottom: 2px dotted currentColor; padding: 0 2px; border-radius: 3px }
.photo { max-width: 100%; border-radius: 12px; border: 1px solid var(--line); max-height: 220px; object-fit: cover; width: 100% }

.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px }
.sw { border: 2px solid var(--line); background: var(--surface); border-radius: var(--radius); padding: 10px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; font-weight: 700; font-size: .86em }
.sw[aria-pressed="true"] { border-color: var(--fg) }
.sw i { display: flex; width: 100%; height: 26px; border-radius: 8px; overflow: hidden }
.sw i b { flex: 1 }

.note-field { display: flex; flex-direction: column; gap: 4px; padding-block: 10px; border-top: 1px solid var(--line) }
.note-field:first-child { border-top: 0 }
.note-field p { white-space: pre-wrap }
.lock { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: var(--radius); background: color-mix(in srgb, var(--c-personal) 12%, var(--surface)); color: var(--fg) }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(110px + env(safe-area-inset-bottom, 0px)); background: var(--fg); color: var(--bg); padding: 12px 18px; border-radius: 14px; z-index: 40; font-weight: 700; max-width: calc(100% - 32px); box-shadow: 0 8px 24px rgb(0 0 0 / .25) }

/* Printable pages: always light, black-and-white friendly */
.paper { background: #fff; color: #111; border-radius: 6px; box-shadow: 0 2px 10px rgb(0 0 0 / .15); padding: 22px; font-size: 13px; line-height: 1.4; color-scheme: light; overflow-x: auto }
.paper .ph { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; border-bottom: 2px solid #111; padding-bottom: 10px; margin-bottom: 12px }
.paper .ph img { max-height: 44px; max-width: 140px; object-fit: contain }
.paper h2 { font-size: 17px; color: #111 }
.paper .meta { display: grid; grid-template-columns: repeat(4, auto); gap: 4px 14px; font-size: 12px }
.paper .fld { margin-bottom: 10px }
.paper .fld b { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .05em }
.paper .foot { border-top: 1px solid #999; margin-top: 14px; padding-top: 6px; font-size: 10.5px; display: flex; justify-content: space-between }
.boxsheet .bx { border: 2.5px solid #111; border-radius: 4px; margin-bottom: 10px; position: relative; min-height: 120px; padding: 22px 10px 8px }
.boxsheet .bx > span { position: absolute; top: -1px; left: -1px; background: #111; color: #fff; font-weight: 700; font-size: 11px; padding: 3px 8px; border-radius: 3px 0 4px 0; letter-spacing: .04em }
.boxsheet .bx.tall { min-height: 190px }
.boxsheet .ticks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px 10px; font-size: 12px }
.boxsheet .ticks i { display: inline-block; width: 12px; height: 12px; border: 1.5px solid #111; margin-right: 6px; vertical-align: -2px }
.boxsheet .lines { background-image: repeating-linear-gradient(transparent 0 25px, #bbb 25px 26px); height: 100%; min-height: 90px }

/* Scanner */
.scan-stage { position: relative; width: 100%; max-width: 100%; max-height: 58vh; margin: 0 auto; border-radius: 10px; overflow: hidden; background: #000; touch-action: none }
.scan-stage img, .scan-stage svg { position: absolute; inset: 0; width: 100%; height: 100% }
.scan-stage img { object-fit: fill }
#scan-poly { fill: color-mix(in srgb, var(--accent) 22%, transparent); stroke: var(--accent); stroke-width: .5%; vector-effect: non-scaling-stroke }
#scan-svg .handle { fill: #fff; stroke: var(--accent); stroke-width: 3px; vector-effect: non-scaling-stroke; cursor: grab }
.pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px }
.pages figure { margin: 0; display: flex; flex-direction: column; gap: 4px; font-size: .8em; color: var(--muted) }
.pages img { width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: #fff }
.addpage { aspect-ratio: 3/4; border: 2px dashed var(--line); border-radius: 8px; background: transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--accent-deep); font-weight: 700; font-size: .85em }
.linkbtn { border: 0; background: none; color: var(--danger); font-weight: 700; padding: 0 0 0 4px; font-size: 1em }
.thumb { width: 44px; height: 58px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); background: #fff; flex: none }
.docpage { width: 100%; border-radius: 6px; border: 1px solid var(--line); background: #fff; box-shadow: 0 2px 10px rgb(0 0 0 / .08) }

@media print {
  body * { visibility: hidden }
  #print-area, #print-area * { visibility: visible }
  #print-area { position: absolute; inset: 0; box-shadow: none; padding: 0 }
}
@media (max-width: 380px) { .actions3 .btn { font-size: .8em } .cats { grid-template-columns: 1fr } }

/* Personal (private) notes stand out everywhere: purple, a lock, and "Private · only you". */
.tl.private .body { background: color-mix(in srgb, var(--c-personal) 9%, transparent); border-left: 4px solid var(--c-personal); padding-left: 10px; padding-right: 8px }
.lock.private { border: 2px solid var(--c-personal); background: color-mix(in srgb, var(--c-personal) 14%, var(--surface)) }
.lock.private svg { color: var(--c-personal) }
.cat.personal { border-style: dashed }
.cat.personal b { color: var(--c-personal) }
.doccols { grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 8px; margin-bottom: 12px }
.doccols .sw { padding: 8px; gap: 4px; font-size: .78em; min-height: 48px }
.doccols .sw i { height: 22px }
.flabel { font-weight: 700 }
.ticks { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px }
.tick { min-height: 44px; padding: 8px 14px; border-radius: 999px; border: 2px solid var(--line); background: var(--surface); color: var(--fg); font: inherit; font-weight: 600 }
.tick[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--fg) }
.tick[aria-pressed="true"]::before { content: "✓ "; font-weight: 800 }
.tplf { padding: 12px }
div.f { display: flex; flex-direction: column; gap: 6px; font-size: .92em }
/* App lock */
#lock { position: fixed; inset: 0; z-index: 100; background: var(--bg, #F5F8F8); color: var(--fg, #111); display: grid; place-items: center; overflow: auto; padding: max(24px, env(safe-area-inset-top, 0px)) 16px max(24px, env(safe-area-inset-bottom, 0px)) }
.lockin { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 14px; align-items: stretch }
.lockin .brand img { max-height: 44px; max-width: 160px; object-fit: contain }
.pindots { display: flex; justify-content: center; gap: 14px; margin: 6px 0 }
.pindots i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--accent, #0F7C7A) }
.pindots i.on { background: var(--accent, #0F7C7A) }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; justify-items: center; max-width: 300px; margin: 0 auto; width: 100% }
.key { width: 76px; height: 76px; border-radius: 50%; border: 2px solid var(--line, #ccd); background: var(--surface, #fff); color: var(--fg, #111); font: inherit; font-size: 1.6em; font-weight: 700 }
.key:active { background: var(--accent-soft, #dff) }
body.veil #app { filter: blur(18px) }
/* Booking clash warning */
.clash { padding: 12px 14px; border-radius: var(--radius); background: var(--warn-soft); color: var(--warn-fg); display: grid; gap: 6px }
.clash b { display: flex; gap: 8px; align-items: center }
.clash ul { margin: 0; padding-left: 20px }
/* Action items: a round tick to mark one done */
.tickbox { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); color: transparent; display: grid; place-items: center; padding: 0; cursor: pointer }
.tickbox .icon { width: 22px; height: 22px }
.tickbox:hover, .tickbox:focus-visible { border-color: var(--accent); color: var(--accent) }
.act-row { min-height: 60px; gap: 12px }
.late { color: var(--danger, #b3261e); font-weight: 600 }
