/* =====================================================================
   Деловойс · кабинет v8.6
   Справка и «О Деловойсе» внутри кабинета; тёмная тема.
   Тёмная тема — та же палитра: Abyssal и Blue Fantastic вместо Palladian,
   Oatmeal для текста, Truffle и Burning Flame — акценты.
   ===================================================================== */

/* ---------- справка ---------- */
.h86,.a86{display:flex;flex-direction:column;gap:16px}
.h86-grid{display:grid;grid-template-columns:220px minmax(0,1fr);gap:20px;align-items:start}
.h86-toc{position:sticky;top:76px;display:flex;flex-direction:column;gap:2px;padding:6px 0}
.h86-toc a{display:block;padding:7px 10px;border-radius:8px;font-size:13.5px;color:var(--ds-text-muted);text-decoration:none;cursor:pointer}
.h86-toc a:hover{background:var(--ds-hover);color:var(--ds-fg)}
.h86-toc .h86-sup{display:flex;align-items:center;gap:8px;margin-top:10px;color:var(--ds-accent);font-weight:600}
.h86-toc .h86-sup svg{width:16px;height:16px}
.h86-body{display:flex;flex-direction:column;gap:14px;max-width:820px;min-width:0}
.h86-sec{scroll-margin-top:76px;padding:18px 22px}
.h86-sec h3{margin:0 0 12px;font:500 17px/1.25 var(--ds-head);letter-spacing:-.01em;color:var(--ds-fg)}
.h86-lead{padding:18px 22px;background:var(--ds-muted);border-color:transparent}
.h86-lead p{margin:0;font-size:15px;line-height:1.6;color:var(--ds-fg)}
.h86-note{margin:-4px 0 10px;font-size:13px;color:var(--ds-text-subtle)}
.h86-steps{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:12px}
.h86-steps li{display:flex;gap:14px;align-items:flex-start}
.h86-steps .n{flex:none;display:grid;place-items:center;width:28px;height:28px;border-radius:50%;background:var(--ds-muted);
  font:600 12px/1 var(--ds-mono);color:var(--ds-accent)}
.h86-steps b{display:block;font-size:14.5px;color:var(--ds-fg);margin:3px 0 3px}
.h86-steps p{margin:0;font-size:14px;line-height:1.55;color:var(--ds-text-muted)}
.h86-terms{display:grid;grid-template-columns:minmax(120px,170px) minmax(0,1fr);gap:10px 18px;margin:0}
.h86-terms dt{font-weight:600;font-size:14px;color:var(--ds-fg)}
.h86-terms dd{margin:0;font-size:14px;line-height:1.55;color:var(--ds-text-muted)}
.h86-list{margin:0;padding:0 0 0 18px;display:flex;flex-direction:column;gap:9px}
.h86-list li{font-size:14px;line-height:1.55;color:var(--ds-text-muted)}
.h86-list li::marker{color:var(--ds-accent)}
.h86-list b{color:var(--ds-fg);font-weight:600}
.h86-help{display:flex;flex-direction:row;align-items:center;text-align:left;justify-content:space-between;gap:16px;flex-wrap:wrap;padding:18px 22px}
.h86-help h3{margin:0;font:500 16px/1.25 var(--ds-head);color:var(--ds-fg)}
.h86-help p{margin:4px 0 0;font-size:13.5px;color:var(--ds-text-muted)}
.h86 a.dhp,.a86 a.dhp{text-decoration:none}
@media (max-width:900px){
  .h86-grid{grid-template-columns:minmax(0,1fr)}
  .h86-toc{position:static;flex-direction:row;flex-wrap:wrap;gap:6px;padding:0}
  .h86-toc a{padding:6px 10px;background:var(--ds-muted);border-radius:999px;font-size:12.5px}
  .h86-toc .h86-sup{margin-top:0}
}
@media (max-width:600px){
  .h86-sec,.h86-lead,.h86-help{padding:16px}
  .h86-terms{grid-template-columns:minmax(0,1fr);gap:2px}
  .h86-terms dd{margin-bottom:10px}
  .h86-help .dhp{width:100%;justify-content:center}
}

