:root {
  --bg: #f5f6f8; --card: #fff; --text: #1d1f23; --muted: #6b7280; --line: #e5e7eb; --accent: #2f6fed;
  --red: #dc3545; --blue: #2f6fed; --violet: #7c4dff; --green: #1f9d55; --teal: #0e9488; --gray: #8a8f98;
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
a { color: var(--accent); text-decoration: none; }
h1 { font-size: 20px; margin: 0 0 8px; } h1 span, .brand span { color: var(--accent); }
h2 { font-size: 17px; margin: 18px 0 8px; }
.muted { color: var(--muted); } .pad { padding: 16px; }
.btn { background: var(--accent); color: #fff; border: 0; border-radius: 10px; padding: 10px 18px; font-size: 15px; cursor: pointer; }
.link { background: none; border: 0; color: var(--accent); cursor: pointer; font: inherit; padding: 0; }
body.center { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 16px; }
.box { background: var(--card); border-radius: var(--radius); padding: 24px; max-width: 420px; box-shadow: 0 2px 12px rgba(0,0,0,.06); }

/* шапка */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 16px; padding: 10px 16px;
  background: var(--card); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 17px; color: var(--text); }
#nav { display: flex; gap: 4px; flex: 1; }
#nav a { padding: 6px 12px; border-radius: 8px; color: var(--text); }
#nav a.on { background: var(--bg); color: var(--accent); font-weight: 600; }
.me { display: flex; gap: 12px; align-items: center; color: var(--muted); font-size: 14px; }
.me form { margin: 0; }
main { max-width: 1200px; margin: 0 auto; padding: 16px; }

/* календарь */
.calhead { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.calhead b { font-size: 18px; min-width: 170px; }
.calhead b::first-letter { text-transform: uppercase; }
.calhead button { background: var(--card); border: 1px solid var(--line); border-radius: 8px; width: 36px; height: 32px;
  color: var(--text); cursor: pointer; font-size: 16px; }
.calhead .today { width: auto; padding: 0 12px; font-size: 14px; }
.grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.wd { background: var(--card); padding: 6px; font-size: 12px; color: var(--muted); text-align: center; }
.wd.we { color: var(--red); }
.cell { background: var(--card); min-height: 108px; padding: 4px; display: flex; flex-direction: column; gap: 2px; }
.cell.out { opacity: .45; }
.cell .n { font-size: 12px; color: var(--muted); padding: 0 2px; }
.cell.we .n { color: var(--red); }
.cell.now .n { color: #fff; background: var(--accent); border-radius: 10px; padding: 0 6px; align-self: flex-start; }
.chip { display: block; font-size: 12px; line-height: 1.25; padding: 2px 5px; border-radius: 5px; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip.ph { opacity: .75; }
.more { font-size: 11px; color: var(--muted); padding: 0 4px; }
.c-blue { background: var(--blue); } .c-violet { background: var(--violet); } .c-green { background: var(--green); }
.c-teal { background: var(--teal); } .c-gray { background: var(--gray); } .c-red { background: var(--red); }
.legend { display: flex; gap: 12px; flex-wrap: wrap; margin: 10px 0; font-size: 13px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }

/* список и карточки */
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.filters button { border: 1px solid var(--line); background: var(--card); color: var(--text); border-radius: 16px;
  padding: 4px 12px; cursor: pointer; font-size: 13px; }
.filters button.on { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.row { display: flex; gap: 12px; align-items: center; background: var(--card); border-radius: var(--radius);
  padding: 12px 14px; margin-bottom: 8px; color: var(--text); }
.row:hover { box-shadow: 0 2px 10px rgba(0,0,0,.07); }
.row .when { min-width: 110px; font-weight: 600; }
.row .what { flex: 1; min-width: 0; } .row .what div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .sum { font-weight: 600; white-space: nowrap; }
.pill { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 10px; color: #fff; white-space: nowrap; }
.card { background: var(--card); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 12px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; } td.r, th.r { text-align: right; white-space: nowrap; }
tr.sec td { font-weight: 600; background: var(--bg); }
tr.tot td { font-weight: 700; }
.ppl { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.ppl ul { margin: 4px 0 0; padding-left: 18px; }
.back { display: inline-block; margin-bottom: 10px; }
.tag { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 10px; }
.tag.req { background: #fff3cd; color: #8a6100; } .tag.ok { background: #d1f2df; color: #136c3a; }
@media (max-width: 700px) {
  .cell { min-height: 64px; } .chip { font-size: 10px; padding: 1px 3px; }
  .kv { grid-template-columns: 1fr; } .kv dt { margin-top: 6px; }
  .row { flex-wrap: wrap; } .row .when { min-width: 0; width: 100%; }
  .row .what { flex-basis: 100%; } .row .what div { white-space: normal; }
  .me span { display: none; }
}

/* правка */
.ed { background: none; border: 0; cursor: pointer; font-size: 13px; padding: 0 4px; opacity: .55; }
.ed:hover { opacity: 1; }
.stbar { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 14px; }
.st { border: 0; border-radius: 14px; padding: 4px 12px; font-size: 13px; color: #fff; cursor: pointer; opacity: .35; }
.st.on { opacity: 1; font-weight: 600; box-shadow: 0 0 0 2px var(--card), 0 0 0 4px currentColor; cursor: default; }
.st:hover { opacity: .85; }
.btn.small { padding: 5px 10px; font-size: 13px; border-radius: 8px; margin: 6px 6px 0 0; }
.btn.ghost { background: var(--bg); color: var(--text); border: 1px solid var(--line); }
.btn.ok { background: var(--green); } .btn.bad { background: var(--red); }
.btn:disabled { opacity: .5; cursor: default; }
h2 .btn.small { margin: 0 0 0 8px; vertical-align: 2px; }
.pre { white-space: pre-wrap; }
.small { font-size: 13px; }
.acts { display: flex; flex-wrap: wrap; }
dialog { border: 0; border-radius: 14px; padding: 20px; width: min(460px, calc(100vw - 24px)); background: var(--card); color: var(--text);
  box-shadow: 0 10px 40px rgba(0,0,0,.25); max-height: 88vh; overflow: auto; }
dialog::backdrop { background: rgba(0,0,0,.35); }
dialog h2 { margin-top: 0; } dialog h3 { font-size: 15px; margin: 14px 0 4px; }
dialog label { display: block; font-size: 13px; color: var(--muted); margin: 8px 0; }
dialog label.ck { color: var(--text); font-size: 14px; display: flex; gap: 8px; align-items: baseline; margin: 6px 0; }
dialog input:not([type=checkbox]):not([type=radio]), dialog textarea, dialog select {
  display: block; width: 100%; margin-top: 4px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg); color: var(--text); font: inherit; }
dialog .two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
dialog .dbtn { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.err { color: var(--red); font-size: 14px; white-space: pre-wrap; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: #1d1f23; color: #fff; padding: 10px 16px;
  border-radius: 10px; font-size: 14px; max-width: calc(100vw - 32px); white-space: pre-wrap; z-index: 50; transition: opacity .3s; }
.toast.bad { background: var(--red); } .toast.hide { opacity: 0; pointer-events: none; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 12px; }
.stat { background: var(--card); border-radius: var(--radius); padding: 14px 16px; }
.stat span { display: block; color: var(--muted); font-size: 13px; } .stat b { display: block; font-size: 22px; margin: 2px 0; }
.stat i { font-style: normal; color: var(--muted); font-size: 12px; } .stat.warn b { color: var(--red); }
.late { color: var(--red); font-weight: 600; }
.dbtn.left { justify-content: flex-start; flex-wrap: wrap; margin-top: 10px; }
.calhead .btn.small { margin: 0 0 0 auto; white-space: nowrap; width: auto; height: auto; padding: 6px 12px;
  background: var(--accent); color: #fff; border: 0; }
h1 .btn.small { vertical-align: 3px; margin-left: 8px; }
.search { width: 100%; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--card);
  color: var(--text); font: inherit; margin-bottom: 12px; }
h1 .btn.bad { margin-left: 6px; }
.two-inline { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.two-inline .search { flex: 1; min-width: 220px; margin: 0; }
.two-inline input[type=date] { padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--text); font: inherit; }
#nav { flex-wrap: wrap; }
.docs { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; } .docs .btn.small { margin: 0; }
label.btn { display: inline-block; cursor: pointer; }
.pick { display: flex; flex-direction: column; gap: 2px; max-height: 220px; overflow: auto; }
.pick button { text-align: left; border: 1px solid var(--line); background: var(--bg); color: var(--text); border-radius: 8px;
  padding: 6px 10px; cursor: pointer; font: inherit; font-size: 14px; }
.pick button.on { border-color: var(--accent); background: var(--card); font-weight: 600; }
dialog select { appearance: auto; }

/* редактор сметы */
table.est input.num { width: 84px; padding: 4px 6px; text-align: right; border: 1px solid transparent; border-radius: 6px; background: transparent; font: inherit; color: inherit; }
table.est input.num:hover { border-color: var(--line, #d5dae0); }
table.est input.num:focus { border-color: var(--accent); background: var(--card); outline: none; }
table.est input.num.saving { opacity: .6; }
table.est input.num.saved { border-color: #2e9d5b; }
table.est input.num[data-f=days] { width: 56px; }
tr.sub td { color: var(--muted); font-size: 13px; border-bottom: 2px solid var(--bg); }
tr.sub td.r { font-weight: 600; color: inherit; }
tr.sec.zone td { background: transparent; font-size: 15px; padding-top: 14px; }
.tag.bad { background: #fde2e4; color: #a11a2b; }
.card.att .row { background: var(--bg); margin-top: 6px; text-decoration: none; color: inherit; }
.card.att .row:hover { outline: 1px solid var(--accent); }
/* КП по ссылке (страница клиента) */
body.kp { max-width: 860px; margin: 0 auto; padding: 16px; }
body.kp header .brand { font-weight: 700; color: var(--accent); letter-spacing: .02em; }
body.kp h1 { margin: 4px 0 14px; font-size: 22px; }
body.kp dl { display: grid; grid-template-columns: 130px 1fr; gap: 6px 12px; margin: 0; }
body.kp dt { color: var(--muted); } body.kp dd { margin: 0; }
body.kp .card { margin-bottom: 12px; overflow-x: auto; }
body.kp .btn.big { font-size: 16px; padding: 12px 22px; margin: 10px 0; }
body.kp .done { font-size: 17px; font-weight: 600; color: var(--green); }
body.kp footer { color: var(--muted); font-size: 13px; padding: 8px 4px 24px; }
body.kp #f label { display: block; max-width: 340px; }
table.est input.num { display: inline-block; margin: 0; }
table.est td { padding-top: 4px; padding-bottom: 4px; }
table.est td.r { white-space: nowrap; }
@media (max-width: 560px) {
  body.kp table { font-size: 13px; }
  body.kp th, body.kp td { padding-left: 4px; padding-right: 4px; }
  body.kp dl { grid-template-columns: 100px 1fr; }
}
body.kp td.r { white-space: nowrap; }
body.kp #f input { display: block; width: 100%; margin-top: 4px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--text); font: inherit; }
table.est td { vertical-align: middle; }

/* настройки, чек-лист первого запуска, уведомление о лицензии */
.notice { background: #fff4d6; color: #6b4a00; padding: 8px 16px; font-size: 14px; text-align: center; }
.notice.bad { background: #fde2e4; color: #a11a2b; }
.card.setup .row { background: var(--bg); margin-top: 6px; text-decoration: none; color: inherit; }
.card.setup a.row:hover { outline: 1px solid var(--accent); }
form.form label { display: block; margin-bottom: 10px; max-width: 560px; }
form.form input, form.form textarea { display: block; width: 100%; margin-top: 4px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--text); font: inherit; }
.btn.bad { background: #c0392b; color: #fff; border-color: #c0392b; }
.me a.link { margin-right: 12px; }
/* руководство пользователя */
body.help main { max-width: 860px; margin: 0 auto; padding: 20px 16px 60px; line-height: 1.55; }
body.help h1 { font-size: 26px; margin: 8px 0; }
body.help h2 { margin: 34px 0 10px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 20px; }
body.help h3 { margin: 20px 0 6px; font-size: 16px; }
body.help .lead { font-size: 17px; color: var(--muted); }
body.help .toc { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 14px 0; }
body.help li { margin-bottom: 6px; }
body.help code { background: var(--card); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; font-size: 13px; }
body.help figure { margin: 16px 0; }
body.help figure img { max-width: 100%; border: 1px solid var(--line); border-radius: 10px; display: block; }
body.help figure.phone img { max-width: 300px; }
body.help figcaption { color: var(--muted); font-size: 13px; margin-top: 4px; }
body.help table { background: var(--card); border-radius: 10px; }
body.help dt { font-weight: 600; margin-top: 12px; }
body.help dd { margin: 2px 0 0; color: var(--muted); }

/* планирование: шкалы техники и людей */
.planwrap { overflow-x: auto; padding: 8px; }
table.plan { border-collapse: collapse; font-size: 13px; width: 100%; }
table.plan th { font-weight: 600; text-align: center; padding: 4px 2px; min-width: 34px; }
table.plan th small { display: block; font-weight: 400; color: var(--muted); }
table.plan th.we { color: #c0392b; } table.plan th.now { background: var(--bg); border-radius: 6px; }
table.plan td { border: 1px solid var(--line); text-align: center; padding: 3px 2px; height: 30px; }
table.plan td:first-child, table.plan th:first-child { text-align: left; white-space: nowrap; padding: 3px 10px 3px 6px; position: sticky; left: 0; background: var(--card); min-width: 190px; }
table.plan td.ok { background: #e3f4e8; } table.plan td.warn { background: #fff1cc; } table.plan td.bad { background: #fde2e4; font-weight: 600; }
table.plan a.chip { display: inline-block; padding: 1px 4px; margin: 1px; border-radius: 5px; background: var(--accent); color: #fff; text-decoration: none; font-size: 12px; }
table.plan a.chip.wait { opacity: .45; }
.lg { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-left: 8px; }
.lg.ok { background: #e3f4e8; } .lg.warn { background: #fff1cc; } .lg.bad { background: #fde2e4; }
.head .tabs a { margin-right: 4px; }
/* поиск */
.gsearch { position: relative; margin-right: 12px; }
.gsearch input { width: 230px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); font: inherit; font-size: 14px; }
#found { position: absolute; right: 0; top: 36px; width: 380px; max-height: 70vh; overflow-y: auto; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.12); z-index: 30; padding: 6px; text-align: left; }
#found a { display: block; padding: 6px 8px; border-radius: 6px; color: inherit; text-decoration: none; }
#found a:hover { background: var(--bg); }
#found .g { font-size: 12px; color: var(--muted); padding: 6px 8px 2px; text-transform: uppercase; letter-spacing: .04em; }
@media (max-width: 760px) { .gsearch input { width: 130px; } #found { width: 290px; } }
form.form select { display: block; width: 100%; margin-top: 4px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--text); font: inherit; }
/* шапка в два ряда: бренд, поиск и пользователь — сверху; разделы — отдельной строкой */
header.top { flex-wrap: wrap; row-gap: 6px; }
header.top .brand { order: 1; }
header.top .me { order: 2; margin-left: auto; }
header.top #nav { order: 3; flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 2px; margin: 0; }
.gsearch { display: inline-block; }
#found[hidden], #searchbox[hidden] { display: none; }
.me a.link { margin-right: 0; }

/* колокольчик, вход */
a.bell { position: relative; font-size: 18px; text-decoration: none; }
a.bell b { position: absolute; top: -6px; right: -10px; background: var(--red); color: #fff; border-radius: 9px; font-size: 11px; padding: 1px 5px; line-height: 14px; }
a.bell b[hidden] { display: none; }
.what.unread { font-weight: 600; }
.box.form label { display: block; margin: 10px 0; }
.box.form input { display: block; width: 100%; margin-top: 4px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--text); font: inherit; }
.box.wide { max-width: 520px; }
.box.form .btn { margin-top: 6px; }
dialog textarea { width: 100%; font: 14px/1.5 ui-monospace, monospace; padding: 8px; border: 1px solid var(--line); border-radius: 8px; }
.offdays { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.offdays .day { width: 44px; padding: 5px 0; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--text); font: inherit; cursor: pointer; }
.offdays .day small { display: block; font-size: 11px; color: var(--muted); }
.offdays .day.we { color: #c0392b; }
.offdays .day.off { background: #fff1cc; border-color: #e0b84b; }
.offdays .day.off::after { content: "🌴"; display: block; font-size: 11px; }
.conf { border-top: 1px solid var(--line); padding: 6px 0; }
form.inline { display: flex; gap: 6px; margin: 8px 0; } form.inline input { flex: 1; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--text); font: inherit; }

/* 3D-вид площадки */
.scene-wrap { display: grid; grid-template-columns: minmax(300px, 380px) 1fr; gap: 12px; align-items: start; }
.scene-wrap .card { margin-bottom: 0; }
.scene-form h2 { font-size: 16px; margin: 4px 0 6px; } .scene-form h2:not(:first-child) { margin-top: 14px; }
.scene-form label { display: block; font-size: 12px; color: var(--muted); }
.scene-form input[type=number], .scene-form select { width: 100%; box-sizing: border-box; margin-top: 2px; }
.scene-form label.chk { display: inline-flex; gap: 6px; align-items: center; font-size: 16px; color: var(--text); }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 6px; }
.scr { border-top: 1px solid rgba(0,0,0,.08); padding-top: 8px; margin-top: 8px; }
.scr-h { display: flex; gap: 8px; align-items: baseline; margin-bottom: 4px; } .scr-h .ed { margin-left: auto; }
.dbtn.left { justify-content: flex-start; flex-wrap: wrap; display: flex; gap: 6px; margin-top: 12px; }
.scene-view { position: sticky; top: 8px; }
.scene-view canvas { width: 100%; height: min(62vh, 560px); display: block; border-radius: 10px; cursor: grab; touch-action: none; }
.scene-view canvas:active { cursor: grabbing; }
.vbtn { margin-top: 2px; }
ul.warn { padding-left: 0; list-style: none; color: #b42318; margin: 10px 0; } ul.warn li { margin: 4px 0; }
.card.bad { border-left: 4px solid #d92d20; }
@media (max-width: 900px) {
  .scene-wrap { grid-template-columns: 1fr; } .scene-view { position: static; order: -1; }
  .scene-view canvas { height: 52vh; }
}
.scene-form input[type=number], .scene-form select { padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--card); color: var(--text); font: inherit; font-size: 14px; }
.hscroll { overflow-x: auto; -webkit-overflow-scrolling: touch; } .hscroll table { min-width: 560px; }
.eqadd { display: flex; gap: 6px; align-items: center; } .eqadd select { flex: 1; } .eqadd .btn { margin: 0; }
.eqlist summary { cursor: pointer; margin: 8px 0 4px; font-size: 14px; }
.eq { display: grid; grid-template-columns: 1fr 62px 62px auto auto; gap: 4px; align-items: end; padding: 4px; border-radius: 8px; }
.eq:has([name=olen]) { grid-template-columns: 1fr 56px 56px 56px 56px auto auto; }
.eq:has([name=oh]):not(:has([name=olen])) { grid-template-columns: 1fr 58px 58px 58px auto auto; }
.eq.on { background: rgba(47,111,237,.1); }
.eq .lbl { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; align-self: center; }
.eq label { font-size: 11px; } .eq .ed { padding: 2px 4px; }

/* ИИ-помощник */
.askbox { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.askbox input { flex: 1; min-width: 220px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; background: var(--card); color: var(--text); }
.askbox #askres { flex-basis: 100%; } .askbox #askres h3 { margin: 6px 0 4px; font-size: 16px; }
.askbox #askres ul { margin: 0; padding-left: 18px; } .askbox #askres li { margin: 3px 0; } .askbox li.bad, .askbox li.bad a { color: #b42318; }
.hints { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: rgba(255, 196, 0, .1); }
.hint { display: flex; gap: 8px; align-items: center; margin-top: 6px; } .hint > span { flex: 1; } .hint .btn { margin: 0; }
.sctext { display: flex; gap: 8px; align-items: stretch; } .sctext textarea { flex: 1; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; font: inherit; resize: vertical; background: var(--card); color: var(--text); }
#stxres { margin-top: 6px; }
.aichip { white-space: nowrap; font-size: 13px; padding: 3px 8px; border-radius: 999px; background: rgba(120,130,145,.15); color: var(--muted); text-decoration: none; margin-right: 6px; }
.aichip.on { background: rgba(18,183,106,.15); color: #067647; }
.photo-in { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 4px 0 8px; } .photo-in .btn { margin: 0; }
.bigurl code { font-size: 20px; user-select: all; }
.loadrow { margin: 8px 0 6px; padding: 8px 10px; border-radius: 10px; background: rgba(120,130,145,.08); font-size: 14px; }
.loadrow .chips { margin: 4px 0; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.chips .chip { color: var(--text); display: inline-flex; align-items: center; gap: 2px; padding: 2px 8px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: 13px; }
.chips .chip.off { opacity: .5; text-decoration: line-through; }
.chips .chip .ed { padding: 0 2px; }
.tnote { margin: 4px 0 10px; padding: 8px 10px; border-radius: 10px; background: rgba(255,196,0,.1); font-size: 14px; }
.calcard .acts { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; } .calcard .acts .btn { margin: 0; }

/* подразделы: «Календарь» (месяц / техника / люди) и «Справочники» (клиенты / площадки / каталог) */
.subnav { display: flex; gap: 6px; flex-wrap: wrap; max-width: 1180px; margin: 14px auto 0; padding: 0 24px; }
.subnav a { padding: 5px 12px; border-radius: 999px; background: var(--card, #fff); color: var(--text); border: 1px solid var(--line, #e3e6ec); font-size: 14px; }
.subnav a.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.attline { margin-top: 2px; }
.attline.hot { color: var(--bad, #c62828); }
.kpbox { display: inline-flex; align-items: center; gap: 0; margin-right: 6px; }
.kpbox .btn { border-top-right-radius: 0; border-bottom-right-radius: 0; margin-right: 0; }
.kpbox select { height: 28px; border: 1px solid var(--line, #e3e6ec); border-left: 0; border-radius: 0 8px 8px 0; background: var(--card); color: var(--text); font-size: 13px; padding: 0 6px; }
.packt td.tick { text-align: center; font-size: 18px; width: 90px; }
.packt tr.kit td { color: var(--muted, #667); font-size: 13px; }
.packt tr.zone td { font-weight: 700; background: #eef2f8; }
.packt tr.sec td { font-weight: 600; background: #f6f7fa; }
@media print {
  header.top, .subnav, .noprint, #notice { display: none !important; }
  body { background: #fff; }
  .card.pack { box-shadow: none; border: 0; page-break-after: always; }
}
.avail { font-size: 12.5px; margin-top: 2px; }
.avail.bad { color: var(--bad, #c62828); }
.avail.warn { color: #b26a00; }
/* субаренда */
.plist { max-height: 260px; overflow: auto; border: 1px solid var(--line, #e3e6ec); border-radius: 8px; padding: 6px 10px; margin: 8px 0; }
.plist .chk { display: block; padding: 4px 0; }
.card.sub { margin-bottom: 12px; }
.needrow { display: flex; align-items: center; gap: 12px; }
.needrow .what { flex: 1; }
.tag.ok { background: #e3f4e8; color: #1b7a3a; }
.tag.warn { background: #fff1dc; color: #9a5b00; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 800px) { .grid2 { grid-template-columns: 1fr; } }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
/* 3D по запросу: файлы плана и фото, красивый вид */
.hallmake .hm-files { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.hallmake .hm-files label.btn { cursor: pointer; }
.scene-form input[type=color] { width: 100%; height: 34px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
/* реалистичный 3D (hall3d.js) — в карточке и на весь экран */
.scene-view .modes { display: flex; gap: 6px; margin-bottom: 8px; }
.h3d-inline { position: relative; height: min(66vh, 620px); border-radius: 10px; overflow: hidden; background: #1d1713; }
.h3d-host { color: #f4ebe2; }
.h3d-host .h3d-cv { display: block; width: 100%; height: 100%; touch-action: none; outline: none; }
.h3d-host .h3d-bar { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); display: flex; flex-wrap: wrap; gap: 5px; justify-content: center;
  padding: 6px; max-width: calc(100% - 16px); background: rgba(32,25,20,.86); border-radius: 12px; }
.h3d-host .h3d-bar button { font: inherit; font-size: 13px; color: #f4ebe2; background: transparent; border: 1px solid rgba(244,235,226,.22); border-radius: 9px;
  min-height: 34px; padding: 0 10px; cursor: pointer; white-space: nowrap; }
.h3d-host .h3d-bar button:hover { border-color: #d9875a; }
.h3d-host .h3d-bar button.on { background: #d9875a; border-color: #d9875a; color: #20160f; }
.h3d-host .h3d-bar .sep { width: 1px; align-self: stretch; background: rgba(244,235,226,.18); margin: 2px 2px; }
.h3d-host .h3d-msg { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 20px; color: #c4b2a2; }
.h3d-host .h3d-info { position: absolute; left: 10px; top: 10px; background: rgba(32,25,20,.86); padding: 7px 11px; border-radius: 10px; font-size: 13px; pointer-events: none; }
.h3d.h3d-host { position: fixed; inset: 0; z-index: 60; background: #1d1713; }
/* живой 3D-зал для клиента */
body.kp3d { margin: 0; background: #1d1713; color: #f4ebe2; min-height: 100vh; display: flex; flex-direction: column; }
.k3-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; background: #241c17; }
.k3-head b { font-size: 18px; font-weight: 600; } .k3-sub, .k3-co { color: #c4b2a2; font-size: 13px; }
.k3-view { position: relative; flex: 1; min-height: 70vh; }
.k3-view .h3d-msg { position: absolute; inset: 0; display: grid; place-items: center; color: #c4b2a2; }
.k3-hint { margin: 0; padding: 8px 16px; color: #8f7f72; font-size: 12px; }

/* ================= Внешний вид 2.1: меню сверху, светлая тема по умолчанию, тёмная — по кнопке ◐ ================= */
:root {
  --bg: #f3f4f7; --card: #ffffff; --text: #161a22; --muted: #697386; --line: #e3e6ec; --accent: #3563e9;
  --accent-soft: rgba(53, 99, 233, .10); --side: #ffffff; --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --radius: 12px;
}
:root[data-theme="light"] { color-scheme: light; }
html, body { font: 15px/1.45 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
.card { border: 1px solid var(--line); box-shadow: var(--shadow); }
h1 { font-size: 22px; letter-spacing: -.01em; }
.btn { border-radius: 9px; font-weight: 500; transition: filter .15s; }
.btn:hover { filter: brightness(1.07); }
.btn.ghost { background: transparent; color: var(--accent); border: 1px solid var(--line); }
.btn.ghost:hover { background: var(--accent-soft); filter: none; }
input, select, textarea { color-scheme: inherit; }
.themebtn { line-height: 0; color: var(--muted); }
.themebtn:hover { color: var(--accent); }

#nav a { display: inline-flex; align-items: center; gap: 8px; }
#nav a svg { flex: none; opacity: .75; }
#nav a.on { background: var(--accent-soft); color: var(--accent); }
#nav a.on svg { opacity: 1; }
.subnav a.on { background: var(--accent-soft); color: var(--accent); }

/* меню — сверху, строкой; на узком экране разделы прокручиваются вбок */
body.app > header.top { gap: 10px 18px; padding: 8px 20px; background: var(--side); box-shadow: var(--shadow); }
header.top .brand { font-size: 18px; white-space: nowrap; }
header.top #nav { flex: 1 1 auto; min-width: 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 2px; }
header.top #nav::-webkit-scrollbar { display: none; }
header.top #nav a { white-space: nowrap; padding: 7px 11px; border-radius: 9px; font-size: 14.5px; }
header.top #nav a:hover:not(.on) { background: var(--bg); }
header.top .me { gap: 6px 10px; flex-wrap: wrap; }
header.top .gsearch input { padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); color: var(--text); font: inherit; }
body.app > #subnav { margin-left: auto; margin-right: auto; max-width: 1240px; padding: 12px 20px 0; }
body.app > main { max-width: 1240px; padding: 20px; }
@media (max-width: 999px) {
  body.app > header.top { padding: 8px 12px; }
  header.top #nav { order: 3; flex-basis: 100%; }
  header.top .me { margin-left: auto; }
}
@media (max-width: 600px) {
  body.app > header.top { gap: 6px 10px; }
  header.top .brand { font-size: 16px; }
  header.top .me { flex-wrap: nowrap; gap: 8px; font-size: 13px; min-width: 0; }
  header.top .me #me { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  header.top .me a[href="/help"], header.top .me .aichip { display: none; }
}
@media print { body.app { display: block; } }
/* тёмная тема: мягкий графит, не чёрный; цветные плашки — полупрозрачные, чтобы не «светились» */
:root[data-theme="dark"] {
  --bg: #1b1e24; --card: #242830; --text: #e4e7ec; --muted: #a3abb8; --line: #353b46; --accent: #7d9bff;
  --accent-soft: rgba(125, 155, 255, .16); --side: #20242b; --red: #ff6b74; --shadow: 0 1px 3px rgba(0, 0, 0, .35); color-scheme: dark;
}
:root[data-theme="dark"] input:not([type=checkbox]):not([type=radio]):not([type=color]), :root[data-theme="dark"] select, :root[data-theme="dark"] textarea { background: var(--bg); color: var(--text); border-color: var(--line); }
:root[data-theme="dark"] .tag.req, :root[data-theme="dark"] .tag.warn { background: rgba(240, 180, 40, .18); color: #f3c969; }
:root[data-theme="dark"] .tag.ok { background: rgba(60, 190, 110, .18); color: #7fd9a2; }
:root[data-theme="dark"] .tag.bad, :root[data-theme="dark"] .notice.bad { background: rgba(230, 80, 90, .18); color: #ff9aa3; }
:root[data-theme="dark"] .notice { background: rgba(240, 180, 40, .14); color: #f3c969; }
:root[data-theme="dark"] table.plan td.ok, :root[data-theme="dark"] .lg.ok { background: rgba(60, 190, 110, .15); }
:root[data-theme="dark"] table.plan td.warn, :root[data-theme="dark"] .lg.warn, :root[data-theme="dark"] .offdays .day.off { background: rgba(240, 180, 40, .15); }
:root[data-theme="dark"] table.plan td.bad, :root[data-theme="dark"] .lg.bad { background: rgba(230, 80, 90, .16); }
:root[data-theme="dark"] .packt tr.zone td, :root[data-theme="dark"] .packt tr.sec td { background: var(--bg); }
:root[data-theme="dark"] .row:hover { box-shadow: 0 2px 10px rgba(0, 0, 0, .4); }
:root[data-theme="dark"] .toast { background: #3a404c; }
.pickn { margin: 8px 0; } .pickn .chip.pick { cursor: pointer; border: 1px solid var(--line); background: var(--card); color: var(--text); font: inherit; font-size: 13px; padding: 4px 10px; border-radius: 999px; display: inline-block; margin: 0 4px 4px 0; }
.pickn .chip.pick:hover { border-color: var(--accent); color: var(--accent); }
.delzone { margin: 26px 0 8px; padding-top: 16px; border-top: 1px dashed var(--line); text-align: center; }
#found a.best { background: var(--accent-soft); }
.paybar { margin: 6px 0 10px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.addrtools { white-space: nowrap; } .addrtools .ed { text-decoration: none; margin-left: 4px; font-size: 13px; }
.tline { display: flex; flex-direction: column; gap: 2px; margin: 4px 0 6px; }
.tl { display: flex; gap: 10px; padding: 3px 0; border-bottom: 1px dashed var(--line); }
.tl .tlw { min-width: 150px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tl.custom { font-weight: 600; }
.stgrow { display: grid; grid-template-columns: 1fr 140px 90px 10px 90px 28px; gap: 6px; align-items: center; margin-bottom: 6px; }
@media (max-width: 600px) { .stgrow { grid-template-columns: 1fr 1fr; } .stgrow span { display: none; } }
.mycal .mcgrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.mycal .wd { text-align: center; font-size: 12px; color: var(--muted); }
.mday { position: relative; border: 0; border-radius: 10px; padding: 10px 0 14px; background: transparent; color: var(--text); font: inherit; font-size: 16px; cursor: pointer; }
.mday:hover { background: var(--bg); }
.mday i { position: absolute; left: 0; right: 0; bottom: 2px; font-style: normal; font-size: 11px; color: var(--accent); letter-spacing: 1px; }
.mday.work { background: rgba(31, 157, 85, .14); color: #136c3a; }
.mday.req { background: rgba(240, 180, 40, .2); color: #8a6100; }
.mday.off { background: rgba(220, 53, 69, .12); color: #a11a2b; }
.mday.today { outline: 2px solid var(--accent); }
.mday.past { opacity: .45; cursor: default; }
:root[data-theme="dark"] .mday.work { color: #7fd9a2; } :root[data-theme="dark"] .mday.req { color: #f3c969; } :root[data-theme="dark"] .mday.off { color: #ff9aa3; }
.lg2 { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: -1px; }
.lg2.work { background: rgba(31, 157, 85, .5); } .lg2.req { background: rgba(240, 180, 40, .6); } .lg2.off { background: rgba(220, 53, 69, .45); }
.team .tm { display: flex; align-items: center; gap: 6px; padding: 3px 0; } .team .tm span:first-child { flex: 1; }
.row.flash { box-shadow: 0 0 0 3px var(--accent); transition: box-shadow .3s; }
.two-inline { display: flex; gap: 8px; align-items: center; }
.xrow { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; border-bottom: 1px solid var(--line); }
.xrow .what { flex: 1; min-width: 0; word-break: break-word; }
h2 label.btn { font-weight: 500; }
.fixrow { display: grid; grid-template-columns: 1fr 160px 170px; gap: 6px; align-items: center; margin-bottom: 6px; }
@media (max-width: 600px) { .fixrow { grid-template-columns: 1fr 1fr; } .fixrow b { grid-column: 1 / -1; } }

/* ================= Телефон 2.0: как в Rentman — заголовок сверху, вкладки снизу, карточка вкладками ================= */
.mback, .mtitle, .mico, .tabbar, .fab, .mtabs, .stmore { display: none; }
@media (max-width: 760px) {
  html { -webkit-text-size-adjust: 100%; }
  body.app { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  /* шапка: ‹ Заголовок 🔍 🔔 */
  body.app > header.top { position: sticky; top: 0; z-index: 30; flex-wrap: nowrap; gap: 4px; padding: calc(6px + env(safe-area-inset-top)) 8px 6px;
    min-height: 52px; background: var(--card); box-shadow: 0 1px 0 var(--line); }
  header.top #nav, header.top .me > :not(.bell):not(.gsearch), header.top .me form, header.top .aichip { display: none !important; }
  header.top .brand { font-size: 16px; padding-left: 6px; }
  body.inner header.top .brand { display: none; }
  .mback { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 0; background: none; color: var(--accent); border-radius: 10px; }
  .mback[hidden] { display: none; }
  .mtitle { display: block; flex: 1; min-width: 0; text-align: center; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  body:not(.inner) .mtitle { text-align: left; padding-left: 8px; }
  .mico { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 0; background: none; color: var(--text); border-radius: 10px; }
  .mico[hidden] { display: none; }
  header.top .me { margin: 0; flex: 0 0 auto; gap: 0; }
  header.top .bell { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; font-size: 20px; }
  /* поиск — строкой под шапкой по 🔍 */
  header.top .gsearch { display: none !important; }
  body.msearching header.top .gsearch { display: block !important; position: absolute; left: 8px; right: 8px; top: calc(100% + 4px); }
  body.msearching header.top .gsearch input { width: 100%; font-size: 16px; padding: 12px 14px; border-radius: 12px; box-shadow: 0 6px 24px rgba(0,0,0,.18); }
  body.msearching #found { position: static; width: 100%; max-height: 60vh; margin-top: 4px; }
  /* нижние вкладки */
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--card); border-top: 1px solid var(--line);
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); }
  .tabbar[hidden] { display: none; }
  .tabbar a, .tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0 4px; border: 0; background: none;
    color: var(--muted); font: inherit; font-size: 11px; text-decoration: none; border-radius: 10px; }
  .tabbar svg { width: 24px; height: 24px; }
  .tabbar .on { color: var(--accent); font-weight: 600; }
  .fab { display: flex; position: fixed; right: 16px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 41; width: 56px; height: 56px; border-radius: 50%;
    border: 0; background: var(--accent); color: #fff; font-size: 30px; line-height: 1; align-items: center; justify-content: center; box-shadow: 0 6px 18px rgba(53,99,233,.45); }
  .fab[hidden] { display: none; }
  /* «Ещё» — лист снизу */
  dialog.msheet { margin: auto 0 0; width: 100vw; max-width: 100vw; border-radius: 18px 18px 0 0; padding: 8px 8px calc(12px + env(safe-area-inset-bottom)); }
  .msheet-grab { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 4px auto 10px; }
  .msheet-list a, .msheet-list button { display: flex; align-items: center; gap: 14px; width: 100%; padding: 13px 14px; border: 0; background: none; color: var(--text);
    font: inherit; font-size: 16px; text-decoration: none; border-radius: 12px; text-align: left; }
  .msheet-list a:active, .msheet-list button:active { background: var(--bg); }
  .msheet-list svg { width: 22px; height: 22px; color: var(--muted); }
  .msheet-list .bad { color: var(--red, #dc3545); }
  /* окна — снизу на всю ширину */
  dialog:not(.msheet) { margin: auto 0 0; width: 100vw; max-width: 100vw; max-height: 92vh; border-radius: 18px 18px 0 0; padding: 18px 16px calc(16px + env(safe-area-inset-bottom)); }
  dialog .dbtn { position: sticky; bottom: -16px; background: var(--card); padding: 10px 0 4px; margin-bottom: -4px; }
  dialog .dbtn .btn { flex: 1; padding: 12px; font-size: 16px; }
  input, select, textarea { font-size: 16px !important; }       /* iPhone не приближает страницу при вводе */
  body.app > main { padding: 12px 12px 24px; }
  body.app > #subnav { padding: 8px 12px 0; overflow-x: auto; white-space: nowrap; flex-wrap: nowrap; scrollbar-width: none; }
  .card { padding: 14px; border-radius: 14px; }
  h1 { font-size: 21px; } h2 { font-size: 17px; }
  .btn, .btn.small { min-height: 38px; }
  .ed { min-width: 32px; min-height: 32px; }
  /* списки: дата слева, как в расписании */
  a.row, .row { display: grid; grid-template-columns: 58px 1fr auto; grid-template-areas: "when what sum" "when what pill"; gap: 2px 10px; padding: 12px; align-items: start; flex-wrap: nowrap; }
  .row .when { grid-area: when; width: auto; min-width: 0; font-size: 13px; line-height: 1.3; color: var(--accent); font-weight: 700; }
  .row .what { grid-area: what; } .row .what div { white-space: nowrap; }
  .row .pill { grid-area: pill; justify-self: end; font-size: 11px; }
  .row .sum { grid-area: sum; justify-self: end; font-size: 13px; }
  .filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
  .filters button { white-space: nowrap; }
  .calhead { flex-wrap: wrap; } .calhead .btn.small { display: none; }
  .calhead b { min-width: 0; flex: 1; }
  /* календарь: в клетках — цветные точки, список дня — ниже */
  .grid .cell { min-height: 46px; padding: 3px 2px; cursor: pointer; }
  .grid .chip { display: inline-block; width: 8px; height: 8px; padding: 0; margin: 1px; border-radius: 50%; font-size: 0; overflow: hidden; vertical-align: middle; }
  .grid .more { font-size: 9px; }
  .legend { font-size: 12px; }
  .agenda h3 { margin: 18px 4px 8px; font-size: 14px; color: var(--muted); text-transform: none; }
  .agenda h3.now { color: var(--accent); }
  /* карточка мероприятия: статус одной кнопкой ▾ и вкладки */
  .stmore { display: inline; }
  .stbar:not(.open) .st:not(.on) { display: none; }
  .stbar .st { padding: 7px 14px; font-size: 14px; }
  .mtabs { display: flex; position: sticky; top: calc(52px + env(safe-area-inset-top)); z-index: 20; margin: -12px -12px 12px; padding: 0 6px;
    background: var(--card); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
  .mtabs button { flex: 1 0 auto; padding: 13px 10px 11px; border: 0; border-bottom: 2.5px solid transparent; background: none; color: var(--muted);
    font: inherit; font-size: 14px; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; white-space: nowrap; }
  .mtabs button.on { color: var(--accent); border-bottom-color: var(--accent); }
  .mtabs small { font-weight: 500; opacity: .7; }
  [data-tab][hidden] { display: none !important; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dt { margin-top: 10px; font-size: 13px; } .kv dd { font-size: 16px; }
  .ppl { display: block; } .ppl > div { padding: 10px 0; border-bottom: 1px solid var(--line); }
  .card.docs { display: flex; flex-wrap: wrap; gap: 6px; } .card.docs > b { width: 100%; }
  .card.docs .btn { flex: 1 1 45%; text-align: center; }
  /* смета: строка — карточкой: название, ниже кол-во × дни × цена = сумма */
  table.est, table.est tbody { display: block; }
  table.est tr:first-child { display: none; }
  table.est tr { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 4px 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  table.est tr.sec, table.est tr.sub, table.est tr.tot { display: flex; justify-content: space-between; padding: 8px 0; }
  table.est td { display: block; padding: 0 !important; border: 0 !important; text-align: left !important; }
  table.est tr[data-row] td:first-child { grid-column: 1 / -1; font-weight: 500; }
  table.est tr[data-row] td:nth-child(5) { grid-column: 1 / 3; font-weight: 700; align-self: center; }
  table.est tr[data-row] td:nth-child(6) { grid-column: 3; justify-self: end; }
  table.est td:nth-child(2)::before { content: "Кол-во "; color: var(--muted); font-size: 12px; display: block; }
  table.est td:nth-child(3)::before { content: "Дней "; color: var(--muted); font-size: 12px; display: block; }
  table.est td:nth-child(4)::before { content: "Цена "; color: var(--muted); font-size: 12px; display: block; }
  table.est tr.sec td::before, table.est tr.sub td::before, table.est tr.tot td::before { content: none !important; }
  table.est input.num { width: 100% !important; border: 1px solid var(--line); background: var(--bg); padding: 8px; text-align: left; }
  /* таблицы в остальных разделах — прокрутка вбок, а не обрезка */
  .card > table:not(.est) { display: block; overflow-x: auto; white-space: nowrap; }
  .delzone .btn { width: 100%; }
}
@media (max-width: 760px) {
  header.top .brand { display: none; }
  .back, #bk { display: none !important; }
  body.app > main { padding-bottom: 96px; }
  .mtabs { margin-top: -12px; }
}
#subnav[hidden] { display: none !important; }
@media (max-width: 760px) {
  table.est td .muted.small { display: none; }
  .tl .tlw { min-width: 118px; }
}
@media (max-width: 760px) {
  /* работа монтажника — карточкой: дата и время, что и где, ниже кнопки во всю ширину */
  .row.job { display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding: 14px; }
  .row.job .when { font-size: 15px; }
  .row.job .what div { white-space: normal; }
  .row.job > .tag { align-self: flex-start; }
  .row.job .acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px; }
  .row.job .acts .btn { width: 100%; min-height: 46px; font-size: 15px; display: flex; align-items: center; justify-content: center; gap: 6px; }
  .row.job .what .btn { width: 100%; min-height: 46px; font-size: 15px; margin-top: 6px; }
  .mycal .mday { padding: 12px 0 16px; }
}
table.payt { width: 100%; border-collapse: collapse; margin-bottom: 10px; }
table.payt td, table.payt th { padding: 4px 6px; border-bottom: 1px solid var(--line); text-align: left; font-size: 14px; }
table.payt input { width: 100%; max-width: 110px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--text); font: inherit; }
.payrow { display: grid; grid-template-columns: 1fr 90px 70px 80px; gap: 6px; align-items: center; margin: 4px 0; }
.payrow input { padding: 6px; }
@media (max-width: 760px) { .card > table.payt { display: table; white-space: normal; } table.payt th { font-size: 11px; } table.payt input { max-width: none; } }

/* 🦺 подтверждение смены и 📋 табель на проверку */
.card.warnbox { border-left: 4px solid #e0a100; }
.shrow { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
.shrow label.chk { flex: 1; margin: 0; display: flex; align-items: center; gap: 8px; flex-direction: row; }
.shrow label.chk input { width: auto !important; flex: none; }
.shrow input[type=number] { width: 80px !important; flex: none; }
.tbl2 { margin: 8px 0; }
.tbl2 .tr2 { display: flex; gap: 10px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--line, #e5e7eb); }
.tbl2 .tr2 .d { flex: none; width: 44px; color: var(--muted, #6b7280); }
.tbl2 .tr2 .w { flex: 1; min-width: 0; }
.tbl2 .tr2 .a { flex: none; white-space: nowrap; }
.tbl2 .tr2.tot { border-bottom: 0; font-weight: 700; }

/* 🎚 варианты КП и опции «по желанию» */
.vbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 6px 0 10px; }
.vbar .vt { background: var(--chip, #eef2f7); border-radius: 8px; padding: 3px 8px; font-size: 13px; }
.vbar .vt.def { outline: 2px solid #2f6fed; }
.vchips { margin-top: 4px; display: flex; gap: 4px; align-items: center; }
.vchip { border: 1px solid #c9d2de; background: #fff; color: #6b7280; border-radius: 6px; font-size: 12px; min-width: 26px; padding: 1px 6px; cursor: pointer; }
.vchip.on { background: #2f6fed; border-color: #2f6fed; color: #fff; }
tr.notbase td { color: #8a94a3; }
tr.notbase input.num { opacity: .75; }
button.ed.on { color: #e0a100; }
/* КП для клиента: выбор варианта и опций */
.kp .tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.kp .tier { border: 2px solid #d5dae0; border-radius: 12px; padding: 12px; cursor: pointer; background: #fff; text-align: left; font: inherit; }
.kp .tier b { display: block; font-size: 18px; margin-top: 4px; }
.kp .tier.on { border-color: #2f6fed; box-shadow: 0 0 0 3px rgba(47,111,237,.15); }
.kp .opts label { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid #eef0f3; }
.kp .opts label span.r { margin-left: auto; white-space: nowrap; }
@media (max-width: 560px) { .kp .tiers { grid-template-columns: 1fr; } }
/* ⚙️ автоматика */
.autor { padding: 8px 0; border-bottom: 1px solid #eef0f3; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
.autor > div, .autor > details { flex-basis: 100%; }
.autor input.audays { width: 64px; }
/* 💬 входящие */
.navbadge { font-style: normal; background: #e5484d; color: #fff; border-radius: 9px; font-size: 11px; padding: 0 6px; margin-left: 6px; line-height: 16px; display: inline-block; }
.navbadge[hidden] { display: none; }
.chats { display: grid; grid-template-columns: 320px 1fr; gap: 12px; min-height: 60vh; }
.chatlist { background: var(--card, #fff); border-radius: 12px; padding: 8px; overflow: auto; max-height: 75vh; }
.chatlist .seg { display: flex; gap: 6px; margin-bottom: 6px; }
.chatlist .seg button { flex: 1; border: 1px solid #d5dae0; background: #fff; border-radius: 8px; padding: 5px; cursor: pointer; font: inherit; font-size: 13px; }
.chatlist .seg button.on { background: #2f6fed; color: #fff; border-color: #2f6fed; }
.chatrow { display: flex; gap: 8px; align-items: flex-start; padding: 8px; border-radius: 10px; color: inherit; text-decoration: none; }
.chatrow:hover, .chatrow.on { background: #eef3fd; }
.chatrow .cm { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chatrow .cm .muted { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chatrow.new .cm b { color: #1d4ed8; }
.chatrow .cw { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.chatpane { background: var(--card, #fff); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; max-height: 75vh; }
.chathead { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; border-bottom: 1px solid #eef0f3; padding-bottom: 8px; }
.chathead .acts { margin-left: auto; display: flex; flex-wrap: wrap; gap: 6px; }
.chathead .cback { display: none; text-decoration: none; font-size: 22px; padding: 0 6px 0 0; }
.msgs { flex: 1; overflow: auto; padding: 10px 2px; display: flex; flex-direction: column; gap: 6px; min-height: 200px; }
.msg { display: flex; }
.msg.out { justify-content: flex-end; }
.msg .bubble { max-width: 78%; padding: 7px 10px; border-radius: 12px; background: #f1f3f6; white-space: normal; word-wrap: break-word; }
.msg.out .bubble { background: #dbe8ff; }
.msg .bubble img { max-width: 260px; max-height: 260px; border-radius: 8px; display: block; }
.msg .mt { font-size: 11px; color: #6b7280; margin-top: 2px; }
.reply { display: flex; gap: 8px; align-items: flex-end; border-top: 1px solid #eef0f3; padding-top: 8px; }
.reply textarea { flex: 1; resize: vertical; font: inherit; padding: 8px; border: 1px solid #d5dae0; border-radius: 10px; }
#tabbar a { position: relative; }
#tabbar .navbadge { position: absolute; top: 2px; left: 55%; margin: 0; }
.convmini { padding: 6px 0; border-bottom: 1px solid #eef0f3; }
@media (max-width: 760px) {
  .chats { grid-template-columns: 1fr; }
  .chats.open .chatlist { display: none; }
  .chats:not(.open) .chatpane { display: none; }
  .chathead .cback { display: inline; }
  .chatlist, .chatpane { max-height: none; }
  .msgs { max-height: 60vh; }
}
.idlechip { display: inline-block; margin: 3px; padding: 3px 9px; border-radius: 999px; background: var(--chip, #eef2f7); border: 1px solid #dde3ea; font-size: 13px; }
label.chk, form.form label.chk { display: flex; align-items: center; gap: 8px; }
label.chk input[type=checkbox], label.chk input[type=radio] { width: auto; margin: 0; flex: none; }
body.kp #f label.chk { display: flex; max-width: 560px; }

/* 01.12: люди на работу — роли, бригады, несколько сразу; смета — несколько позиций; доп. работы */
[hidden], .ck[hidden], label[hidden] { display: none !important; }
.pgroup { margin: 10px 0 4px; }
.pgroup h3 { margin: 8px 0 4px; font-size: 15px; }
details.prest, details.pmore { margin: 4px 0 6px; }
details.prest > summary, details.pmore > summary { cursor: pointer; color: var(--accent, #2563eb); font-size: 14px; padding: 4px 0; }
details.pmore > summary { font-weight: 600; }
.qtyrow input, label.qty input { width: 70px; margin: 0 4px; display: inline-block; }
label.qty { display: inline-flex; align-items: center; gap: 2px; font-size: 13px; margin: 0; }
.fixrow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.fixrow > b { flex: 1 1 120px; }
.fixrow > select { flex: 0 1 170px; width: auto; margin: 0; }
.fixrow details.r2 { flex-basis: 100%; font-size: 13px; }
.fixrow details.r2 summary { cursor: pointer; color: var(--muted, #6b7280); }
.fixrow details.r2 .ck { display: inline-flex; margin-right: 10px; }
.mp-sel .mp-row, .bk { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line, #e5e7eb); flex-wrap: wrap; }
.mp-row b { flex: 1 1 140px; }
.mp-row select { width: auto; flex: 0 1 180px; margin: 0; }
.bk .what { flex: 1 1 180px; }
.bk input { width: 80px; margin: 0; }
.mp-q { margin-bottom: 6px; }
.xjadd { margin-top: 10px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
dialog .bk input[type=number] { width: 90px !important; flex: none; margin: 0 !important; padding: 6px 8px; }
dialog .qtyrow input[type=number], dialog label.qty input[type=number] { width: 72px !important; flex: none; margin: 0 4px !important; padding: 6px 8px; display: inline-block; }
dialog .mp-row select { width: auto !important; flex: 0 1 190px; margin: 0 !important; }
dialog .two #addown { align-self: end; margin-bottom: 2px; }
dialog .fixrow > select { width: auto !important; flex: 0 1 180px; margin: 0 !important; }

/* 🤖 помощник */
.agentbtn { position: fixed; right: 18px; bottom: 18px; z-index: 50; width: 56px; height: 56px; border-radius: 50%; border: 0;
  background: var(--accent, #2f6fed); color: #fff; font-size: 26px; box-shadow: 0 4px 14px rgba(0,0,0,.25); cursor: pointer; }
.agentbtn:hover { transform: scale(1.05); }
@media (max-width: 760px) { .agentbtn { bottom: 76px; right: 12px; width: 50px; height: 50px; font-size: 22px; } }
dialog.agdlg { width: min(640px, 94vw); }
dialog.agdlg textarea { width: 100%; box-sizing: border-box; }
.agplan { border-top: 1px solid var(--line, #e3e3e3); padding: 10px 0; }
.agcard .agplan:first-of-type { border-top: 0; }
.agtext { margin: 4px 0; font-style: italic; }
.agheard { margin: 8px 0; color: var(--muted, #666); }
.agreply { margin: 6px 0; white-space: pre-line; }
.agstep { display: block; margin: 4px 0; }
.agdone { white-space: pre-line; line-height: 1.5; }
#agout .acts, .agplan .acts { margin-top: 8px; }

.agtools { margin: 4px 0 8px; gap: 6px; }
dialog.estdlg { width: min(860px, 96vw); }
dialog.estdlg table.est { margin: 8px 0; }
