:root {
  --bg: #f3f4f6; --card: #fff; --text: #16181d; --muted: #6b7280; --line: #e5e7eb;
  --accent: #c8102e; --accent-soft: #fde8eb; --ok: #15803d; --ok-soft: #dcfce7;
  --warn: #b45309; --warn-soft: #fef3c7; --top: #16181d; --chip: #eef0f3;
  --radius: 12px;
  --soft: #f8f9fb; --soft2: #e9ebef; --red-soft: #fff5f6; --blue-soft: #eef2ff; --violet-soft: #f5f3ff;
  --today: #fff7d6; --today2: #fffdf2; --ok-soft2: #f3fbf5; color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 15px/1.45 -apple-system, "Segoe UI", Roboto, Arial, sans-serif; background: var(--bg); color: var(--text); }
a { color: inherit; }
button, input, select, textarea { font: inherit; }

.top { position: sticky; top: 0; z-index: 10; background: var(--top); color: #fff; display: flex; align-items: center;
  gap: 12px; padding: 10px 16px; min-height: 52px; }
.brand { font-weight: 700; text-decoration: none; display: flex; align-items: center; gap: 8px; font-size: 17px; white-space: nowrap; }
.brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
#nav { margin-left: auto; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
#nav a, #nav button { color: #d1d5db; background: none; border: 0; padding: 6px 10px; border-radius: 8px; cursor: pointer; text-decoration: none; font-size: 14px; }
#nav a.on, #nav a:hover, #nav button:hover { background: #2b2f38; color: #fff; }
#nav .who { color: #9ca3af; font-size: 13px; padding: 0 4px; }

main { max-width: 900px; margin: 0 auto; padding: 16px; }
.loading, .empty { text-align: center; color: var(--muted); padding: 40px 0; }
h1 { font-size: 22px; margin: 4px 0 12px; }
h2 { font-size: 16px; margin: 22px 0 10px; }

.card { background: var(--card); border-radius: var(--radius); padding: 14px 16px; box-shadow: 0 1px 2px rgba(0,0,0,.05); border: 1px solid var(--line); }
.card + .card { margin-top: 10px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: var(--card);
  border-radius: 10px; padding: 9px 14px; cursor: pointer; font-weight: 500; color: var(--text); text-decoration: none; }
.btn:hover { border-color: #cbd5e1; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.small { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn.ghost { border-color: transparent; background: none; color: var(--muted); }
.btn:disabled { opacity: .5; cursor: default; }

input[type=text], input[type=password], input[type=search], input[type=tel], select, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--card); color: var(--text); }
input:focus, select:focus, textarea:focus { outline: 2px solid #fca5b1; border-color: var(--accent); }
textarea { resize: vertical; min-height: 44px; }
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }

.login { max-width: 380px; margin: 8vh auto 0; }
.login h1 { text-align: center; }
.login .btn { width: 100%; margin-top: 16px; padding: 12px; }
.err { color: var(--accent); margin-top: 10px; font-size: 14px; min-height: 1em; }

