/* wow-b v2 «Приёмная»: лист на планшете. Только системные шрифты, без внешних ресурсов. */

:root, [data-theme="light"] {
  --bg: #F2EDE5;            /* стол: овсяная бумага */
  --board: #B48C66;         /* планшет (оргалит) */
  --board-2: #9C764F;       /* кромка планшета */
  --sheet: #FFFDF9;         /* лист */
  --deep: #EFE8DD;          /* углубления на листе и на столе */
  --line: #EEE7DC;
  --ink: #2A2420;
  --ink-2: #4F463E;         /* превью: 9.0:1 на листе */
  --ink-3: #6B6158;         /* мета: 6.0:1 на листе, 5.2:1 на столе */
  --me: #1F6B58;            /* хвоя: «вы», создать; 6.4:1 */
  --me-ink: #FFFFFF;
  --urgent: #C4401F;        /* коралл: только срочное; белое на нём 4.9:1 */
  --urgent-ink: #FFFFFF;
  --urgent-thread: #F2C9BC;
  --tag: #EFE5D6;           /* жетон пациента */
  --tag-ink: #7A5B3F;
  --tag-hi: rgba(255,255,255,.8);
  --new: #2A2420;           /* «новое для вас»: чернильная точка */
  --ring: #9A8E80;          /* кружок закрытия: 3.2:1 */
  --scene: #E0D2BE;
  --scene-cut: #F2EDE5;
  --clip: #4A3F36; --clip-2: #3A3029;
  --shadow-sheet: 0 1px 0 rgba(255,255,255,.9) inset, 0 1px 1px rgba(60,36,16,.18), 0 3px 6px -2px rgba(60,36,16,.18);
  --shadow-board: 0 1px 0 rgba(255,255,255,.25) inset, 0 -1px 0 rgba(0,0,0,.12) inset, 0 2px 3px rgba(74,52,30,.12), 0 18px 40px -18px rgba(74,52,30,.5);
  --shadow-console: 0 1px 0 rgba(255,255,255,.9) inset, 0 2px 6px rgba(74,52,30,.10), 0 16px 36px -14px rgba(74,52,30,.42);
  --grain-op: .045;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #15120F;
  --board: #4A3A2D;
  --board-2: #3B2E23;
  --sheet: #231F1B;
  --deep: #2C2621;
  --line: #332D27;
  --ink: #F4EDE3;
  --ink-2: #D2C6B7;         /* 9.4:1 */
  --ink-3: #ADA192;         /* 6.4:1 */
  --me: #6CC7AC;            /* 7.9:1 */
  --me-ink: #0F2A22;
  --urgent: #E0603E;        /* тёмный текст на нём 5.6:1 */
  --urgent-ink: #2A0F06;
  --urgent-thread: #5A2C1E;
  --tag: #312A24;
  --tag-ink: #CDB090;
  --tag-hi: rgba(255,255,255,.07);
  --new: #F4EDE3;
  --ring: #847869;          /* 3.6:1 */
  --scene: #3B332B;
  --scene-cut: #15120F;
  --clip: #6A5D52; --clip-2: #574B41;
  --shadow-sheet: 0 1px 0 rgba(255,255,255,.05) inset, 0 1px 2px rgba(0,0,0,.45), 0 3px 8px -2px rgba(0,0,0,.4);
  --shadow-board: 0 1px 0 rgba(255,255,255,.08) inset, 0 2px 4px rgba(0,0,0,.4), 0 20px 44px -16px rgba(0,0,0,.8);
  --shadow-console: 0 1px 0 rgba(255,255,255,.06) inset, 0 2px 6px rgba(0,0,0,.45), 0 16px 36px -12px rgba(0,0,0,.85);
  --grain-op: .06;
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg); color: var(--ink);
  font-family: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI Variable Display", "Segoe UI", Roboto, system-ui, sans-serif;
  font-size: 15px; line-height: 1.35; -webkit-font-smoothing: antialiased;
}
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: var(--grain-op);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.35  0 0 0 0 0.25  0 0 0 0 0.15  0 0 0 1 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; text-align: left; }
svg.i { width: 22px; height: 22px; display: block; flex: none; }
.num { font-variant-numeric: tabular-nums; }
.ell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