/* ---------- о Деловойсе ---------- */
.a86-grid{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(0,1fr);gap:16px;align-items:start}
.a86-side{display:flex;flex-direction:column;gap:16px;min-width:0}
.a86 .dhc{padding:18px 20px}
.a86-dl{display:grid;grid-template-columns:150px minmax(0,1fr);gap:12px 16px;margin:14px 0 0}
.a86-dl dt{font-size:13px;color:var(--ds-text-subtle)}
.a86-dl dd{margin:0;font-size:14px;color:var(--ds-fg);overflow-wrap:anywhere}
.a86-dl dd.mono{font-family:var(--ds-mono);font-size:13px}
.a86-dl a{color:var(--ds-accent)}
.a86-dl.sm{grid-template-columns:90px minmax(0,1fr)}
.a86-empty{font-family:var(--ds-font);font-size:13px;color:var(--ds-text-subtle);font-style:italic}
.a86-docs{display:flex;flex-direction:column;gap:6px;margin-top:12px}
.a86-docs a{display:flex;align-items:center;gap:10px;padding:10px 12px;border-radius:12px;background:var(--ds-muted);color:var(--ds-fg);text-decoration:none;font-size:14px}
.a86-docs a:hover{background:var(--ds-muted-hover)}
.a86-docs svg{width:18px;height:18px;color:var(--ds-accent);flex:none}
.a86-acts{display:flex;gap:8px;flex-wrap:wrap;margin-top:16px}
@media (max-width:900px){ .a86-grid{grid-template-columns:minmax(0,1fr)} }
@media (max-width:600px){ .a86-dl{grid-template-columns:minmax(0,1fr);gap:2px} .a86-dl dd{margin-bottom:10px} .a86-acts .dhp{flex:1;justify-content:center} }

/* ---------- переключатель темы ---------- */
#dsTheme svg{width:17px;height:17px}
html.th-anim body,html.th-anim body *{transition:background-color .3s ease,border-color .3s ease,color .2s ease,fill .3s ease !important}

/* =====================================================================
   ТЁМНАЯ ТЕМА
   ===================================================================== */
html[data-theme="dark"]{
  color-scheme:dark;
  --ds-bg:#121A23;
  --ds-panel:#121A23;
  --ds-control:#1F2B38;
  --ds-muted:#1F2B39;
  --ds-muted-hover:#283748;
  --ds-border:#243241;
  --ds-border-strong:#34465A;
  --ds-fg:#EDE7DC;
  --ds-text-muted:#BDB5A6;
  --ds-text-subtle:#8A93A0;
  --ds-icon:#C9C1B1;
  --ds-hover:rgb(237 231 220 / .06);
  --ds-accent:#D9744F;
  --ds-accent-hover:#E5845F;
  --ds-accent-fg:#FFF8EC;
  --ds-flame:#FFB162;
  --ds-success:#6DBB98;
  --ds-warning:#E8A84E;
  --ds-danger:#EF7A68;
  --ds-danger-solid:#C2412F;
  --ds-danger-solid-hover:#D04C39;
  --ds-ring:#6E7C8C;
  --ds-control-shadow:0 0 0 1px rgb(237 231 220 / .08), 0 1px 2px rgb(0 0 0 / .3);
  --ds-accent-shadow:0 2px 6px rgb(0 0 0 / .35), 0 0 0 1px #8C432F, inset 0 4px 6px rgb(255 255 255 / .14),
    inset 0 0 0 1px rgb(255 255 255 / .1), inset 0 -8px 14px rgb(0 0 0 / .18);
  --ds-menu:rgb(27 38 50 / .9);
  --ds-menu-highlight:rgb(237 231 220 / .07);
  --ds-menu-shadow:0 0 0 1px rgb(237 231 220 / .08), 0 2px 4px rgb(0 0 0 / .2), 0 16px 40px -8px rgb(0 0 0 / .6);
  --card:#1A2430; --line-2:#22303E; --brand2:#34465A;
  /* поверхность плиток и тона делометрики */
  --t86-card:#1A2430;
  --t86-soft:#2A2420;      /* тёплая подложка вместо розовой */
  --t86-red:#3A2226; --t86-green:#1E3530; --t86-amber:#3A2F1C; --t86-fire:#3D261C;
  --mx-g:#8FA8C2; --mx-m:#FFB162; --mx-b:#E07B5C; --mx-n:#55606C;
}
html[data-theme="dark"] body{background:var(--ds-bg);color:var(--ds-fg)}

