/* Swim Coach — base styles. Mobile-first; works on phone, tablet, desktop. */
:root {
  --bg: #f0f6fa;
  --surface: #ffffff;
  --surface-2: #eef4f8;
  --line: #d9e2ec;
  --text: #102a43;
  --muted: #627d98;
  --brand: #0b6fb8;
  --brand-2: #0a5f9e;
  --brand-ink: #ffffff;
  --accent: #f2b705;
  --ok: #1f9d6b;
  --warn: #d98a00;
  --danger: #d64545;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 40, 60, .06), 0 4px 16px rgba(16, 40, 60, .06);
  --side-w: 240px;
  --tab-h: 64px;
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --z-white: #dfe6ee; --z-pink: #f78da7; --z-red: #e63946; --z-blue: #1d4ed8; --z-purple: #7c3aed; --z-green: #22b07d; --z-rec: #9aa7b4;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a1a2b; --surface: #112a42; --surface-2: #182b38; --line: #23394a; --text: #e6eef4; --muted: #93a8b8;
    --brand: #3a9be0; --brand-2: #5bb0ea; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25); --z-white: #cfd8e0;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a1a2b; --surface: #112a42; --surface-2: #182b38; --line: #23394a; --text: #e6eef4; --muted: #93a8b8;
  --brand: #3a9be0; --brand-2: #5bb0ea; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25); --z-white: #cfd8e0;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h2 { font-size: 18px; } h3 { font-size: 16px; }
.muted { color: var(--muted); }
small, .small { font-size: 13px; }
img { max-width: 100%; }

/* ---------- shell ---------- */
.shell { display: flex; min-height: 100vh; min-height: 100dvh; }
.side { display: none; }
.main { flex: 1; min-width: 0; padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 16px); }
.is-client .main { padding-bottom: 24px; }
.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: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top h1 { font-size: 18px; margin: 0; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-act { display: flex; gap: 8px; align-items: center; }
.content { padding: 16px; max-width: 1280px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--text); font-size: 17px; }
.brand img { width: 32px; height: 32px; }
.brand-sm img { width: 28px; height: 28px; }
.brand-sm span { display: none; }

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr); background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: var(--tab-h); color: var(--muted); font: 600 11px var(--font); background: none; border: 0; cursor: pointer; }
.tabbar .ic { font-size: 20px; line-height: 1; }
.tabbar .on { color: var(--brand); }
.more-sheet { display: none; position: fixed; inset: 0; z-index: 40; background: rgba(5, 20, 30, .45); }
.more-open .more-sheet { display: flex; align-items: flex-end; }
.sheet { width: 100%; background: var(--surface); border-radius: 18px 18px 0 0; padding: 12px 12px calc(16px + env(safe-area-inset-bottom)); }
.sheet a { display: flex; gap: 12px; align-items: center; padding: 14px 12px; border-radius: 10px; color: var(--text); font-weight: 600; }
.sheet a:active { background: var(--surface-2); }
.sheet-foot { display: flex; justify-content: space-between; align-items: center; padding: 12px; border-top: 1px solid var(--line); margin-top: 8px; }

@media (min-width: 900px) {
  .side { display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; width: var(--side-w); flex: 0 0 var(--side-w); background: var(--surface); border-right: 1px solid var(--line); padding: 16px 12px; }
  .side nav { display: flex; flex-direction: column; gap: 2px; margin-top: 20px; flex: 1; overflow: auto; }
  .side nav a { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 10px; color: var(--text); font-weight: 600; }
  .side nav a:hover { background: var(--surface-2); }
  .side nav a.on { background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand); }
  .side .ic { width: 22px; text-align: center; }
  .side-foot { display: flex; flex-direction: column; gap: 10px; padding: 8px 12px; }
  .tabbar, .more-sheet { display: none !important; }
  .main { padding-bottom: 24px; }
  .content { padding: 24px; }
  .top { padding: 14px 24px; }
  .top h1 { font-size: 20px; }
  .brand-sm span { display: inline; }
}
.soon-dot { color: var(--muted); }

.langsw { display: inline-flex; background: var(--surface-2); border-radius: 999px; padding: 3px; }
.langsw a { padding: 4px 10px; border-radius: 999px; font: 700 12px var(--font); color: var(--muted); }
.langsw a.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