/* элементы внутри <use> красятся только наследуемыми переменными */
.cut { fill: var(--cutc); }
.t2 { fill: var(--tc2); }
.cuts { fill: none; stroke: var(--scene-cut); }
.cutf { fill: var(--scene-cut); }

/* ---------- жетон пациента (адресник на ошейник) ---------- */
.tag {
  --tb: var(--tag); --tc: var(--tag-ink);
  --cutc: var(--tb); --tc2: color-mix(in srgb, var(--tc) 66%, var(--tb));
  position: relative; flex: none;
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(120% 90% at 30% 16%, var(--tag-hi), transparent 55%), var(--tb);
  box-shadow: inset 0 -1.5px 0 rgba(90,60,30,.12), inset 0 0 0 1px rgba(90,60,30,.06);
  color: var(--tc);
}
/* колечко адресника */
.tag::before {
  content: ""; position: absolute; left: 50%; top: -5px; width: 9px; height: 9px; margin-left: -4.5px;
  border-radius: 50%; border: 2px solid var(--tb); background: transparent;
  box-shadow: 0 0 0 0 transparent;
}
.tag svg { width: 28px; height: 28px; fill: currentColor; }
.tag .ini { font-size: 19px; font-weight: 750; letter-spacing: -.01em; color: var(--tc); line-height: 1; }
.tag--urg { --tb: var(--urgent); --tc: var(--urgent-ink); --tc2: color-mix(in srgb, var(--urgent-ink) 92%, var(--urgent)); --tag-hi: rgba(255,255,255,.22); }
[data-theme="dark"] .tag { box-shadow: inset 0 -1.5px 0 rgba(0,0,0,.35), inset 0 0 0 1px rgba(255,255,255,.04); }
[data-theme="dark"] .tag--urg { --tag-hi: rgba(255,255,255,.18); }
.tag--sm { width: 32px; height: 32px; }
.tag--sm svg { width: 21px; height: 21px; }
.tag--sm .ini { font-size: 15px; }
.tag--sm::before { top: -4px; width: 7px; height: 7px; margin-left: -3.5px; }
/* новое для вас: чернильная точка-бейдж на жетоне */
.tag .nb { position: absolute; right: -3px; top: 3px; width: 11px; height: 11px; border-radius: 50%; background: var(--new); box-shadow: 0 0 0 2.5px var(--sheet); }

/* ---------- планшет и лист ---------- */
.board { position: relative; z-index: 1; background: linear-gradient(180deg, rgba(255,255,255,.07), transparent 40%), var(--board); box-shadow: var(--shadow-board); }
.board::after { /* лёгкая фактура оргалита */
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: .18; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='m'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.3  0 0 0 0 0.2  0 0 0 0 0.1  0 0 0 .9 0'/></filter><rect width='100%' height='100%' filter='url(%23m)'/></svg>");
}
.sheet { position: relative; z-index: 2; background: var(--sheet); box-shadow: var(--shadow-sheet); }
.clip { position: absolute; z-index: 3; left: 50%; pointer-events: none; }
.clip-b { fill: var(--clip); } .clip-t { fill: var(--clip-2); } .clip-h { fill: var(--board); } .clip-l { fill: rgba(255,255,255,.16); }
.cat { position: absolute; bottom: 100%; z-index: 1; color: var(--scene); fill: currentColor; pointer-events: none; }

/* шапка листа: дата + правила одной строкой */
.sh { display: flex; align-items: center; gap: 10px; }
.sh__date { font-size: 17px; font-weight: 700; letter-spacing: -.01em; color: var(--ink); }
.sh__date span { font-weight: 500; color: var(--ink-3); }
.rules { margin-left: auto; display: flex; align-items: center; gap: 6px; height: 44px; padding: 0 10px 0 12px; border-radius: 13px; color: var(--ink-3); font-size: 15px; font-weight: 600; }
.rules .i { width: 18px; height: 18px; }
.rules .chev { width: 16px; height: 16px; }

