/* Стиль — дизайн-система Додонова (design: ~/Code/dodonov-design-system), приглушённый для долгой работы:
   фон не белый, синий только на действиях и выделении, текст ink7 вместо чёрного. */
:root {
  --blue: #1B4FFF;
  --ink: #0A0E1A;
  --ink7: #2C3654;
  --mute: #5A6478;
  --mute2: #A6AEC2;
  --line: #E6EAF2;
  --edge: rgba(166, 174, 194, .7);
  --frame: rgba(166, 174, 194, .55);
  --paper: #FFFFFF;
  --paper2: #F4F6FB;
  --canvas: #EDF0F6;
  --soft: #E9EFFF;
  --rule: rgba(27, 79, 255, .28);
  --grid: rgba(27, 79, 255, .07);
  --warn: #B4540A;
  --bad: #C0283A;
  --display: 'Oswald', Impact, sans-serif;
  --body: 'Manrope', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --sheet: 0 24px 50px -32px rgba(10, 14, 26, .22);
  --on-blue: #FFFFFF;
  --blue-hover: #1640D6;
  --warn-bg: #FDF1E4;
  --bad-bg: #FCE8EB;
  --hover: rgba(10, 14, 26, .06);
  --backdrop: rgba(10, 14, 26, .32);
  color-scheme: light;
}
/* Тёмная тема: по системе, или вручную кнопкой в шапке (data-theme на <html>) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --blue: #7D96FF;
    --ink: #F2F4FA;
    --ink7: #D3D8E6;
    --mute: #9AA3B7;
    --mute2: #5D677D;
    --line: #262D3B;
    --edge: rgba(154, 163, 183, .55);
    --frame: rgba(154, 163, 183, .32);
    --paper: #1A202C;
    --paper2: #12161F;
    --canvas: #0D1118;
    --soft: #1F2A4A;
    --rule: rgba(125, 150, 255, .45);
    --grid: rgba(125, 150, 255, .07);
    --warn: #F2A867;
    --bad: #FF7385;
    --sheet: 0 24px 50px -32px rgba(0, 0, 0, .7);
    --on-blue: #0A0E1A;
    --blue-hover: #97ABFF;
    --warn-bg: #3A2A17;
    --bad-bg: #3D1D25;
    --hover: rgba(255, 255, 255, .06);
    --backdrop: rgba(0, 0, 0, .6);
    color-scheme: dark;
}
}
:root[data-theme="dark"] {
  --blue: #7D96FF;
  --ink: #F2F4FA;
  --ink7: #D3D8E6;
  --mute: #9AA3B7;
  --mute2: #5D677D;
  --line: #262D3B;
  --edge: rgba(154, 163, 183, .55);
  --frame: rgba(154, 163, 183, .32);
  --paper: #1A202C;
  --paper2: #12161F;
  --canvas: #0D1118;
  --soft: #1F2A4A;
  --rule: rgba(125, 150, 255, .45);
  --grid: rgba(125, 150, 255, .07);
  --warn: #F2A867;
  --bad: #FF7385;
  --sheet: 0 24px 50px -32px rgba(0, 0, 0, .7);
  --on-blue: #0A0E1A;
  --blue-hover: #97ABFF;
  --warn-bg: #3A2A17;
  --bad-bg: #3D1D25;
  --hover: rgba(255, 255, 255, .06);
  --backdrop: rgba(0, 0, 0, .6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; display: flex; flex-direction: column; background: var(--paper2); color: var(--ink7); font: 400 16px/1.55 var(--body); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
[hidden] { display: none !important; }
.label { font: 500 13px/1.4 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--mute); }

/* шапка */
.top { display: flex; align-items: center; gap: 40px; height: 60px; padding: 0 24px; border-bottom: 1px solid var(--line); background: var(--paper2); flex: none; }
.wordmark { flex: none; white-space: nowrap; font: 700 24px/1 var(--display); text-transform: uppercase; letter-spacing: -.01em; color: var(--ink); text-decoration: none; }
.wordmark .dot { display: inline-block; width: .14em; height: .14em; margin-left: .06em; background: var(--blue); vertical-align: baseline; }
.tabs { display: flex; gap: 8px; height: 100%; }
.theme { margin-left: auto; }
.tab { border: 0; background: none; padding: 0 12px; font-weight: 600; font-size: 16px; color: var(--mute); border-bottom: 2px solid transparent; }
.tab:hover { color: var(--ink7); }
.tab.is-on { color: var(--ink); border-bottom-color: var(--blue); }

