/* The companion app: one column, a tab bar, the site's own palette and type through brand.css tokens. */
:root {
  --bg: #F7F2E9; --white: #FFFDF9; --ink: #2B2B2B; --muted: #6E6A63; --line: #E4DCCF;
  --accent: #24595B; --accent-2: #24595B; --soft: #AAB6A3; --clay: #BC7058; --gold: #C49A45;
  --serif: Georgia, serif; --sans: system-ui, Arial, sans-serif;
  --card-radius: 10px; --btn-bg: var(--accent); --btn-fg: #fff; --btn-radius: 8px;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
main { min-height: 100%; display: flex; flex-direction: column; padding-bottom: calc(66px + env(safe-area-inset-bottom, 0px)); }
.top { display: flex; align-items: center; gap: 12px; padding: calc(10px + env(safe-area-inset-top, 0px)) 18px 10px; background: var(--white); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 2; }
.top .mark { width: 40px; height: 40px; border-radius: 50%; }
.top .name { font: 500 19px/1.1 var(--serif); color: var(--accent); }
.top .sub { font-size: 12px; color: var(--muted); }
.top .unread { margin-left: auto; background: var(--clay); color: #fff; font: 700 12px/18px var(--sans); min-width: 20px; text-align: center; border-radius: 10px; padding: 0 6px; }
.unread[hidden], .dot[hidden], .install[hidden], .view[hidden], [hidden] { display: none !important; }
.view { padding: 18px 18px 24px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
h1 { font: 500 26px/1.15 var(--serif); color: var(--accent); margin: 0; }
h2 { font: 500 22px/1.15 var(--serif); color: var(--accent); margin: 10px 0 2px; }
h3 { font: 500 17px/1.2 var(--serif); color: var(--accent); margin: 14px 0 0; }
p { margin: 0; }
.card, .practice, .item, .me-card, .msg .body { background: var(--white); border: 1px solid var(--line); border-radius: var(--card-radius); padding: 14px 16px; }
.muted { color: var(--muted); font-size: 14px; }
.btn, .send, .book { display: inline-block; background: var(--btn-bg); color: var(--btn-fg); border: 0; border-radius: var(--btn-radius); padding: 11px 18px; font: 600 15px var(--sans); cursor: pointer; text-decoration: none; text-align: center; }
.btn.quiet { background: transparent; color: var(--accent); border: 1px solid var(--line); }
.btn.small { padding: 7px 12px; font-size: 13px; }
.book { margin-top: 8px; }
.link { background: none; border: 0; padding: 0; color: var(--accent-2); font: 600 14px var(--sans); cursor: pointer; }

.install { background: color-mix(in srgb, var(--gold) 14%, var(--white)); border: 1px solid var(--gold); border-radius: var(--card-radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.install ol { margin: 0; padding-left: 20px; }
.today .practice { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.practice .t { flex: 1; }
.practice .t b { display: block; font-weight: 600; }
.practice .t span { display: block; font-size: 13px; color: var(--muted); }
.practice .done { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--soft); background: var(--white); color: var(--white); font-size: 18px; cursor: pointer; display: grid; place-items: center; }
.practice .done.yes { background: var(--accent); border-color: var(--accent); }
.practice .meta { font-size: 13px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.practice .meta input { border: 1px solid var(--line); border-radius: 6px; padding: 4px 6px; font: 14px var(--sans); background: var(--bg); }
.days { display: flex; gap: 4px; }
.days label { font-size: 12px; border: 1px solid var(--line); border-radius: 6px; padding: 3px 6px; cursor: pointer; background: var(--bg); }
.days input { display: none; }
.days input:checked + span { color: var(--white); }
.days label:has(input:checked) { background: var(--accent); border-color: var(--accent); color: var(--white); }
.latest .msg { margin-bottom: 8px; }

.thread { display: flex; flex-direction: column; gap: 10px; flex: 1; }
.msg { display: flex; flex-direction: column; max-width: 88%; }
.msg.client { align-self: flex-end; }
.msg .who { font-size: 12px; color: var(--muted); margin: 0 6px 3px; }
.msg.client .body { background: color-mix(in srgb, var(--accent) 10%, var(--white)); border-color: color-mix(in srgb, var(--accent) 25%, var(--white)); }
.msg.assistant .body { border-left: 3px solid var(--gold); }
.msg.coach .body { border-left: 3px solid var(--accent); }
.msg.handover .body { border: 1px solid var(--clay); background: color-mix(in srgb, var(--clay) 8%, var(--white)); }
.msg .body p { margin: 0 0 8px; } .msg .body p:last-child { margin: 0; }
.composer { display: flex; gap: 8px; align-items: flex-end; position: sticky; bottom: calc(66px + env(safe-area-inset-bottom, 0px)); background: var(--bg); padding-top: 8px; }
.composer textarea { flex: 1; resize: none; border: 1px solid var(--line); border-radius: 10px; padding: 11px 14px; font: 16px/1.4 var(--sans); background: var(--white); color: var(--ink); max-height: 40vh; }
.note { font-size: 12px; color: var(--muted); }

.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filters button { border: 1px solid var(--line); background: var(--white); border-radius: 16px; padding: 5px 11px; font: 600 13px var(--sans); color: var(--accent); cursor: pointer; }
.filters button.on { background: var(--accent); color: var(--white); border-color: var(--accent); }
.items { display: flex; flex-direction: column; gap: 8px; }
.item { display: block; text-decoration: none; color: var(--ink); }
.item b { display: block; font-weight: 600; color: var(--accent); }
.item span { font-size: 13px; color: var(--muted); }

.me-card { display: flex; flex-direction: column; gap: 10px; }
.me-card .row { display: flex; align-items: center; gap: 12px; }
.me-card img, .me-card .initial { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: var(--soft); color: var(--white); display: grid; place-items: center; font: 600 26px var(--sans); }
.me-card label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
.me-card input { border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; font: 15px var(--sans); background: var(--bg); color: var(--ink); }
.status { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.status i { width: 10px; height: 10px; border-radius: 50%; background: var(--clay); display: inline-block; }
.status i.ok { background: var(--accent); }

.tabs { position: fixed; bottom: 0; left: 0; right: 0; display: flex; background: var(--white); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); z-index: 3; }
.tabs button { flex: 1; background: none; border: 0; padding: 12px 0 10px; font: 600 12px var(--sans); color: var(--muted); cursor: pointer; position: relative; }
.tabs button.on { color: var(--accent); }
.tabs .dot { position: absolute; top: 8px; right: calc(50% - 22px); width: 8px; height: 8px; border-radius: 50%; background: var(--clay); }
.signin { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px; text-align: center; }
.signin img { border-radius: 50%; }
@media (min-width: 700px) { main { max-width: 560px; margin: 0 auto; } .tabs { max-width: 560px; margin: 0 auto; } }

/* Reader: a video player or a page's content, inside the app */
.player { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: var(--card-radius); overflow: hidden; }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.reader { background: var(--white); border: 1px solid var(--line); border-radius: var(--card-radius); padding: 18px; font-size: 17px; line-height: 1.65; overflow-wrap: anywhere; }
.reader img, .reader video, .reader iframe { max-width: 100%; height: auto; border-radius: 6px; }
.reader figure { margin: 0 0 14px; }
.reader h1, .reader h2, .reader h3 { font-family: var(--serif); color: var(--accent); font-weight: 500; line-height: 1.2; margin: 18px 0 8px; }
.reader h2 { font-size: 24px; } .reader h3 { font-size: 20px; }
.reader p { margin: 0 0 14px; }
.reader ul, .reader ol { margin: 0 0 14px; padding-left: 22px; }
.reader blockquote { margin: 0 0 14px; padding-left: 14px; border-left: 3px solid var(--soft); font-style: italic; }
.reader a { color: var(--accent-2); }
.reader .wp-block-buttons, .reader form, .reader nav, .reader svg { display: none; }
.reader .wp-block-columns { display: flex; flex-direction: column; gap: 10px; }

/* Someone is writing */
.msg.typing .body { padding: 12px 16px; }
.dots { display: inline-flex; gap: 5px; align-items: center; height: 10px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--soft); animation: dot 1.2s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: .2s; } .dots i:nth-child(3) { animation-delay: .4s; }
@keyframes dot { 0%, 80%, 100% { transform: translateY(0); opacity: .5; } 40% { transform: translateY(-4px); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .dots i { animation: none; opacity: .8; } }
.book iframe { width: 100%; min-height: 720px; border: 0; border-radius: var(--card-radius); background: var(--white); }
.page-frame { width: 100%; height: calc(100vh - 230px); min-height: 480px; border: 1px solid var(--line); border-radius: var(--card-radius); background: var(--white); }
.page-frame[hidden], .reader[hidden] { display: none; }
.transcript { margin-top: 10px; }
.transcript summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.transcript p { font-size: 15px; color: var(--ink); }
.transcript .at { font-size: 12px; color: var(--muted); margin-right: 6px; }

/* The tidy YouTube player: embed underneath, our bar on top, the title band cropped away */
.player.yt { overflow: hidden; }
.yt .yt-frame { position: absolute; left: 0; right: 0; top: -24%; height: 148%; }
.yt .yt-poster { position: absolute; inset: 0; background: #000 center / cover no-repeat; transition: opacity .3s; }
.yt.started .yt-poster { opacity: 0; pointer-events: none; }
.yt .yt-frame iframe, .yt .yt-target { width: 100%; height: 100%; border: 0; }
.yt .yt-tap { position: absolute; inset: 0 0 44px 0; cursor: pointer; }
.yt .yt-big { position: absolute; inset: 0 0 44px 0; display: grid; place-items: center; pointer-events: none; }
.yt .yt-big span { width: 64px; height: 64px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; display: grid; place-items: center; font-size: 26px; padding-left: 4px; transition: opacity .2s; }
.yt.playing .yt-big span { opacity: 0; }
.yt.ended .yt-big span::before { content: ''; }
.yt .yt-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 44px; display: flex; align-items: center; gap: 8px; padding: 0 10px; background: linear-gradient(transparent, rgba(0,0,0,.75)); color: #fff; font: 600 12px var(--sans); transition: opacity .25s; }
.yt.idle .yt-bar { opacity: 0; pointer-events: none; }
.yt .yt-bar button { background: none; border: 0; color: #fff; font-size: 15px; cursor: pointer; padding: 6px; min-width: 32px; }
.yt .yt-bar .yt-cc { font-size: 11px; border: 1px solid rgba(255,255,255,.6); border-radius: 4px; padding: 2px 5px; min-width: 0; opacity: .6; }
.yt .yt-bar .yt-cc.on { opacity: 1; background: #fff; color: #000; }
.yt .yt-seek { flex: 1; accent-color: var(--gold); height: 4px; }
.yt.wide { position: fixed; inset: 0; z-index: 20; aspect-ratio: auto; border-radius: 0; background: #000; }
.yt.wide .yt-frame { top: 0; height: 100%; }
.yt.full .yt-frame { top: 0; height: 100%; }

/* A switch */
.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 15px; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch span { width: 46px; height: 26px; border-radius: 13px; background: var(--line); position: relative; transition: background .2s; flex: none; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:disabled + span { opacity: .5; }