/* ---------- строка ---------- */
.row { position: relative; display: grid; grid-template-columns: 44px 1fr 44px; column-gap: 12px; align-items: center; }
.row + .row::before, .row + .later::before { content: ""; position: absolute; top: 0; height: 1px; background: var(--line); }
.row__tag { align-self: start; position: relative; display: grid; justify-items: center; }
.row__body { min-width: 0; }
.row__l1 { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.row__name { font-size: 17px; font-weight: 650; letter-spacing: -.01em; color: var(--ink); white-space: nowrap; }
.row__owner { font-size: 15px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row__l2 { margin-top: 2px; font-size: 15px; color: var(--ink-2); }
.meta { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink-3); min-width: 0; }
.meta b { font-weight: 600; color: var(--ink-2); }
.meta b.me { color: var(--me); }
.row--chain-from .row__tag::after { content: ""; position: absolute; left: 50%; width: 2px; margin-left: -1px; border-radius: 2px; background: var(--tag); }
.row--chain-from.is-urg .row__tag::after { background: var(--urgent-thread); }
.chk { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; }
.chk::before { content: ""; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--ring); background: var(--sheet); box-shadow: inset 0 1.5px 2px rgba(80,55,30,.12); }
[data-theme="dark"] .chk::before { box-shadow: inset 0 1.5px 2px rgba(0,0,0,.5); }
.later { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; color: var(--ink-3); font-size: 15px; }
.later b { color: var(--ink-2); font-weight: 600; }
.later .i { width: 20px; height: 20px; }
.later .chev { margin-left: auto; width: 18px; height: 18px; }

.av { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--me); color: var(--me-ink); font-size: 14px; font-weight: 700; letter-spacing: .02em; box-shadow: inset 0 -1.5px 0 rgba(0,0,0,.15); }
.search { display: flex; align-items: center; gap: 10px; color: var(--ink-3); background: var(--deep); box-shadow: inset 0 1.5px 3px rgba(80,55,30,.10); }
[data-theme="dark"] .search { box-shadow: inset 0 1.5px 3px rgba(0,0,0,.45); }
.search .i { width: 20px; height: 20px; }
.kbd { font-size: 12px; font-weight: 600; color: var(--ink-3); border: 1px solid var(--ring); border-radius: 6px; padding: 0 6px; line-height: 18px; }
.new-btn { display: grid; place-items: center; background: var(--me); color: var(--me-ink); box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 2px 4px rgba(20,60,48,.25), 0 12px 24px -10px rgba(20,60,48,.55); }

