@font-face { font-family: "Roboto Condensed"; src: url("assets/fonts/RobotoCondensed-Regular.ttf"); font-weight: 400; }
@font-face { font-family: "Roboto Condensed"; src: url("assets/fonts/RobotoCondensed-Medium.ttf"); font-weight: 500; }
@font-face { font-family: "Roboto Condensed"; src: url("assets/fonts/RobotoCondensed-Bold.ttf"); font-weight: 700; }

/* Палитра сайта broneplast-arm: чёрный фон, графитовые панели, красный акцент, узкий гротеск */
:root {
  --bg: #0f1113; --bg2: #16191c; --panel: #1b1e22; --panel2: #22262b; --ink: #ececec; --ink2: #b9bec6; --muted: #8a9099; --line: #2e3339; --line2: #3b4149;
  --accent: #e0242e; --accent-dark: #b51a23; --accent-soft: rgba(224, 36, 46, .14);
  --ok: #3ddc84; --warn: #f0b429;
  --ui: "Roboto Condensed", "Arial Narrow", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font-family: var(--ui); font-size: 14px; color: var(--ink); background: var(--bg); display: flex; flex-direction: column; overflow: hidden; }
button, input, select, textarea { font-family: inherit; font-size: 14px; color: inherit; }
input, select, textarea { color-scheme: dark; }
.hidden { display: none !important; }
::-webkit-scrollbar { width: 10px; height: 10px; } ::-webkit-scrollbar-thumb { background: #33383f; border-radius: 6px; } ::-webkit-scrollbar-track { background: transparent; }

/* ---- верхняя панель ---- */
.topbar { height: 60px; background: #000; color: #fff; display: flex; align-items: center; padding: 0 22px; gap: 30px; flex: 0 0 auto; border-bottom: 1px solid #2a2d31; -webkit-app-region: drag; }
.topbar button, .topbar .chip { -webkit-app-region: no-drag; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { height: 42px; width: auto; }
.brand-name { font-weight: 700; letter-spacing: .1em; font-size: 18px; text-transform: uppercase; }
.brand-sub { font-size: 10.5px; color: #8a9099; letter-spacing: .12em; text-transform: uppercase; }
.nav { display: flex; gap: 2px; margin-left: 20px; }
.nav-btn { background: transparent; border: 0; border-bottom: 2px solid transparent; color: #c9ced6; padding: 20px 14px 18px; cursor: pointer; font-weight: 700; font-size: 15px; text-transform: uppercase; letter-spacing: .04em; }
.nav-btn:hover:not(:disabled) { color: #fff; }
.nav-btn.active { color: #fff; border-bottom-color: var(--accent); }
.nav-btn:disabled { opacity: .3; cursor: default; }
.top-right { margin-left: auto; }
.chip { background: transparent; color: #b9bec6; padding: 6px 0; font-size: 13px; letter-spacing: .02em; }
.chip::before { content: "●"; color: var(--accent); margin-right: 8px; font-size: 9px; vertical-align: middle; }

.view { flex: 1; min-height: 0; overflow: auto; }

/* ---- общие элементы ---- */
.btn { border: 1px solid var(--line2); background: var(--panel2); color: var(--ink); padding: 8px 14px; border-radius: 3px; cursor: pointer; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; letter-spacing: .02em; }
.btn:hover { background: #2b3036; border-color: #4a515a; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.btn.primary:hover { background: var(--accent-dark); }
.btn.dark { background: #fff; border-color: #fff; color: #111; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.btn.dark:hover { background: #e5e5e5; }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn.icon { padding: 5px 8px; }
.btn.wrap { white-space: normal; text-align: left; line-height: 1.25; }
.btn.ai { background: var(--accent-soft); border-color: rgba(224, 36, 46, .45); color: #ff8a90; }
.btn.ai:hover { background: rgba(224, 36, 46, .24); }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.field label { font-size: 11px; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: .12em; }
.field input, .field select, .field textarea { border: 1px solid var(--line); border-radius: 3px; padding: 8px 10px; background: var(--bg2); width: 100%; color: var(--ink); }
.field textarea { resize: vertical; min-height: 70px; line-height: 1.45; }
.field input:focus, .field textarea:focus, .field select:focus, .block textarea:focus, .block input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; min-width: 0; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: 14px 16px; margin-bottom: 12px; position: relative; }
.card h2 { font-size: 13px; margin: 0 0 12px; text-transform: uppercase; letter-spacing: .14em; color: var(--ink); display: flex; align-items: center; justify-content: space-between; font-weight: 700; }
.card h2::before { content: ""; display: inline-block; width: 6px; height: 6px; background: var(--accent); margin-right: 10px; }
.card h2 > :first-child { margin-right: auto; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.status { display: inline-block; padding: 3px 9px; border-radius: 2px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.status.draft { background: #2b3036; color: #b9bec6; }
.status.review { background: #3d2f0c; color: #f0b429; }
.status.approved { background: #14304a; color: #6cb6ff; }
.status.sent { background: #123522; color: #3ddc84; }
.status.declined { background: #3a1417; color: #ff6b73; }
.status.won { background: #0f3b2e; color: #4ae3a0; }

/* ---- реестр ---- */
.registry { padding: 26px 30px; max-width: 1400px; margin: 0 auto; }
.registry-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.registry-head h1 { flex: 1 1 100%; margin-bottom: 4px; }
table.reg tbody tr { cursor: default; }
.registry-head h1 { font-size: 26px; margin: 0; margin-right: auto; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.registry-head h1::before { content: "01"; color: var(--accent); font-size: 12px; letter-spacing: .2em; margin-right: 14px; vertical-align: middle; }
.registry-head input, .registry-head select { border: 1px solid var(--line); border-radius: 3px; padding: 8px 10px; background: var(--bg2); color: var(--ink); }
.registry-head input { width: 280px; }
.stats { display: flex; gap: 12px; margin-bottom: 18px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 3px; padding: 12px 16px; min-width: 160px; }
.stat b { display: block; font-size: 24px; font-weight: 700; }
.stat span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .14em; }
table.reg { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); }
table.reg th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--bg2); }
table.reg td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.reg tr:hover td { background: var(--panel2); }
table.reg td.num { font-weight: 700; white-space: nowrap; color: #fff; }
table.reg td.actions { white-space: nowrap; text-align: right; }
table.reg td .title { color: var(--muted); font-size: 12.5px; }
.empty { text-align: center; padding: 60px; color: var(--muted); }

/* ---- редактор ---- */
.editor { display: grid; grid-template-columns: 560px 1fr; height: 100%; }
.editor-form { overflow: auto; padding: 0 16px 16px; border-right: 1px solid var(--line); background: var(--bg); }
.editor-preview { overflow: auto; background: #2a2e33; padding: 24px; display: flex; justify-content: center; align-items: flex-start; }
.preview-scale { transform-origin: top center; }
.page { box-shadow: 0 10px 40px rgba(0, 0, 0, .55); }
.editor-toolbar { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 14px 16px 10px; margin: 0 -16px 12px; box-shadow: 0 6px 12px -8px rgba(0,0,0,.8); display: flex; flex-direction: column; gap: 8px; border-bottom: 1px solid var(--line); }
.tb-row { display: flex; gap: 8px; align-items: center; }
.tb-row b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 15px; }
.editor-toolbar .spacer { flex: 1; }
.editor-toolbar select { border: 1px solid var(--line); border-radius: 3px; padding: 7px 8px; background: var(--bg2); color: var(--ink); }

.blocks { display: flex; flex-direction: column; gap: 8px; }
.block { background: var(--bg2); border: 1px solid var(--line); border-radius: 3px; padding: 10px 12px; }
.block-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.block-head .kind { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin-right: auto; }
.block textarea { width: 100%; border: 1px solid var(--line); border-radius: 3px; padding: 8px 10px; resize: vertical; min-height: 60px; line-height: 1.45; font-family: "PT Serif", Georgia, serif; font-size: 14px; background: var(--panel); color: var(--ink); }
.block input[type=text], .block input[type=number] { width: 100%; border: 1px solid var(--line); border-radius: 3px; padding: 6px 8px; background: var(--panel); color: var(--ink); }
.block.heading textarea { font-family: var(--ui); font-weight: 700; min-height: 38px; text-transform: uppercase; letter-spacing: .04em; }
.add-bar { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.grid-table { width: 100%; border-collapse: collapse; }
.grid-table td, .grid-table th { padding: 2px; }
.grid-table input { width: 100%; }
.grid-table th input { font-weight: 700; background: var(--panel2); }
.pricing-grid th { font-size: 11px; color: var(--muted); text-align: left; padding: 2px 4px; text-transform: uppercase; letter-spacing: .08em; font-weight: 500; }
.pricing-grid td { padding: 2px; vertical-align: top; }
.pricing-grid .sum { text-align: right; padding-right: 6px; white-space: nowrap; font-weight: 700; }
.img-block { display: flex; gap: 12px; align-items: flex-start; }
.img-block .thumb { width: 130px; height: 100px; border: 1px dashed var(--line2); border-radius: 3px; background: var(--panel) center/contain no-repeat; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; cursor: pointer; }
.img-block .ctl { flex: 1; }
.ai-status { font-size: 13px; color: #ff8a90; min-height: 16px; display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.ai-status .spinner { width: 12px; height: 12px; border: 2px solid rgba(224, 36, 46, .3); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.check { display: flex; align-items: center; gap: 8px; margin: 6px 0; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.terms-item { display: grid; grid-template-columns: 160px 1fr auto; gap: 6px; margin-bottom: 6px; align-items: start; }
.terms-item textarea { min-height: 48px; font-size: 13px; }
.ai-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.ai-actions #ai-undo { grid-column: 1 / -1; justify-content: center; }
#ed-form textarea { overflow: hidden; }
.block select { border: 1px solid var(--line); border-radius: 3px; padding: 6px 8px; background: var(--panel); color: var(--ink); width: 100%; }
.block.flash { box-shadow: 0 0 0 2px var(--accent); transition: box-shadow .6s; }
.gal-edit { display: grid; gap: 8px; }
.gal-thumb { position: relative; display: flex; flex-direction: column; gap: 4px; }
.gal-thumb .thumb { width: 100%; height: 90px; border: 1px solid var(--line); border-radius: 3px; background: var(--panel) center/cover no-repeat; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; }
.gal-thumb.add .thumb { border-style: dashed; background: var(--panel); height: 100%; min-height: 90px; }
.gal-thumb .gal-del { position: absolute; top: 4px; right: 4px; padding: 2px 6px; background: rgba(0, 0, 0, .7); }
.editor-form.dropping { outline: 2px dashed var(--accent); outline-offset: -6px; }
.provider-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.provider-tabs .btn.on { border-color: var(--accent); color: #fff; background: var(--accent-soft); }
.models-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
.models-list .btn.on { border-color: var(--accent); color: #fff; }
.hint { background: var(--bg2); border-left: 3px solid var(--accent); padding: 10px 12px; font-size: 13px; color: var(--ink2); line-height: 1.5; margin: 8px 0; }
.hint code { background: #000; padding: 2px 6px; border-radius: 3px; font-family: Menlo, Consolas, monospace; font-size: 12px; color: #fff; user-select: text; }

/* ---- настройки ---- */
.settings { padding: 26px 30px; max-width: 1180px; margin: 0 auto; }
.settings h1 { font-size: 26px; margin: 0 0 18px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.settings h1::before { content: "03"; color: var(--accent); font-size: 12px; letter-spacing: .2em; margin-right: 14px; vertical-align: middle; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.logo-preview { height: 90px; border: 1px dashed var(--line2); border-radius: 3px; background: #fff center/contain no-repeat; display: flex; align-items: center; justify-content: center; color: #666; font-size: 12px; margin-bottom: 8px; }
.mgr { border: 1px solid var(--line); border-radius: 3px; padding: 10px; margin-bottom: 8px; background: var(--bg2); }
.sig-preview { height: 60px; background: #fff center/contain no-repeat; border: 1px dashed var(--line2); border-radius: 3px; margin: 6px 0; }

/* ---- модалка ---- */
.modal-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, .7); display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal { background: var(--panel); border: 1px solid var(--line2); border-radius: 4px; padding: 20px 22px; width: 560px; max-width: 95vw; max-height: 90vh; overflow: auto; box-shadow: 0 20px 60px rgba(0, 0, 0, .6); }
.modal h3 { margin: 0 0 14px; font-size: 18px; text-transform: uppercase; letter-spacing: .06em; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
canvas.sig-canvas { border: 1px solid var(--line2); border-radius: 3px; background: #fff; width: 100%; touch-action: none; cursor: crosshair; }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: #fff; color: #111; padding: 10px 18px; border-radius: 3px; z-index: 100; box-shadow: 0 8px 24px rgba(0, 0, 0, .5); max-width: 70vw; font-weight: 500; }
.toast.err { background: var(--accent); color: #fff; }

/* служебные элементы интерфейса не выделяются мышью */
.topbar, .btn, .nav-btn, .card h2, .field label, .block-head, .stat, .registry-head h1, .add-bar, .check { user-select: none; }