/* кнопки */
.btn { display: inline-flex; flex: none; align-items: center; justify-content: center; gap: 8px; height: 44px; white-space: nowrap; padding: 0 16px; border: 1px solid var(--frame); border-radius: 12px; background: var(--paper); font-size: 16px; font-weight: 600; transition: border-color .2s var(--ease), background .2s var(--ease); }
.btn:hover { border-color: var(--mute2); background: var(--paper2); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: var(--on-blue); }
.btn.primary:hover { background: var(--blue-hover); border-color: var(--blue-hover); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.icon { width: 44px; padding: 0; justify-content: center; }
.btn.ghost { border-color: transparent; background: none; color: var(--mute); }
.btn.danger { color: var(--bad); }
.ico { display: inline-flex; width: 20px; height: 20px; flex: none; }
.ico svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* рабочая зона: чат слева, схема справа */
.work { flex: 1; min-height: 0; display: grid; grid-template-columns: 400px minmax(0, 1fr); }
.chat { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: var(--paper2); }
.chat-head { display: flex; flex-direction: column; gap: 4px; padding: 16px 24px 12px; border-bottom: 1px solid var(--line); }
.chat-funnel { font-weight: 600; color: var(--ink); }
.chat-log { flex: 1; overflow-y: auto; padding: 16px 24px; display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 92%; padding: 12px 16px; border-radius: 18px; background: var(--paper); border: 1px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.katya { align-self: flex-end; background: var(--soft); border-color: transparent; border-bottom-right-radius: 4px; }
.msg.nafanya { align-self: flex-start; border-bottom-left-radius: 4px; }
.msg.err { border-color: var(--bad); color: var(--bad); }
.msg .about { display: block; margin-bottom: 4px; font: 500 12px/1.4 var(--mono); letter-spacing: .08em; color: var(--mute); }
.msg.wait { color: var(--mute); }
.empty-chat { margin: auto 0; color: var(--mute); }
.empty-chat b { color: var(--ink7); }
.chat-form { padding: 12px 16px 16px; border-top: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.chat-form textarea { width: 100%; min-height: 84px; max-height: 240px; resize: vertical; padding: 12px 16px; border: 1px solid var(--frame); border-radius: 12px; background: var(--paper); line-height: 1.5; }
.chat-actions { display: flex; align-items: center; gap: 8px; }
.chat-actions .hint { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; font-size: 13px; color: var(--mute); }
#mic.rec { border-color: var(--bad); color: var(--bad); }
.ctx { display: flex; align-items: center; gap: 8px; padding: 4px 4px 4px 12px; border-radius: 12px; background: var(--soft); font-size: 14px; font-weight: 600; color: var(--ink7); }
.ctx span { flex: 1; }
.x { width: 36px; height: 36px; border: 0; border-radius: 8px; background: none; position: relative; }
.x::before, .x::after { content: ''; position: absolute; left: 10px; right: 10px; top: 17px; height: 1.6px; background: var(--mute); border-radius: 2px; transform: rotate(45deg); }
.x::after { transform: rotate(-45deg); }
.x:hover { background: var(--hover); }

/* схема */
.board { display: grid; grid-template-rows: auto minmax(0, 1fr); grid-template-columns: minmax(0, 1fr); min-width: 0; min-height: 0; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--paper2); flex: none; }
.toolbar select { flex: 0 1 360px; min-width: 200px; height: 44px; padding: 0 12px; border: 1px solid var(--frame); border-radius: 12px; background: var(--paper); font-weight: 600; }
.status { flex: none; white-space: nowrap; height: 44px; padding: 0 16px; border: 1px solid var(--frame); border-radius: 999px; background: var(--paper); font-size: 14px; font-weight: 600; color: var(--mute); }
.status::before { content: ''; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--mute2); }
.status.on { color: var(--ink); border-color: var(--rule); background: var(--soft); }
.status.on::before { background: var(--blue); }
.issues { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; height: 32px; padding: 0 12px; border: 0; border-radius: 999px; background: var(--warn-bg); color: var(--warn); font-size: 14px; font-weight: 600; }
.issues.bad { background: var(--bad-bg); color: var(--bad); }
.grow { flex: 1; }
.zoombar { display: flex; align-items: center; gap: 8px; }
.zoom { min-width: 48px; text-align: center; font: 500 13px/1 var(--mono); color: var(--mute); }
.canvas { grid-area: 2 / 1; position: relative; overflow: hidden; background-color: var(--canvas); background-image: radial-gradient(var(--grid) 1.2px, transparent 1.2px); background-size: 20px 20px; cursor: grab; touch-action: none; }
.canvas.panning { cursor: grabbing; }
.world { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.edges { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: visible; pointer-events: none; }
.edges path { fill: none; stroke: var(--edge); stroke-width: 1.6; }
.edges path.on { stroke: var(--blue); stroke-width: 2; }
.edges path.dim { opacity: .35; }
.edges path.link { stroke-dasharray: 6 5; }   /* пунктир — переход по условию, без кнопки */
.building { position: absolute; left: 50%; top: 16px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 8px 16px; border-radius: 999px; background: var(--paper); box-shadow: var(--sheet); font-size: 14px; font-weight: 600; color: var(--ink7); }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); }

