/* SMM · components (tokens.css holds the tokens and the font). Mockups: wt-design/mockups/smm/smm/SMM-*.png */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--text); font: 400 14px/1.45 var(--sans); -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ic { width: 17px; height: 17px; flex: none; }
.sub { color: var(--muted); font-size: 13px; }
.faint { color: var(--faint); }
.pad { padding: 14px; }
.h1 { margin: 0; font: 600 22px/1.2 var(--sans); letter-spacing: -.015em; }
.h2 { margin: 0; font: 600 15px/1.3 var(--sans); }
.loading { padding: 48px 24px; color: var(--faint); }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 34px; padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: transparent; font-weight: 500; font-size: 13px; white-space: nowrap; text-decoration: none; transition: background var(--t) var(--ease); }
.btn:hover { background: var(--raised); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); font-weight: 600; }
.btn.primary:hover { opacity: .92; }
.btn.quiet { border-color: transparent; color: var(--muted); }
.btn.sm { height: 28px; font-size: 12px; padding: 0 10px; }
.btn .ic { width: 15px; height: 15px; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r-sm); border: 0; background: none; color: var(--muted); text-decoration: none; padding: 0; }
.icon-btn:hover { background: var(--raised); color: var(--text); }
.icon-btn:disabled { opacity: .4; cursor: default; }
.link { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; font-size: 13px; padding: 4px 0; }
.link:hover { color: var(--text); }
.link .ic { width: 15px; height: 15px; }
.seg { display: inline-flex; padding: 3px; border-radius: 9px; background: var(--sunken); border: 1px solid var(--line); max-width: 100%; overflow-x: auto; }
.seg button { height: 28px; padding: 0 12px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 500; white-space: nowrap; }
.seg button.on { background: var(--raised); color: var(--text); box-shadow: var(--shadow-sm); }
.field { height: 38px; padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--sunken); width: 100%; font-size: 14px; }
textarea.field { height: auto; min-height: 64px; padding: 9px 12px; resize: vertical; line-height: 1.45; }
select.field { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 17px) 16px, calc(100% - 12px) 16px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 28px; }
.label { font-size: 12px; color: var(--muted); }
.field-l { display: flex; flex-direction: column; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 7px; font-size: 12px; font-weight: 500; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); white-space: nowrap; }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
.chip-btn { height: 30px; padding: 0 12px; border-radius: 15px; border: 1px solid var(--line-strong); background: var(--sunken); color: var(--text); font-size: 13px; white-space: nowrap; }
.chip-btn.on { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); }
.bar { height: 5px; border-radius: 3px; background: var(--sunken); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 3px; background: var(--text); transition: width .3s var(--ease); }
.av { --c: #888; display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 10px; background: var(--c); color: #fff; font: 600 13px/1 var(--sans); }
.av.sm { width: 24px; height: 24px; border-radius: 6px; font-size: 10px; }
.av.big { width: 46px; height: 46px; border-radius: 12px; font-size: 15px; }
.own { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px 0 3px; border-radius: 11px; background: var(--sunken); border: 1px solid var(--line); font-size: 12px; color: var(--muted); flex: none; white-space: nowrap; }
.own i { font-style: normal; width: 16px; height: 16px; border-radius: 50%; background: var(--raised); display: grid; place-items: center; font-size: 9px; font-weight: 600; color: var(--text); }
.own.shared { padding-left: 8px; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; padding: 64px 24px; max-width: 460px; margin: 0 auto; }
.empty-ic { width: 54px; height: 54px; border-radius: 50%; background: var(--raised); display: grid; place-items: center; color: var(--muted); }
.empty-ic .ic { width: 24px; height: 24px; }

/* ---------- the bar ---------- */
header.topbar { position: sticky; top: 0; z-index: 25; height: 60px; display: flex; align-items: center; gap: 14px; padding: 0 20px; border-bottom: 1px solid var(--line); background: var(--bg); }
.logo { display: block; width: 46px; aspect-ratio: 158 / 70; background: var(--text); -webkit-mask: url(/img/wt-logo-mask.png) center / contain no-repeat; mask: url(/img/wt-logo-mask.png) center / contain no-repeat; }
.logo-link { display: flex; align-items: center; padding: 4px 6px; }
.menu-wrap { position: relative; }
.switcher { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--panel); font-weight: 600; }
.switcher .chev { width: 14px; height: 14px; }
.menu { position: absolute; z-index: 30; top: 44px; left: 0; min-width: 220px; padding: 6px; border-radius: var(--r); border: 1px solid var(--line-strong); background: var(--raised); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; }
.menu.right { left: auto; right: 0; }
.menu-item { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: 7px; text-decoration: none; font-size: 14px; }
.menu-item:hover { background: var(--sunken); }
.menu-item.on { color: var(--accent); }
.menu-who { padding: 8px 10px; color: var(--muted); font-size: 13px; }
.bar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.spend { display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; color: var(--muted); font-size: 13px; padding: 6px 8px; border-radius: var(--r-sm); }
.spend:hover { background: var(--raised); color: var(--text); }
.spend .ic { width: 15px; height: 15px; }
.theme-seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--sunken); border: 1px solid var(--line); }
.theme-seg button { width: 34px; height: 30px; border: 0; border-radius: 7px; background: none; color: var(--faint); display: grid; place-items: center; padding: 0; }
.theme-seg button.on { background: var(--raised); color: var(--text); box-shadow: var(--shadow-sm); }
.avatar-btn { width: 38px; height: 38px; border-radius: 50%; background: var(--raised); color: var(--text); font-weight: 600; }

