/* ACO Media Planner — новый дизайн, этап 1 (22.11.2026).
   Подключается ПОСЛЕ старых style.css/forms.css/tipsy.css, поэтому всё под body.nd.
   Старые классы (.rounded-corner, .bt_*, .action-button, .tipsy, .db-message, .subm …) перекрашены здесь,
   разметку и классы js-* шаблоны сохраняют. Внешних шрифтов нет. */

:root{
  --bg:#F4F6F9; --surface:#FFFFFF; --border:#E2E6EC; --border-strong:#D5DAE1; --line:#EEF1F4;
  --text:#141821; --text-2:#3B4352; --muted:#5B6472;
  --accent:#2457D6; --accent-hover:#1C47B3; --accent-soft:#EAF0FD;
  --ok:#17663F; --ok-soft:#E3F4EA; --warn:#8A4307; --warn-soft:#FDEBD6; --danger:#B42E22; --danger-soft:#FBE9E7; --danger-line:#F1C9C4;
  --r-sm:8px; --r:10px; --r-lg:14px;
  --font:system-ui,-apple-system,"Segoe UI",Roboto,Inter,"Helvetica Neue",Arial,sans-serif;
  --side:240px;
}

/* ---------- база ---------- */
body.nd{background:var(--bg);color:var(--text);font-family:var(--font);font-size:15px;line-height:1.45;margin:0;
  -webkit-text-size-adjust:100%;text-size-adjust:100%}
body.nd *, body.nd *::before, body.nd *::after{box-sizing:border-box}
body.nd a{color:var(--accent);text-decoration:none}
body.nd a:hover{color:var(--accent-hover);text-decoration:underline}
body.nd h1{font-size:24px;line-height:1.25;font-weight:700;margin:0;letter-spacing:-.01em;color:var(--text)}
body.nd h2{font-size:17px;font-weight:600;color:var(--text);padding:0;margin:0;clear:none}
body.nd h3{font-size:15px;font-weight:600;color:var(--text);padding:0;margin:0;float:none;clear:none}
body.nd p{margin:0}
body.nd svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;flex:none}
body.nd .nd-muted{color:var(--muted);font-size:14px}
body.nd .hidden{display:none}
body.nd [hidden]{display:none!important}
body.nd img{max-width:100%}

/* ---------- каркас ---------- */
body.nd #main_container{width:auto;max-width:none;min-height:0;margin:0;padding:0}
.nd-app{display:flex;min-height:100vh;width:100%;margin:0;padding:0}
.nd-side{width:var(--side);flex:none;background:var(--surface);border-right:1px solid var(--border);
  padding:18px 12px;display:flex;flex-direction:column;gap:4px;position:sticky;top:0;height:100vh;overflow-y:auto;z-index:30}
.nd-main{flex:1 1 auto;min-width:0;display:flex;flex-direction:column}
.nd-content{flex:1 0 auto;padding:26px 32px 40px;width:100%;max-width:1480px;display:flex;flex-direction:column;gap:18px;clear:none}
body.nd .center_content{padding:26px 32px 40px}
.nd-content > #player{position:absolute;width:0;height:0;overflow:hidden}