/* блок */
.node { position: absolute; width: 280px; border: 1px solid var(--frame); border-radius: 18px; background: var(--paper); cursor: pointer; user-select: none; transition: border-color .2s var(--ease), box-shadow .2s var(--ease); }
.node:hover { border-color: var(--mute2); }
.node.sel { border-color: var(--blue); box-shadow: 0 0 0 3px var(--soft); }
.node.dragging { cursor: grabbing; box-shadow: var(--sheet); z-index: 2; }
.node.t-start { border-top: 3px solid var(--blue); }
.node.t-pause { background: var(--paper2); border-style: dashed; }
.node.t-lead { background: var(--soft); border-color: var(--rule); }
.node.t-end { width: 216px; background: var(--paper2); }
.nh { display: flex; align-items: center; gap: 8px; padding: 12px 16px 0; color: var(--mute); }
.nh .ico { width: 16px; height: 16px; }
.t-start .nh, .t-lead .nh { color: var(--blue); }
.nh .label { color: inherit; font-size: 12px; }
.nh .flag { margin-left: auto; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); }
.nh .flag.bad { background: var(--bad); }
.ntitle { padding: 4px 16px 0; font-weight: 700; font-size: 16px; line-height: 1.35; color: var(--ink); }
.nimg { display: block; width: calc(100% - 32px); height: 64px; margin: 12px 16px 0; border-radius: 12px; object-fit: cover; background: var(--paper2); }
.ntext { padding: 8px 16px 0; font-size: 14px; line-height: 1.45; color: var(--ink7); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.nmeta { padding: 8px 16px 0; font-size: 14px; color: var(--mute); }
.nouts { list-style: none; margin: 12px 0 0; padding: 0 0 16px; display: grid; gap: 8px; }
.nouts:empty { padding: 0 0 16px; margin: 0; }
.nout { position: relative; margin: 0 16px; padding: 4px 12px; border-radius: 6px; background: var(--paper2); border: 1px solid var(--line); font-size: 14px; line-height: 1.4; color: var(--ink7); }
.t-lead .nout, .t-pause .nout { background: var(--paper); }
.nout.next, .nout.link { background: none; border: 1px dashed var(--frame); color: var(--mute); }
.nout.url { color: var(--blue); }
.nout.loose { border-color: var(--warn); color: var(--warn); }
.port { position: absolute; right: -23px; top: 50%; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%; background: var(--paper); border: 1.6px solid var(--mute2); }
.port.in { right: auto; left: -6px; top: 22px; margin-top: -5px; }
.node.sel .port { border-color: var(--blue); }
@media (prefers-reduced-motion: no-preference) {
  .node.flash { animation: flash 1.8s var(--ease); }
  .pulse { animation: pulse 1.2s ease-in-out infinite; }
}
@keyframes flash { 0% { box-shadow: 0 0 0 0 rgba(27, 79, 255, .45); border-color: var(--blue); } 100% { box-shadow: 0 0 0 14px rgba(27, 79, 255, 0); } }
@keyframes pulse { 50% { opacity: .3; } }

/* панель блока */
.inspector { grid-area: 2 / 1; justify-self: end; z-index: 3; min-height: 0; width: 440px; max-width: 100%; overflow-y: auto; background: var(--paper); border-left: 1px solid var(--line); box-shadow: var(--sheet); padding: 24px 24px 32px; display: grid; align-content: start; gap: 24px; }
.insp-head { display: flex; align-items: flex-start; gap: 8px; }
.insp-head .label { flex: 1; padding-top: 6px; }
.field { display: grid; gap: 8px; }
.field > span { font-size: 14px; font-weight: 600; color: var(--ink); }
.field input, .field textarea, .field select { width: 100%; min-width: 0; border: 1px solid var(--frame); border-radius: 12px; background: var(--paper); line-height: 1.5; }
.field input, .field select { height: 48px; padding: 0 12px; }
.field textarea { min-height: 160px; padding: 12px; resize: vertical; }
.field .title-input { font-weight: 700; font-size: 18px; color: var(--ink); }
.field > .btn { justify-self: start; }
.row { display: flex; gap: 8px; align-items: center; }
.row > input, .row > select { flex: 1; min-width: 0; }
.row > .btn { height: 48px; }
.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.btns { display: grid; gap: 8px; }
.bt { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper2); }
.check { display: flex; align-items: center; gap: 12px; min-height: 44px; font-size: 16px; color: var(--ink7); cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--blue); }
.row.wrap { flex-wrap: wrap; }
.dest { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.dest-k { flex: none; font-size: 14px; color: var(--mute); }
.dest-go { display: inline-flex; align-items: center; gap: 8px; min-width: 0; min-height: 44px; padding: 0 12px; border: 1px solid var(--frame); border-radius: 12px; background: var(--paper); font-weight: 600; text-align: left; }
.dest-go:hover { border-color: var(--blue); color: var(--blue); }
.dest-go .ico { width: 16px; height: 16px; color: var(--mute); }
.dest .x { margin-left: auto; flex: none; }
.dest-new { font-size: 14px; font-weight: 600; color: var(--blue); }
.dest-bad { font-size: 14px; font-weight: 600; color: var(--warn); }
.img-prev { width: 100%; max-height: 180px; object-fit: cover; border-radius: 12px; }
.inspector .del { justify-self: start; padding: 0 8px; }
.insp-foot { position: sticky; bottom: -32px; margin: 0 -24px -32px; padding: 16px 24px 32px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; background: var(--paper); border-top: 1px solid var(--line); }
.note { font-size: 14px; color: var(--mute); }
.note.warn { color: var(--warn); }

/* вопрос «сохранить?» */
.dlg { width: min(480px, calc(100% - 32px)); padding: 24px; border: 0; border-radius: 18px; background: var(--paper); color: var(--ink7); box-shadow: var(--sheet); }
.dlg::backdrop { background: var(--backdrop); }
.dlg h2 { margin: 0 0 8px; font-size: 20px; line-height: 1.25; color: var(--ink); }
.dlg p { margin: 0 0 24px; }
.dlg-foot { display: flex; flex-wrap: wrap; gap: 8px; }

/* шапка: где я */
.crumb { display: flex; align-items: baseline; gap: 8px; flex: none; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 16px; }
.crumb-k { font-weight: 500; color: var(--mute); }
.crumb-k::after { content: '/'; margin-left: 8px; color: var(--mute2); }
.crumb:hover .crumb-k { color: var(--blue); }

/* страницы: клиенты, база, аналитика, настройки */
.page { flex: 1; min-height: 0; overflow-y: auto; padding: 48px 24px 64px; }
.page-in { max-width: 1120px; margin: 0 auto; }
.page h1 { margin: 0 0 24px; font: 700 38px/1.1 var(--display); text-transform: uppercase; letter-spacing: -.01em; color: var(--ink); }
.page h2 { margin: 48px 0 16px; font-size: 20px; line-height: 1.25; color: var(--ink); }
.page .lead { margin: -16px 0 32px; font-size: 18px; color: var(--mute); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.card { display: grid; align-content: start; gap: 8px; padding: 24px; border: 1px solid var(--frame); border-radius: 18px; background: var(--paper); color: var(--ink7); text-decoration: none; transition: border-color .2s var(--ease), box-shadow .2s var(--ease); }
.card:hover { border-color: var(--blue); box-shadow: 0 0 0 3px var(--soft); }
.card h2 { margin: 0; font: 700 24px/1.2 var(--display); text-transform: uppercase; color: var(--ink); }
.card p { margin: 0; }
.card ul { list-style: none; margin: 8px 0 0; padding: 16px 0 0; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.card li { display: flex; align-items: center; gap: 8px; }
.muted { color: var(--mute); }
.dot-s { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--mute2); }
.dot-s.on { background: var(--blue); }
.search { width: min(360px, 100%); height: 48px; margin-bottom: 16px; padding: 0 16px; border: 1px solid var(--frame); border-radius: 12px; background: var(--paper); }
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); }
.tbl { width: 100%; border-collapse: collapse; font-size: 15px; }
.tbl th { padding: 12px 16px; text-align: left; white-space: nowrap; font: 500 12px/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--mute); border-bottom: 1px solid var(--line); }
.tbl td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl-wrap.tall { max-height: max(360px, calc(100vh - 300px)); overflow: auto; }
.tall .tbl td { white-space: nowrap; }
.tall .tbl th { position: sticky; top: 0; z-index: 1; background: var(--paper); border-bottom: 0; box-shadow: inset 0 -1px var(--line); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl a, .sets a { color: var(--blue); text-decoration: none; }
.tbl a:hover, .sets a:hover { text-decoration: underline; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; }
.tile { display: grid; gap: 8px; padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); }
.tile b { font: 700 38px/1.1 var(--display); color: var(--ink); font-variant-numeric: tabular-nums; }
.facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-width: 720px; }
.facts li { display: flex; justify-content: space-between; gap: 16px; padding: 12px 16px; border-radius: 12px; background: var(--paper); border: 1px solid var(--line); }
.facts b { font-variant-numeric: tabular-nums; color: var(--ink); }
.sets { margin: 0; display: grid; gap: 8px; max-width: 880px; }
.sets div { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 16px; padding: 12px 16px; border-radius: 12px; background: var(--paper); border: 1px solid var(--line); }
.sets dt { font-weight: 600; color: var(--ink); }
.sets dd { margin: 0; overflow-wrap: anywhere; }
.page .note { margin-top: 16px; }
.page h3 { margin: 32px 0 12px; font-size: 16px; line-height: 1.25; color: var(--ink); }
.bot { padding: 32px 0 48px; border-top: 1px solid var(--line); }
.bot:first-of-type { border-top: 0; padding-top: 0; }
.bot-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-bottom: 24px; }
.bot-head h2 { margin: 0; }
.bot-head a { color: var(--blue); text-decoration: none; font-weight: 600; }
.pill { display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 12px; border-radius: 999px; font-size: 14px; font-weight: 600; background: var(--paper); border: 1px solid var(--frame); color: var(--mute); }
.pill::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--mute2); }
.pill.on { background: var(--soft); border-color: var(--rule); color: var(--ink); }
.pill.on::before { background: var(--blue); }
.pill.off { color: var(--bad); }
.pill.off::before { background: var(--bad); }
.duo { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 0 24px; }
.empty-board { grid-area: 2 / 1; align-self: center; justify-self: center; text-align: center; color: var(--mute); font-size: 18px; }
.empty-board b { color: var(--ink7); }