/* ================= телефон ================= */
.ph { position: relative; height: 100vh; overflow: hidden; z-index: 1; }
.ph__top { display: flex; align-items: center; height: 56px; padding: 6px 12px 0 8px; }
.tabs { display: flex; gap: 2px; }
.tab { height: 44px; padding: 0 12px; border-radius: 13px; display: flex; align-items: center; font-size: 16px; font-weight: 650; color: var(--ink-3); }
.tab.is-on { color: var(--ink); background: var(--deep); box-shadow: inset 0 1px 2px rgba(80,55,30,.10); }
[data-theme="dark"] .tab.is-on { box-shadow: inset 0 1px 2px rgba(0,0,0,.4); }
.ph__top .me { margin-left: auto; width: 44px; height: 44px; display: grid; place-items: center; }
.ph .board { margin: 40px 8px 0; border-radius: 22px 22px 0 0; padding: 12px 8px 0; min-height: calc(100vh - 96px); }
.ph .sheet { border-radius: 14px 14px 0 0; padding: 18px 0 140px; min-height: calc(100vh - 116px); }
.ph .clip { top: -14px; width: 112px; height: 30px; margin-left: -56px; }
.ph .cat { right: 22px; width: 118px; height: 42px; }
.ph .sh { padding: 0 6px 6px 16px; }
.ph .row { padding: 12px 6px 12px 12px; }
.ph .row + .row::before, .ph .row + .later::before { left: 68px; right: 12px; }
.ph .row__tag { grid-row: 1 / span 2; padding-top: 2px; }
.ph .row__body { grid-column: 2 / span 2; grid-row: 1 / span 2; padding-right: 8px; }
.ph .chk { grid-column: 3; grid-row: 1; align-self: start; margin-top: -10px; position: relative; z-index: 1; }
.ph .row__l1 { padding-right: 44px; }
.ph .meta { margin-top: 5px; }
.ph .row--chained .row__tag { padding-top: 8px; }
.ph .row--chain-from .row__tag::after { top: 48px; height: 50px; }
.ph .later { padding: 8px 16px 8px 22px; }
/* консоль под большим пальцем: поиск + задача (вкладки наверху, внизу одна полоса) */
.console { position: absolute; left: 12px; right: 12px; bottom: 22px; z-index: 6; display: flex; gap: 10px; }
.console .search { flex: 1; height: 56px; padding: 0 16px; border-radius: 19px; font-size: 16px; background: var(--sheet); box-shadow: var(--shadow-console); }
.console .new-btn { width: 56px; height: 56px; border-radius: 19px; }
.console .new-btn .i { width: 26px; height: 26px; }
.ph::after { content: ""; position: absolute; left: 16px; right: 16px; bottom: 0; height: 104px; z-index: 5; pointer-events: none;
  background: linear-gradient(to bottom, transparent, var(--sheet) 46%); }

/* ================= компьютер ================= */
.dk { position: relative; z-index: 1; height: 100vh; overflow: hidden; padding: 0 40px; }
.dk__bar { max-width: 1120px; margin: 0 auto; height: 84px; display: flex; align-items: center; gap: 14px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 700; color: var(--ink); margin-right: 18px; }
.brand small { display: block; font-size: 13px; font-weight: 500; color: var(--ink-3); }
.brand__mark { width: 34px; height: 34px; border-radius: 11px; background: var(--ink); color: var(--bg); display: grid; place-items: center; }
.brand__mark svg { width: 22px; height: 22px; fill: currentColor; }
.dk__bar .search { margin-left: auto; width: 300px; height: 44px; padding: 0 12px 0 14px; border-radius: 14px; font-size: 15px; }
.dk__bar .search .kbd { margin-left: auto; }
.dk__bar .new-btn { display: flex; gap: 8px; height: 44px; padding: 0 16px 0 13px; border-radius: 14px; font-size: 15px; font-weight: 650; }
.dk__bar .new-btn .i { width: 20px; height: 20px; }
.dk__bar .new-btn .kbd { color: inherit; border-color: rgba(255,255,255,.45); }
.dk__bar .me { width: 44px; height: 44px; display: grid; place-items: center; }
.dk .board { max-width: 1120px; margin: 48px auto 0; border-radius: 26px 26px 0 0; padding: 16px 16px 0; height: calc(100vh - 132px); }
.dk .sheet { border-radius: 16px 16px 0 0; padding: 30px 0 30px; height: 100%; overflow: hidden; }
.dk .clip { top: -18px; width: 150px; height: 40px; margin-left: -75px; }
.dk .cat { right: 64px; width: 168px; height: 60px; }
.dk .sh { padding: 0 34px 0 36px; }
.dk .sh__date { font-size: 28px; font-weight: 750; letter-spacing: -.02em; }
.dk .sh__date span { font-size: 17px; font-weight: 500; margin-left: 6px; letter-spacing: 0; }
.cols { display: grid; grid-template-columns: 44px 1fr 220px 44px; column-gap: 16px; padding: 18px 26px 8px 36px; font-size: 12.5px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); border-bottom: 1px solid var(--line); }
.cols .legend { text-transform: none; letter-spacing: 0; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; margin-left: 10px; }
.cols .legend i { width: 8px; height: 8px; border-radius: 50%; background: var(--new); display: inline-block; }
.dk .row { grid-template-columns: 44px 1fr 220px 44px; column-gap: 16px; padding: 14px 26px 14px 36px; }
.dk .row + .row::before, .dk .row + .later::before { left: 96px; right: 26px; }
.dk .row__name { font-size: 18px; }
.dk .row__owner, .dk .row__l2 { font-size: 15.5px; }
.dk .row__l2 { margin-top: 3px; }
.dk .meta { display: block; line-height: 1.3; }
.dk .meta b { display: block; font-size: 15px; }
.dk .row--chain-from .row__tag::after { top: 48px; height: 38px; }
.dk .row--chained .row__tag { padding-top: 6px; }
.dk .later { padding: 8px 26px 8px 46px; }