.viewas-bar { position: sticky; top: 0; z-index: 50; background: var(--accent); color: #fff; padding: 8px 16px; display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap; font-weight: 600; font-size: 14px; }

/* ---------- elements ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.card + .card { margin-top: 12px; }
.grid { display: grid; gap: 12px; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1100px) { .grid-4 { grid-template-columns: repeat(4, 1fr); } }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 12px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid transparent; background: var(--brand); color: var(--brand-ink); font: 700 15px var(--font); cursor: pointer; white-space: nowrap; touch-action: manipulation; }
.btn:hover { background: var(--brand-2); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-light { background: var(--surface); color: var(--text); border-color: var(--line); }
.btn-light:hover { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 10%, transparent); }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn-ic { width: 40px; min-height: 40px; padding: 0; }

label.f { display: block; }
label.f > span { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
input[type=text], input[type=password], input[type=number], input[type=email], input[type=tel], input[type=search], input[type=date], input[type=time], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text);
  font: 16px var(--font); /* 16px prevents iOS zoom */ outline: none; -webkit-appearance: none; appearance: none;
}
select { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: 600 14px var(--font); cursor: pointer; user-select: none; touch-action: manipulation; }
.chip:hover { border-color: var(--brand); }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip.sm { min-height: 30px; padding: 0 10px; font-size: 13px; }
.chip .dot { width: 10px; height: 10px; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 700; }
.badge.ok { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.badge.warn { background: color-mix(in srgb, var(--warn) 15%, transparent); color: var(--warn); }

.list { display: flex; flex-direction: column; }
.list-item { display: flex; gap: 12px; align-items: center; padding: 12px 4px; border-bottom: 1px solid var(--line); color: var(--text); }
.list-item:last-child { border-bottom: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .title { font-weight: 700; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: color-mix(in srgb, var(--brand) 15%, transparent); color: var(--brand); display: grid; place-items: center; font-weight: 800; flex: 0 0 40px; }

.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.toast-inline { background: color-mix(in srgb, var(--ok) 14%, var(--surface)); border: 1px solid color-mix(in srgb, var(--ok) 35%, transparent); color: var(--text); padding: 10px 14px; border-radius: 12px; margin-bottom: 12px; font-weight: 600; }
.err { background: color-mix(in srgb, var(--danger) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent); padding: 10px 14px; border-radius: 12px; margin-bottom: 12px; }

.stat { padding: 14px 16px; }
.stat .v { font-size: 26px; font-weight: 800; letter-spacing: -.01em; }
.stat .k { color: var(--muted); font-size: 13px; font-weight: 600; }

#toast { position: fixed; left: 50%; bottom: calc(var(--tab-h) + 20px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px); opacity: 0; background: #10222f; color: #fff; padding: 10px 16px; border-radius: 12px; font-weight: 600; pointer-events: none; transition: .2s; z-index: 100; }
#toast.show { opacity: 1; transform: translateX(-50%); }
@media (min-width: 900px) { #toast { bottom: 24px; } }

/* ---------- guest / login ---------- */
.guest { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; background: linear-gradient(160deg, #073f6b 0%, #0b6fb8 50%, #19c3d6 100%); background-size: cover; background-position: center; }
.guest.has-bg { background-image: linear-gradient(rgba(7,63,107,.25), rgba(7,63,107,.35)), image-set(url(login-bg.webp) type('image/webp'), url(login-bg.jpg) type('image/jpeg')); }
@media (max-width: 700px) and (orientation: portrait) { .guest.has-bg { background-image: linear-gradient(rgba(7,63,107,.25), rgba(7,63,107,.35)), image-set(url(login-bg-mobile.webp) type('image/webp'), url(login-bg-mobile.jpg) type('image/jpeg')); } }
.login-card { width: 100%; max-width: 380px; background: var(--surface); border-radius: 20px; padding: 28px 24px; box-shadow: 0 20px 60px rgba(0, 30, 60, .25); }
.login-card .brand { justify-content: center; margin-bottom: 6px; font-size: 22px; }
.login-card .brand img { width: 44px; height: 44px; }
.login-card .sub { text-align: center; color: var(--muted); margin-bottom: 20px; }
.login-card form > * + * { margin-top: 12px; }
.login-card .langsw { display: flex; justify-content: center; margin: 16px auto 0; width: max-content; }

/* ---------- workout render ---------- */
.wk { font-size: 15px; }
.wk-l { display: flex; gap: 10px; align-items: baseline; padding: 3px 0; }
.wk-t { flex: 1; white-space: pre-wrap; }
.wk-m { color: var(--muted); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.wk-m::after { content: ' м'; }
html[lang=en] .wk-m::after { content: 'm'; }
.wk-focus { font-weight: 700; color: var(--brand); margin-bottom: 6px; }
.wk-section { font-weight: 800; font-size: 16px; margin-top: 14px; padding-top: 10px; border-top: 1px dashed var(--line); }
.wk-section:first-of-type { border-top: 0; }
.wk-zone { font-size: 13px; color: var(--muted); font-weight: 600; }
.wk-set, .wk-group { font-weight: 600; }
.wk-lvl1 { padding-left: 8px; } .wk-lvl2 { padding-left: 28px; } .wk-lvl3 { padding-left: 48px; }
.wk-var { color: var(--text); font-weight: 400; }
.wk-note { color: var(--muted); font-style: italic; font-weight: 400; }
.wk-total { font-weight: 800; font-size: 17px; margin-top: 14px; padding-top: 10px; border-top: 2px solid var(--line); }
.wk-l[data-zone]::before { content: ''; width: 6px; align-self: stretch; border-radius: 3px; flex: 0 0 6px; background: var(--z-white); }
.wk-l[data-zone=pink]::before { background: var(--z-pink); } .wk-l[data-zone=red]::before { background: var(--z-red); } .wk-l[data-zone=blue]::before { background: var(--z-blue); }
.wk-l[data-zone=purple]::before { background: var(--z-purple); } .wk-l[data-zone=green]::before { background: var(--z-green); } .wk-l[data-zone=rec]::before { background: var(--z-rec); }
.wk-l.hl { background: color-mix(in srgb, var(--brand) 10%, transparent); border-radius: 6px; }

@media print {
  .side, .tabbar, .top, .no-print, .viewas-bar { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border: 0; padding: 0; }
  .content { padding: 0; }
}

/* ---------- builder ---------- */
.page-builder .content { max-width: 1440px; padding-bottom: 90px; }
.b-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.b-tabs .chip { flex: 1; justify-content: center; }
.b-wrap { display: block; }
.b-wrap.tab-edit .b-prev { display: none; }
.b-wrap.tab-prev .b-edit { display: none; }
@media (min-width: 1100px) {
  .no-desk { display: none !important; }
  .b-wrap { display: grid !important; grid-template-columns: minmax(0, 1.25fr) minmax(360px, .9fr); gap: 20px; align-items: start; }
  .b-wrap .b-prev, .b-wrap .b-edit { display: block !important; }
  .b-prev { position: sticky; top: 76px; max-height: calc(100vh - 170px); overflow: auto; border-radius: var(--radius); }
}
.b-edit > .card { margin-bottom: 12px; }
.b-title { font-size: 20px !important; font-weight: 800 !important; border: 0 !important; padding-left: 0 !important; background: transparent !important; box-shadow: none !important; border-bottom: 2px solid var(--line) !important; border-radius: 0 !important; margin-bottom: 12px; }
.b-title:focus { border-bottom-color: var(--brand) !important; }
.b-f { margin-top: 12px; }
.b-lab { font-size: 12px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.b-row2, .b-row3 { display: grid; gap: 0 16px; }
@media (min-width: 640px) { .b-row2 { grid-template-columns: 1fr 1fr; } .b-row3 { grid-template-columns: 1.2fr .8fr .8fr; } }
.b-total { margin-top: 14px; font-size: 16px; }
.b-overtxt { color: var(--danger); font-weight: 700; }
.b-bar { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; margin: 8px 0 4px; }
.b-bar.big { height: 8px; }
.b-bar i { display: block; height: 100%; background: var(--ok); border-radius: 3px; transition: width .2s; }
.b-bar i.over { background: var(--danger); }
.b-sec { padding: 12px; }
.b-sec-h { display: flex; gap: 8px; align-items: center; }
.b-sec-type { flex: 1; font-weight: 800; font-size: 16px !important; max-width: 320px; }
.b-sec-m { font-weight: 800; color: var(--brand); white-space: nowrap; font-variant-numeric: tabular-nums; }
.b-mv { display: inline-flex; margin-left: auto; }
.b-mv .btn { min-width: 34px; padding: 0 8px; }
.b-sec-set { margin-top: 4px; padding: 4px 0 8px; border-bottom: 1px dashed var(--line); }
.b-nodes { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.b-node { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.b-node.open { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 14%, transparent); }
.b-node.is-group { background: var(--surface-2); }
.b-node-h { display: flex; align-items: center; gap: 8px; padding: 8px 6px 8px 12px; cursor: pointer; min-height: 48px; }
.b-num { font-weight: 800; color: var(--muted); min-width: 22px; }
.b-sum { flex: 1; min-width: 0; font-weight: 600; }
.b-m { font-weight: 800; font-size: 13px; color: var(--muted); white-space: nowrap; }
.b-ed { padding: 0 12px 12px; border-top: 1px solid var(--line); }
.b-gitems { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: 12px; background: var(--bg); }
.b-gitems .b-node { background: var(--surface); }
.stepper { display: flex; gap: 6px; align-items: center; }
.stepper input { width: 80px; text-align: center; font-weight: 800; }
.b-f .chips { margin-top: 6px; }
.b-f > .chips:first-child, .b-f > .b-lab + .chips { margin-top: 0; }
.b-by, .b-ps { margin-top: 8px; gap: 6px; }
.b-by input, .b-ps input { width: 80px; }
.b-by select { width: 110px; }
.t-in { width: 92px !important; text-align: center; font-variant-numeric: tabular-nums; }
.n-in { width: 70px !important; min-height: 32px !important; padding: 4px 8px !important; }
.b-parts { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.b-part { border: 1px dashed var(--line); border-radius: 10px; padding: 8px 10px; }
.b-part-h { display: flex; justify-content: space-between; align-items: center; min-height: 30px; }
.b-part-g { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 6px; }
@media (min-width: 640px) { .b-part-g { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.b-part-g label > span:first-child { display: block; font-size: 11px; font-weight: 700; color: var(--muted); margin-bottom: 3px; }
.b-part-g .wide { grid-column: 1 / -1; }
.b-part-g select, .b-part-g input { min-height: 40px; padding: 6px 10px; }
.b-part-g select { padding-right: 28px; }
.b-warn { color: var(--warn); font-weight: 700; font-size: 13px; }
.b-check { margin-top: 12px; font-weight: 600; gap: 8px; cursor: pointer; }
.b-check input { width: 20px; height: 20px; }
.b-rgrid { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.b-acts { margin-top: 14px; gap: 6px; }
.b-add { margin-top: 10px; gap: 6px; }
.b-addsec { margin: 4px 0 16px; }
.b-savebar { position: fixed; z-index: 25; left: 0; right: 0; bottom: calc(var(--tab-h) + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 12px; padding: 8px 16px; background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(0,0,0,.05); }
.b-savebar #b-state { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.b-savetot { font-weight: 800; color: var(--brand); }
@media (min-width: 900px) { .b-savebar { left: var(--side-w); bottom: 0; padding: 10px 24px; } }
.b-modal { position: fixed; inset: 0; z-index: 60; background: rgba(5, 20, 30, .45); display: flex; align-items: flex-end; justify-content: center; }
.b-modal-in { width: 100%; max-width: 560px; max-height: 80vh; overflow: auto; border-radius: 18px 18px 0 0; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
@media (min-width: 640px) { .b-modal { align-items: center; } .b-modal-in { border-radius: 18px; } }
.b-start h2 { margin: 8px 0 16px; }
.b-method { display: flex; flex-direction: column; gap: 10px; margin: 0 !important; }
.b-mt { font-weight: 800; font-size: 16px; }
.b-method .btn { align-self: flex-start; margin-top: auto; }
.b-tpl { max-height: 240px; overflow: auto; }
.b-prev-card { margin: 0; }
.page-builder #toast { bottom: calc(var(--tab-h) + 84px + env(safe-area-inset-bottom)); } @media (min-width:900px){ .page-builder #toast { bottom: 84px; } }

/* ---------- calendar ---------- */
.cal-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-title { font-weight: 800; font-size: 17px; flex: 1; text-align: center; min-width: 160px; }
@media (max-width: 640px) { .cal-bar { display: grid; grid-template-columns: auto 1fr; } .cal-title { order: -1; grid-column: 1 / -1; text-align: left; } .cal-bar .chips { justify-self: end; } }
.cal-card { padding: 0; overflow: hidden; }
.cal-head { display: grid; grid-template-columns: 52px repeat(var(--n), 1fr); border-bottom: 1px solid var(--line); background: var(--surface); }
.cal-head > div { padding: 8px 4px; text-align: center; font-size: 13px; color: var(--muted); font-weight: 600; cursor: pointer; }
.cal-head > div b { display: block; font-size: 18px; color: var(--text); }
.cal-head > div.td b { color: #fff; background: var(--brand); border-radius: 999px; width: 32px; height: 32px; line-height: 32px; margin: 2px auto 0; }
.cal-scroll { max-height: calc(100vh - 250px); max-height: calc(100dvh - 250px); overflow-y: auto; -webkit-overflow-scrolling: touch; }
.page-cal .cal-scroll { min-height: 360px; }
.cal-grid { position: relative; display: grid; grid-template-columns: 52px repeat(var(--n), 1fr); }
.cal-times { position: relative; }
.cal-times div { position: absolute; right: 6px; transform: translateY(-7px); font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cal-times div:first-child { transform: none; }
.cal-col { position: relative; border-left: 1px solid var(--line); cursor: copy; }
.cal-col.td { background: color-mix(in srgb, var(--brand) 4%, transparent); }
.cal-hr { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line); opacity: .7; pointer-events: none; }
.cal-ev { position: absolute; z-index: 2; overflow: hidden; border-radius: 8px; padding: 3px 6px; font-size: 12px; line-height: 1.25; cursor: pointer; background: color-mix(in srgb, var(--k) 16%, var(--surface)); border-left: 4px solid var(--k); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); user-select: none; touch-action: auto; }
.cal-ev:hover { box-shadow: 0 2px 10px rgba(0,0,0,.15); }
.cal-ev.dragging { opacity: .85; z-index: 5; box-shadow: 0 6px 20px rgba(0,0,0,.25); cursor: grabbing; }
.cal-ev .ev-t { font-weight: 800; font-variant-numeric: tabular-nums; }
.cal-ev .ev-n { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-ev .ev-s { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-ev .ev-rs { position: absolute; left: 0; right: 0; bottom: 0; height: 7px; cursor: ns-resize; }
.cal-ev.st-cancelled { opacity: .5; text-decoration: line-through; }
.cal-ev.st-done { background: color-mix(in srgb, var(--ok) 14%, var(--surface)); border-left-color: var(--ok); }
.cal-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--danger); z-index: 3; pointer-events: none; }
.cal-now::before { content: ''; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); }
.cal-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 10px; }
.cal-strip button { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font: 600 12px var(--font); cursor: pointer; }
.cal-strip button b { font-size: 17px; color: var(--text); }
.cal-strip button.td b { color: var(--brand); }
.cal-strip button.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.cal-strip button.on b { color: #fff; }
.cal-strip button i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.cal-month { padding: 0; overflow: hidden; }
.cm-head { display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid var(--line); }
.cm-head div { padding: 8px; text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); }
.cm-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cm-day { min-height: 96px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 4px; cursor: pointer; position: relative; overflow: hidden; }
.cm-day:nth-child(7n) { border-right: 0; }
.cm-day.out { background: var(--surface-2); opacity: .7; }
.cm-n { font-weight: 700; font-size: 13px; margin-bottom: 2px; }
.cm-day.td .cm-n { color: #fff; background: var(--brand); border-radius: 999px; width: 24px; height: 24px; display: grid; place-items: center; }
.cm-ev { font-size: 11px; padding: 1px 4px; border-radius: 4px; margin-bottom: 2px; background: color-mix(in srgb, var(--k) 15%, var(--surface)); border-left: 3px solid var(--k); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cm-ev.st-cancelled { text-decoration: line-through; opacity: .5; }
.cm-more { font-size: 11px; color: var(--muted); }
.cm-dot { display: none; }
@media (max-width: 640px) {
  .cm-day { min-height: 56px; }
  .cm-ev, .cm-more { display: none; }
  .cm-dot { display: block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin: 4px auto 0; }
  .cm-n { text-align: center; margin: 0 auto; }
}
.cal-form { max-width: 620px; }
.f-clients { max-height: 200px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; margin-top: 6px; padding: 4px; }
.f-cl { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; cursor: pointer; }
.f-cl:hover { background: var(--surface-2); }
.f-cl input { width: 20px; height: 20px; }
.f-att { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.chip.on.bad { background: var(--danger); border-color: var(--danger); }
.cal-card.is-day .cal-head { display: none; }
@media (max-width: 640px) {
  .cal-bar { grid-template-columns: auto 1fr; }
  .cal-bar .chips { grid-column: 1 / -1; justify-self: stretch; display: grid; grid-template-columns: repeat(3, 1fr); }
  .cal-bar .chips .chip { justify-content: center; }
}
.cal-ev.is-series, .cm-ev.is-series { background-image: repeating-linear-gradient(135deg, transparent 0 8px, color-mix(in srgb, var(--k) 10%, transparent) 8px 16px); }
@media (max-width: 1100px) { .cal-copy span { display: none; } }