/* боковое меню: ночная лужайка */
html[data-theme="dark"] #side,html[data-theme="dark"] #dsDrawer .pn{--ds-sidebar:#161F2A;background:#161F2A}
html[data-theme="dark"] #side .ds-foot::after,html[data-theme="dark"] #dsDrawer .ds-foot::after{background-image:url(/lawn-dark.webp)}
html[data-theme="dark"] .ds-item[aria-current="page"],html[data-theme="dark"] .ds-pill{background:#223040}

/* плитки и карточки */
html[data-theme="dark"] .dhc,
html[data-theme="dark"] #main .card,html[data-theme="dark"] #main .xcard,
html[data-theme="dark"] .dx-sum div,html[data-theme="dark"] .mx-t,
html[data-theme="dark"] .mxl button{background:var(--t86-card)}
html[data-theme="dark"] .dhm-rec{background:linear-gradient(180deg,#22252A 0%,var(--t86-card) 70%)}
html[data-theme="dark"] .d85-fresh{border-color:#4A3226;background:linear-gradient(90deg,#2B211D,var(--t86-card) 70%)}
html[data-theme="dark"] .d85-fresh .ic{background:var(--t86-fire)}
html[data-theme="dark"] .dhu-zone{background:repeating-linear-gradient(135deg,transparent 0 10px,rgb(237 231 220 / .035) 10px 11px)}
html[data-theme="dark"] .dhu-zone:hover,html[data-theme="dark"] .dhu-zone.over{background-color:rgb(255 177 98 / .06)}
html[data-theme="dark"] .dhu-zone .ic{background:var(--ds-control)}
html[data-theme="dark"] .dhr-btn{color:#fff}
html[data-theme="dark"] .dhr-btn::before{border-color:rgb(217 116 79 / .25)}

/* тёмные кнопки становятся светлыми */
html[data-theme="dark"] .dhp.dark,html[data-theme="dark"] .rx-tabs button.on,html[data-theme="dark"] .mx-sw button.on,
html[data-theme="dark"] #main .xbtn.dark,html[data-theme="dark"] .ds-rec{background:var(--ds-fg);color:#121A23}
html[data-theme="dark"] .dhp.dark:hover,html[data-theme="dark"] #main .xbtn.dark:hover{background:#FFFFFF}
html[data-theme="dark"] .dhp:disabled{background:#26313D;color:#5E6875}
html[data-theme="dark"] .dhp.line:disabled{color:#5E6875;box-shadow:inset 0 0 0 1.5px #2E3B4A;background:none}

/* поля ввода */
html[data-theme="dark"] .mxc-ed select,html[data-theme="dark"] .mxc-ed .inp,html[data-theme="dark"] .mx-per .dhu-date,
html[data-theme="dark"] .dx-in,html[data-theme="dark"] .wx-code,html[data-theme="dark"] .rx-search,
html[data-theme="dark"] input,html[data-theme="dark"] textarea,html[data-theme="dark"] select{background:var(--ds-control);color:var(--ds-fg);border-color:var(--ds-border-strong)}
html[data-theme="dark"] input::placeholder,html[data-theme="dark"] textarea::placeholder{color:#6E7884}

/* календарь */
html[data-theme="dark"] .dhk .wd.we{color:#7C705F}
html[data-theme="dark"] .dhk button.out{color:#4C5866}
html[data-theme="dark"] .dhk button.today .n{background:var(--ds-fg);color:#121A23}
html[data-theme="dark"] .dhk button.today.mt .n{box-shadow:inset 0 0 0 2px #121A23,0 0 0 1.5px var(--mx-g)}
html[data-theme="dark"] .dhk button.sel{background:var(--t86-fire)}
html[data-theme="dark"] .dhk button.inr{background:rgb(237 231 220 / .06)}

/* метки */
html[data-theme="dark"] .dhchip.red,html[data-theme="dark"] .dhl .cnt.red,html[data-theme="dark"] .d85-lost button,
html[data-theme="dark"] .m85-msg.err,html[data-theme="dark"] .mxd.down{background:var(--t86-red);color:var(--ds-danger)}
html[data-theme="dark"] .dhchip.green,html[data-theme="dark"] .mxd.up,html[data-theme="dark"] .m85-msg.ok{background:var(--t86-green);color:var(--ds-success)}
html[data-theme="dark"] .dhchip.amber{background:var(--t86-amber);color:var(--ds-warning)}
html[data-theme="dark"] .dhchip.fire,html[data-theme="dark"] .dhl .fl.fire{background:var(--t86-fire);color:#F0956F}
html[data-theme="dark"] .d85-mt .w.t-m,html[data-theme="dark"] .mxchip.t-m{color:var(--ds-flame)}
html[data-theme="dark"] .mxchip{background:color-mix(in srgb,var(--c) 22%,#1A2430);color:color-mix(in srgb,var(--c) 70%,#fff)}
html[data-theme="dark"] .mxb.empty{background:repeating-linear-gradient(135deg,var(--ds-muted) 0 6px,#2A3746 6px 8px)}
html[data-theme="dark"] .mxln .pt{fill:var(--t86-card)}
html[data-theme="dark"] .d85-sum small{background:rgb(0 0 0 / .2)}

/* удаление и очистка */
html[data-theme="dark"] .dhp.line.dx-del{box-shadow:inset 0 0 0 1.5px #5A2F2A}
html[data-theme="dark"] .dhp.line.dx-del:hover{background:var(--t86-red)}
html[data-theme="dark"] .dx-danger{border-color:#5A2F2A;background:#211A1D}

/* текст встречи */
html[data-theme="dark"] .rx-ln.hit{background:#2D2618}
html[data-theme="dark"] .rx-ln mark{background:#6B4A1E;color:#FFE9C9}

/* анкета и старые разделы */
html[data-theme="dark"] .qchip{background:var(--ds-control);color:var(--ds-fg);border-color:var(--ds-border-strong)}
html[data-theme="dark"] .qchip.on{background:var(--ds-fg);color:#121A23;border-color:var(--ds-fg)}
html[data-theme="dark"] .life .gap i{background:var(--t86-card);border-color:#3E5568}

/* меню и окна */
html[data-theme="dark"] .ds-layer,html[data-theme="dark"] .ds-dialog,html[data-theme="dark"] .ds-dlg{color:var(--ds-fg)}
@media (max-width:600px){ #dsTheme{display:none} }   /* на телефоне тема — в меню аккаунта */

/* ---------- v8.8: меню прячется ---------- */
#app.ds{transition:grid-template-columns .28s var(--ds-ease)}
#app.ds[data-resizing]{transition:none}
#app.ds[data-sbc]{grid-template-columns:0 minmax(0,1fr)}
#app.ds[data-sbc] > aside.ds-side{overflow:hidden;border-right-color:transparent;visibility:hidden;transition:visibility 0s .28s}
#app.ds[data-sbc] .ds-rz{display:none}
#dsSbBtn svg{width:18px;height:18px}
@media (max-width:899px){ #dsSbBtn{display:none} }
@media (prefers-reduced-motion: reduce){ #app.ds{transition:none} }

/* ---------- v8.8: надписи на время расшифровки ---------- */
#prog .pg .pq{margin-left:auto;max-width:52%;font:500 12.5px/1.35 var(--ds-font);color:var(--ds-text-muted);text-align:right;
  transition:opacity .35s ease, transform .35s ease}
#prog .pg .pq.out{opacity:0;transform:translateY(-3px)}
@media (max-width:600px){ #prog .pg .pq{margin-left:0;max-width:none;width:100%;text-align:left} }
@media (prefers-reduced-motion: reduce){ #prog .pg .pq{transition:none} }
#prog .pg .pl{display:flex;gap:4px;margin-top:-2px}
#prog .pg .pl span{flex:1;min-width:0;font:500 12px/1.35 var(--ds-font);color:var(--ds-text-subtle)}
#prog .pg .pl span.a{color:var(--ds-fg);font-weight:600}
#prog .pg .pl span.d{color:var(--ds-text-muted)}
#prog .pg .pl span.d::before{content:'✓ ';color:var(--ds-success)}
@media (max-width:600px){ #prog .pg .pl span{font-size:11.5px} }
