/* EmptyHands student app & coach panel. Same palette as the main site (assets/css/style.css). */
:root {
  --paper: #f6f2ea;
  --paper-2: #ede6d9;
  --paper-3: #e3d9c7;
  --card: #fffdf8;
  --ink: #1c1a16;
  --ink-2: #4b463d;
  --ink-3: #7b7466;
  --bronze: #7a684a;
  --bronze-2: #a48c62;
  --seal: #a8342a;
  --seal-2: #8e2a21;
  --night: #14120f;
  --line: rgba(28, 26, 22, .12);
  --ok: #3d6b3f;
  --warn: #9a5b12;

  /* Calendar key — matches the colours on the printed dojo calendar. */
  --c-training: #f3d63a;
  --c-closed: #d23a2c;
  --c-blackbelt: #1c1a16;
  --c-grading: #ec9a2a;

  --serif: "Shippori Mincho", "Hiragino Mincho ProN", "Yu Mincho", Georgia, serif;
  --sans: "Karla", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 10px;
  --tabbar-h: 84px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--paper); color: var(--ink);
  font: 400 16px/1.55 var(--sans); -webkit-font-smoothing: antialiased;
}
body.has-tabbar { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 16px); }
img { max-width: 100%; display: block; }
a { color: var(--seal); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--seal); outline-offset: 2px; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; margin: 0 0 .4em; }
h1 { font-size: clamp(1.7rem, 5vw, 2.4rem); }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .8em; }
code { font-size: .9em; background: rgba(0, 0, 0, .06); padding: 1px 5px; border-radius: 4px; }
small { color: var(--ink-3); font-weight: 400; }
.muted { color: var(--ink-3); }
.fine { font-size: .85rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .72rem; font-weight: 700; color: var(--bronze); margin: 0 0 .4em; }