.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar input { flex: 1 1 200px; }
.tabs { display: inline-flex; background: var(--line); border-radius: 10px; padding: 3px; }
.tabs button { border: 0; background: none; padding: 7px 12px; border-radius: 8px; cursor: pointer; color: var(--muted); font-weight: 500; }
.tabs button.on { background: var(--card); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

.order { display: block; text-decoration: none; cursor: pointer; }
.order:hover { border-color: #cbd5e1; }
.order .row1 { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.order .num { font-weight: 700; font-size: 17px; }
.order .car { font-weight: 600; }
.order .date { margin-left: auto; color: var(--muted); font-size: 13px; }
.order .meta { color: var(--muted); font-size: 14px; margin-top: 2px; }
.regno { display: inline-block; border: 1.5px solid var(--text); border-radius: 5px; padding: 0 6px; font-weight: 700; font-size: 13px; letter-spacing: .5px; background: var(--card); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.chip { background: var(--chip); border-radius: 999px; padding: 2px 10px; font-size: 13px; display: inline-flex; align-items: center; gap: 4px; }
.chip.me { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.chip.asg { background: var(--blue-soft); color: #3730a3; }
.chip button { border: 0; background: none; cursor: pointer; color: inherit; padding: 0 0 0 2px; font-size: 15px; line-height: 1; }
.badge { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.badge.open { background: var(--warn-soft); color: var(--warn); }
.badge.closed { background: var(--ok-soft); color: var(--ok); }
.badge.cancel { background: var(--soft); color: var(--muted); }

.progress { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.bar { flex: 1; height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--ok); border-radius: 99px; }

.head .title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.head .title h1 { margin: 0; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin-top: 10px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.textblock { white-space: pre-wrap; background: var(--soft); border-radius: 8px; padding: 8px 10px; margin-top: 8px; font-size: 14px; }

.work { display: flex; gap: 12px; align-items: flex-start; }
.work.done .wname { color: var(--muted); text-decoration: line-through; }
.check { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 9px; border: 2px solid #cbd5e1; background: var(--card); cursor: pointer;
  display: grid; place-items: center; color: #fff; font-size: 18px; font-weight: 700; margin-top: 1px; }
.check.on { background: var(--ok); border-color: var(--ok); }
.check:disabled { cursor: default; }
.wbody { flex: 1; min-width: 0; }
.wname { font-weight: 500; }
.wmeta { font-size: 13px; color: var(--muted); margin-top: 2px; display: flex; gap: 10px; flex-wrap: wrap; }
.work.mine { border-left: 4px solid var(--accent); }
.wnotes { margin-top: 6px; }
.note { font-size: 14px; background: var(--soft); border-radius: 8px; padding: 6px 10px; margin-top: 6px; }
.note .by { font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.note .by button { margin-left: auto; }
.note .txt { white-space: pre-wrap; }
.addnote { display: flex; gap: 8px; margin-top: 8px; }
.addnote textarea { min-height: 40px; }

.parts td, .parts th { padding: 6px 4px; border-bottom: 1px solid var(--line); text-align: left; font-size: 14px; }
.parts { width: 100%; border-collapse: collapse; }
.parts .q { text-align: right; white-space: nowrap; }

.assign { display: flex; gap: 8px; margin-top: 10px; }
.assign select { flex: 1; }

.users table { width: 100%; border-collapse: collapse; }
.users td, .users th { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; font-size: 14px; vertical-align: middle; }
.users th { color: var(--muted); font-weight: 500; font-size: 13px; }
.users tr.off td { color: #9ca3af; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.pwline { display: flex; gap: 8px; }
.secret { background: var(--warn-soft); border-radius: 10px; padding: 10px 12px; margin-top: 12px; font-size: 14px; }
.secret code { font-size: 16px; font-weight: 700; user-select: all; }
.muted { color: var(--muted); }
.back { display: inline-block; margin-bottom: 8px; color: var(--muted); text-decoration: none; }

#toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: #111827; color: #fff; padding: 10px 16px;
  border-radius: 10px; font-size: 14px; opacity: 0; transition: opacity .2s; pointer-events: none; max-width: 90vw; z-index: 50; }
#toast.show { opacity: 1; }
#toast.bad { background: var(--accent); }

@media (max-width: 600px) {
  main { padding: 12px; }
  .grid2 { grid-template-columns: 1fr; }
  .users .hide-sm { display: none; }
  .order .date { margin-left: 0; width: 100%; order: 5; }
  #nav .who { display: none; }
}
.wbody > .btn.ghost { padding-left: 0; margin-top: 4px; }

/* --- v2: board, proposals --- */
.cnt { background: var(--accent); color: #fff; border-radius: 999px; padding: 0 7px; font-size: 12px; font-weight: 700; margin-left: 2px; }
.badge.pend { background: var(--warn-soft); color: var(--warn); }
.badge.app { background: var(--blue-soft); color: #3730a3; }
.hint { font-size: 13px; margin: -4px 0 12px; }
main:has(.board) { max-width: none; }
.board { display: flex; gap: 12px; overflow-x: auto; align-items: flex-start; padding-bottom: 16px; }
.bcol { flex: 0 0 270px; background: var(--soft2); border-radius: var(--radius); padding: 8px; min-height: 220px; border: 2px dashed transparent; }
.bcol.unas { background: var(--red-soft); }
.bcol.over { border-color: var(--accent); background: var(--red-soft); }
.bhead { font-weight: 700; padding: 4px 6px 8px; display: flex; justify-content: space-between; }
.bbody { display: flex; flex-direction: column; gap: 8px; min-height: 150px; }
.bempty { color: var(--muted); font-size: 13px; text-align: center; padding: 30px 8px; border: 1px dashed #cbd5e1; border-radius: 10px; }
.bcard { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: grab; font-size: 14px; }
.bcard:hover { border-color: #cbd5e1; box-shadow: 0 2px 6px rgba(0,0,0,.06); }
.bcard.dragging { opacity: .4; }
.bcard .bcar { font-weight: 600; margin-top: 2px; }
.bcard .meta { font-size: 13px; }
.bcard .progress { margin-top: 6px; }
.bx { position: absolute; top: 4px; right: 6px; border: 0; background: none; color: var(--muted); font-size: 18px; cursor: pointer; line-height: 1; }
.bx:hover { color: var(--accent); }
.execs { margin-top: 6px; font-size: 14px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip.pendchip { background: var(--warn-soft); color: var(--warn); }
.xbtn { border: 0; background: none; cursor: pointer; color: inherit; opacity: .6; font-size: 15px; padding: 0 0 0 2px; }
.xbtn:hover { opacity: 1; }
.dec { display: inline-flex; gap: 3px; margin-left: 4px; vertical-align: middle; }
.dec .btn { padding: 1px 8px; font-size: 13px; }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.no { background: var(--card); color: var(--accent); border-color: #f3b5bf; }
.pendtxt { color: var(--warn); }
.sumbad { color: var(--accent); font-weight: 600; font-size: 13px; }
.wact { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.wact .btn.ghost { padding-left: 6px; }
.wbody > .btn.ghost { padding-left: 0; }
.iform { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.iform input[type=text], .iform select { width: auto; flex: 1 1 140px; padding: 7px 10px; }
.iform textarea { flex: 1 1 100%; }
.card.work.pendwork { background: var(--warn-soft); border-color: #fcd34d; }
.pendbar { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 10px 12px; background: var(--warn-soft); border-radius: 10px; color: var(--warn); flex-wrap: wrap; }
.pendbar .btn { margin-left: auto; }
.addwork { margin-top: 10px; }
.addwork .iform { margin-top: 0; }
.cb { display: inline-flex; align-items: center; gap: 4px; margin: 0; font-size: 13px; color: var(--muted); }
.hours b { color: var(--text); }

.filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 4px 12px; margin-bottom: 12px; padding: 8px 16px 14px; }
.filters label { margin-top: 6px; }
.filters input, .filters select { padding: 8px 10px; }
.factions { display: flex; align-items: flex-end; }

/* --- planning --- */
main:has(.pgrid) { max-width: none; }
.pnav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.toolbar .pdate { flex: 0 0 auto; width: auto; padding: 5px 8px; }
.plabel { font-weight: 600; margin-left: 6px; }
.pscroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.pgrid { display: grid; }
.pgrid > div { min-width: 0; }
.pentry { overflow-wrap: anywhere; }
.pgrid > div { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.pcorner, .pplace { position: sticky; top: 0; background: var(--soft); z-index: 2; }
.pplace { padding: 8px 10px; font-size: 13px; display: flex; flex-direction: column; }
.pplace span { color: var(--muted); font-size: 12px; }
.pday { padding: 8px; font-size: 13px; display: flex; flex-direction: column; background: var(--soft); position: sticky; left: 0; z-index: 1; }
.pday span { color: var(--muted); }
.pday.we, .pcell.we { background: #eef0f3; }
.pday.today { background: var(--today); }
.pcell.today { background: var(--today2); }
.pcell { min-height: 96px; padding: 4px; display: flex; flex-direction: column; gap: 4px; cursor: pointer; }
.pcell.over { outline: 2px dashed var(--accent); outline-offset: -3px; background: var(--red-soft); }
.pentry { background: var(--card); border: 1px solid var(--line); border-left: 4px solid #f59e0b; border-radius: 8px; padding: 5px 7px; font-size: 12.5px; line-height: 1.35; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.pentry.conf { border-left-color: var(--ok); }
.pentry:hover { border-color: #cbd5e1; }
.pentry.dragging { opacity: .4; }
.phead { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 12px; }
.pok { color: #fff; background: var(--ok); border-radius: 50%; width: 16px; height: 16px; display: inline-grid; place-items: center; font-size: 11px; }
.pwhen { font-weight: 700; }
.plink { color: #3730a3; font-weight: 600; text-decoration: none; }
.pnotes { white-space: pre-wrap; font-style: italic; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.pcar { font-weight: 600; margin-top: 2px; }
.pcl { color: var(--muted); }
.regno.sm { font-size: 11px; padding: 0 4px; }
.modalbg { position: fixed; inset: 0; background: rgba(17,24,39,.45); z-index: 40; display: flex; align-items: flex-start; justify-content: center; padding: 5vh 12px; overflow-y: auto; }
.modal { width: 100%; max-width: 560px; }
.modal .pnotes { -webkit-line-clamp: unset; }
.mbtns { display: flex; gap: 8px; margin-top: 16px; }
.clpick { display: flex; gap: 6px; }
.clres { border: 1px solid var(--line); border-radius: 10px; margin-top: 4px; max-height: 220px; overflow-y: auto; }
.clres:empty { display: none; }
.clitem { padding: 7px 10px; cursor: pointer; font-size: 14px; border-bottom: 1px solid var(--line); }
.clitem:hover { background: var(--soft); }

/* --- v4 --- */
.pwwrap { position: relative; }
.pwwrap input { padding-right: 44px; }
.eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; font-size: 18px; cursor: pointer; opacity: .45; padding: 4px 6px; }
.eye.on { opacity: 1; }
.drange { width: 100%; accent-color: var(--accent); margin: 6px 0; }
.zoomctl { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; }
.zoomctl span { font-size: 13px; color: var(--muted); min-width: 40px; text-align: center; }
.pscroll { touch-action: pan-x pan-y; }
.appbar { margin-top: 12px; padding: 10px 12px; background: var(--blue-soft); color: #3730a3; border-radius: 10px; font-size: 14px; }
.appbar .assign input { flex: 1; }
.total { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.total b { font-size: 26px; }
.mw th { color: var(--muted); font-weight: 500; font-size: 13px; }
.warn { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 800; font-size: 13px; }
.rateline { display: flex; align-items: center; gap: 6px; }
.rateline input { max-width: 120px; padding: 6px 8px; }
.users .q, .parts .q { text-align: right; }
.total.open b { color: var(--warn); font-size: 20px; }
.total small { font-size: 12px; }
tr.notclosed td { color: var(--muted); }

/* --- v5 --- */
.btn.cam { padding: 6px 10px; font-size: 18px; flex: 0 0 auto; }
.qline { flex: 1 1 200px; }
.qline input { flex: 1; }
.matchbox { background: var(--warn-soft); color: #78350f; border-radius: 10px; padding: 8px 12px; margin-top: 10px; font-size: 14px; }
.matchitem { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 6px 0; border-top: 1px solid rgba(0,0,0,.06); }
.matchbox .matchitem:first-of-type { border-top: 0; }
.pickbox { background: var(--ok-soft); color: #14532d; border-radius: 10px; padding: 8px 12px; margin-top: 10px; font-size: 14px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pickbox select { width: auto; flex: 1 1 200px; padding: 6px 8px; }
.wrow { display: flex; gap: 6px; margin-bottom: 6px; align-items: center; }
.wrow input:first-child { flex: 1; }
.wrow input:nth-child(2) { width: 80px; flex: 0 0 80px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 10px; }
@media (max-width: 600px) { .grid3 { grid-template-columns: 1fr; } }

/* --- v6: bottom nav, AI, voice --- */
#bnav { display: none; }
#micFab { display: none; }
.mic { font-size: 18px !important; }
@media (max-width: 700px) {
  .top { min-height: 48px; padding: 8px 14px; }
  #nav { display: none; }
  main { padding-bottom: 86px; }
  #bnav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--top); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); justify-content: space-around; box-shadow: 0 -2px 10px rgba(0,0,0,.15); }
  #bnav a, #bnav button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; color: #9ca3af; text-decoration: none; font-size: 11px; background: none; border: 0; padding: 4px 2px; cursor: pointer; font-family: inherit; }
  #bnav .on { color: #fff; }
  #bnav .ic { font-size: 20px; line-height: 1; position: relative; }
  #bnav .cnt { position: absolute; top: -6px; right: -14px; font-size: 10px; padding: 0 5px; }
  #micFab { display: grid; place-items: center; position: fixed; right: 14px; bottom: calc(76px + env(safe-area-inset-bottom)); width: 54px; height: 54px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; font-size: 24px; z-index: 31; box-shadow: 0 4px 12px rgba(0,0,0,.25); }
  .modalbg { padding: 12px 10px 90px; }
}
.sheet { display: flex; flex-direction: column; }
.sheetitem { display: block; padding: 14px 8px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--text); font-size: 16px; background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; cursor: pointer; font-family: inherit; }
.aibtn { border: 1px solid var(--line); background: var(--card); border-radius: 8px; padding: 2px 8px; margin: 4px 0 0; cursor: pointer; font-size: 14px; }
.aibtn:hover { border-color: #c4b5fd; background: var(--violet-soft); }
.wrow .aibtn, .iform .aibtn { margin: 0; flex: 0 0 auto; }
.aisug { background: var(--violet-soft); border: 1px solid #ddd6fe; border-radius: 10px; padding: 8px 10px; margin-top: 6px; flex-basis: 100%; }
.aitext { font-size: 15px; margin: 2px 0 6px; white-space: pre-wrap; }
.aibtns { display: flex; gap: 6px; }
.cardbtns { margin-top: 8px; display: flex; justify-content: flex-end; }
h3 { font-size: 14px; margin: 14px 0 6px; }

/* v7: shift schedule columns */
.pplace { position: relative; }
.pshtag { display: inline-block; margin-top: 2px; font-size: 11px; color: #1a7f37; background: var(--ok-soft); border-radius: 6px; padding: 1px 6px; }
.pgear { position: absolute; top: 4px; right: 4px; border: 0; background: transparent; cursor: pointer; font-size: 15px; opacity: .55; }
.pgear:hover { opacity: 1; }
.pcell.off { background: repeating-linear-gradient(45deg, #f1f1f3, #f1f1f3 6px, #e6e6ea 6px, #e6e6ea 12px); }
.pcell.onsh { background: var(--ok-soft2); }
.pentry.pshift { background: var(--ok-soft); border-color: #b7dfc2; color: #1a5c2c; }

/* подсказки работ */
.wsbox { position: absolute; z-index: 60; background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.15); max-height: 55vh; overflow-y: auto; }
.wsit { padding: 8px 10px; border-bottom: 1px solid var(--line); cursor: pointer; }
.wsit:hover, .wsit.act { background: var(--accent-soft); }
.wsname { font-size: 14px; line-height: 1.3; }
.wsmeta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; color: var(--muted); margin-top: 2px; }
.wssem { color: #6d28d9; }
.wsfoot { padding: 6px 10px; font-size: 12px; color: var(--muted); }
.hchips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0; font-size: 13px; }
.hchip { border: 1px solid var(--line); background: var(--card); border-radius: 16px; padding: 3px 10px; cursor: pointer; font-size: 13px; }
.hchip small { color: var(--muted); }
.hchip.on { border-color: var(--accent); background: var(--accent-soft); }

/* админ смотрит как другой пользователь */
#asbar { position: sticky; top: 52px; z-index: 9; background: var(--warn-soft); color: var(--warn); border-bottom: 1px solid #fcd34d;
  padding: 8px 16px; display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; font-size: 14px; }

/* строка работы: название широкое, часы узкие */
.wrow input[data-ai="work"], .iform input[name="name"] { flex: 1 1 auto; min-width: 0; width: auto; }
.wrow input[placeholder="Часы"], .iform input[name="hours"] { flex: 0 0 76px; width: 76px; max-width: 76px; }
#micFab, .aibtn { display: none !important; }

/* назначение работ и цена сдельщика */
.asgline { margin-bottom: 2px; }
.asgpick { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.piece { color: var(--text); }

/* новое у сотрудника; ждёт записи в АД */
.badge.newb { background: var(--accent); color: #fff; }
.waitline { font-size: 13px; color: var(--warn); margin: 4px 0; }

/* запись: одинаковая высота строк, раскрытие по дню */
.pcell { height: 150px; min-height: 0; overflow: hidden; position: relative; }
.pcell.open { height: auto; min-height: 150px; overflow: visible; }
.pcell:not(.open) .pnotes { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pmore { position: absolute; left: 0; right: 0; bottom: 0; border: 0; padding: 14px 0 3px; font-size: 12px; cursor: pointer;
  color: var(--accent); background: linear-gradient(to bottom, rgba(0,0,0,0), var(--card) 55%); }
.pday { cursor: pointer; }

/* справка */
.helpbtn { margin-left: 8px; width: 28px; height: 28px; border-radius: 50%; border: 1px solid #4b5563; background: none; color: #e5e7eb;
  font-weight: 700; cursor: pointer; position: relative; flex: 0 0 auto; }
.helpbtn.hasnew::after { content: ""; position: absolute; top: -2px; right: -2px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.htabs { display: flex; gap: 6px; margin-bottom: 8px; }
.htabs button { border: 1px solid var(--line); background: var(--card); border-radius: 16px; padding: 5px 12px; cursor: pointer; }
.htabs button.on { background: var(--top); color: #fff; border-color: var(--top); }
.hbody { }
.hsec { font-size: 14px; margin: 12px 0 6px; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; }
.hrow { display: flex; flex-direction: column; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.hrow b { font-size: 14px; }
.hnew { margin: 0; padding-left: 18px; font-size: 14px; }
.hnew li { margin: 4px 0; }
.pushbox { background: var(--soft); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-top: 10px; font-size: 14px; line-height: 1.6; }
/* тестовый стенд */
body.stand .top { background: repeating-linear-gradient(135deg, #16181d, #16181d 18px, #3a2a05 18px, #3a2a05 36px); }
body.stand .top::after { content: "СТЕНД"; background: #f59e0b; color: #111; font-weight: 700; font-size: 11px; border-radius: 5px; padding: 1px 6px; margin-left: 6px; }

/* компактные работы: название + исполнители, остальное по нажатию */
.work .wmore { display: none; }
.work.open .wmore { display: block; margin-top: 8px; }
.work.open .wmore > .wname { display: none; }
.wtap { cursor: pointer; }
.wtitle { font-weight: 600; line-height: 1.3; display: flex; gap: 6px; align-items: flex-start; }
.work.done .wtitle { text-decoration: line-through; color: var(--muted); font-weight: 500; }
.wchev { margin-left: auto; color: var(--muted); font-size: 13px; transition: transform .15s; }
.work.open .wchev { transform: rotate(180deg); }
.wexec { font-size: 13px; color: var(--text); margin-top: 2px; }
.wpend { font-size: 13px; }
/* шапка: логотип + HHC team, справка справа */
.brand .logo { width: 26px; height: 26px; filter: invert(1); }
.top .helpbtn { margin-left: 8px; }
@media (max-width: 700px) { .top .helpbtn { margin-left: auto; } }
/* расхождения с АД */
.cnt.hot { background: #dc2626 !important; color: #fff !important; }
.card.disc { border: 2px solid #dc2626; background: var(--red-soft); }
.drow { padding: 8px 0; border-top: 1px solid #fecaca; font-size: 14px; }
.drow:first-of-type { border-top: 0; }
.dblock { color: #b45309; font-size: 13px; margin-top: 2px; }
.dbtns { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
/* обратная связь */
.card.fb.done { opacity: .55; }
.fbimg { max-width: 100%; max-height: 320px; border-radius: 8px; margin: 4px 0; display: block; }

/* 1.4 */
.mclose { position: sticky; top: 0; float: right; z-index: 3; margin: -6px -6px 4px 10px; width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--card); color: var(--text); font-size: 18px; line-height: 1; cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.mclose:hover { color: var(--accent); border-color: var(--accent); }
.modal .sheet { clear: both; }
.ibtn { border: 1px solid var(--line); background: var(--card); color: var(--muted); width: 28px; height: 28px; border-radius: 50%; cursor: pointer; font-size: 15px; line-height: 1; padding: 0; flex: 0 0 auto; }
.ibtn:hover { color: var(--accent); border-color: var(--accent); }
.ptop { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.ptop h1 { margin: 0; font-size: 20px; }
.ptop .plabel { margin: 0; font-weight: 600; color: var(--muted); font-size: 14px; white-space: nowrap; }
.ptop #padd { margin-left: auto; }
.pnav { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; margin-bottom: 6px; -webkit-overflow-scrolling: touch; }
.pnav .btn.small { padding: 5px 9px; white-space: nowrap; }
.pnav .pdate { flex: 0 0 auto; width: auto; padding: 4px 6px; font-size: 14px; }
.pnav .zoomctl { margin-left: 0; }
.hrow > div { line-height: 1.45; }
.hl { display: block; }
.hrow b, .hsec { overflow-wrap: normal; word-break: normal; hyphens: manual; }
.hbody, .hrow, .hnew li { overflow-wrap: break-word; word-break: normal; hyphens: none; }
a.addr { white-space: nowrap; color: var(--accent); }
.mgrpick { font-size: 12px; color: var(--muted); display: inline-flex; gap: 4px; align-items: center; margin-left: 6px; }
.mgrpick select { width: auto; padding: 3px 6px; font-size: 13px; }
.carrow { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; border-top: 1px solid var(--line); padding: 8px 0; margin-top: 6px; }
.carrow.off { opacity: .55; }
.fbst { display: inline-block; border-radius: 6px; padding: 0 6px; background: var(--line); color: var(--text); font-size: 11px; font-weight: 600; margin-right: 4px; }
.fbst.hot { background: var(--accent); color: #fff; }
.fbst.fix { background: var(--blue-soft); color: #1e40af; }
.fbst.draft { background: var(--warn-soft); color: #78350f; }
.card.fb.st-urgent { border-left: 4px solid var(--accent); }
.card.fb.st-fix { border-left: 4px solid #3b82f6; }
.card.fb.st-done, .card.fb.st-rejected { opacity: .55; }
.fbbtns { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.standexit { color: #111 !important; background: #f59e0b; border-radius: 8px; padding: 4px 10px; text-decoration: none; font-weight: 600; }

/* 1.5 поручения */
.card.task { border-left: 5px solid #f59e0b; background: var(--warn-soft); }
.card.task.late { border-left-color: var(--accent); background: var(--red-soft); }
.card.task.review { border-left-color: #3b82f6; background: var(--blue-soft); }
.card.task.done { border-left-color: var(--ok); background: var(--card); opacity: .6; }
.task .ttop { display: flex; gap: 8px; align-items: flex-start; }
.task .tico { font-size: 18px; line-height: 1.3; }
.task .ttext { font-weight: 600; white-space: pre-wrap; }
.task.done .ttext { text-decoration: line-through; }
.task .tmeta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 13px; margin: 4px 0; }
.task .tdue { font-weight: 600; color: #92400e; }
.task.late .tdue { color: var(--accent); }

/* ---- тёмная тема: html[data-theme=dark] или «как в системе» ---- */
html[data-theme="dark"] { --bg: #0f1115; --card: #1a1d23; --text: #e6e8eb; --muted: #9aa3af; --line: #2c313a; --chip: #262b33;
  --accent: #e0364f; --accent-soft: #3a1820; --ok: #22a355; --ok-soft: #13301f; --ok-soft2: #152419;
  --warn: #f0a24a; --warn-soft: #33290f; --top: #0b0c0f;
  --soft: #20242b; --soft2: #16191e; --red-soft: #33171c; --blue-soft: #1a2238; --violet-soft: #251f38;
  --today: #2e2a14; --today2: #24221a; color-scheme: dark; }
html[data-theme="dark"] .chip.asg, html[data-theme="dark"] .badge.app, html[data-theme="dark"] .appbar, html[data-theme="dark"] .matchbox, html[data-theme="dark"] .pickbox, html[data-theme="dark"] .fbst, html[data-theme="dark"] .fbst.fix, html[data-theme="dark"] .fbst.draft, html[data-theme="dark"] .pentry.pshift, html[data-theme="dark"] .pshtag, html[data-theme="dark"] .aisug, html[data-theme="dark"] .task .tdue, html[data-theme="dark"] .badge.pend, html[data-theme="dark"] .badge.open, html[data-theme="dark"] .badge.closed { color: var(--text) !important; }
html[data-theme="dark"] .regno { border-color: var(--text); }
html[data-theme="dark"] .check { border-color: #475063; }
html[data-theme="dark"] img.logo { background: #fff; border-radius: 6px; }
@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] { --bg: #0f1115; --card: #1a1d23; --text: #e6e8eb; --muted: #9aa3af; --line: #2c313a; --chip: #262b33;
  --accent: #e0364f; --accent-soft: #3a1820; --ok: #22a355; --ok-soft: #13301f; --ok-soft2: #152419;
  --warn: #f0a24a; --warn-soft: #33290f; --top: #0b0c0f;
  --soft: #20242b; --soft2: #16191e; --red-soft: #33171c; --blue-soft: #1a2238; --violet-soft: #251f38;
  --today: #2e2a14; --today2: #24221a; color-scheme: dark; }
  html[data-theme="auto"] .chip.asg, html[data-theme="auto"] .badge.app, html[data-theme="auto"] .appbar, html[data-theme="auto"] .matchbox, html[data-theme="auto"] .pickbox, html[data-theme="auto"] .fbst, html[data-theme="auto"] .fbst.fix, html[data-theme="auto"] .fbst.draft, html[data-theme="auto"] .pentry.pshift, html[data-theme="auto"] .pshtag, html[data-theme="auto"] .aisug, html[data-theme="auto"] .task .tdue, html[data-theme="auto"] .badge.pend, html[data-theme="auto"] .badge.open, html[data-theme="auto"] .badge.closed { color: var(--text) !important; }
  html[data-theme="auto"] .regno { border-color: var(--text); }
  html[data-theme="auto"] .check { border-color: #475063; }
  html[data-theme="auto"] img.logo { background: #fff; border-radius: 6px; }
}

/* 1.6 */
.zgroup .zhead { margin-bottom: 6px; }
.zgroup .ztot { text-align: right; font-size: 14px; margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); }
.zgroup.notclosed { opacity: .85; border-style: dashed; }
.wexec .whrs { color: var(--muted); margin-left: 6px; white-space: nowrap; }

.wsec .sechead { width: 100%; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.wsec .seclist { display: none; }
.wsec.on .seclist { display: block; }
.wsec .secchev { display: inline-block; font-size: 14px; color: var(--muted); transition: transform .15s; }
.wsec.on .secchev { transform: rotate(180deg); }

.paysec{font-size:17px;margin:16px 2px 6px}
.paysec small{font-weight:normal;font-size:13px}
.paytot{margin-top:14px;border:2px solid var(--line, #ccc)}

/* фото к ЗН */
.phcard{padding:12px}
.phbtns{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.phadd{position:relative;overflow:hidden;cursor:pointer}
.phadd input{position:absolute;inset:0;opacity:0;cursor:pointer;width:100%}
.phgrp{margin-top:10px}
.phuser{font-size:13px;color:var(--muted, #888);margin-bottom:4px}
.phgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(88px,1fr));gap:6px}
.phgrid img{width:100%;aspect-ratio:1;object-fit:cover;border-radius:8px;cursor:pointer;background:var(--soft, #eee)}
.phview{position:fixed;inset:0;z-index:1000;background:rgba(0,0,0,.94);display:flex;flex-direction:column;color:#fff}
.phtop{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:10px 12px;font-size:14px;flex-wrap:wrap}
.phact{display:flex;gap:6px}
.phimg{flex:1;display:flex;align-items:center;justify-content:center;min-height:0;padding:0 8px 12px}
.phimg img{max-width:100%;max-height:100%;object-fit:contain;border-radius:6px}
.phnav{position:absolute;top:50%;transform:translateY(-50%);background:rgba(255,255,255,.15);color:#fff;border:0;font-size:34px;width:46px;height:64px;border-radius:10px;cursor:pointer}
.phnav.l{left:8px}.phnav.r{right:8px}
.phvisit{border-top:1px solid var(--line, #ddd);padding:10px 0}
.phvh{margin-bottom:4px}

.reloadbtn{background:none;border:0;color:inherit;font-size:22px;line-height:1;cursor:pointer;padding:4px 8px;margin-left:2px;opacity:.75}
.reloadbtn:hover{opacity:1}
.reloadbtn.spin{animation:hhspin .8s linear infinite}
@keyframes hhspin{to{transform:rotate(360deg)}}

/* несколько работ сразу — только на ПК */
.worksh{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.worksh .btn{margin-left:auto}
@media (max-width: 799px){.pconly{display:none!important}}
.bulkbar{position:sticky;top:56px;z-index:20;display:flex;gap:8px;align-items:center;flex-wrap:wrap;padding:10px 12px;margin-bottom:8px;border-radius:12px;background:var(--card, #fff);box-shadow:0 2px 10px rgba(0,0,0,.18)}
.bulkbar[hidden]{display:none}
.work .bsel{float:left;margin:2px 10px 0 -2px;cursor:pointer}
.work .bsel input{width:20px;height:20px;cursor:pointer}
.work.bsel-on{outline:2px solid var(--accent, #e33);outline-offset:-2px}

.seg{display:inline-flex;border:1px solid var(--line, #ccc);border-radius:10px;overflow:hidden}
.seg label{display:flex;align-items:center;gap:6px;padding:8px 14px;margin:0;cursor:pointer;font-weight:500}
.seg label:has(input:checked){background:var(--accent, #e33);color:#fff}
.seg input{display:none}
.pdraft{opacity:.7;margin-right:3px}
.pbot{margin-right:3px}
.botans{margin-top:8px;padding:8px 10px;border-radius:8px;background:var(--soft, #f3f3f3);font-size:14px}
.clnew{color:var(--accent, #e33);font-weight:600}

.wphotos:empty{display:none}
.wphgrid{grid-template-columns:repeat(auto-fill,minmax(64px,72px));margin:6px 0}