/* ---------- shell: clients | main ---------- */
.shell { display: grid; grid-template-columns: 290px minmax(0, 1fr); min-height: calc(100vh - 60px); align-items: start; }
.clients { position: sticky; top: 60px; max-height: calc(100vh - 60px); overflow-y: auto; padding: 16px 14px 24px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.cl-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cl-head .h2 { font-size: 17px; }
.cl-search { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 10px; border-radius: var(--r-sm); background: var(--sunken); border: 1px solid var(--line); color: var(--faint); }
.cl-search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font-size: 14px; }
.cl-search:focus-within { border-color: var(--line-strong); }
.cl-search.grow { flex: 1; min-width: 200px; }
.cl-search.big { height: 48px; border-radius: var(--r); }
.clist { display: flex; flex-direction: column; gap: 6px; }
.crow { display: flex; gap: 12px; padding: 12px; border-radius: var(--r); border: 1px solid transparent; text-decoration: none; }
.crow:hover { background: var(--sunken); }
.crow.on { background: var(--panel); border-color: var(--line); box-shadow: var(--shadow-sm); }
.cr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.cr-top b { font-weight: 500; font-size: 15px; overflow-wrap: anywhere; }
.cr-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; color: var(--faint); }
.cr-pfs { display: inline-flex; gap: 4px; }
.cr-pfs .ic { width: 14px; height: 14px; }
.cr-week { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cr-money { font-size: 12px; color: var(--faint); }
.clients-page { padding: 16px; display: flex; flex-direction: column; gap: 12px; }

/* ---------- main: the client's header ---------- */
.main { min-width: 0; padding-bottom: 60px; }
.back-m { display: none; }
.chead { display: flex; align-items: center; gap: 14px; padding: 18px 24px 8px; flex-wrap: wrap; }
.chead-t { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 3px; }
.chead-n { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ctabs { display: inline-flex; gap: 2px; }
.ctabs a { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: var(--r-sm); color: var(--muted); text-decoration: none; }
.ctabs a:hover { color: var(--text); }
.ctabs a.on { background: var(--raised); color: var(--text); }
.ctabs .ic.out { width: 12px; height: 12px; opacity: .6; }
.wrow { display: flex; align-items: center; gap: 14px; padding: 8px 24px 14px; flex-wrap: wrap; }
.wnav { display: flex; align-items: center; gap: 4px; }
.wr { margin: 0 6px; font: 600 22px/1.2 var(--sans); letter-spacing: -.015em; }
.wr-state { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* ---------- the week ---------- */
.grid-wrap { padding: 0 24px; overflow-x: auto; }
.grid { display: grid; grid-template-columns: 88px repeat(7, minmax(120px, 1fr)); gap: 8px; min-width: 990px; align-items: stretch; }
.gd, .gl, .gcorner { align-self: start; }
.gd { padding: 8px 4px; color: var(--muted); font-size: 13px; }
.gd b { color: var(--text); font-weight: 600; font-size: 16px; }
.gd.today { color: var(--accent); }
.gd.today b { color: var(--accent); }
.gl { display: flex; align-items: flex-start; gap: 6px; padding-top: 10px; color: var(--muted); font-size: 13px; }
.gl-ic .ic { width: 14px; height: 14px; }
.gl-t { overflow-wrap: break-word; min-width: 0; }
.gc { min-height: 120px; display: flex; flex-direction: column; gap: 8px; padding: 0; border-radius: var(--r); }
.gc.over { background: var(--accent-soft); outline: 2px dashed var(--accent-line); outline-offset: 2px; }
.gc-add { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 120px; flex: 1; border: 1px dashed var(--line); border-radius: var(--r); background: none; color: var(--faint); font-size: 13px; opacity: .8; }
.gc-add.more { min-height: 34px; flex: none; opacity: 0; }
.gc:hover .gc-add.more, .gc-add.more:focus-visible { opacity: 1; }
.gc-add:hover { color: var(--text); border-color: var(--line-strong); }
.gc-add .ic { width: 14px; height: 14px; }
.pc { flex: 1; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; cursor: pointer; transition: border-color var(--t), transform var(--t) var(--ease); }
.pc:hover { border-color: var(--line-strong); }
.pc.dragging { opacity: .45; }
.pc-cover { position: relative; aspect-ratio: 4 / 3; background: var(--sunken); }
.pc-cover img, .ph { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph { background: linear-gradient(135deg, color-mix(in srgb, var(--c) 55%, var(--panel)), color-mix(in srgb, var(--c) 15%, var(--sunken))); }
.pc-fmt { position: absolute; top: 8px; left: 8px; display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px; background: rgb(0 0 0 / .55); color: #fff; font-size: 11.5px; backdrop-filter: blur(4px); }
.pc-fmt .ic { width: 12px; height: 12px; }
.pc-body { flex: 1; padding: 10px 10px 10px; display: flex; flex-direction: column; gap: 8px; }
.pc-foot { margin-top: auto; }
.pc-title { font-size: 13.5px; line-height: 1.3; min-height: 2.6em; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pc-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pc-time { font-weight: 600; font-size: 13px; }
.hint-line { margin: 14px 24px 0; font-size: 12.5px; color: var(--faint); }
.daylist { display: none; }
.dl-day { padding: 10px 0 4px; }
.dl-day h3 { margin: 0 0 8px; font: 600 16px/1.3 var(--sans); }
.dl-post { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); text-decoration: none; }
.dl-th { width: 64px; height: 80px; flex: none; border-radius: 8px; overflow: hidden; background: var(--sunken); }
.dl-th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dl-b { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }
.dl-b b { font-weight: 500; font-size: 15px; line-height: 1.3; }
.dl-b .sub { display: inline-flex; align-items: center; gap: 6px; }
.dl-b .sub .ic { width: 13px; height: 13px; }

/* ---------- history ---------- */
.hist { padding: 8px 24px 24px; max-width: 760px; display: flex; flex-direction: column; }
.hrow { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 4px; border-top: 1px solid var(--line); text-decoration: none; }
.hrow:first-child { border-top: 0; }
.hr-go { margin-left: auto; color: var(--faint); }

/* ---------- materials ---------- */
.mat { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; padding: 6px 24px 90px; align-items: start; }
.mat-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.shoot { margin-bottom: 22px; }
.shoot h3 { margin: 0 0 10px; font: 600 15px/1.3 var(--sans); display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.shoot h3 .sub { font-weight: 400; }
.ph-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.ph-th { position: relative; aspect-ratio: 4 / 5; border: 0; padding: 0; border-radius: 10px; overflow: hidden; background: var(--sunken); }
.ph-th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph-th.sel { outline: 2px solid var(--text); outline-offset: -2px; }
.ph-th .lb { position: absolute; left: 6px; bottom: 6px; padding: 2px 8px; border-radius: 6px; font-size: 11.5px; background: rgb(0 0 0 / .6); color: #fff; }
.ph-th .lb.bad { background: #C0412E; } .ph-th .lb.cover { background: #B88A3A; }
.ph-th .ck { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid #fff; background: rgb(0 0 0 / .25); color: transparent; display: grid; place-items: center; }
.ph-th .ck .ic { width: 12px; height: 12px; stroke-width: 3.2; }
.ph-th.sel .ck { background: var(--text); border-color: var(--text); color: var(--bg); }
.more-row { display: flex; justify-content: center; padding: 8px 0 16px; }
.mat-change { display: flex; gap: 18px; flex-wrap: wrap; }
.mat-side { padding: 16px; display: flex; flex-direction: column; gap: 6px; position: sticky; top: 76px; }
.side-h { display: flex; align-items: baseline; gap: 8px; }
.doc { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.doc-k { width: 36px; height: 40px; flex: none; border-radius: 6px; background: var(--raised); display: grid; place-items: center; font-size: 10px; font-weight: 600; color: var(--muted); }
.doc .t { display: flex; flex-direction: column; min-width: 0; }
.doc .t b { font-weight: 500; font-size: 13.5px; overflow-wrap: anywhere; }
.selbar { position: fixed; z-index: 20; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; align-items: center; gap: 14px; padding: 10px 16px; border-radius: 16px; background: var(--text); color: var(--bg); box-shadow: var(--shadow); max-width: calc(100vw - 24px); flex-wrap: wrap; }
.selbar .sub { color: color-mix(in srgb, var(--bg) 70%, var(--text)); }
.selbar .btn { background: color-mix(in srgb, var(--bg) 16%, var(--text)); color: var(--bg); border-color: transparent; }
.selbar .link { color: var(--bg); }
.docs-big { max-width: 560px; }

/* ---------- the editor panel ---------- */
.panel-scrim { position: fixed; inset: 0; z-index: 34; background: var(--scrim); }
.panel { position: fixed; z-index: 35; top: 0; right: 0; bottom: 0; width: min(1200px, calc(100vw - 260px)); background: var(--bg); border-left: 1px solid var(--line-strong); box-shadow: var(--shadow); display: flex; flex-direction: column; }
.ph-bar { flex: none; height: 60px; display: flex; align-items: center; gap: 12px; padding: 0 20px; border-bottom: 1px solid var(--line); }
.ph-ic .ic { width: 18px; height: 18px; color: var(--muted); }
.ph-t { font-weight: 600; font-size: 16px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-nav { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.ph-body { flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 28px; padding: 20px 24px 28px; align-items: start; }
.pv-col { position: sticky; top: 0; }
.pv { display: flex; flex-direction: column; gap: 10px; }
.pv-note { text-align: center; margin: 0; font-size: 12.5px; }
.pv-slide { margin: 0; padding: 10px 12px; border-radius: var(--r-sm); background: var(--sunken); font-size: 13.5px; line-height: 1.4; }
.ig { background: #fff; color: #111; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
.ig-h { display: flex; align-items: center; gap: 8px; padding: 10px 12px; font-size: 14px; }
.ig-h .av.sm { background: var(--c); }
.ig-more { margin-left: auto; letter-spacing: 2px; color: #666; }
.ig-img { position: relative; aspect-ratio: 4 / 5; background: #eee; cursor: pointer; overflow: hidden; }
.ig-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ig-empty { height: 100%; display: grid; place-items: center; color: #999; }
.ig-count { position: absolute; top: 10px; right: 10px; padding: 2px 8px; border-radius: 12px; background: rgb(0 0 0 / .6); color: #fff; font-size: 12px; }
.ig-cover { position: absolute; left: 0; right: 0; bottom: 0; padding: 60px 16px 16px; background: linear-gradient(to top, rgb(0 0 0 / .72), transparent); color: #fff; font: 700 24px/1.15 var(--sans); }
.ig-dots { display: flex; justify-content: center; gap: 5px; padding: 8px 0 0; }
.ig-dots i { width: 6px; height: 6px; border-radius: 50%; background: #ccc; }
.ig-dots i.on { background: #3B82F6; }
.ig-cap { padding: 8px 12px 14px; font-size: 13.5px; line-height: 1.4; overflow-wrap: anywhere; white-space: pre-line; }
.ig-cap.text-only { font-size: 15px; padding: 12px 14px 18px; }
.frame { position: relative; aspect-ratio: 9 / 16; width: min(100%, 300px); margin: 0 auto; border-radius: 14px; overflow: hidden; background: linear-gradient(160deg, #263648, #172230); }
.frame-bg { position: absolute; inset: 0; background-size: cover; background-position: center; }
.zone { position: absolute; display: flex; padding: 6px 8px; font-size: 10.5px; color: #fff; background: repeating-linear-gradient(135deg, rgb(200 60 60 / .38) 0 6px, rgb(200 60 60 / .12) 6px 12px); border: 1px dashed rgb(255 120 100 / .8); }
.zone span { padding: 2px 7px; border-radius: 5px; background: rgb(18 18 18 / .78); line-height: 1.3; }
.zone.top { top: 0; left: 0; right: 0; height: 14%; align-items: flex-start; }
.zone.bottom { bottom: 0; left: 0; right: 0; height: 20%; align-items: flex-end; }
.zone.right { top: 38%; right: 0; width: 12%; height: 24%; writing-mode: vertical-rl; align-items: center; }
.frame-text { position: absolute; left: 7%; right: 16%; top: 28%; color: #fff; font: 700 26px/1.15 var(--sans); text-shadow: 0 2px 12px rgb(0 0 0 / .45); overflow-wrap: anywhere; }
.fl-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.f4 { display: grid; grid-template-columns: 1.1fr 1fr .8fr 1fr; gap: 10px; }
.fl { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fl .chip { align-self: flex-start; margin-top: 8px; }
.field.bad { border-color: var(--st-error); }
textarea[name=theses], textarea[name=title] { overflow: hidden; resize: none; }
textarea[name=title] { min-height: 38px; padding-top: 8px; padding-bottom: 8px; line-height: 1.35; }
textarea.cap { overflow: hidden; resize: none; }
.field.strong { font-weight: 600; font-size: 15px; }
.cap-l { display: flex; justify-content: space-between; gap: 10px; }
.field.cap { min-height: 120px; }
.sls { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--panel); }
.sls:empty { display: none; }
.sl { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-top: 1px solid var(--line); }
.sl:first-child { border-top: 0; }
.sl.on { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.sl.over { background: var(--accent-soft); }
.sl.dragging { opacity: .4; }
.drag { color: var(--faint); cursor: grab; display: grid; place-items: center; }
.drag .ic { width: 14px; height: 14px; }
.sls.cover .sl-t, .sls.cover .sl-n, .sls.cover .drag, .sls.cover .chip { display: none; }
.sls.cover .sl { padding: 8px 10px; }
.sl-n { width: 16px; color: var(--faint); font-size: 13px; text-align: center; }
.sl-th { width: 48px; height: 60px; flex: none; border: 0; border-radius: 7px; overflow: hidden; background: var(--sunken); color: var(--faint); display: grid; place-items: center; padding: 0; }
.sl-th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sl-t { flex: 1; min-width: 0; min-height: 40px; overflow: hidden; border: 1px solid transparent; background: none; resize: none; padding: 6px 8px; border-radius: 7px; font-size: 14px; line-height: 1.35; }
.sl-t:hover, .sl-t:focus { background: var(--sunken); border-color: var(--line); outline: none; }
.w-rm { width: 28px; height: 28px; flex: none; border: 0; border-radius: 6px; background: none; color: var(--faint); display: inline-grid; place-items: center; padding: 0; }
.w-rm:hover { background: var(--raised); color: var(--text); }
.w-rm .ic { width: 14px; height: 14px; }
.w-add { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--muted); font-size: 13px; padding: 4px 0; }
.w-add:hover { color: var(--text); }
.w-add .ic { width: 14px; height: 14px; }
.sb { display: grid; grid-template-columns: 70px 1.4fr 1fr 28px; gap: 8px; margin-bottom: 8px; align-items: center; }
.board-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.dur { display: flex; align-items: center; gap: 8px; }
.dur .field { width: 90px; }
.tgs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 6px; min-height: 42px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--sunken); }
.tg { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 8px 0 10px; border-radius: 14px; border: 0; background: var(--raised); font-size: 13px; }
.tg .ic { width: 12px; height: 12px; }
.tg-in { flex: 1; min-width: 120px; height: 28px; border: 0; background: none; outline: none; padding: 0 6px; font-size: 13.5px; }
.ph-foot { flex: none; display: flex; align-items: center; gap: 20px; padding: 12px 24px; border-top: 1px solid var(--line); }
.ph-foot .saved { margin-left: auto; }
body.panel-open { overflow: hidden; }

/* ---------- sheets, toast, search ---------- */
.layer { position: fixed; inset: 0; z-index: 50; background: var(--scrim); display: flex; justify-content: center; align-items: flex-start; padding: 56px 16px; overflow-y: auto; }
.sheet { width: 720px; max-width: 100%; background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--r-lg); box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; }
.sheet.narrow { width: 540px; }
.sheet.wide { width: 980px; }
.sheet-head { padding: 18px 22px 14px; display: flex; flex-direction: column; gap: 12px; border-bottom: 1px solid var(--line); }
.sheet-head .line { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.sheet-head .line .sub { margin-left: auto; }
.sheet-body { padding: 4px 22px 14px; display: flex; flex-direction: column; }
.sheet-foot { padding: 12px 22px; display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); background: var(--sunken); flex-wrap: wrap; }
.sheet-foot .sub { flex: 1; min-width: 160px; }
.d-sec { padding: 14px 0 6px; font-size: 12px; color: var(--faint); }
.d-row { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 0; border-top: 1px solid var(--line); }
.d-row .t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cand { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 0; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; }
.cand:hover b { color: var(--accent); }
.cand .t { display: flex; flex-direction: column; gap: 2px; }
.cand b { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }
.cand .ic { width: 15px; height: 15px; }
.pk-f { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.pk-f .cl-search { flex: 1; min-width: 200px; }
.pk-f select { width: auto; min-width: 180px; }
.pk-body { max-height: 60vh; overflow-y: auto; }
.pk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; padding-top: 14px; }
.pk { position: relative; aspect-ratio: 4 / 5; padding: 0; border: 0; border-radius: 9px; overflow: hidden; background: var(--sunken); }
.pk img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pk:hover { outline: 2px solid var(--accent); }
.pk-used { position: absolute; left: 5px; bottom: 5px; padding: 1px 6px; border-radius: 5px; font-size: 11px; background: rgb(0 0 0 / .6); color: #fff; }
.search-sheet { margin-top: 8vh; }
.search { padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.q-out { display: flex; flex-direction: column; max-height: 52vh; overflow-y: auto; }
.q-row { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 8px; border-radius: 8px; text-decoration: none; }
.q-row:hover { background: var(--sunken); }
.q-row .t { flex: 1; min-width: 0; }
.q-fmt { font-size: 11.5px; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.use-row { display: grid; grid-template-columns: minmax(0, 1fr) 140px 72px 64px; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.use-row.total { border-top: 1px solid var(--line-strong); }
.use-bar { height: 6px; border-radius: 3px; background: var(--sunken); overflow: hidden; }
.use-bar i { display: block; height: 100%; background: var(--st-published); }
.toast { position: fixed; z-index: 60; left: 50%; bottom: 28px; transform: translateX(-50%); padding: 10px 16px; border-radius: var(--r); background: var(--text); color: var(--bg); font-size: 13.5px; box-shadow: var(--shadow); display: flex; gap: 12px; align-items: center; max-width: calc(100vw - 32px); }
.toast.err { background: var(--st-error); color: #fff; }
.toast button { border: 0; background: none; color: inherit; font-weight: 600; text-decoration: underline; padding: 0; }
.tabbar { display: none; }

/* ---------- narrower: the column folds away, the grid scrolls ---------- */
@media (max-width: 1180px) {
  .panel { width: min(1200px, calc(100vw - 80px)); }
  .ph-body { grid-template-columns: 320px minmax(0, 1fr); }
  .mat { grid-template-columns: minmax(0, 1fr); }
  .mat-side { position: static; }
}
/* ---------- the phone ---------- */
@media (max-width: 860px) {
  header.topbar { padding: 0 12px; gap: 8px; height: 54px; }
  .spend { display: none; }
  .theme-seg button { width: 30px; }
  .shell { display: block; }
  .clients { display: none; }
  body[data-route="clients"] .main { padding-bottom: 80px; }
  .back-m { display: inline-flex; align-items: center; gap: 4px; margin: 10px 12px 0; padding: 4px 8px; color: var(--muted); text-decoration: none; font-size: 13px; }
  .back-m .ic { width: 15px; height: 15px; }
  .chead { padding: 8px 16px 4px; }
  .ctabs { display: none; }
  .chead .h1 { font-size: 20px; }
  .wrow { padding: 6px 16px 12px; gap: 10px; }
  .wr { font-size: 18px; }
  .wr-state { margin-left: 0; width: 100%; }
  .grid-wrap, .hint-line { display: none; }
  .daylist { display: block; padding: 0 16px 20px; }
  .tabbar { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; z-index: 24; left: 0; right: 0; bottom: 0; height: calc(60px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); border-top: 1px solid var(--line); background: var(--panel); }
  .tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; color: var(--faint); text-decoration: none; }
  .tab.on { color: var(--text); }
  .tab .ic { width: 20px; height: 20px; }
  .panel { width: 100vw; border-left: 0; }
  .panel-scrim { display: none; }
  .ph-bar { padding: 0 10px; gap: 8px; }
  .ph-bar #ed-date { display: none; }
  .ph-body { grid-template-columns: minmax(0, 1fr); padding: 14px 14px 24px; gap: 18px; }
  .pv-col { position: static; }
  .frame { width: min(100%, 240px); }
  .f4 { grid-template-columns: 1fr 1fr; }
  .sb { grid-template-columns: 56px minmax(0, 1fr) 28px; }
  .sb input[data-k=on_screen] { grid-column: 1 / 3; grid-row: 2; }
  .ph-foot { padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); gap: 14px; flex-wrap: wrap; }
  .mat { padding: 6px 16px 100px; }
  .ph-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hist { padding: 8px 16px 24px; }
  .layer { padding: 0; align-items: flex-end; }
  .sheet, .sheet.narrow, .sheet.wide { width: 100%; border-radius: var(--r-lg) var(--r-lg) 0 0; max-height: 92vh; overflow-y: auto; }
  .search-sheet { margin-top: 0; }
  .toast { bottom: calc(76px + env(safe-area-inset-bottom)); }
  .selbar { bottom: calc(72px + env(safe-area-inset-bottom)); }
  .use-row { grid-template-columns: minmax(0, 1fr) 70px 56px; }
  .use-row .use-bar { display: none; }
}

/* the editor's own controls: a dropdown with an icon or a chip in it, a calendar, no browser widgets */
.dd { position: relative; }
.dd-b { display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: left; cursor: pointer; padding-right: 10px; }
.dd-v { display: inline-flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; white-space: nowrap; }
.dd-v .ic { color: var(--muted); }
.dd-ch { width: 14px; height: 14px; color: var(--muted); }
.dd-b[aria-expanded="true"] { border-color: var(--muted); }
.dd-b > .ic { width: 15px; height: 15px; color: var(--muted); }
.dd-m { position: absolute; z-index: 40; top: 44px; left: 0; min-width: 100%; padding: 5px; border-radius: var(--r); border: 1px solid var(--line-strong); background: var(--raised); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; }
.dd-o { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 34px; padding: 0 10px; border: 0; border-radius: 7px; background: none; text-align: left; white-space: nowrap; }
.dd-o:hover { background: var(--sunken); }
.dd-o.on { background: var(--sunken); }
.dd-o .ic { color: var(--muted); }
.cal { position: absolute; z-index: 40; top: 44px; left: 0; width: 280px; padding: 10px; border-radius: var(--r); border: 1px solid var(--line-strong); background: var(--raised); box-shadow: var(--shadow); }
.cal-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.cal-w, .cal-g { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.cal-w span { font-size: 11.5px; color: var(--faint); padding: 4px 0; }
.cal-d { height: 34px; border: 0; border-radius: 8px; background: none; font-size: 13.5px; }
.cal-d:hover { background: var(--sunken); }
.cal-d.today { color: var(--accent); font-weight: 600; }
.cal-d.on { background: var(--primary); color: var(--primary-ink); }
@media (max-width: 860px) { .dd-m, .cal { top: 44px; } .cal { width: min(280px, calc(100vw - 40px)); } }

/* ---------- S2: generation, trends, banners, redo, settings, marking ---------- */
.wr-state .btn { position: relative; }
.btn-sub { margin-left: 2px; font-size: 12px; font-weight: 400; color: var(--muted); }
.banner { --bc: var(--accent); display: flex; align-items: center; gap: 14px; margin: 0 24px 14px; padding: 14px 16px; border-radius: var(--r); border: 1px solid color-mix(in srgb, var(--bc) 38%, transparent); background: color-mix(in srgb, var(--bc) 10%, var(--panel)); }
.banner.warn { --bc: var(--st-publishing); }
.banner.bad { --bc: var(--st-error); }
.banner.info { --bc: var(--st-ready); }
.bn-ic { width: 28px; height: 28px; flex: none; display: grid; place-items: center; color: var(--bc); }
.bn-ic .ic { width: 20px; height: 20px; }
.bn-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.bn-t b { font-weight: 600; }
.gen { margin: 0 24px 14px; padding: 16px 18px 14px; border-radius: var(--r); border: 1px solid var(--line); border-left: 3px solid var(--st-ready); background: var(--panel); }
.gen-h { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.gen-h b { font-size: 15px; font-weight: 600; }
.gen-cost { margin-left: auto; color: var(--muted); font-size: 13px; }
.gen .bar { height: 6px; }
.gen .bar i { background: var(--st-ready); }
.gen-st { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 26px; font-size: 13.5px; color: var(--faint); }
.gen-st li { display: inline-flex; align-items: center; gap: 8px; }
.gen-st li.done { color: var(--text); }
.gen-st li.cur { color: var(--text); font-weight: 500; }
.gs-ic { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--line-strong); display: grid; place-items: center; flex: none; }
.gen-st .done .gs-ic { background: var(--text); border-color: var(--text); color: var(--bg); }
.gen-st .gs-ic .ic { width: 12px; height: 12px; stroke-width: 2.4; }
.spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--st-ready); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.trends { margin: 0 24px 16px; border-radius: var(--r); border: 1px solid var(--line); background: var(--panel); }
.tr-h { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border: 0; background: none; text-align: left; }
.tr-hi { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tr-hi .ic { color: var(--muted); }
.tr-ch { color: var(--muted); transition: transform var(--t); }
.trends.shut .tr-ch { transform: rotate(180deg); }
.tr-b { padding: 0 16px 6px; }
.tr-row { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr); gap: 16px; padding: 11px 0; border-top: 1px solid var(--line); font-size: 14px; }
.tr-s { color: var(--muted); }
.tr-l { color: var(--muted); font-size: 13px; }
.tr-l a, .tr-l span { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
.tr-l span { text-decoration: none; }
.tr-l a:hover { color: var(--text); }
.tr-l .ic { width: 14px; height: 14px; }
.tr-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 14px; }
.pc.sk { cursor: default; pointer-events: none; border-style: dashed; background: transparent; }
.pc.sk .pc-body { display: flex; flex-direction: column; gap: 8px; padding: 12px; }
.pc.sk i { display: block; height: 9px; border-radius: 5px; background: var(--raised); animation: pulse 1.4s ease-in-out infinite; }
.pc.sk i.s { width: 55%; }
.pc.sk .pc-cover { background: var(--raised); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .5; } }
@media (prefers-reduced-motion: reduce) { .spin, .pc.sk i, .pc.sk .pc-cover { animation: none; } }

/* the redo block of the editor */
.ph-foot { flex-direction: column; align-items: stretch; gap: 10px; }
.redo { display: flex; flex-direction: column; gap: 10px; }
.redo-r1 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.redo-r1 .chips { display: flex; gap: 8px; flex-wrap: wrap; }
.redo-q { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.redo-r2 { display: flex; gap: 12px; }
.redo-r2 .field { height: 44px; }
.redo-r2 .btn { height: 44px; padding: 0 18px; }
.redo.off .redo-r1, .redo.off .redo-r2 { opacity: .55; }
.redo-note { margin: 0; }
.chip-btn:disabled { opacity: .5; cursor: default; }
.ph-links { display: flex; align-items: center; gap: 20px; }
.ph-links .saved { margin-left: auto; }
.sl-no { font-size: 10.5px; line-height: 1.15; color: var(--muted); text-align: center; padding: 0 3px; }
.sl-th { flex-direction: column; gap: 3px; }

/* the settings sheet */
.st-body { gap: 20px; padding-top: 18px; }
.st-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; }
.st-row > .label { flex: 0 0 190px; font-size: 13px; }
.st-row.col { flex-direction: column; align-items: stretch; }
.st-row.col > .label { flex: none; }
.st-days button { padding: 0 10px; }
.st-time { display: inline-flex; align-items: center; gap: 8px; }
.st-time .field { width: 74px; height: 34px; text-align: center; }
.st-time .field.bad { border-color: var(--st-error); }
.st-hint { flex-basis: 100%; margin-left: 204px; margin-top: -4px; }
.st-acc { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid var(--line); }
.st-pf { display: inline-flex; align-items: center; gap: 8px; }
.st-acc .chips { display: flex; gap: 8px; flex-wrap: wrap; }
.sw { width: 40px; height: 24px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--sunken); padding: 2px; display: inline-flex; }
.sw i { width: 18px; height: 18px; border-radius: 50%; background: var(--muted); transition: transform var(--t) var(--ease), background var(--t); }
.sw[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); }
.sw[aria-pressed="true"] i { transform: translateX(16px); background: var(--primary-ink); }
.gear { margin-left: 6px; }

/* marking of the photos */
.tagline { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; padding: 12px 16px; border-radius: var(--r); border: 1px solid var(--line); background: var(--panel); }
.tagline .t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.tagline .bar i { background: var(--st-ready); }
.tagline .pct { color: var(--faint); font-size: 13px; }
.chips.tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.chip-btn .num { color: var(--faint); margin-left: 4px; }
.chip-btn.on .num { color: inherit; opacity: .7; }

@media (max-width: 760px) {
  .banner, .gen, .trends { margin-left: 16px; margin-right: 16px; }
  .banner { flex-wrap: wrap; }
  .gen-cost { margin-left: 0; flex-basis: 100%; }
  .gen-st { flex-direction: column; gap: 10px; }
  .tr-row { grid-template-columns: 1fr; gap: 3px; }
  .redo-r1 { gap: 8px; } .redo-q { margin-left: 0; }
  .redo-r2 { flex-direction: column; } .redo-r2 .btn { width: 100%; }
  .st-row > .label { flex: 1 0 100%; }
  .st-hint { margin-left: 0; }
  .ph-links { flex-wrap: wrap; gap: 14px; }
}
.wr-state .sub { white-space: nowrap; }
@media (max-width: 760px) {
  .wr-state { margin-left: 0; width: 100%; flex-wrap: wrap; row-gap: 8px; }
  .wr-state .btn { margin-left: auto; }
}

/* ---------- S3: «Выгрузка», sources of the medical mode ---------- */
.xp { padding: 8px 24px 40px; display: flex; flex-direction: column; gap: 16px; max-width: 1100px; }
.xp-h { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.xp-h .h1 { font-size: 20px; }
.xp .banner { margin: 0; }
.xl { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); overflow: hidden; }
.xr { display: grid; grid-template-columns: 92px 64px minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 12px 16px; border-top: 1px solid var(--line); }
.xr:first-child { border-top: 0; }
.xr:has(.xr-pick) { grid-template-columns: 24px 92px 64px minmax(0, 1fr) minmax(0, 300px); }
.xr.done { background: color-mix(in srgb, var(--st-published) 6%, var(--panel)); }
.xr-d { display: flex; flex-direction: column; gap: 2px; }
.xr-d b { font-size: 15px; font-weight: 600; }
.xr-th { width: 64px; height: 64px; border-radius: 10px; overflow: hidden; background: var(--sunken); }
.xr-th img, .xr-th .ph { width: 100%; height: 100%; object-fit: cover; display: block; }
.xr-t { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.xr-t b { font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.xr-a { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.xr-ck { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.xr-ck input, .xr-pick input, .src-ck input { width: 17px; height: 17px; accent-color: var(--primary); }
.xr-r { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; font-size: 13px; }
.xr-ok { color: var(--st-published); font-weight: 500; }
.xr-bad { color: var(--st-error); line-height: 1.35; }
.xp-foot { display: flex; justify-content: flex-end; }
.srcs { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.src { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-top: 1px solid var(--line); }
.src:first-child { border-top: 0; }
.src.ok { background: color-mix(in srgb, var(--st-published) 7%, transparent); }
.src-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; font-size: 13.5px; }
.src-t b { font-weight: 500; }
.src-t a { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; text-underline-offset: 3px; overflow-wrap: anywhere; }
.src-t a .ic { width: 13px; height: 13px; }
.src-no { color: var(--st-error); font-size: 12.5px; }
.src-ck { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); cursor: pointer; white-space: nowrap; }
@media (max-width: 760px) {
  .xp { padding: 8px 16px 40px; }
  .xr, .xr:has(.xr-pick) { grid-template-columns: 56px minmax(0, 1fr); gap: 10px 12px; }
  .xr:has(.xr-pick) .xr-pick { grid-column: 1; grid-row: 1; }
  .xr .xr-d { grid-column: 2; }
  .xr .xr-th { display: none; }
  .xr-t, .xr-a, .xr-r { grid-column: 1 / -1; }
  .xr-a { justify-content: flex-start; }
  .xp-foot .btn { width: 100%; }
}
.xp-foot { position: sticky; bottom: 0; padding: 12px 0; background: linear-gradient(to top, var(--bg) 70%, transparent); }