.demo-banner { background: #f8e7b0; color: #5a4310; font-size: .85rem; padding: 8px 16px; text-align: center; }

/* Top bar */
.app-top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
  background: rgba(246, 242, 234, .92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.app-top--dark { background: var(--night); color: var(--paper); border-color: transparent; }
.app-brand img { height: 44px; width: auto; border-radius: 8px; }
.app-title { font-family: var(--serif); font-weight: 600; font-size: 1.05rem; padding-left: 12px; border-left: 1px solid currentColor; opacity: .85; }
.app-user { margin-left: auto; font-weight: 700; font-size: .9rem; background: var(--paper-2); padding: 4px 12px; border-radius: 99px; }

.app-main { max-width: 980px; margin: 0 auto; padding: 24px 16px 40px; }
.app-main--wide { max-width: 1240px; }

/* Loading */
.loading { display: grid; place-items: center; min-height: 60vh; padding: 16px; text-align: center; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--paper-3); border-top-color: var(--seal); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 20px;
  border: 1px solid var(--ink); border-radius: 99px; background: var(--ink); color: var(--paper);
  font-weight: 700; font-size: .95rem; text-decoration: none; cursor: pointer; transition: background .15s, opacity .15s;
}
.btn:hover { background: #000; }
.btn--seal { background: var(--seal); border-color: var(--seal); color: #fff; }
.btn--seal:hover { background: var(--seal-2); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { background: var(--paper-2); }
.btn--light { color: var(--paper); border-color: rgba(246, 242, 234, .3); }
.btn--light:hover { background: rgba(246, 242, 234, .1); }
.btn--sm { min-height: 38px; padding: 6px 14px; font-size: .88rem; }
.btn--block { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.is-busy { opacity: .7; cursor: progress; }
.linkish { background: none; border: 0; padding: 4px 0; color: var(--seal); font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.linkish.danger { color: var(--seal-2); }
.row-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 16px; }

/* Forms */
.stack { display: grid; gap: 14px; }
label { display: grid; gap: 6px; font-weight: 700; font-size: .9rem; }
input:not([type=checkbox]):not([type=radio]), select, textarea {
  width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--paper-3); border-radius: 8px;
  background: #fff; font-weight: 400; font-size: 1rem;
}
textarea { resize: vertical; min-height: 0; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--bronze); box-shadow: 0 0 0 3px rgba(164, 140, 98, .25); }
input:disabled { background: var(--paper-2); }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-weight: 700; font-size: .9rem; margin-bottom: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid var(--paper-3); border-radius: 99px; background: #fff; cursor: pointer; font-weight: 500; }
.chip:has(input:checked) { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.chip input { accent-color: var(--seal); margin: 0; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.form-error { color: var(--seal-2); background: #f8e1dd; padding: 10px 12px; border-radius: 8px; margin: 0; font-size: .92rem; }
.inline-form { display: flex; gap: 8px; }

/* Auth */
.auth { display: grid; place-items: start center; }
.auth-card { width: 100%; max-width: 460px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 28px 22px; box-shadow: 0 20px 50px -30px rgba(20, 18, 15, .4); position: relative; overflow: hidden; }
.auth-kanji { position: absolute; right: -6px; top: -12px; font-family: var(--serif); font-size: 6rem; line-height: 1; color: var(--paper-2); pointer-events: none; writing-mode: vertical-rl; }
.auth-card > * { position: relative; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--paper-2); border-radius: 99px; padding: 4px; margin: 18px 0; }
.seg button { border: 0; background: none; padding: 9px; border-radius: 99px; font-weight: 700; cursor: pointer; color: var(--ink-2); }
.seg button[aria-selected=true] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }

/* Cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 26px 0 10px; }
.card-head h2 { margin: 0; }
.view-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 14px; }
.view-head h1 { margin: 0; }
.view-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.view-actions select { width: auto; min-height: 38px; padding: 6px 10px; }
.empty { text-align: center; padding: 34px 16px; color: var(--ink-3); border: 1px dashed var(--paper-3); border-radius: var(--radius); }
.empty span { font-family: var(--serif); font-size: 2.4rem; color: var(--bronze-2); display: block; }

/* Home */
.greeting { margin-bottom: 18px; }
.next-card { background: var(--night); color: var(--paper); border: 0; padding: 22px; display: grid; gap: 14px; }
.next-when strong { display: block; font-family: var(--serif); font-size: 1.9rem; line-height: 1.1; }
.next-when span { color: var(--bronze-2); }
.next-what { display: flex; gap: 12px; align-items: center; padding-top: 14px; border-top: 1px solid rgba(246, 242, 234, .14); }
.next-what b, .next-what small { display: block; }
.next-what small { color: rgba(246, 242, 234, .65); }
.next-what .swatch { width: 18px; height: 18px; outline: 1px solid rgba(255, 255, 255, .25); }
.next-warn { margin: 0; background: rgba(210, 58, 44, .2); color: #ffd9d3; padding: 8px 12px; border-radius: 8px; font-size: .92rem; }
.home-grid { display: grid; gap: 4px 28px; }
@media (min-width: 800px) { .home-grid { grid-template-columns: 1fr 1fr; } }
.upcoming { list-style: none; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.upcoming li { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; border-top: 1px solid var(--line); }
.upcoming li:first-child { border-top: 0; }
.upcoming b, .upcoming small { display: block; }
.upcoming time { text-align: right; font-weight: 700; font-size: .92rem; white-space: nowrap; }
.upcoming time small { font-weight: 400; }

/* Notices */
.notice { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--paper-3); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; }
.notice.is-new { border-left-color: var(--seal); }
.notice header { display: flex; justify-content: space-between; gap: 10px; font-size: .78rem; color: var(--ink-3); margin-bottom: 4px; }
.notice .aud { text-transform: uppercase; letter-spacing: .1em; font-weight: 700; color: var(--bronze); }
.notice.is-new .aud::before { content: "New · "; color: var(--seal); }
.notice h3 { margin-bottom: 4px; }
.notice p { margin: 0; color: var(--ink-2); overflow-wrap: anywhere; }
.notice footer { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: .88rem; color: var(--ink-3); font-style: italic; }
.notice footer .linkish { font-style: normal; }

/* Coach notices are bold everywhere students see them. */
.notice--coach h3, .notice--coach p { font-weight: 700; color: var(--ink); }

/* EmptyHands chats */
.chat-intro { margin-bottom: 10px; }
.chat-feed { display: flex; flex-direction: column; gap: 10px; padding-bottom: 8px; }
.chat-feed .notice { margin: 4px 0; }
.msg { max-width: min(82%, 560px); align-self: flex-start; }
.msg--mine { align-self: flex-end; text-align: right; }
.msg-meta { font-size: .76rem; color: var(--ink-3); margin: 0 6px 3px; }
.msg-text { display: inline-block; text-align: left; padding: 10px 14px; border-radius: 16px 16px 16px 4px; background: var(--card); border: 1px solid var(--line); overflow-wrap: anywhere; }
.msg--mine .msg-text { border-radius: 16px 16px 4px 16px; background: var(--ink); color: var(--paper); border-color: var(--ink); }
.msg--coach .msg-text { font-weight: 700; }
.msg--coach:not(.msg--mine) .msg-text { border-left: 3px solid var(--seal); }
.msg.is-editing { width: min(82%, 560px); }
.msg-edit { display: flex; flex-direction: column; gap: 6px; }
.msg-edit textarea { width: 100%; font: inherit; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--ink); resize: vertical; }
.msg-edit-actions { display: flex; gap: 8px; justify-content: flex-end; }
.msg.is-new .msg-meta::before { content: "New · "; color: var(--seal); font-weight: 700; }
.chat-compose {
  position: sticky; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); display: grid; gap: 6px;
  background: var(--paper); padding: 10px 0; border-top: 1px solid var(--line);
}
.coach .chat-compose { bottom: 0; }
.chat-pane .chat-compose { background: transparent; }
.chat-row { display: flex; gap: 8px; align-items: flex-end; }
.chat-row textarea { min-height: 46px; max-height: 160px; resize: none; }
.chat-from { display: flex; align-items: center; gap: 8px; font-size: .82rem; }
.chat-from select { width: auto; min-height: 34px; padding: 4px 8px; font-size: .9rem; }
.pending-card { text-align: center; padding: 30px 20px; }
.pending-kanji { font-family: var(--serif); font-size: 3rem; color: var(--bronze-2); line-height: 1; margin-bottom: 8px; }
.pending-mini { font-size: .95rem; }

/* Key dates under the calendar */
.keydates { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); margin-bottom: 18px; }
.keydates-group h2 { display: flex; align-items: center; gap: 10px; font-size: 1.05rem; }
.keydates-group h2 small { margin-left: auto; background: var(--paper-2); padding: 0 8px; border-radius: 99px; font-family: var(--sans); font-size: .8rem; }
.keydates-group ul { list-style: none; margin: 0; padding: 0; }
.keydates-group li { display: grid; grid-template-columns: 96px 1fr auto; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); font-size: .92rem; }
.keydates-group li:first-child { border-top: 0; }
.keydates-group li time { font-weight: 700; }
.keydates-group li.is-past { opacity: .45; }

/* Calendar */
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 4px 0 12px; font-size: .9rem; }
.legend-item { display: inline-flex; align-items: center; gap: 8px; }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 4px; flex: none; vertical-align: -2px; }
.swatch.t-note { background: #fff; border: 2px solid var(--bronze); border-radius: 50%; }
.swatch.t-clear { background: #fff; border: 1px dashed var(--ink-3); }
.t-training, .cal-day.t-training { background: var(--c-training); color: var(--ink); }
.t-closed, .cal-day.t-closed { background: var(--c-closed); color: #fff; }
.t-blackbelt, .cal-day.t-blackbelt { background: var(--c-blackbelt); color: #fff; }
.t-grading, .cal-day.t-grading { background: var(--c-grading); color: var(--ink); }
.cal-tools { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.cal-links { display: flex; gap: 8px; }
.switch { display: inline-flex; align-items: center; gap: 10px; font-weight: 500; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch span { width: 42px; height: 24px; border-radius: 99px; background: var(--paper-3); position: relative; transition: background .15s; flex: none; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.switch input:checked + span { background: var(--ink); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--seal); outline-offset: 2px; }

.cal-year { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 272px), 1fr)); margin-bottom: 18px; }
.cal-month { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 12px 12px; scroll-margin-top: 80px; }
.cal-month h3 { text-transform: uppercase; letter-spacing: .12em; font-family: var(--sans); font-size: .8rem; font-weight: 700; color: var(--bronze); margin: 0 0 8px 4px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-dow { text-align: center; font-size: .7rem; font-weight: 700; color: var(--ink-3); padding-bottom: 2px; }
.cal-day {
  aspect-ratio: 1; display: grid; place-items: center; border: 0; border-radius: 6px; background: none;
  font-size: .9rem; font-variant-numeric: tabular-nums; position: relative; padding: 0; min-width: 0;
}
button.cal-day { cursor: pointer; font-weight: 700; }
button.cal-day:hover { filter: brightness(.94); box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .15); }
.cal-day.is-past:not(.is-today) { opacity: .45; }
.cal-day.is-today { box-shadow: inset 0 0 0 2px var(--seal); color: var(--seal); font-weight: 700; }
.cal-day.is-today[class*="t-"] { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--seal); }
.cal-day.is-faded { opacity: .3; }
.cal-day.is-hidden-type { background: none; color: inherit; font-weight: 400; }
.cal-day.has-note::after { content: ""; position: absolute; top: 3px; right: 3px; width: 6px; height: 6px; border-radius: 50%; background: var(--bronze); box-shadow: 0 0 0 1.5px #fff; }
.cal-year--edit .cal-day { cursor: pointer; }
.cal-year--edit .cal-day:not([class*="t-"]):hover { background: var(--paper-2); }

.timings ul { list-style: none; padding: 0; margin: 0; }
.timings li { padding: 4px 0; color: var(--ink-2); }
.timings li.th { font-weight: 700; color: var(--ink); text-transform: uppercase; letter-spacing: .06em; font-size: .82rem; padding-top: 12px; }
.timings li.th:first-child { padding-top: 0; }

/* Bottom dock (student): a floating rounded tab bar plus a round Message Sensei button */
.dock {
  position: fixed; left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 30;
  display: flex; gap: 10px; align-items: center; max-width: 560px; margin: 0 auto;
}
.tabbar {
  flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; height: 66px; padding: 6px; border-radius: 99px;
  background: rgba(28, 26, 22, .86); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: 0 14px 36px -12px rgba(0, 0, 0, .5);
}
.tabbar button {
  border: 0; background: none; color: rgba(246, 242, 234, .72); display: grid; place-items: center; align-content: center; border-radius: 99px;
  gap: 2px; font-size: .72rem; font-weight: 700; letter-spacing: .02em; cursor: pointer; position: relative; transition: background-color .2s, color .2s;
}
.tabbar svg, .dock-action svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabbar button[aria-current] { background: var(--paper); color: var(--seal); }
.dock-action {
  flex: none; width: 66px; height: 66px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; color: var(--paper);
  background: rgba(28, 26, 22, .86); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: 0 14px 36px -12px rgba(0, 0, 0, .5);
}
.dock-action svg { width: 28px; height: 28px; }
.badge { position: absolute; top: 4px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--seal); color: #fff; font-size: .7rem; line-height: 18px; text-align: center; }
.tabbar button[aria-current] .badge { background: var(--seal); }

/* Dialog sheet */
dialog.sheet { border: 0; border-radius: 16px; padding: 22px; width: min(440px, calc(100% - 32px)); background: var(--card); color: var(--ink); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .5); }
dialog.sheet::backdrop { background: rgba(20, 18, 15, .5); }
dialog.sheet h2 { font-size: 1.4rem; }
.day-note { background: var(--paper-2); padding: 10px 12px; border-radius: 8px; }
@media (max-width: 600px) {
  dialog.sheet { margin: auto 0 0; width: 100%; max-width: 100%; border-radius: 18px 18px 0 0; padding-bottom: calc(22px + env(safe-area-inset-bottom)); }
}

/* Toasts */
#toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 18px); z-index: 50; display: grid; gap: 8px; width: min(420px, calc(100% - 32px)); pointer-events: none; }
.toast { background: var(--ink); color: var(--paper); padding: 12px 16px; border-radius: 10px; font-size: .92rem; box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .5); animation: up .2s ease-out; transition: opacity .3s, transform .3s; }
.toast.bad { background: var(--seal-2); }
.toast.out { opacity: 0; transform: translateY(6px); }
@keyframes up { from { opacity: 0; transform: translateY(8px); } }
.coach #toasts { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 18px); }

/* Coach panel */
.coach-tabs { display: grid; gap: 2px; }
.coach-tabs button { display: flex; align-items: center; justify-content: space-between; }
.coach-tabs button[aria-current] { background: var(--ink); color: var(--paper); }
.coach-tabs .count { font-size: .75rem; background: var(--seal); color: #fff; border-radius: 99px; padding: 1px 8px; }
.coach-tabs .count:empty { display: none; }
.side-site { display: block; padding: 13px 10px; font-weight: 600; color: var(--ink); text-decoration: none; }
/* Sensei panel top bar (on every page but Home) */
.coach .app-top--dark { gap: 12px; }
.coach .app-top--dark .app-title { font-size: 1.15rem; }
.coach #signout { margin-left: auto; }
.hero-round--sm { width: 44px; height: 44px; }
@media (max-width: 600px) { .coach .app-top--dark .app-brand { display: none; } }
/* Sensei Home: what needs attention */
.todo-list { display: grid; gap: 10px; }
.todo-item { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: 18px; background: #fff; color: var(--ink); text-align: left; cursor: pointer; font: inherit; }
.todo-item b { display: block; }
.todo-item small { display: block; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60vw; }
.todo-item .quick-icon { flex: none; }
.coach-cols { display: grid; gap: 20px; align-items: start; margin-top: 18px; }
@media (min-width: 900px) { .coach-cols { grid-template-columns: minmax(340px, 1fr) 1.3fr; } }
.coach-cols .card-head { margin-top: 0; }
.pill { display: inline-block; vertical-align: middle; font-family: var(--sans); font-size: .75rem; font-weight: 700; padding: 3px 10px; border-radius: 99px; letter-spacing: .02em; }
.pill.ok { background: #e1eedf; color: var(--ok); }
.pill.warn { background: #f8e7cc; color: var(--warn); }
.brushes { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 6px 0 8px; }
.brush-label { font-weight: 700; font-size: .9rem; margin-right: 4px; }
.brush { display: inline-flex; flex-direction: row; align-items: center; gap: 8px; padding: 7px 14px; border: 1px solid var(--paper-3); border-radius: 99px; background: #fff; cursor: pointer; font-weight: 500; }
.brush input { position: absolute; opacity: 0; }
.brush:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); font-weight: 700; }
.brush:has(input:focus-visible) { outline: 2px solid var(--seal); outline-offset: 2px; }
.legend small { background: var(--paper-2); padding: 0 7px; border-radius: 99px; color: var(--ink-2); }
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.filters input { flex: 1 1 240px; }
.filters select { flex: 0 1 220px; }
.table-wrap { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
table.students { width: 100%; border-collapse: collapse; font-size: .92rem; }
.students th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.students td { padding: 12px 14px; border-top: 1px solid var(--line); vertical-align: top; }
.students td small { display: block; }
.students tr:first-child td { border-top: 0; }
.tag { display: inline-block; font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--paper-2); margin: 1px 0; }
@media (max-width: 700px) {
  .students thead { display: none; }
  .students tr { display: block; padding: 10px 14px; border-top: 1px solid var(--line); }
  .students tr:first-child { border-top: 0; }
  .students td { display: flex; gap: 12px; padding: 3px 0; border: 0; }
  .students td::before { content: attr(data-th); flex: 0 0 74px; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); padding-top: 2px; }
  .students td small { display: inline; margin-left: 6px; }
}
/* Phone app (Capacitor) */
.is-native #cal-pdf { display: none !important; }
.is-native .app-brand { pointer-events: none; }
.is-native body { -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
.is-native input, .is-native textarea, .is-native .notice p { -webkit-user-select: text; user-select: text; }

ul.plain { list-style: none; margin: 0; padding: 0; }
ul.plain li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
ul.plain li:first-child { border-top: 0; }

/* Coach panel: join requests */
.requests { display: grid; gap: 12px; margin-top: 14px; }
.request { display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between; align-items: center; border-left: 4px solid var(--seal); }
.request h3 { margin-bottom: 2px; }
.request p { margin: 4px 0; }
.request-actions { display: flex; gap: 8px; }

/* Coach panel: EmptyHands chats. Every chat panel is the same fixed height; messages scroll inside. */
.menu-layout { display: grid; gap: 16px; grid-template-columns: minmax(240px, 320px) 1fr; align-items: start; }
.chat-list { padding: 10px; height: clamp(420px, calc(100dvh - 210px), 760px); overflow: auto; overscroll-behavior: contain; }
.chat-list input { margin-bottom: 8px; }
.chat-list ul { list-style: none; margin: 0; padding: 0; }
.chat-item { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; width: 100%; text-align: left; border: 0; background: none; padding: 10px; border-radius: 8px; cursor: pointer; }
.chat-item:hover { background: var(--paper-2); }
.chat-item.is-open { background: var(--paper-2); box-shadow: inset 3px 0 0 var(--seal); }
.chat-item time { font-size: .75rem; color: var(--ink-3); }
.chat-item small { grid-column: 1 / -1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.unread-n { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 6px; border-radius: 99px; background: var(--seal); color: #fff; font-size: .72rem; line-height: 20px; text-align: center; vertical-align: middle; }
.chat-item.is-unread small { color: var(--ink); font-weight: 700; }
.chat-pane { --pane-h: clamp(420px, calc(100dvh - 210px), 760px); height: var(--pane-h); display: flex; flex-direction: column; }
#chat-open:not([hidden]) { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.chat-pane .empty { margin: auto; }
.chat-head { display: flex; gap: 12px; align-items: flex-start; border-bottom: 1px solid var(--line); padding-bottom: 10px; margin-bottom: 10px; }
.chat-head h2 { margin: 0; }
.chat-head p { margin: 0; }
.chat-back { display: none; }
.chat-feed--scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px 4px 8px; }
.chat-pane > p, .chat-head, .chat-pane .chat-compose { flex: none; }
.center { text-align: center; }
@media (max-width: 760px) {
  .menu-layout { grid-template-columns: 1fr; }
  .menu-layout.is-open .chat-list { display: none; }
  .menu-layout:not(.is-open) .chat-pane { display: none; }
  .chat-list { height: auto; }
  .chat-back { display: inline; }
  .chat-head { flex-direction: column; gap: 4px; }
}

/* Student: name chip opens the profile */
button.app-user { border: 0; cursor: pointer; }
button.app-user[aria-current] { background: var(--ink); color: var(--paper); }


/* EmptyHands chats: channels + recommended channel */
.menu-grid { display: grid; gap: 18px; align-items: start; }
@media (min-width: 900px) { .menu-grid { grid-template-columns: 1fr 260px; } .recommend { position: sticky; top: 84px; } }
.channels { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 10px; padding: 0 16px 2px; }
.channels button { flex: none; border: 1px solid var(--paper-3); background: #fff; border-radius: 99px; padding: 8px 14px; font-weight: 700; font-size: .88rem; cursor: pointer; position: relative; color: var(--ink-2); }
.channels button { transition: background-color .2s, color .2s, border-color .2s; }
.channels button[aria-selected=true] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.channels .dot { position: absolute; top: 4px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--seal); }
.recommend { border-top: 4px solid var(--seal); }
.recommend h2 { font-size: 1.15rem; }
.recommend .btn::before { content: "▶"; font-size: .7rem; }
@media (max-width: 899px) {
  .recommend { order: -1; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-top-width: 0; border-left: 4px solid var(--seal); }
  .recommend .eyebrow, .recommend p.muted { display: none; }
  .recommend h2 { margin: 0; flex: 1; font-size: .95rem; }
  .recommend h2::before { content: "Recommended: "; font-family: var(--sans); font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--bronze); display: block; }
  .recommend .btn { min-height: 34px; padding: 4px 12px; font-size: .82rem; }
}

/* Homework */
.homework { display: grid; gap: 10px; }
.hw { display: flex; flex-direction: row; gap: 14px; align-items: flex-start; cursor: pointer; font-weight: 400; font-size: 1rem; }
.hw input { position: absolute; opacity: 0; }
.hw-tick { flex: none; width: 28px; height: 28px; border: 2px solid var(--bronze-2); border-radius: 8px; display: grid; place-items: center; margin-top: 2px; transition: background .15s; }
.hw input:checked + .hw-tick { background: var(--ok); border-color: var(--ok); }
.hw input:checked + .hw-tick::after { content: ""; width: 7px; height: 13px; border: solid #fff; border-width: 0 3px 3px 0; transform: translateY(-2px) rotate(45deg); }
.hw input:focus-visible + .hw-tick { outline: 2px solid var(--seal); outline-offset: 2px; }
.hw-body { display: grid; gap: 4px; }
.hw-details { color: var(--ink-2); }
.hw.is-done b { text-decoration: line-through; color: var(--ink-3); }
.hw.is-done { background: var(--paper-2); }
.hw.is-late small { color: var(--seal-2); font-weight: 700; }

/* Syllabus */
.syllabus { display: grid; gap: 14px; }
.syllabus img { width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--line); background: #fff; box-shadow: 0 10px 30px -20px rgba(0, 0, 0, .4); }
.is-native #syl-pdf { display: none; }

/* Coach panel: channel switcher and homework */
.menu-switch { margin: 0 0 14px; padding: 0; }
.menu-switch button { flex: none; }
.hw-admin { display: grid; gap: 12px; }
.hw-admin .hw-progress { height: 8px; background: var(--paper-2); border-radius: 99px; overflow: hidden; margin: 6px 0; }
.hw-admin .hw-progress span { display: block; height: 100%; background: var(--ok); }
.hw-admin details summary { cursor: pointer; font-weight: 700; font-size: .9rem; }
.hw-admin ul { margin: 6px 0 0; padding-left: 18px; font-size: .9rem; }
.hw-admin .done { color: var(--ok); }

/* Coach panel: belt picker in the Students table */
.belt-select { width: auto; min-height: 36px; padding: 4px 8px; font-size: .9rem; }

/* Pay fees */
.pay-cta { display: flex; align-items: center; gap: 14px; width: 100%; margin-top: 12px; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.pay-cta b, .pay-cta small { display: block; }
.pay-cta > span:last-child { margin-left: auto; font-weight: 700; color: var(--seal); }
.pay-cta-icon { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: #003087; color: #fff; font-weight: 700; flex: none; }
.fees { display: grid; gap: 18px; margin: 12px 0; }
.fee-group h2 { margin-bottom: 8px; }
.fee-group.is-other { opacity: .75; }
.fee { display: grid; grid-template-columns: 1fr auto; gap: 8px 14px; align-items: center; margin-bottom: 8px; }
.fee-main small, .fee-price small { display: block; }
.fee-price { text-align: right; }
.fee-price b { font-size: 1.2rem; }
.fee .btn--paypal { grid-column: 1 / -1; }
@media (min-width: 640px) { .fee { grid-template-columns: 1fr auto auto; } .fee .btn--paypal { grid-column: auto; } }
.fee.is-yours { border-color: var(--seal); box-shadow: inset 4px 0 0 var(--seal); }
.btn--paypal { background: #ffc439; border-color: #ffc439; color: #111; }
.btn--paypal:hover { background: #f0b52a; }
.tag--seal { background: var(--seal); color: #fff; }

/* Coach panel: fee editor */
.fees-admin input, .fees-admin select { min-height: 38px; padding: 6px 8px; font-size: .9rem; }
.fees-admin td { vertical-align: middle; }
.fees-admin td:nth-child(3) input { width: 90px; }
.fees-admin td:nth-child(4) input { width: 100px; }
.fees-admin td:last-child { white-space: nowrap; }

/* Fee status and history */
.pay-status { margin-bottom: 12px; border-left: 4px solid var(--seal); }
.pay-status b, .pay-status small { display: block; }
.pay-status.is-paid { border-left-color: var(--ok); background: #eef5ec; }
.pay-status.is-paid b { color: var(--ok); }
.pay-history { list-style: none; margin: 0 0 18px; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.pay-history li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--line); }
.pay-history li:first-child { border-top: 0; }
.pay-history small { display: block; }
.tag--ok { background: #e1eedf; color: var(--ok); }
.paid-tracker { margin-bottom: 16px; }
.paid-tracker .card-head { margin-top: 0; flex-wrap: wrap; }
.paid-tracker h3 { margin-top: 14px; font-size: 1rem; }

/* Whole fee card is the PayPal link */
.fee--link { text-decoration: none; color: inherit; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .1s; }
.fee--link:hover { border-color: #f0b52a; box-shadow: 0 6px 18px -10px rgba(0, 0, 0, .35); }
.fee--link:active { transform: scale(.99); }
.fee--link .btn--paypal { pointer-events: none; }

/* Pay fees: per lesson / per month choice for each class */
.fee-class h2 { margin-bottom: 10px; }
.fee-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fee-option { display: grid; gap: 2px; align-content: start; padding: 14px; border: 1px solid var(--paper-3); border-radius: var(--radius); background: #fff; text-decoration: none; color: inherit; }
a.fee-option { cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .1s; }
a.fee-option:hover { border-color: #f0b52a; box-shadow: 0 6px 18px -10px rgba(0, 0, 0, .35); }
a.fee-option:active { transform: scale(.98); }
.fee-option-label { text-transform: uppercase; letter-spacing: .1em; font-size: .72rem; font-weight: 700; color: var(--bronze); }
.fee-option > b { font-size: 1.5rem; font-family: var(--serif); }
.fee-option .btn { margin-top: 10px; pointer-events: none; }
.fee-option.is-application { background: var(--paper-2); }
.fee-option.is-application > b { font-size: 1.15rem; }
@media (max-width: 360px) { .fee-options { grid-template-columns: 1fr; } }

/* Add to home screen */
.install-head { display: flex; align-items: center; gap: 14px; }
.install-head img { border-radius: 14px; box-shadow: 0 6px 16px -8px rgba(0, 0, 0, .4); }
.install-head h2 { margin: 0; }
.install-steps { margin: 0; padding-left: 22px; display: grid; gap: 10px; font-size: 1.02rem; }
.ios-share { display: inline-block; width: 18px; height: 22px; vertical-align: -4px; border: 2px solid var(--ink); border-top: 0; border-radius: 0 0 3px 3px; position: relative; margin: 0 2px; }
.ios-share::before { content: ""; position: absolute; left: 50%; top: -9px; width: 2px; height: 16px; background: var(--ink); transform: translateX(-50%); }
.ios-share::after { content: ""; position: absolute; left: 50%; top: -9px; width: 8px; height: 8px; border-left: 2px solid var(--ink); border-top: 2px solid var(--ink); transform: translateX(-50%) rotate(45deg); }
.install-btn { margin-top: 4px; }

/* Screens and chat channels fade in smoothly when you switch to them. */
.view:not([hidden]) { animation: view-in .22s ease both; }
.fade-in { animation: fade-in .2s ease both; }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } }
@keyframes fade-in { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .view:not([hidden]), .fade-in { animation: none; } }

/* Student EmptyHands chats: one fixed-size panel that fills the screen. Switching channels never
   changes its size; longer chats scroll inside it, with the message box always at the bottom. */
body.in-chat { height: 100vh; height: 100dvh; min-height: 0; display: flex; flex-direction: column; overflow: hidden; padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
body.in-chat .app-main { flex: 1; min-height: 0; width: 100%; display: flex; flex-direction: column; padding-bottom: 0; }
body.in-chat #view-menu { flex: 1; min-height: 0; display: flex; flex-direction: column; }
body.in-chat #view-menu .view-head { flex: none; }
body.in-chat #menu-chat { flex: 1; min-height: 0; grid-template-rows: auto minmax(0, 1fr); }
body.in-chat .menu-main { display: flex; flex-direction: column; min-height: 0; align-self: stretch; }
body.in-chat .channels { flex: none; }
body.in-chat .chat-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding-right: 2px; }
body.in-chat .chat-compose { flex: none; position: static; }
@media (min-width: 900px) { body.in-chat #menu-chat { grid-template-rows: minmax(0, 1fr); } }
@media (max-width: 599px) {
  body.in-chat #view-menu .view-head { margin-bottom: 8px; }
  body.in-chat #view-menu .eyebrow { display: none; }
}

/* Notifications */
.notify-card { margin-top: 16px; }
.notify-card h2 { margin: 0; font-size: 1.1rem; }
.notify-card .btn { justify-self: start; }
.notify-quick { float: right; margin-left: 8px; }

/* Student licence, laid out like EmptyHands' paper licence */
.licence { background: #fff; color: #111; border: 1px solid var(--line); border-radius: 12px; padding: clamp(16px, 4vw, 40px); max-width: 820px; margin: 0 auto 16px; font-family: Georgia, "Times New Roman", serif; box-shadow: 0 6px 24px rgba(0, 0, 0, .06); }
.lic-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; border-bottom: 2px solid #111; padding-bottom: 8px; }
.lic-head img { height: 64px; width: auto; border-radius: 8px; }
.lic-head span { font-weight: 700; font-size: .95rem; }
.lic-title { text-align: center; font-size: 1.35rem; margin: 18px 0 14px; font-family: inherit; }
.lic-title i { font-weight: 400; }
.licence h3 { font-size: 1rem; text-transform: uppercase; letter-spacing: .04em; margin: 18px 0 6px; font-family: inherit; }
.lic-details { width: 100%; border-collapse: collapse; font-size: .98rem; }
.lic-details th, .lic-details td { border: 1px solid #111; padding: 4px 8px; text-align: left; vertical-align: top; }
.lic-details th { width: 34%; background: #f1f1f1; }
.lic-oath { font-style: italic; margin: 0; line-height: 1.45; }
.lic-table-wrap { overflow-x: auto; }
.lic-record { width: 100%; border-collapse: collapse; font-family: Arial, Helvetica, sans-serif; font-size: .86rem; min-width: 560px; }
.lic-record th, .lic-record td { border: 1px solid #111; padding: 3px 6px; text-align: center; }
.lic-record thead th { background: #c9c9c9; }
.lic-record .lic-belt { background: var(--belt); color: var(--belt-ink); }
.lic-record tr.is-current td { font-weight: 700; }
.lic-auth { margin: 18px 0 8px; }
.lic-foot { border-top: 1px solid #999; margin-top: 24px; padding-top: 6px; color: #777; font-size: .8rem; }
.licence--edit input, .licence--edit select { width: 100%; min-height: 32px; padding: 2px 6px; border: 1px dashed #b9b2a4; border-radius: 4px; background: #fffdf6; font: inherit; color: inherit; }
.licence--edit .lic-record input, .licence--edit .lic-record select { min-width: 92px; font-size: .86rem; }
.licence--edit .lic-auth input { display: inline-block; width: min(100%, 420px); margin-top: 4px; }
.lic-cta .pay-cta-icon { background: var(--ink); font-family: var(--serif); }
@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff !important; padding: 0 !important; height: auto !important; overflow: visible !important; }
  .app-top, .tabbar, .no-print, #toasts, .demo-banner, .install-btn { display: none !important; }
  .app-main { padding: 0 !important; max-width: none !important; }
  .view:not([hidden]) { animation: none !important; }
  .licence { border: 0; box-shadow: none; padding: 0; max-width: none; }
  .lic-record .lic-belt, .lic-details th, .lic-record thead th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  #view-licences .view-head, #view-licence .view-head { display: none !important; }
  .licence--edit input, .licence--edit select { border: 0 !important; background: none !important; box-shadow: none !important; padding: 0 !important; min-height: 0 !important; height: auto !important; appearance: none; -webkit-appearance: none; color: #111 !important; }
  .licence--edit input::placeholder { color: transparent; }
  .licence--edit .lic-auth input { width: 100% !important; display: block; }
}

/* Medals */
.medal-list { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.medal { display: flex; gap: 14px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; border-left: 5px solid var(--medal, var(--bronze)); }
.medal--gold { --medal: #d4a017; } .medal--silver { --medal: #a8a9ad; } .medal--bronze { --medal: #b0703c; } .medal--trophy { --medal: #d4a017; } .medal--star { --medal: #e8b923; }
.medal-icon { font-size: 2.4rem; line-height: 1; width: 56px; height: 56px; display: grid; place-items: center; border-radius: 50%; background: color-mix(in srgb, var(--medal) 18%, #fff); flex: none; }
.medal-body h3 { margin: 0 0 2px; font-size: 1.05rem; }
.medal-body p { margin: 0 0 4px; color: var(--ink-2); overflow-wrap: anywhere; }
.medal-body footer { font-size: .8rem; color: var(--ink-3); }
.medal-cta .pay-cta-icon { background: #fff3c4; font-size: 1.3rem; }
.count-pill { display: inline-block; min-width: 20px; padding: 0 7px; margin-left: 4px; border-radius: 99px; background: var(--seal); color: #fff; font-size: .72rem; line-height: 20px; text-align: center; vertical-align: middle; }
.award-students { max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; margin: 6px 0 0; }
.award-students li { padding: 4px 0; }
.medal-reasons .chip { padding: 6px 12px; font-size: .86rem; }

/* Home (student): dark hero with highlights, then a rounded sheet */
body.on-home .app-top { display: none; }
.hero {
  margin: -24px -16px 0; padding: max(14px, env(safe-area-inset-top)) 20px 62px; color: var(--paper);
  background: radial-gradient(120% 90% at 85% 10%, #4a4852 0%, #2c2b31 45%, #1b1a1e 100%);
}
.hero-top { display: flex; justify-content: space-between; align-items: center; }
.hero-round {
  width: 52px; height: 52px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer;
  background: rgba(246, 242, 234, .22); color: var(--paper); backdrop-filter: blur(8px);
}
.hero-round svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.hero-pill { border: 0; border-radius: 99px; padding: 12px 20px; font-weight: 700; font-size: 1rem; background: rgba(246, 242, 234, .82); color: var(--ink); cursor: pointer; }
.hero-slides { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin-top: 26px; }
.hero-slides::-webkit-scrollbar { display: none; }
.hero-slide {
  flex: 0 0 100%; scroll-snap-align: start; display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center;
  min-height: 170px; border: 0; background: none; color: inherit; text-align: left; padding: 0 4px; cursor: pointer; font: inherit;
}
.hero-text b { display: block; font-size: clamp(2.1rem, 9vw, 3.1rem); font-weight: 500; line-height: 1.05; letter-spacing: -.01em; margin-bottom: 10px; }
.hero-text > span { display: block; font-size: 1.12rem; line-height: 1.4; color: rgba(246, 242, 234, .88); max-width: 22ch; }
.hero-art {
  width: 112px; height: 112px; border-radius: 20px; transform: rotate(45deg); display: grid; place-items: center; margin-right: 14px;
  background: linear-gradient(135deg, #f4f1ea, #a9a59c); box-shadow: inset 0 0 0 6px rgba(255, 255, 255, .35), 0 16px 30px -10px rgba(0, 0, 0, .6);
}
.hero-art > * { transform: rotate(-45deg); }
.hero-art img { width: 82px; height: 82px; border-radius: 50%; object-fit: cover; }
.hero-emoji { font-size: 3.6rem; line-height: 1; }
.hero-kanji { font-family: var(--serif); font-size: 3.2rem; font-weight: 700; color: var(--seal); line-height: 1; }
.hero-dots { display: flex; gap: 10px; margin-top: 14px; padding-left: 4px; min-height: 14px; }
.hero-dots button { width: 13px; height: 13px; border-radius: 50%; border: 0; padding: 0; background: rgba(246, 242, 234, .35); cursor: pointer; }
.hero-dots button[aria-current] { background: var(--paper); }
.sheet-body { position: relative; margin: -34px -16px 0; padding: 24px 16px 8px; background: var(--paper); border-radius: 28px 28px 0 0; }
.quick-row { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x proximity; scroll-padding-inline: 16px; scrollbar-width: none; margin: 0 -16px; padding: 4px 16px 8px; }
.quick-row::-webkit-scrollbar { display: none; }
.quick-card {
  flex: 0 0 128px; height: 128px; scroll-snap-align: start; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start;
  padding: 14px; border: 1.5px solid var(--line); border-radius: 18px; background: #fff; color: var(--ink); text-align: left; cursor: pointer; font: inherit;
}
.quick-card b { font-size: 1.12rem; line-height: 1.2; }
.quick-icon { position: relative; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: #f5e3e0; color: var(--seal); font-weight: 700; font-family: var(--serif); font-size: 1.1rem; }
.quick-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.quick-icon .count-pill { position: absolute; top: -6px; right: -12px; margin: 0; font-family: var(--sans); }
.sec-title { display: flex; justify-content: space-between; align-items: baseline; font-family: var(--sans); font-size: 1.55rem; font-weight: 700; margin: 26px 0 12px; }
.sec-title .linkish { font-size: .92rem; }
.sec-title--brand { color: #23413c; }
.sched-card {
  width: 100%; display: flex; align-items: center; gap: 16px; padding: 16px; border: 0; border-radius: 20px; background: #ebe8e2;
  color: var(--ink); text-align: left; cursor: pointer; font: inherit;
}
.sched-icon { flex: none; width: 64px; height: 64px; border-radius: 50%; background: #fff; color: var(--seal); display: grid; place-items: center; }
.sched-icon svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sched-text b { display: block; font-size: 1.12rem; }
.sched-text small { display: block; color: var(--ink-2); font-size: .95rem; }
.sched-go { margin-left: auto; font-size: 1.8rem; color: var(--ink-3); }
.upcoming--compact { margin-top: 10px; }
.explore-row { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 16px; scrollbar-width: none; margin: 0 -16px; padding: 0 16px 10px; }
.explore-row::-webkit-scrollbar { display: none; }
.explore-card {
  flex: 0 0 76%; max-width: 340px; height: 300px; position: relative; overflow: hidden; border-radius: 20px; scroll-snap-align: start;
  border: 0; padding: 0; background: var(--ink); color: #fff; text-decoration: none; cursor: pointer; text-align: left; font: inherit;
}
.explore-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.explore-card span { position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 16px 16px; background: linear-gradient(transparent, rgba(0, 0, 0, .75)); }
.explore-card b { display: block; font-size: 1.15rem; }
.explore-card small { color: rgba(255, 255, 255, .85); }
@media (min-width: 900px) {
  .hero { border-radius: 0 0 28px 28px; margin: -24px 0 0; }
  .sheet-body { margin: -34px 0 0; border-radius: 28px; padding: 24px; }
  .quick-row, .explore-row { margin: 0; padding: 4px 0 8px; scroll-padding-inline: 0; }
  .explore-card { flex-basis: 300px; }
}
/* Side menu */
.side-menu { margin: 0 auto 0 0; height: 100dvh; max-height: none; width: min(320px, 86vw); border: 0; padding: max(18px, env(safe-area-inset-top)) 18px 18px; background: var(--paper); color: var(--ink); }
.side-menu[open] { display: flex; flex-direction: column; animation: side-in .22s ease both; }
.side-menu::backdrop { background: rgba(20, 18, 15, .5); }
@keyframes side-in { from { transform: translateX(-30px); opacity: 0; } }
.side-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.side-head img { border-radius: 12px; }
.side-head b { display: block; } .side-head small { color: var(--ink-3); }
.side-head .hero-round { margin-left: auto; width: 44px; height: 44px; background: var(--paper-2); color: var(--ink); }
.side-links { display: grid; gap: 2px; flex: 1; align-content: start; overflow: auto; }
.side-links button, .side-links a { text-align: left; border: 0; background: none; padding: 13px 10px; border-radius: 12px; font: inherit; font-weight: 600; font-size: 1.05rem; color: var(--ink); text-decoration: none; cursor: pointer; }
.side-links button:hover, .side-links a:hover { background: var(--paper-2); }

/* Training journal: ready-made sentences, one swipeable row */
.quick-phrases { display: flex; flex-wrap: nowrap; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.quick-phrases::-webkit-scrollbar { display: none; }
.quick-phrases .chip { flex: none; padding: 7px 12px; font-size: .85rem; white-space: nowrap; }

/* Attendance */
.reg-list { display: grid; gap: 8px; max-height: 60vh; overflow: auto; margin: 0; }
.reg-row { width: 100%; display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 16px; background: #fff; color: var(--ink); text-align: left; cursor: pointer; font: inherit; transition: background-color .15s, border-color .15s; }
.reg-row b { display: block; } .reg-row small { color: var(--ink-3); }
.reg-tick { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--paper-3); color: transparent; font-weight: 700; }
.reg-row.is-here { border-color: #2e7d4f; background: #eef7f1; }
.reg-row.is-here .reg-tick { background: #2e7d4f; border-color: #2e7d4f; color: #fff; }
.att-bar { display: inline-block; width: 70px; height: 8px; border-radius: 99px; background: var(--paper-3); vertical-align: middle; overflow: hidden; margin-right: 6px; }
.att-bar span { display: block; height: 100%; background: #2e7d4f; }
.att-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.att-stat { background: #fff; border: 1.5px solid var(--line); border-radius: 18px; padding: 16px 12px; text-align: center; }
.att-stat b { display: block; font-size: 2rem; line-height: 1.1; color: #2e7d4f; }
.att-stat span { color: var(--ink-3); font-size: .9rem; }
.att-month { margin-bottom: 10px; }
.att-month .chip { cursor: default; font-size: .86rem; padding: 6px 10px; }
.att-month .card-head { margin-top: 0; }

/* Attendance on the calendar: ✓ attended, ✗ missed, a dot where a register was taken (Sensei) */
.cal-day.att-here, .cal-day.att-away, .cal-day.att-reg { position: relative; }
.cal-day.att-here::after, .cal-day.att-away::after { position: absolute; top: -5px; right: -5px; width: 15px; height: 15px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; font-weight: 700; line-height: 1; color: #fff; box-shadow: 0 0 0 2px var(--paper); }
.cal-day.att-here::after { content: "✓"; background: #2e7d4f; }
.cal-day.att-away::after { content: "✗"; background: var(--seal); }
.cal-day.att-reg::before { content: ""; position: absolute; bottom: 2px; left: 50%; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: #2e7d4f; }
.swatch.t-register { display: inline-grid; place-items: center; background: #2e7d4f; color: #fff; font-size: 10px; font-weight: 700; }
.day-att { padding: 10px 12px; border-radius: 10px; font-weight: 700; }
.day-att.is-here { background: #eef7f1; color: #2e7d4f; }
.day-att.is-away { background: #f8e1dd; color: var(--seal-2); }
.regd-list { display: grid; gap: 4px; max-height: 50vh; overflow: auto; margin: 0; }
.regd { display: flex; justify-content: flex-start; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; font-weight: 600; }
.regd > span:first-child { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: .8rem; flex: none; }
.regd.is-here { background: #eef7f1; } .regd.is-here > span:first-child { background: #2e7d4f; }
.regd.is-away { background: #fbefec; } .regd.is-away > span:first-child { background: var(--seal); }

/* Private chats: choose all Sensei or one */
.dm-pick, .thread-pick { flex: none; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 0 10px; }
.dm-pick .chip, .thread-pick .chip { flex: none; padding: 7px 14px; font-size: .88rem; font-weight: 700; position: relative; }
.dm-pick .chip[aria-selected=true], .thread-pick .chip[aria-selected=true] { background: var(--seal); border-color: var(--seal); color: #fff; }
.dm-pick .dot { position: absolute; top: 3px; right: 5px; width: 8px; height: 8px; border-radius: 50%; background: var(--seal); }
.thread-tag { font-size: .7rem; font-weight: 700; color: var(--ink-3); background: var(--paper-2); border-radius: 99px; padding: 1px 7px; margin-left: 4px; vertical-align: middle; white-space: nowrap; }
.chat-readonly { flex: none; padding: 10px 12px; background: var(--paper-2); border-radius: 10px; }