.nd-brand{display:flex;align-items:center;gap:10px;padding:4px 10px 16px;color:var(--text)!important;text-decoration:none!important}
.nd-brand b{font-size:15px;display:block}
.nd-brand small{display:block;font-size:12px;color:var(--muted)}
.nd-logo{width:32px;height:32px;border-radius:8px;background:var(--accent);color:#fff;display:inline-flex;align-items:center;justify-content:center;font-weight:700;font-size:14px;flex:none}

.nd-nav{display:flex;flex-direction:column;gap:2px}
.nd-nav a{display:flex;align-items:center;gap:10px;padding:9px 10px;border-radius:var(--r-sm);color:var(--text-2);font-size:14px;min-height:40px}
.nd-nav a:hover{background:#F1F4F8;color:var(--text);text-decoration:none}
.nd-nav a.is-active{background:var(--accent-soft);color:var(--accent);font-weight:600}

.nd-side-foot{margin-top:auto;border-top:1px solid var(--border);padding:14px 6px 0;display:flex;flex-direction:column;gap:10px}
.nd-user b{display:block;font-size:13px;font-weight:600;color:var(--text-2);overflow-wrap:anywhere}
.nd-warn-text{display:block;color:var(--warn);font-size:12px;margin-top:2px}

.nd-seg{display:flex;gap:0;border:1px solid var(--border-strong);border-radius:var(--r-sm);overflow:hidden;background:var(--surface)}
.nd-seg-btn{flex:1;text-align:center;padding:7px 6px;font-size:12px;font-weight:500;color:var(--text-2)!important;text-decoration:none!important;min-height:34px;display:flex;align-items:center;justify-content:center}
.nd-seg-btn + .nd-seg-btn{border-left:1px solid var(--border-strong)}
.nd-seg-btn:hover{background:#F1F4F8}
.nd-seg-btn.is-active, html[lang="uk"] .nd-seg-btn[data-lang="uk"], html[lang="ru"] .nd-seg-btn[data-lang="ru"]{background:var(--accent-soft);color:var(--accent)!important;font-weight:600}
.nd-seg-sm .nd-seg-btn{min-width:40px}

.nd-topbar{display:none}
.nd-tabbar{display:none}
.nd-scrim{display:none}

.nd-footer{display:flex;flex-wrap:wrap;gap:8px 16px;justify-content:space-between;align-items:center;padding:14px 32px 24px;color:var(--muted);font-size:12px}
body.nd .nd-footer .right_footer{float:none;padding:0;font-size:12px}
body.nd .report-error,body.nd .report-error:visited{color:var(--muted);border-bottom:1px dotted var(--border-strong)!important}

/* ---------- заголовки страниц, карточки ---------- */
.nd-crumbs{font-size:13px;color:var(--muted);display:flex;flex-wrap:wrap;gap:4px}
.nd-page-head{display:flex;flex-wrap:wrap;gap:12px 16px;align-items:flex-end;justify-content:space-between}
.nd-page-head > div:first-child{display:flex;flex-direction:column;gap:6px;min-width:0}
.nd-page-head h1{overflow-wrap:anywhere}
.nd-actions{display:flex;flex-wrap:wrap;gap:10px;align-items:center}
.nd-toolbar{display:flex;flex-wrap:wrap;gap:10px;align-items:center}
.nd-toolbar > div{float:none!important}
.nd-section{display:flex;flex-direction:column;gap:12px}
.nd-section-head{display:flex;flex-wrap:wrap;gap:10px;align-items:center;justify-content:space-between}
.nd-card{background:var(--surface);border:1px solid var(--border);border-radius:12px;padding:16px 18px}
.nd-empty{max-width:720px;display:flex;flex-direction:column;gap:10px}
.nd-pre{white-space:pre-wrap;overflow:auto;max-height:50vh;font-size:12px;background:#F8FAFC;border:1px solid var(--line);border-radius:8px;padding:10px}
.nd-desc{width:auto!important;font-size:14px;margin:0!important;color:var(--text-2)}

.nd-facts{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:12px;margin:0}
.nd-facts > div{background:var(--surface);border:1px solid var(--border);border-radius:12px;padding:12px 14px;min-width:0}
.nd-facts dt{font-size:13px;color:var(--muted);margin:0 0 4px}
.nd-facts dd{margin:0;font-weight:600;overflow-wrap:anywhere}
.nd-facts dd:empty::after{content:"—";color:var(--muted);font-weight:400}

.nd-tiles{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:12px}
.nd-tile{background:var(--surface);border:1px solid var(--border);border-radius:var(--r-lg);padding:16px;min-height:92px;display:flex;flex-direction:column;justify-content:space-between;gap:8px;color:var(--text)!important;text-decoration:none!important}
.nd-tile:hover{border-color:#C5CEDB;box-shadow:0 2px 8px rgba(20,24,33,.06)}
.nd-tile b{font-size:15px;font-weight:600}
.nd-tile small{font-size:13px;color:var(--muted)}
.nd-tile-primary{background:var(--accent);border-color:var(--accent)}
.nd-tile-primary b,.nd-tile-primary small{color:#fff}

/* ---------- кнопки ---------- */
.nd-btn, body.nd input[type=submit], body.nd input[type=button], body.nd button.nd-btn{
  -webkit-appearance:none;appearance:none;display:inline-flex;align-items:center;justify-content:center;gap:6px;
  border:1px solid var(--border-strong);background:var(--surface);color:var(--text)!important;border-radius:var(--r-sm);
  padding:8px 16px;min-height:38px;font:500 14px/1.2 var(--font);cursor:pointer;text-decoration:none!important;box-shadow:none;margin:0;
  background-image:none;white-space:nowrap}
.nd-btn:hover, body.nd input[type=submit]:hover, body.nd input[type=button]:hover{background:#F1F4F8;border-color:#C5CEDB}
.nd-btn-primary, body.nd button.nd-btn-primary, body.nd input[type=submit].nd-btn-primary, body.nd .tipsy input[type=submit], body.nd form input[type=submit]{
  background:var(--accent);border-color:var(--accent);color:#fff!important;font-weight:600}
.nd-btn-primary:hover, body.nd button.nd-btn-primary:hover, body.nd .tipsy input[type=submit]:hover, body.nd form input[type=submit]:hover{background:var(--accent-hover);border-color:var(--accent-hover)}
.nd-btn-block{width:100%}
body.nd .logout{background:none}
body.nd .nd-side-foot .logout.nd-btn{color:var(--text-2)!important}

/* старые кнопки bt_* (span + strong + span): одна кнопка без картинок */
body.nd a.bt_green, body.nd a.bt_blue, body.nd a.bt_red, body.nd a.bt_purple,
body.nd span.bt_green, body.nd span.bt_blue, body.nd span.bt_red, body.nd span.bt_purple{
  float:none;display:inline-flex;align-items:center;justify-content:center;margin:0;line-height:1.2;min-height:38px;
  padding:8px 16px;border-radius:var(--r-sm);border:1px solid var(--border-strong);background:var(--surface);
  color:var(--text)!important;text-shadow:none;text-decoration:none!important;font-size:14px;font-weight:500;cursor:pointer;white-space:nowrap}
body.nd [class*="bt_"] > span[class$="_lft"], body.nd [class*="bt_"] > span[class$="_r"]{display:none}
body.nd [class*="bt_"] > strong{background:none!important;height:auto;padding:0;float:none;display:inline;font-weight:inherit;width:auto}
body.nd a.bt_green{background:var(--ok);border-color:var(--ok);color:#fff!important;font-weight:600}
body.nd a.bt_green:hover{background:#12522F}
body.nd a.bt_blue, body.nd a.nd-btn-primary-bt{background:var(--accent);border-color:var(--accent);color:#fff!important;font-weight:600}
body.nd a.bt_blue:hover, body.nd a.nd-btn-primary-bt:hover{background:var(--accent-hover)}
body.nd a.bt_red{background:var(--surface);border-color:var(--danger-line);color:var(--danger)!important}
body.nd a.bt_red:hover{background:var(--danger-soft)}
body.nd a.bt_purple{background:var(--surface)}
body.nd a.nd-btn-plain{background:var(--surface)!important;border-color:var(--border-strong)!important;color:var(--text)!important;font-weight:500}
body.nd a.nd-btn-plain:hover{background:#F1F4F8!important}
body.nd a.nd-btn-danger-bt{background:var(--surface)!important;border-color:var(--danger-line)!important;color:var(--danger)!important}
body.nd a.nd-btn-green{background:var(--ok);border-color:var(--ok);color:#fff!important}

/* статус ролика в таблицах (подтверждение / юрист) — чип */
body.nd a.js-block-confirm{min-height:30px;padding:4px 10px;border-radius:6px;font-size:12px;font-weight:600;min-width:0;margin:2px 4px 2px 0}
body.nd a.js-block-confirm.bt_green{background:var(--ok-soft);border-color:#BFE3CC;color:var(--ok)!important}
body.nd a.js-block-confirm.bt_red{background:var(--warn-soft);border-color:#F4CFA6;color:var(--warn)!important}
body.nd a.js-block-confirm[disabled]{opacity:.6}

/* кнопки действий в строках: подписаны словами */
body.nd .action-button{width:auto;height:auto;min-height:32px;display:inline-flex;align-items:center;justify-content:center;
  padding:5px 10px;border:1px solid var(--border-strong);border-radius:var(--r-sm);background:var(--surface)!important;
  color:var(--text-2)!important;font-size:13px;font-weight:500;line-height:1.2;text-decoration:none!important;vertical-align:middle;margin:2px 4px 2px 0;white-space:nowrap}
body.nd .action-button:hover{background:#F1F4F8!important}
body.nd .nd-act{display:inline-flex;align-items:center;gap:6px;min-height:32px;padding:5px 10px;border:1px solid var(--border-strong);
  border-radius:var(--r-sm);background:var(--surface);color:var(--text-2)!important;font-size:13px;font-weight:500;text-decoration:none!important;vertical-align:middle;margin:2px 4px 2px 0;white-space:nowrap}
body.nd .nd-act:hover{background:#F1F4F8}
body.nd .nd-act-primary{border-color:#BFD0F5;color:var(--accent)!important;background:var(--accent-soft)!important}
body.nd .nd-act-danger{border-color:var(--danger-line);color:var(--danger)!important}
body.nd .nd-act-danger:hover{background:var(--danger-soft)!important}
body.nd .nd-act img{width:14px;height:14px;padding:0;border:0;vertical-align:middle}
body.nd img.play-button{width:32px;height:32px;padding:7px;border:1px solid var(--border-strong);border-radius:var(--r-sm);background:var(--surface);cursor:pointer;vertical-align:middle;margin:2px 4px 2px 0}
body.nd img.play-button:hover{background:#F1F4F8}
body.nd img.download-button{border:0;padding:0}
.nd-td-actions{white-space:normal}
@media (min-width: 761px){
  body.nd .nd-table td.nd-td-actions{white-space:normal;min-width:180px}
  .nd-footer{padding-right:230px}
}

/* «Вы уверены?» */
body.nd .question{background:var(--surface);border:1px solid var(--border);border-radius:var(--r);box-shadow:0 8px 24px rgba(20,24,33,.14);
  width:190px;height:auto;padding:10px 12px;font-size:14px;line-height:1.4;text-shadow:none;margin-left:-60px;margin-top:-96px;z-index:50}
body.nd .yes, body.nd .cancel{width:auto;height:auto;display:inline-flex;align-items:center;justify-content:center;min-width:64px;min-height:32px;
  padding:4px 12px;border-radius:var(--r-sm);background:var(--surface);border:1px solid var(--border-strong);color:var(--text)!important;text-shadow:none;font-size:13px;margin:6px 4px 0 0}
body.nd .yes{background:var(--danger);border-color:var(--danger);color:#fff!important}

/* ---------- формы ---------- */
body.nd input[type=text], body.nd input[type=password], body.nd input[type=search], body.nd input[type=email], body.nd input:not([type]),
body.nd select, body.nd textarea, .nd-input, .nd-select, .nd-textarea{
  font:400 15px/1.3 var(--font);color:var(--text);background:var(--surface);background-image:none;border:1px solid var(--border-strong);
  border-radius:var(--r-sm);padding:8px 10px;min-height:38px;margin:2px 0;box-shadow:none;max-width:100%}
body.nd textarea{min-height:90px;resize:vertical}
body.nd input:focus, body.nd select:focus, body.nd textarea:focus{outline:2px solid #9DB6F0;outline-offset:0;border-color:var(--accent)}
body.nd input[type=checkbox], body.nd input[type=radio]{width:18px;height:18px;min-height:0;margin:0 6px 0 0;box-shadow:none;background:none;vertical-align:middle;accent-color:var(--accent)}
body.nd input[type=file]{max-width:100%;box-shadow:none;background:none;border:0;padding:4px 0}
body.nd input.error, body.nd select.error, body.nd textarea.error{background:#FDF1F0;border-color:var(--danger)}
body.nd fieldset{border:0;padding:0;margin:0}
.nd-field{display:flex;flex-direction:column;gap:6px;min-width:0}
.nd-field > label, .nd-field-label{font-size:13px;color:var(--muted);font-weight:500}
.nd-check{flex-direction:row!important;align-items:center;gap:4px}
.nd-check label{font-size:14px;color:var(--text-2)}
.nd-form-card{max-width:560px}
.nd-form{display:flex;flex-direction:column;gap:14px}
.nd-form .nd-field input, .nd-form .nd-field select{width:100%}
body.nd .search-filter label{min-width:0;text-align:left;display:block;font-size:13px;color:var(--muted);margin-bottom:4px}
body.nd .search-filter input, body.nd .search-filter select{width:100%}

.nd-search{display:flex;gap:8px;max-width:520px}
.nd-search input{flex:1;min-width:0}

.nd-filter-grid{display:grid!important;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:12px 18px;align-items:end}
.nd-filter-col{display:flex;flex-direction:column;gap:12px;min-width:0}
.nd-filter-go{display:flex;align-items:flex-end}
.nd-filter-grid.el-clear:after{display:none}

/* ---------- таблицы ---------- */
.nd-table-wrap{background:var(--surface);border:1px solid var(--border);border-radius:12px;overflow-x:auto;max-width:100%}
body.nd table.rounded-corner{margin:0;width:100%;border-collapse:collapse;font-size:14px;background:var(--surface)}
body.nd .rounded-corner th, body.nd .rounded-corner thead th.rounded-top-left, body.nd .rounded-corner thead th.rounded-top-right,
body.nd .rounded-corner thead th.rounded-foot-left, body.nd .rounded-corner thead th.rounded-foot-right{
  background:#F8FAFC;color:var(--muted);font-size:12px;font-weight:600;text-transform:uppercase;letter-spacing:.04em;padding:10px 12px;text-align:left;border-bottom:1px solid var(--border);width:auto;white-space:nowrap}
body.nd .rounded-corner td{background:var(--surface);color:var(--text);border-top:1px solid var(--line);padding:10px 12px;vertical-align:middle}
body.nd .rounded-corner tbody tr:hover td{background:#F7F9FC}
body.nd .rounded-corner tfoot{display:none}
body.nd .rounded-corner tr.empty td{color:var(--muted);text-align:center;padding:22px 12px}
body.nd tr[data-url]{cursor:pointer}

body.nd div.pagination{float:none;width:auto;padding:4px 0;display:flex;flex-wrap:wrap;gap:6px;justify-content:center;font-size:14px}
body.nd div.pagination a, body.nd div.pagination span.current{min-width:36px;min-height:36px;display:inline-flex;align-items:center;justify-content:center;
  border:1px solid var(--border-strong);border-radius:var(--r-sm);color:var(--text-2);background:var(--surface);padding:4px 8px;margin:0}
body.nd div.pagination a:hover{background:var(--accent-soft);color:var(--accent);border-color:#BFD0F5;text-decoration:none}
body.nd div.pagination span.current{background:var(--accent);border-color:var(--accent);color:#fff;font-weight:600}

/* ---------- подменю (param menu) ---------- */
body.nd .subm, .nd-subm{background:none;margin:0;padding:18px 32px 0;display:flex;flex-wrap:wrap;gap:8px;min-height:0;overflow:visible}
body.nd .subm a{float:none;padding:7px 14px;border:1px solid var(--border-strong);border-radius:999px;background:var(--surface);color:var(--text-2);font-size:13px}
body.nd .subm a:hover{text-decoration:none;background:#F1F4F8}
body.nd .subm a.active{background:var(--accent-soft);border-color:#BFD0F5;color:var(--accent);font-weight:600}
body.nd .subm.el-clear:after{display:none}

/* ---------- всплывающие формы (tipsy) ---------- */
body.nd .tipsy{font-size:14px}
body.nd .tipsy-inner{background:var(--surface)!important;border:1px solid var(--border);border-radius:var(--r-lg);box-shadow:0 12px 32px rgba(20,24,33,.18);padding:18px 20px;color:var(--text)}
body.nd .tipsy-arrow{display:none}
body.nd .tipsy-inner h2{font-size:17px;padding:0 0 4px}
body.nd .tipsy-inner label{min-width:120px;color:var(--text-2);font-size:14px}
body.nd .tipsy-inner div{margin-bottom:12px}
body.nd .error-tipsy .tipsy-inner{padding:8px 12px;color:var(--danger);border-color:var(--danger-line)}

/* ---------- сообщения на главной ---------- */
body.nd .db-message{background:var(--surface)!important;border:1px solid var(--border);border-radius:12px;padding:14px 0;margin:0 0 10px;width:auto}
body.nd .db-message.red{border-left:4px solid #E2A15B}
body.nd .db-message.blue{border-left:4px solid var(--accent)}
body.nd .db-message .content{margin:0 16px}
body.nd .db-message .db-header{display:flex;flex-wrap:wrap;align-items:center;gap:4px 10px;margin:0 0 6px;line-height:1.4;position:relative}
body.nd .db-message h3{font-size:15px;color:var(--text)!important;display:block;flex:1 1 220px;min-width:0}
body.nd .db-message .date, body.nd .db-message .author{font-size:12px;padding:0;color:var(--muted)!important;font-weight:400;white-space:normal}
body.nd .db-message .nd-act{margin-left:auto}
body.nd .db-message .nd-msg-text, body.nd .db-message .nd-msg-text *{color:var(--text-2)!important;font-size:14px;overflow-wrap:anywhere}
body.nd .db-message ul{margin:.5em 0}
body.nd .db-message li{margin-left:1.5em}

/* ---------- календарь ---------- */
.nd-cal{display:flex;flex-direction:column;gap:16px}
.nd-cal-controls{display:flex;flex-wrap:wrap;gap:14px 24px;align-items:flex-end}
.nd-cal-region{flex:1 1 320px;max-width:520px}
.nd-cal-region select{width:100%}
.nd-month{display:flex;align-items:center;gap:6px}
body.nd .nd-month .prev, body.nd .nd-month .next{float:none;width:38px;height:38px;display:inline-flex;align-items:center;justify-content:center;background:var(--surface)!important;
  border:1px solid var(--border-strong);border-radius:var(--r-sm);font-size:20px;color:var(--text-2)!important;text-decoration:none!important}
body.nd .nd-month .prev:hover, body.nd .nd-month .next:hover{background:#F1F4F8!important}
.nd-month-label{min-width:130px;text-align:center;font-weight:600}
body.nd .nd-month-label .month-name, body.nd .nd-month-label .js-year{float:none;display:inline;width:auto}
.nd-legend{display:flex;flex-wrap:wrap;gap:6px 16px;font-size:13px;color:var(--text-2);align-items:center}
.nd-legend-title{color:var(--muted)}
.nd-sw{display:inline-block;width:14px;height:14px;border-radius:4px;vertical-align:-2px;margin-right:6px;border:1px solid rgba(20,24,33,.12)}
.nd-heat-0{background:#E3F4EA}.nd-heat-1{background:#F3F0D2}.nd-heat-2{background:#FDEBD6}.nd-heat-3{background:#F6CFCB}
.nd-sw-weekend{background:#E6E9EE}
body.nd .schedule-box, .nd-scroll-box{width:auto;max-width:100%;margin:0;overflow:auto;background:var(--surface);border:1px solid var(--border);border-radius:12px;padding:0;max-height:75vh}
body.nd table.schedule-table{margin:0;border-collapse:separate;border-spacing:0;font-size:12px;background:var(--surface)}
body.nd table.schedule-table th{background:#F8FAFC;color:var(--muted);font-weight:600;padding:6px 4px;border-bottom:1px solid var(--border);min-width:34px;position:sticky;top:0;z-index:2}
body.nd table.schedule-table th:hover{color:var(--accent);background:var(--accent-soft)}
body.nd table.schedule-table th.row_headers{min-width:72px;left:0;z-index:3}
body.nd table.schedule-table td{padding:4px 2px;border-right:1px solid var(--line);border-bottom:1px solid var(--line);min-width:34px;height:34px;font-variant-numeric:tabular-nums}
body.nd table.schedule-table td.place-template-block{position:sticky;left:0;background:#F8FAFC!important;font-weight:600;color:var(--text-2);padding:4px 8px;z-index:1;white-space:nowrap}
body.nd table.schedule-table tbody tr.even td{background:var(--surface)}
body.nd table.schedule-table tbody td.cell-available{border:0;border-right:1px solid var(--line);border-bottom:1px solid var(--line);color:var(--text)}
body.nd table.schedule-table tbody td.cell-disabled{color:#A9B2BF;background:#FAFBFC}
body.nd table.schedule-table .js-weekDay-6, body.nd table.schedule-table .js-weekDay-5{background:#EEF0F3!important}
body.nd table.schedule-table tbody td.nd-heat-0{background:#E3F4EA!important}
body.nd table.schedule-table tbody td.nd-heat-1{background:#F3F0D2!important}
body.nd table.schedule-table tbody td.nd-heat-2{background:#FDEBD6!important}
body.nd table.schedule-table tbody td.nd-heat-3{background:#F6CFCB!important}
body.nd table.schedule-table tbody td.marked div.mark{font-size:9px;left:1px;top:0;color:var(--warn);font-weight:700}
body.nd .tableFloatingHeader{display:none!important}
body.nd .tooltip{border:1px solid var(--border);border-radius:var(--r);box-shadow:0 8px 24px rgba(20,24,33,.14);background:var(--surface);font-size:13px;padding:8px 10px;z-index:200}
body.nd .schedule-fieldset{margin:0;padding:0}

/* сетка размещения (/campaign/schedule — пока старый шаблон, но в новой обёртке) */
body.nd div.schedule-toolbar input[type=button]{background:var(--surface);color:var(--text)!important;border-color:var(--border-strong);font-weight:500}
body.nd div.schedule-toolbar input[type=button].selected{background:var(--accent-soft);color:var(--accent)!important;border-color:#BFD0F5;font-size:14px}

/* ---------- монтажный лист ---------- */
.nd-ml-scroll{max-height:70vh;overflow:auto;background:var(--surface);border:1px solid var(--border);border-radius:12px;max-width:900px}
body.nd table.nd-ml-table{min-width:560px}
body.nd #ml-playlist table tbody tr.block td{background:#E8EDFB!important;color:#1D3E9E;font-weight:700}
body.nd tr.ml-fixed-clip td{background:#FBE7E5!important;color:var(--text)}
body.nd tr.ml-aux-clip td{background:#EEF1F4!important;color:var(--text)}
body.nd tr.ml-music-clip td{background:#FBF6D9!important;color:var(--text)}
body.nd tr.ml-bracket-clip td{background:#E5F5DC!important;color:var(--text)}
body.nd tr.pos-hint td{background:var(--danger)!important;padding:1px}
.nd-sw-block{background:#E8EDFB}.nd-sw-fixed{background:#FBE7E5}.nd-sw-aux{background:#EEF1F4}.nd-sw-music{background:#FBF6D9}.nd-sw-bracket{background:#E5F5DC}
body.nd .js-ml-clip-name .play-button{margin-right:8px!important}

/* ---------- jQuery UI ---------- */
body.nd .ui-widget{font-family:var(--font);font-size:14px}
body.nd .ui-datepicker{border-radius:var(--r);box-shadow:0 8px 24px rgba(20,24,33,.14);z-index:300!important}

/* ---------- отзыв о дизайне ---------- */
.nd-fb-btn{position:fixed;right:18px;bottom:18px;z-index:60;border:1px solid var(--accent);background:var(--surface);color:var(--accent);
  border-radius:999px;padding:10px 16px;min-height:44px;font:600 14px/1 var(--font);box-shadow:0 6px 18px rgba(36,87,214,.18);cursor:pointer}
.nd-fb-btn:hover{background:var(--accent-soft)}
.nd-modal{position:fixed;inset:0;z-index:1200;background:rgba(20,24,33,.45);display:flex;align-items:center;justify-content:center;padding:16px}
.nd-modal-box{background:var(--surface);border-radius:var(--r-lg);width:100%;max-width:480px;padding:20px;display:flex;flex-direction:column;gap:12px;box-shadow:0 20px 48px rgba(20,24,33,.25);max-height:calc(100vh - 32px);overflow:auto}
.nd-modal-box h2{font-size:18px!important}
.nd-modal-actions{display:flex;justify-content:flex-end;gap:10px;flex-wrap:wrap}
.nd-modal-status{font-size:14px;min-height:1.4em}
.nd-modal-status.is-ok{color:var(--ok)} .nd-modal-status.is-err{color:var(--danger)}
.nd-radio-row{display:flex;flex-wrap:wrap;gap:8px}
.nd-chip-radio{display:inline-flex;align-items:center;gap:6px;border:1px solid var(--border-strong);border-radius:999px;padding:8px 14px;min-height:40px;cursor:pointer;font-size:14px;color:var(--text-2)}
.nd-chip-radio:has(input:checked){border-color:var(--accent);background:var(--accent-soft);color:var(--accent);font-weight:600}
.nd-textarea{width:100%}

/* ---------- вход ---------- */
body.nd-login-page{min-height:100vh}
.nd-login{min-height:100vh;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:24px 16px;gap:16px;width:auto}
body.nd .nd-login-card{background:var(--surface);border:1px solid var(--border);border-radius:16px;padding:28px;width:100%;max-width:400px;display:flex;flex-direction:column;gap:18px;
  float:none;height:auto;margin:0;box-shadow:0 10px 30px rgba(20,24,33,.06)}
.nd-login-head{display:flex;gap:12px;align-items:center}
.nd-login-head b{display:block;font-size:16px}
.nd-login-head small{display:block}
.nd-login-title{font-size:22px!important}
body.nd .nd-login-card .form{width:auto;margin:0;font-size:15px;display:flex;flex-direction:column;gap:14px}
body.nd .nd-login-card .form label{width:auto;text-align:left;display:block}
body.nd .nd-login-card .form > div{margin:0}
body.nd .nd-login-card .nd-field input{width:100%;min-height:44px}
body.nd .nd-login-card .check{margin:0;display:flex;align-items:center}
body.nd .nd-login-card input[type=submit]{width:100%;min-height:44px;font-size:15px;margin:0;display:flex}
.nd-captcha{display:flex;gap:8px;align-items:center}
.nd-captcha input{width:110px!important}
.nd-login-links{display:flex;justify-content:center}
body.nd a.forgot_pass{float:none;background:none;padding:0;margin:0;display:inline;color:var(--accent)}
.nd-login-switch{display:flex;justify-content:space-between;align-items:center;gap:12px;border-top:1px solid var(--border);padding-top:14px}
.nd-link-muted{color:var(--muted)!important;font-size:13px}
.nd-login-foot{color:var(--muted);font-size:12px;text-align:center}

/* ---------- телефон / узкий экран ---------- */
@media (max-width: 1100px){
  .nd-content, body.nd .center_content{padding:22px 20px 32px}
  body.nd .subm, .nd-subm{padding:14px 20px 0}
  .nd-footer{padding:12px 20px 20px}
}
@media (max-width: 760px){
  body.nd{font-size:15px}
  .nd-app{display:block}
  .nd-side{position:fixed;left:0;top:0;bottom:0;height:auto;width:min(300px,86vw);transform:translateX(-105%);transition:transform .2s ease;box-shadow:0 0 40px rgba(20,24,33,.25);z-index:1100}
  body.nd-menu-open .nd-side{transform:none}
  body.nd-menu-open .nd-scrim{display:block;position:fixed;inset:0;background:rgba(20,24,33,.4);z-index:1050}
  .nd-nav a{min-height:44px}
  .nd-seg-btn{min-height:44px}
  .nd-topbar{display:flex;align-items:center;gap:10px;background:var(--surface);border-bottom:1px solid var(--border);padding:8px 16px;position:sticky;top:0;z-index:40;min-height:56px}
  .nd-topbar .nd-brand{padding:0}
  .nd-topbar-spacer{flex:1}
  .nd-tabbar{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);position:fixed;left:0;right:0;bottom:0;z-index:70;background:var(--surface);
    border-top:1px solid var(--border);padding:4px 4px calc(6px + env(safe-area-inset-bottom))}
  .nd-tabbar a{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-height:50px;color:var(--muted);font-size:11px;text-decoration:none!important;text-align:center;overflow:hidden}
  .nd-tabbar a span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
  .nd-tabbar a.is-active{color:var(--accent);font-weight:600}
  .nd-tabbar svg{width:22px;height:22px}
  .nd-main{padding-bottom:72px}
  .nd-content, body.nd .center_content{padding:16px 16px 28px;gap:14px}
  body.nd .subm, .nd-subm{padding:12px 16px 0}
  .nd-footer{padding:8px 16px 24px}
  body.nd h1{font-size:21px}
  .nd-page-head{align-items:stretch}
  .nd-actions{width:100%}
  .nd-actions > *{flex:1 1 auto}
  .nd-actions .js-create, .nd-actions .js-create > a{width:100%}
  body.nd a.bt_green, body.nd a.bt_blue, body.nd a.bt_red, body.nd a.bt_purple, .nd-btn, body.nd input[type=submit], body.nd input[type=button]{min-height:44px}
  body.nd input[type=text], body.nd input[type=password], body.nd input[type=search], body.nd select, body.nd textarea{font-size:16px;min-height:44px;width:100%}
  body.nd .action-button, body.nd .nd-act{min-height:40px;padding:8px 12px}
  body.nd img.play-button{width:40px;height:40px;padding:11px}
  body.nd a.js-block-confirm{min-height:36px}
  .nd-fb-btn{display:none}
  .nd-tiles{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .nd-facts{grid-template-columns:repeat(2,minmax(0,1fr))}
  .nd-toolbar > *, .nd-toolbar > div > a{flex:1 1 auto}
  .nd-search{max-width:none}
  .nd-month-label{min-width:0;flex:1}
  .nd-cal-controls .nd-field{width:100%}
  .nd-month{width:100%}

  /* таблицы из planner.view.table → карточки */
  .nd-table-wrap{background:none;border:0;border-radius:0;overflow:visible}
  body.nd table.nd-table, body.nd table.nd-table tbody{display:block;width:100%;background:none}
  body.nd table.nd-table thead{display:none}
  body.nd table.nd-table tr{display:flex;flex-direction:column;background:var(--surface);border:1px solid var(--border);border-radius:12px;padding:10px 14px;margin:0 0 10px}
  body.nd table.nd-table td{display:flex;gap:10px;align-items:baseline;border:0;padding:5px 0;background:none!important;min-width:0;overflow-wrap:anywhere;width:auto!important}
  body.nd table.nd-table td[data-label]::before{content:attr(data-label);flex:0 0 38%;color:var(--muted);font-size:13px}
  body.nd table.nd-table td.nd-td-actions, body.nd table.nd-table td:last-child{flex-wrap:wrap;align-items:center;padding-top:8px}
  body.nd table.nd-table td:last-child[data-label=""]::before{display:none}
  body.nd table.nd-table tr.empty{display:block}
  body.nd table.nd-table tr.empty td{display:block}
  body.nd .rounded-corner tbody tr:hover td{background:none}

  /* всплывающие формы — снизу на всю ширину */
  body.nd .tipsy:not(.error-tipsy){position:fixed!important;left:8px!important;right:8px!important;top:auto!important;bottom:76px!important;max-height:70vh;overflow:auto;padding:0;z-index:1000}
  body.nd .tipsy:not(.error-tipsy) .tipsy-inner{max-width:none!important;width:100%}
  body.nd .tipsy-inner input[type=text], body.nd .tipsy-inner select, body.nd .tipsy-inner textarea, body.nd .tipsy-inner input[type=file]{width:100%!important}
  body.nd .tipsy-inner label{display:block;text-align:left;min-width:0;margin-bottom:4px}
  body.nd .tipsy table, body.nd .tipsy tbody, body.nd .tipsy tr, body.nd .tipsy td{display:block;width:100%}
  body.nd .blockMsg{width:92%!important;left:4%!important}

  .nd-ml-scroll{max-height:none}
  body.nd .schedule-box, .nd-scroll-box{max-height:70vh}
  .nd-login-card{padding:22px}
}

/* отзыв: ссылка в подвале и кнопка в меню (на телефоне вместо плавающей) */
.nd-fb-link{color:var(--accent)!important;font-weight:600}
.nd-fb-side{color:var(--accent)!important;border-color:#BFD0F5!important}
@media (min-width: 761px){ .nd-fb-side{display:none} }
body.nd .rounded-corner td{overflow-wrap:break-word}
