/* ТМ-платформа — интерфейс менеджера */
@font-face { font-family: "Inter"; src: url("../fonts/Inter-Regular.fb463c033669.otf"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/Inter-Medium.e06b68a3e9e2.otf"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/Inter-SemiBold.176e8de9ead5.otf"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/Inter-Bold.d8e621fcec77.otf"); font-weight: 700; font-display: swap; }

:root {
  --ink: #18202E;
  --ink-2: #3A4354;
  --muted: #6A7385;
  --faint: #9AA3B2;
  --line: #E3E7ED;
  --line-2: #D3D9E1;
  --paper: #FFFFFF;
  --bg: #F5F6F8;
  --desk: #DFE3E9;
  --accent: #0E6E5C;
  --accent-ink: #0A5547;
  --accent-soft: #E2F1EC;
  --danger: #C8393B;
  --danger-soft: #FBEAEA;
  --warn: #B86E09;
  --warn-soft: #FDF3E3;
  --p-critical: #D64545;
  --p-high: #E8912D;
  --p-medium: #3D6FD9;
  --p-low: #94A0B4;
  --r-s: 6px;
  --r-m: 10px;
  --shadow-pop: 0 12px 32px rgba(18, 26, 40, .16), 0 2px 6px rgba(18, 26, 40, .08);
  --topbar: 52px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 14px; line-height: 1.45;
  color: var(--ink); background: var(--bg); font-feature-settings: "tnum" 1, "cv11" 1; -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.hidden, [hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* --- верхняя панель --- */
.topbar {
  height: var(--topbar); display: flex; align-items: center; gap: 20px; padding: 0 20px;
  background: var(--ink); color: #E9EDF3; position: sticky; top: 0; z-index: 40;
}
.topbar .logo { font-weight: 700; letter-spacing: -0.01em; color: #fff; display: flex; align-items: center; gap: 8px; }
.topbar .logo i { width: 18px; height: 18px; border-radius: 5px; background: var(--accent); display: inline-block;
  box-shadow: inset 0 0 0 4px #13896f; }
.topbar nav { display: flex; gap: 4px; }
.topbar nav a { color: #B9C1CE; padding: 6px 10px; border-radius: var(--r-s); font-weight: 500; }
.topbar nav a:hover, .topbar nav a.on { color: #fff; background: rgba(255,255,255,.08); text-decoration: none; }
.topbar .spacer { flex: 1; }
.topbar .user { color: #B9C1CE; font-size: 13px; display: flex; gap: 12px; align-items: center; }
.topbar .user a { color: #B9C1CE; }
.topbar form { margin: 0; }
.topbar .linkbtn { background: none; border: 0; color: #B9C1CE; cursor: pointer; padding: 0; }

/* --- кнопки и поля --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px;
  border-radius: var(--r-s); border: 1px solid var(--line-2); background: var(--paper); color: var(--ink);
  font-weight: 500; cursor: pointer; white-space: nowrap; text-decoration: none !important;
}
.btn:hover { border-color: var(--faint); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-ink); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: rgba(24,32,46,.06); }
.btn.danger { color: var(--danger); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.lg { height: 44px; padding: 0 20px; font-size: 15px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.icon-btn { width: 30px; height: 30px; padding: 0; border-radius: var(--r-s); border: 0; background: transparent;
  color: var(--muted); cursor: pointer; display: inline-grid; place-items: center; }
.icon-btn:hover { background: rgba(24,32,46,.07); color: var(--ink); }
.icon-btn svg, .btn svg { width: 16px; height: 16px; }

.field { display: flex; flex-direction: column; gap: 4px; }
.field > span, .field > label { font-size: 12px; color: var(--muted); font-weight: 500; }
.input, .field input, .field select, .field textarea {
  height: 36px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: var(--r-s); background: var(--paper);
  width: 100%; min-width: 0;
}
.field textarea, textarea.input { height: auto; padding: 8px 10px; resize: vertical; line-height: 1.45; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft); }
.field .err { color: var(--danger); font-size: 12px; }
.field.has-error input { border-color: var(--danger); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 12px; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: 1 / -1; }

.badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 11px;
  font-size: 12px; font-weight: 500; background: #EEF1F5; color: var(--ink-2); white-space: nowrap; }
.badge i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }

.flash { margin: 12px 20px 0; padding: 10px 14px; border-radius: var(--r-s); background: var(--accent-soft); color: var(--accent-ink); }
.flash.error { background: var(--danger-soft); color: var(--danger); }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff;
  padding: 10px 16px; border-radius: var(--r-m); box-shadow: var(--shadow-pop); z-index: 100; font-size: 14px; }
.toast.error { background: var(--danger); }

/* --- страницы со списками --- */
.page { max-width: 1240px; margin: 0 auto; padding: 28px 24px 60px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; letter-spacing: -0.015em; }
.page-head .spacer { flex: 1; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line);
  border-radius: var(--r-m); overflow: hidden; margin-bottom: 20px; }
.stats div { background: var(--paper); padding: 14px 16px; }
.stats b { display: block; font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.stats span { color: var(--muted); font-size: 13px; }
.filters { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; align-items: center; }
.filters .input { width: 280px; }
.filters select.input { width: 200px; }
.table { width: 100%; border-collapse: collapse; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-m); overflow: hidden; }
.table th { text-align: left; font-size: 12px; font-weight: 500; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); background: #FAFBFC; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.rowlink { cursor: pointer; }
.table tr.rowlink:hover td { background: #FAFBFC; }
.table .title { font-weight: 500; }
.table .sub { color: var(--muted); font-size: 13px; }
.empty { padding: 48px 24px; text-align: center; background: var(--paper); border: 1px dashed var(--line-2); border-radius: var(--r-m); }
.empty h2 { font-size: 18px; margin-bottom: 6px; }
.empty p { color: var(--muted); margin: 0 0 16px; }

.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-m); padding: 20px; }
.card + .card { margin-top: 16px; }
.card h2 { font-size: 15px; margin-bottom: 14px; }

/* --- вход --- */
.login { min-height: 100vh; display: grid; place-items: center; background: var(--ink); padding: 20px; }
.login .card { width: 100%; max-width: 380px; padding: 32px; }
.login h1 { font-size: 22px; margin-bottom: 4px; }
.login p { color: var(--muted); margin: 0 0 22px; }
.login form { display: grid; gap: 14px; }

/* ================= Конструктор КП ================= */
.builder { height: calc(100vh - var(--topbar)); display: grid; grid-template-columns: 300px minmax(400px, 460px) 1fr; overflow: hidden; }
.pane { min-height: 0; display: flex; flex-direction: column; }
.pane-head { padding: 14px 16px 10px; border-bottom: 1px solid var(--line); background: var(--paper); }
.pane-head h2 { font-size: 13px; font-weight: 600; color: var(--muted); }
.pane-body { flex: 1; overflow-y: auto; min-height: 0; }

/* левая: каталог */
.catalog { background: #FAFBFC; border-right: 1px solid var(--line); }
.catalog .search { position: relative; margin-top: 8px; }
.catalog .search input { padding-left: 32px; }
.catalog .search svg { position: absolute; left: 10px; top: 10px; width: 16px; height: 16px; color: var(--faint); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.chip { height: 26px; padding: 0 10px; border-radius: 13px; border: 1px solid var(--line-2); background: var(--paper);
  font-size: 12px; font-weight: 500; color: var(--ink-2); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.chip i { width: 7px; height: 7px; border-radius: 50%; }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.cat-group { padding: 6px 8px 10px; }
.cat-group h3 { font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 8px 6px; display: flex; align-items: center; gap: 6px; }
.cat-group h3 i { width: 8px; height: 8px; border-radius: 2px; }
.svc-item { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 9px 8px 9px 10px; border-radius: var(--r-s);
  cursor: pointer; border: 1px solid transparent; position: relative; }
.svc-item:hover { background: var(--paper); border-color: var(--line); }
.svc-item .n { font-weight: 500; font-size: 13.5px; }
.svc-item .s { grid-column: 1; font-size: 12px; color: var(--muted); line-height: 1.35; }
.svc-item .p { grid-row: 1; grid-column: 2; font-size: 13px; font-weight: 500; text-align: right; }
.svc-item .add { grid-row: 2; grid-column: 2; justify-self: end; align-self: end; width: 24px; height: 24px; border-radius: 12px;
  border: 1px solid var(--line-2); background: var(--paper); display: grid; place-items: center; color: var(--accent); font-size: 16px; line-height: 1; }
.svc-item:hover .add { background: var(--accent); border-color: var(--accent); color: #fff; }
.svc-item.in .add { background: var(--accent-soft); border-color: var(--accent-soft); }
.svc-item.in::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 2px; background: var(--accent); }
.catalog-foot { padding: 10px 16px; border-top: 1px solid var(--line); font-size: 12px; }

/* средняя: состав */
.compose { background: var(--paper); border-right: 1px solid var(--line); }
.compose .pane-body { padding: 0 0 12px; }
.block { padding: 14px 18px; border-bottom: 1px solid var(--line); }
.block-title { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.block-title h3 { font-size: 13px; font-weight: 600; color: var(--muted); flex: 1; }
.title-input { width: 100%; border: 0; padding: 4px 0; font-size: 19px; font-weight: 600; letter-spacing: -0.01em; background: transparent; }
.title-input:focus { outline: none; box-shadow: inset 0 -2px 0 var(--accent); }
.meta-line { display: flex; gap: 10px; align-items: center; font-size: 13px; color: var(--muted); margin-top: 4px; flex-wrap: wrap; }
.meta-line select { border: 0; background: transparent; font-weight: 500; color: var(--ink-2); padding: 2px 0; cursor: pointer; }

.client-card { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: var(--r-m); background: #FAFBFC; }
.client-card .nm { font-weight: 600; }
.client-card .rq { font-size: 12.5px; color: var(--muted); }
.client-card .act { grid-row: 1 / span 2; grid-column: 2; display: flex; gap: 2px; align-items: center; }
.warn { margin-top: 8px; padding: 8px 10px; border-radius: var(--r-s); background: var(--warn-soft); color: var(--warn); font-size: 12.5px; }
.warn a { color: var(--warn); font-weight: 600; text-decoration: underline; cursor: pointer; }
.combo { position: relative; }
.combo-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--r-m); box-shadow: var(--shadow-pop); z-index: 30; max-height: 320px; overflow-y: auto; padding: 4px; }
.combo-list button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: var(--r-s); cursor: pointer; }
.combo-list button:hover, .combo-list button.on { background: var(--bg); }
.combo-list .t { font-weight: 500; }
.combo-list .d { font-size: 12px; color: var(--muted); }
.combo-list .sep { font-size: 11px; color: var(--faint); padding: 8px 10px 4px; font-weight: 600; }

/* позиции */
.items { list-style: none; margin: 0; padding: 4px 10px; }
.item { border-radius: var(--r-m); border: 1px solid transparent; margin-bottom: 2px; position: relative; }
.item:hover { border-color: var(--line); }
.item.open { border-color: var(--line-2); background: #FAFBFC; margin: 6px 0; }
.item.dragging { opacity: .4; }
.item.drop-before::before { content: ""; position: absolute; left: 8px; right: 8px; top: -2px; height: 2px; background: var(--accent); border-radius: 1px; }
.item-row { display: grid; grid-template-columns: 14px 22px 1fr auto; gap: 6px; align-items: center; padding: 8px 6px 8px 2px; }
.handle { cursor: grab; color: var(--faint); opacity: 0; display: grid; place-items: center; }
.item:hover .handle { opacity: 1; }
.prio { width: 22px; height: 22px; border-radius: 6px; border: 0; cursor: pointer; display: grid; place-items: center; background: transparent; }
.prio i { width: 10px; height: 10px; border-radius: 50%; display: block; }
.prio:hover { background: rgba(24,32,46,.07); }
.item-main { min-width: 0; }
.item-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.item-calc { font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.item-calc .opt { color: var(--warn); font-weight: 500; }
.item-sum { font-weight: 600; text-align: right; font-size: 14px; cursor: pointer; }
.item-sum .old { display: block; font-size: 11.5px; font-weight: 400; color: var(--faint); text-decoration: line-through; }
.item.optional .item-sum { color: var(--muted); font-weight: 500; }
.item-edit { padding: 2px 12px 14px 44px; display: grid; gap: 10px; }
.item-edit .row4 { display: grid; grid-template-columns: 1fr 1.4fr 0.8fr 1fr; gap: 8px; }
.item-edit .row3 { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 8px; align-items: end; }
.item-edit .field input, .item-edit .field select { height: 32px; }
.toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; user-select: none; height: 32px; }
.toggle input { width: 16px; height: 16px; accent-color: var(--accent); }
.item-edit .foot { display: flex; justify-content: space-between; }
.empty-items { margin: 14px 18px; padding: 26px 16px; border: 1px dashed var(--line-2); border-radius: var(--r-m); text-align: center; color: var(--muted); font-size: 13.5px; }
.empty-items b { color: var(--ink); display: block; margin-bottom: 4px; font-size: 14px; }
.add-custom { margin: 4px 18px 0; }

.prio-pop { position: absolute; z-index: 35; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-m);
  box-shadow: var(--shadow-pop); padding: 4px; width: 170px; }
.prio-pop button { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: none; padding: 7px 10px; border-radius: var(--r-s); cursor: pointer; text-align: left; }
.prio-pop button:hover { background: var(--bg); }
.prio-pop i { width: 10px; height: 10px; border-radius: 50%; }

/* распределение бюджета */
.split { height: 8px; border-radius: 4px; overflow: hidden; display: flex; background: var(--bg); }
.split span { height: 100%; transition: flex-grow .25s ease; }
.split-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.split-legend span { display: inline-flex; gap: 5px; align-items: center; }
.split-legend i { width: 8px; height: 8px; border-radius: 50%; }
.split-legend b { color: var(--ink-2); font-weight: 500; }

details.params summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
details.params summary::-webkit-details-marker { display: none; }
details.params summary .chev { transition: transform .15s; }
details.params[open] summary .chev { transform: rotate(90deg); }
details.params .params-body { display: grid; gap: 12px; margin-top: 12px; }

/* итог снизу */
.total-bar { border-top: 1px solid var(--line); padding: 12px 18px 14px; background: var(--paper); }
.total-lines { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.total-lines .num { text-align: right; color: var(--ink-2); }
.total-main { display: flex; align-items: center; gap: 14px; }
.total-main .sum { flex: 1; }
.total-main .sum b { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; display: block; line-height: 1.1; }
.total-main .sum span { font-size: 12px; color: var(--muted); }
.total-main .sum b.flash-up { animation: pulse .5s ease; }
@keyframes pulse { 0% { color: var(--accent); } 100% { color: var(--ink); } }
@media (prefers-reduced-motion: reduce) { .total-main .sum b.flash-up { animation: none; } .split span { transition: none; } }

/* варианты цены, сроки */
.opts { display: flex; flex-wrap: wrap; gap: 6px; }
.opt-chip { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 0; padding: 5px 10px; border-radius: 8px;
  border: 1px solid var(--line-2); background: var(--paper); cursor: pointer; font-size: 13px; font-weight: 500; line-height: 1.25; text-align: left; }
.opt-chip small { font-size: 11.5px; font-weight: 400; color: var(--muted); }
.opt-chip:hover { border-color: var(--faint); }
.opt-chip.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.opt-chip.on small { color: var(--accent-ink); }
.timing { display: grid; grid-template-columns: 1fr 1.3fr 1.2fr; gap: 8px; align-items: end; }
.dur { display: flex; gap: 6px; }
.dur input { width: 64px !important; flex: none; height: 32px; }
.dur select { flex: 1; height: 32px; }
.presets { display: flex; flex-wrap: wrap; gap: 4px; margin-top: -2px; }
.preset { height: 26px; padding: 0 9px; border-radius: 13px; border: 1px solid var(--line); background: var(--paper); font-size: 12px;
  color: var(--ink-2); cursor: pointer; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preset:hover { border-color: var(--faint); }
.preset.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.item-calc .var { font-weight: 600; color: var(--accent-ink); }
#share-btn.live { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-soft); }

/* правая: предпросмотр */
.preview { background: var(--desk); }
.preview-head { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line-2); background: #EDF0F4; }
.tabs { display: flex; gap: 2px; background: rgba(24,32,46,.06); padding: 3px; border-radius: 8px; }
.tabs button { border: 0; background: transparent; height: 28px; padding: 0 12px; border-radius: 6px; font-size: 13px; font-weight: 500; color: var(--ink-2); cursor: pointer; }
.tabs button.on { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(24,32,46,.12); }
.preview-head .spacer { flex: 1; }
.save-state { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.save-state i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.save-state.busy i { background: var(--warn); }
.save-state.err { color: var(--danger); }
.save-state.err i { background: var(--danger); }
.frame-wrap { flex: 1; position: relative; min-height: 0; }
.frame-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: var(--desk); }
.frame-wrap iframe.back { visibility: hidden; }
.menu { position: relative; }
.menu-list { position: absolute; right: 0; top: calc(100% + 4px); background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-m);
  box-shadow: var(--shadow-pop); padding: 4px; min-width: 220px; z-index: 30; }
.menu-list a, .menu-list button { display: flex; justify-content: space-between; gap: 12px; padding: 8px 10px; border-radius: var(--r-s); color: var(--ink);
  font-size: 13.5px; border: 0; background: none; width: 100%; text-align: left; cursor: pointer; }
.menu-list a:hover, .menu-list button:hover { background: var(--bg); text-decoration: none; }
.menu-list .sep { height: 1px; background: var(--line); margin: 4px 6px; }
.menu-list small { color: var(--faint); }

/* --- модальные окна --- */
.modal-bg { position: fixed; inset: 0; background: rgba(18,26,40,.45); z-index: 60; display: grid; place-items: center; padding: 20px; }
.modal { background: var(--paper); border-radius: 14px; box-shadow: var(--shadow-pop); width: 100%; max-width: 640px; max-height: calc(100vh - 40px);
  display: flex; flex-direction: column; }
.modal.wide { max-width: 760px; }
.modal-head { padding: 18px 22px 12px; display: flex; align-items: flex-start; gap: 12px; }
.modal-head h2 { font-size: 18px; flex: 1; }
.modal-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.modal-body { padding: 4px 22px 18px; overflow-y: auto; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; align-items: center; }
.modal-foot .left { margin-right: auto; font-size: 13px; color: var(--muted); }
.section-label { font-size: 12px; font-weight: 600; color: var(--muted); margin: 18px 0 8px; }
.lookup { display: flex; gap: 8px; }
.lookup .input { flex: 1; }
.lookup-results { margin-top: 8px; border: 1px solid var(--line); border-radius: var(--r-m); overflow: hidden; }
.lookup-results button { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: var(--paper); padding: 10px 12px; cursor: pointer; }
.lookup-results button:last-child { border-bottom: 0; }
.lookup-results button:hover { background: var(--bg); }
.lookup-results .t { font-weight: 500; }
.lookup-results .d { font-size: 12px; color: var(--muted); }
.lookup-results .bad { color: var(--danger); }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.hint.err { color: var(--danger); }

.doc-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.doc-pick { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--r-m); cursor: pointer; }
.doc-pick input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--accent); }
.doc-pick b { font-weight: 500; display: block; }
.doc-pick small { color: var(--muted); }
.doc-pick:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }

/* --- пакет документов --- */
.pkg { display: grid; grid-template-columns: 1fr 380px; gap: 20px; align-items: start; }
.doc-row { display: grid; grid-template-columns: 40px 1fr auto; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.doc-row:last-child { border-bottom: 0; }
.doc-ico { width: 40px; height: 48px; border-radius: 4px; border: 1px solid var(--line-2); background: #FAFBFC; position: relative; display: grid; place-items: end center;
  font-size: 9px; font-weight: 700; color: var(--muted); padding-bottom: 5px; }
.doc-ico::before { content: ""; position: absolute; top: 8px; left: 8px; right: 8px; height: 2px; background: var(--line-2); box-shadow: 0 5px 0 var(--line-2), 0 10px 0 var(--line-2); }
.doc-row .t { font-weight: 500; }
.doc-row .d { font-size: 13px; color: var(--muted); }
.doc-row .acts { display: flex; gap: 6px; }
.share-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.copy-line { display: flex; gap: 6px; }
.copy-line input { flex: 1; font-size: 12.5px; color: var(--ink-2); }
.log { font-size: 13px; }
.log div { padding: 6px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; }
.log div:last-child { border-bottom: 0; }
.done-banner { display: flex; gap: 14px; align-items: center; padding: 16px 20px; border-radius: var(--r-m); background: var(--accent-soft); color: var(--accent-ink); margin-bottom: 20px; }
.done-banner b { font-size: 16px; }
.done-banner .check { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; flex: none; }

/* --- клиентская страница --- */
.public { max-width: 720px; margin: 0 auto; padding: 48px 20px; }
.public .brand { font-weight: 700; color: var(--accent); margin-bottom: 24px; }
.public h1 { font-size: 26px; letter-spacing: -0.02em; margin-bottom: 6px; }
.public .lead { color: var(--muted); margin-bottom: 24px; }
.public .total { font-size: 15px; margin: 18px 0 0; }
.public .total b { font-size: 20px; }

@media (max-width: 1180px) {
  .builder { grid-template-columns: 260px 400px 1fr; }
}
@media (max-width: 980px) {
  .builder { height: auto; grid-template-columns: 1fr; overflow: visible; }
  .pane-body { overflow: visible; }
  .catalog .pane-body { max-height: 50vh; overflow-y: auto; }
  .preview .frame-wrap { height: 80vh; flex: none; }
  .pkg { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .topbar nav a { padding: 6px; }
}
@media (max-width: 560px) {
  .timing { grid-template-columns: 1fr 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .item-edit { padding-left: 12px; }
  .item-edit .row4, .item-edit .row3 { grid-template-columns: 1fr 1fr; }
  .filters .input, .filters select.input { width: 100%; }
}