@media (max-width: 1200px) {
  .work { grid-template-columns: 340px minmax(0, 1fr); }
  .chat-actions .hint { visibility: hidden; }
}
@media (max-width: 900px) {
  .sets div { grid-template-columns: 1fr; gap: 4px; }
  .page { padding: 32px 16px 48px; }
  .work { grid-template-columns: 1fr; grid-template-rows: minmax(0, 45vh) minmax(0, 1fr); }
  .chat { border-right: 0; border-bottom: 1px solid var(--line); }
  .top { gap: 16px; padding: 0 16px; overflow-x: auto; }
  .inspector { width: 100%; }
}

/* ── рассылки ── */
.mails { margin-top: 32px; }
.mails .card { text-align: left; font: inherit; cursor: pointer; }
.back { margin: -16px 0 16px -16px; }
.m-title { width: 100%; margin: 0 0 24px; padding: 0; border: 0; background: none; font: 700 38px/1.1 var(--display); text-transform: uppercase; letter-spacing: -.01em; color: var(--ink); }
.m-title:focus-visible { outline-offset: 4px; }
.m-group { display: grid; gap: 8px; margin-bottom: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 1px solid var(--frame); border-radius: 999px; background: var(--paper); cursor: pointer; font-weight: 600; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip b { font: 500 13px/1 var(--mono); color: var(--mute); }
.chip:has(input:checked) { border-color: var(--blue); background: var(--soft); color: var(--ink); }
.chip:has(input:focus-visible) { outline: 2px solid var(--blue); outline-offset: 2px; }
.m-date { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.m-date input { height: 44px; padding: 0 12px; border: 1px solid var(--frame); border-radius: 12px; background: var(--paper); }
.m-count { margin: 24px 0 8px; font-size: 18px; }
.m-count b { font: 700 38px/1 var(--display); color: var(--ink); margin-right: 8px; }
.m-who summary { cursor: pointer; font-weight: 600; color: var(--blue); min-height: 44px; display: flex; align-items: center; }
.m-who .tbl-wrap { margin-top: 8px; }
.m-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.m-two textarea { width: 100%; padding: 12px 16px; border: 1px solid var(--frame); border-radius: 12px; background: var(--paper); line-height: 1.5; resize: vertical; }
.m-two > div { display: grid; gap: 12px; align-content: start; }
.m-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.m-btn { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr) 44px; gap: 8px; margin-bottom: 8px; }
.m-btn input { height: 44px; min-width: 0; padding: 0 12px; border: 1px solid var(--frame); border-radius: 12px; background: var(--paper); }
.bubble { margin-top: 8px; padding: 16px; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); }
.bubble p { margin: 8px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.tg-btn { display: block; margin-top: 8px; padding: 10px; border-radius: 12px; background: var(--soft); color: var(--blue); text-align: center; font-weight: 600; }
.vk-link { color: var(--blue); }
.m-check { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 8px; }
.m-check li { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--paper); color: var(--mute); }
.m-check li::before { content: ''; flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--mute2); }
.m-check li.ok { color: var(--ink7); }
.m-check li.ok::before { background: var(--blue); }
.m-check .check { min-height: 0; color: inherit; }
@media (max-width: 900px) { .m-two { grid-template-columns: minmax(0, 1fr); } .m-title { font-size: 30px; } }
.m-two > div > .btn { justify-self: start; }

/* вход и кабинет */
.me { display: flex; align-items: center; gap: 8px; margin-left: auto; font-size: 14px; color: var(--mute); white-space: nowrap; }
.me:not([hidden]) + .theme { margin-left: 0; }
.login { display: grid; place-items: center; }
.login-card { display: grid; gap: 8px; width: min(360px, 100%); padding: 32px; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); }
.login-card label { margin-top: 8px; font-size: 14px; color: var(--mute); }
.login-card input { height: 48px; padding: 0 16px; border: 1px solid var(--frame); border-radius: 12px; background: var(--paper); color: var(--ink); font-size: 16px; }
.login-card .btn { margin-top: 16px; }
.tbl tr.go { cursor: pointer; }
.tbl tr.go:hover td, .tbl tr.go:focus-visible td { background: var(--hover); }
.lock { padding: 12px 16px; border-radius: 12px; background: var(--soft); color: var(--ink7); font-size: 14px; }
.talk { display: grid; gap: 8px; margin-top: 24px; }
.msg { max-width: min(640px, 85%); padding: 12px 16px; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.bot { justify-self: end; border-color: transparent; background: var(--soft); }
.msg time { display: block; margin-bottom: 4px; font: 500 12px/1.4 var(--mono); color: var(--mute); }