/* ================= v3 ================= */
/* срочно названо словом в начале текста задачи (то же место на телефоне и компьютере) */
.urg { color: var(--urgent); font-weight: 700; }
[data-theme="dark"] .urg { color: #FF8E72; }
.when { color: var(--ink); font-weight: 650; }
/* телефон: текст задачи в две строки */
.ph .row__l2 { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 20px; }
/* низ: консоль стоит на столе, лист уходит под сплошную полосу без просветов */
.ph::after { left: 0; right: 0; height: 96px; background: linear-gradient(to bottom, transparent 0, var(--bg) 16px); }
/* конец листа: «Позже» раскрыто + тихий ключ */
.later-h { position: relative; display: flex; align-items: center; gap: 12px; min-height: 52px; color: var(--ink-3); font-size: 15px; }
.later-h b { color: var(--ink-2); font-weight: 600; }
.later-h .i { width: 20px; height: 20px; }
.later-h .chev { margin-left: auto; width: 18px; height: 18px; transform: rotate(180deg); }
.ph .later-h { padding: 8px 16px 0 22px; }
.ph .later-h::before { content: ""; position: absolute; top: 0; left: 68px; right: 12px; height: 1px; background: var(--line); }
.row.is-later .row__name, .row.is-later .row__l2 { color: var(--ink-2); }
.key { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 18px 16px 0 22px; font-size: 14px; color: var(--ink-3); }
.key span { display: inline-flex; align-items: center; gap: 7px; }
.key i { width: 9px; height: 9px; border-radius: 50%; background: var(--new); display: inline-block; }
.key em { font-style: normal; color: var(--urgent); font-weight: 700; }
.ph--full { height: auto; overflow: visible; }
.ph--full .board, .ph--full .sheet { min-height: 0; }
.ph--full::after { display: none; }
.ph--full .console { position: absolute; }
/* компьютер: блокировка видна, правила смены раскрыты на листе */
.lock { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px 0 12px; border-radius: 14px; color: var(--ink-2); font-size: 15px; font-weight: 600; background: var(--deep); box-shadow: inset 0 1px 2px rgba(80,55,30,.10); }
.lock .i { width: 19px; height: 19px; }
.rules-list { margin: 14px 34px 0 36px; padding: 10px 16px; border-radius: 14px; background: var(--deep); list-style: none; display: grid; gap: 4px; }
.rules-list li { display: flex; align-items: center; gap: 10px; min-height: 26px; font-size: 15px; color: var(--ink-2); }
.rules-list .i { width: 16px; height: 16px; color: var(--ink-3); }
.dk .rules .chev { transform: rotate(180deg); }
.dk .sheet { padding-top: 26px; }
.ph .row--chain-from .row__tag::after { height: 66px; }
.dk__bar, .dk .board { max-width: 1220px; }
.dk__bar .brand, .dk__bar .brand small, .dk__bar .new-btn, .lock, .dk__bar .search span { white-space: nowrap; }
.dk__bar .search { width: 270px; }
.dk__bar .brand { margin-right: 10px; }
