/* ============================================================
   МУТАНТЫ · Зона отчуждения — стили v2
   Постапокалипсис: ПДА-терминал, тёмная Зона, жёлтый радиационный акцент
   ============================================================ */

:root {
    --bg: #0a0d0a;
    --bg-2: #0f140f;
    --surface: #131a13;
    --surface-2: #1a241a;
    --border: #2a3a2a;
    --border-dim: #1e2a1e;
    --text: #c8d6c2;
    --text-dim: #7d8f78;
    --muted: #55644f;
    --accent: #9fd44a;         /* зона-зелёный */
    --accent-dim: #5a7a2e;
    --hazard: #e8c33a;         /* радиационный жёлтый */
    --danger: #d9534a;
    --warn: #d29a3a;
    --rad: #86c832;            /* свечение радиации */
    --glow: 0 0 12px rgba(159, 212, 74, .25);
    --radius: 10px;
    --mono: "Cascadia Mono", "JetBrains Mono", Consolas, "Courier New", monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
    background:
        radial-gradient(1200px 600px at 50% -10%, rgba(134, 200, 50, .06), transparent 60%),
        radial-gradient(900px 500px at 90% 110%, rgba(159, 212, 74, .05), transparent 60%),
        var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.5;
    min-height: 100vh;
}

.hidden { display: none !important; }
.screen { min-height: 100vh; }
main { max-width: 1100px; margin: 0 auto; padding: 0 14px 30px; }

/* ---------- CRT/ПДА-эффект ---------- */
.crt {
    position: fixed; inset: 0; pointer-events: none; z-index: 999;
    background: repeating-linear-gradient(0deg, rgba(0,0,0,.14) 0 1px, transparent 1px 3px);
    mix-blend-mode: multiply;
    opacity: .5;
}
.crt::after {
    content: ""; position: absolute; inset: 0;
    background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,.45) 100%);
}

/* ---------- Кнопки и поля ---------- */
.btn {
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 9px 16px;
    font-size: .92rem;
    cursor: pointer;
    transition: transform .12s ease, box-shadow .15s ease, background .15s ease, border-color .15s;
    touch-action: manipulation;
}
.btn:hover { border-color: var(--accent-dim); box-shadow: var(--glow); }
.btn:active { transform: translateY(1px) scale(.98); }
.btn.accent {
    background: linear-gradient(180deg, #b8e464, #8fbe3c);
    border-color: #a4d24a;
    color: #10150c;
    font-weight: 700;
}
.btn.accent:hover { box-shadow: 0 0 16px rgba(159, 212, 74, .45); }
.btn.danger { border-color: #6e322e; color: #e8908a; background: #1c1211; }
.btn.danger:hover { border-color: var(--danger); box-shadow: 0 0 12px rgba(217, 83, 74, .3); }
.btn.small { padding: 6px 11px; font-size: .82rem; }
.btn.big { padding: 13px 18px; font-size: 1.05rem; width: 100%; }
.btn.ghost { background: transparent; border-color: var(--border-dim); color: var(--text-dim); }

input, textarea, select {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    padding: 10px 12px;
    font-size: .95rem;
    font-family: inherit;
    transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--accent-dim);
    box-shadow: 0 0 0 3px rgba(159, 212, 74, .12);
}
textarea { resize: vertical; }
.error { color: #e8908a; font-size: .85rem; min-height: 1.2em; margin-top: 10px; text-align: center; }

/* ---------- Экран входа ---------- */
#login-screen {
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    background:
        radial-gradient(700px 400px at 50% 30%, rgba(134, 200, 50, .10), transparent 70%),
        var(--bg);
}
.login-box {
    width: 100%; max-width: 380px;
    background: rgba(15, 20, 15, .85);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 34px 28px 22px;
    text-align: center;
    backdrop-filter: blur(4px);
    box-shadow: 0 0 60px rgba(134, 200, 50, .08), inset 0 0 40px rgba(0,0,0,.4);
    animation: loginIn .5s ease both;
}
@keyframes loginIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.login-rad {
    font-size: 3.2rem; color: var(--hazard);
    text-shadow: 0 0 22px rgba(232, 195, 58, .55);
    animation: radPulse 2.6s ease-in-out infinite;
    line-height: 1;
}
@keyframes radPulse {
    0%, 100% { transform: scale(1); opacity: .9; }
    50% { transform: scale(1.08); opacity: 1; }
}
.login-box h1 {
    margin-top: 10px;
    font-size: 2rem; letter-spacing: 4px; font-weight: 900;
    color: var(--accent);
    text-shadow: 0 0 18px rgba(159, 212, 74, .4);
}
.login-box .subtitle {
    font-family: var(--mono);
    color: var(--text-dim); font-size: .72rem; letter-spacing: 1px;
    margin: 6px 0 22px;
}
.login-fields { display: flex; flex-direction: column; gap: 10px; }
.login-foot {
    margin-top: 18px; padding-top: 12px;
    border-top: 1px dashed var(--border-dim);
    font-family: var(--mono); font-size: .62rem; letter-spacing: 2px;
    color: var(--muted);
}

/* ---------- Шапка ---------- */
header {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    max-width: 1100px; margin: 0 auto;
    padding: 14px;
    border-bottom: 1px solid var(--border-dim);
}
.logo {
    font-weight: 900; letter-spacing: 2px; font-size: 1.15rem;
    color: var(--accent);
    text-shadow: 0 0 14px rgba(159, 212, 74, .35);
    white-space: nowrap;
}
.logo .rad { color: var(--hazard); text-shadow: 0 0 14px rgba(232, 195, 58, .5); }
.campaign-info { flex: 1; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.camp-name {
    font-family: var(--mono); font-size: .78rem; color: var(--text-dim);
    border: 1px solid var(--border-dim); border-radius: 20px;
    padding: 4px 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#master-controls { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
#master-controls select { font-size: .8rem; padding: 6px 8px; max-width: 180px; }
.user-info { display: flex; align-items: center; gap: 8px; }
.user-badge {
    font-family: var(--mono); font-size: .75rem; color: var(--accent);
    border: 1px solid var(--accent-dim); border-radius: 20px; padding: 4px 12px;
}

/* ---------- Вкладки ---------- */
.tabs {
    display: flex; gap: 6px;
    max-width: 1100px; margin: 14px auto 0; padding: 0 14px;
    overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
    display: flex; align-items: center; gap: 7px;
    background: var(--surface);
    border: 1px solid var(--border-dim);
    border-bottom: none;
    border-radius: 10px 10px 0 0;
    color: var(--text-dim);
    padding: 9px 16px;
    font-size: .9rem;
    cursor: pointer;
    transition: color .15s, background .15s;
    white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.active {
    background: var(--surface-2);
    color: var(--accent);
    border-color: var(--border);
    box-shadow: 0 -4px 14px rgba(159, 212, 74, .07) inset;
}
.tab-ico { font-size: 1rem; }

.tab-page {
    background: var(--surface);
    border: 1px solid var(--border-dim);
    border-radius: 0 0 var(--radius) var(--radius);
    padding: 18px;
    min-height: 320px;
    animation: pageIn .22s ease both;
}
@keyframes pageIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.section-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; flex-wrap: wrap; margin-bottom: 16px;
}
h2 { font-size: 1.05rem; letter-spacing: 1px; color: var(--text); font-weight: 700; }

/* ---------- Персонажи ---------- */
.chars-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.char-card {
    position: relative;
    background: linear-gradient(180deg, var(--surface-2), var(--surface));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 14px 12px;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .2s ease, border-color .2s;
    overflow: hidden;
}
.char-card::before {
    content: ""; position: absolute; inset: 0 0 auto 0; height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-dim), transparent);
    opacity: .6;
}
.char-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent-dim);
    box-shadow: 0 8px 24px rgba(0,0,0,.45), var(--glow);
}
.char-top { display: flex; gap: 12px; align-items: center; }
.char-icon {
    font-size: 2rem; width: 54px; height: 54px; flex: none;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 10px;
}
.char-id { min-width: 0; flex: 1; }
.char-card h3 { font-size: 1.02rem; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.char-owner { font-size: .74rem; color: var(--muted); font-family: var(--mono); margin-top: 2px; }
.char-level {
    font-family: var(--mono); font-size: .7rem; color: var(--hazard);
    border: 1px solid rgba(232, 195, 58, .35); border-radius: 12px;
    padding: 2px 8px; white-space: nowrap;
}
.attr-line {
    display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px;
}
.attr-line span {
    font-family: var(--mono); font-size: .68rem; color: var(--text-dim);
    background: var(--bg-2); border: 1px solid var(--border-dim);
    border-radius: 6px; padding: 3px 7px;
}
.attr-line b { color: var(--accent); }

.hp-wrap { margin-top: 12px; }
.hp-label {
    display: flex; justify-content: space-between;
    font-family: var(--mono); font-size: .68rem; color: var(--text-dim); margin-bottom: 4px;
}
.hp-bar {
    height: 8px; background: var(--bg-2);
    border: 1px solid var(--border-dim); border-radius: 6px; overflow: hidden;
}
.hp-fill {
    height: 100%;
    background: linear-gradient(90deg, #6fa832, #9fd44a);
    box-shadow: 0 0 8px rgba(159, 212, 74, .4);
    transition: width .5s ease;
}
.hp-fill.low { background: linear-gradient(90deg, #a83b32, #d9534a); box-shadow: 0 0 8px rgba(217, 83, 74, .4); }
.hp-fill.mid { background: linear-gradient(90deg, #b08a2e, #e8c33a); box-shadow: 0 0 8px rgba(232, 195, 58, .4); }

.char-flags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; min-height: 20px; }
.flag {
    font-size: .66rem; font-family: var(--mono);
    border-radius: 5px; padding: 2px 7px;
}
.flag.rads { color: #d9c44a; background: rgba(232, 195, 58, .1); border: 1px solid rgba(232, 195, 58, .3); }
.flag.wounds { color: #e8908a; background: rgba(217, 83, 74, .1); border: 1px solid rgba(217, 83, 74, .3); }
.flag.mut { color: #c49af7; background: rgba(163, 113, 247, .1); border: 1px solid rgba(163, 113, 247, .3); }

.empty {
    padding: 30px; text-align: center;
    color: var(--muted); font-size: .9rem;
    border: 1px dashed var(--border); border-radius: var(--radius);
    grid-column: 1 / -1;
}

/* ---------- Карта ---------- */
.map-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .72rem; color: var(--text-dim); font-family: var(--mono); }
.map-legend span { display: flex; align-items: center; gap: 5px; }
.lg { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.lg-fog { background: #141a14; border: 1px solid #222c22; }
.lg-open { background: #243424; border: 1px solid #4a6a3a; }
.lg-note { background: #243424; border: 1px solid #4a6a3a; box-shadow: inset 0 0 0 3px #141a14; position: relative; }
.lg-note::after { content: ""; position: absolute; right: 1px; top: 1px; width: 4px; height: 4px; border-radius: 50%; background: var(--hazard); }

.map-wrap { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.map-scroll { overflow-x: auto; flex: none; max-width: 100%; padding-bottom: 6px; }
.map-grid { display: grid; gap: 4px; }
.cell {
    width: 46px; height: 46px;
    display: flex; align-items: center; justify-content: center;
    background: #10150f;
    border: 1px solid #1c261c;
    border-radius: 6px;
    color: #2c3a2a;
    font-family: var(--mono); font-size: .62rem; font-weight: 700;
    cursor: pointer;
    position: relative;
    transition: background .15s, border-color .15s, transform .1s, box-shadow .15s;
    user-select: none;
}
.cell.fog { color: #1d281c; }
.cell.fog::after { content: "?"; font-size: .8rem; color: #22301f; }
.cell.explored {
    background: #1d2b1a;
    border-color: #3f5a30;
    color: var(--accent);
    text-shadow: 0 0 6px rgba(159, 212, 74, .4);
}
.cell.explored.has-note::before {
    content: ""; position: absolute; top: 3px; right: 3px;
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--hazard);
    box-shadow: 0 0 6px rgba(232, 195, 58, .6);
}
.cell:hover { border-color: var(--accent-dim); transform: scale(1.06); z-index: 2; }
.cell.selected {
    border-color: var(--hazard);
    box-shadow: 0 0 0 2px rgba(232, 195, 58, .35), 0 0 14px rgba(232, 195, 58, .25);
}

.sector-panel {
    flex: 1; min-width: 240px; max-width: 380px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    animation: pageIn .2s ease both;
}
.sector-panel h3 {
    font-family: var(--mono); color: var(--hazard); letter-spacing: 1px;
    margin-bottom: 12px; font-size: .95rem;
}
.sector-panel label { display: flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--text-dim); margin-bottom: 10px; cursor: pointer; }
.sector-panel input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); }
.sector-panel textarea { width: 100%; margin-bottom: 12px; font-size: .88rem; }
.sector-note-view {
    white-space: pre-wrap; font-size: .88rem; color: var(--text);
    background: var(--bg-2); border: 1px solid var(--border-dim);
    border-radius: 8px; padding: 12px; min-height: 80px;
}

/* ---------- Кубики ---------- */
.dice-panel { max-width: 560px; }
.dice-quick { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.dice-btn { font-family: var(--mono); font-weight: 700; min-width: 58px; }
.dice-btn:hover { border-color: var(--hazard); box-shadow: 0 0 12px rgba(232, 195, 58, .25); }
.dice-custom { display: flex; gap: 8px; margin-bottom: 18px; }
.dice-custom input { flex: 1; font-family: var(--mono); }

.dice-stage {
    display: flex; gap: 10px; flex-wrap: wrap;
    min-height: 58px; margin-bottom: 10px;
}
.die {
    width: 52px; height: 52px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(145deg, #232e1f, #141b12);
    border: 1px solid var(--accent-dim);
    border-radius: 12px;
    color: var(--accent);
    font-family: var(--mono); font-size: 1.25rem; font-weight: 800;
    box-shadow: 0 4px 10px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.06);
    animation: diePop .45s cubic-bezier(.2, 1.4, .4, 1) both;
}
.die.rolling { animation: dieShake .12s linear infinite; border-color: var(--hazard); color: var(--hazard); }
@keyframes dieShake {
    0% { transform: rotate(-8deg) translateY(-2px); }
    50% { transform: rotate(7deg) translateY(1px); }
    100% { transform: rotate(-5deg) translateY(-1px); }
}
@keyframes diePop {
    0% { transform: scale(.4) rotate(-30deg); opacity: 0; }
    100% { transform: scale(1) rotate(0); opacity: 1; }
}
.die.max { border-color: var(--hazard); color: var(--hazard); box-shadow: 0 0 14px rgba(232, 195, 58, .35); }
.die.mod {
    background: transparent; border-style: dashed; border-color: var(--warn);
    color: var(--warn); width: auto; min-width: 52px; padding: 0 12px;
}

.dice-result {
    font-family: var(--mono);
    background: var(--bg-2);
    border: 1px solid var(--border-dim);
    border-left: 3px solid var(--accent-dim);
    border-radius: 8px;
    padding: 12px 14px;
    min-height: 46px;
    font-size: .9rem;
    color: var(--text);
}
.dice-result .total { font-size: 1.4rem; color: var(--accent); font-weight: 800; text-shadow: 0 0 10px rgba(159, 212, 74, .4); }
.dice-result small { display: block; color: var(--text-dim); margin-top: 4px; }

/* ---------- Журнал ---------- */
.log-tools { display: flex; gap: 8px; align-items: center; }
.log-filter { font-size: .8rem; padding: 6px 8px; }
.log-add { display: flex; gap: 8px; margin-bottom: 14px; }
.log-add input { flex: 1; }
.log-list { display: flex; flex-direction: column; gap: 6px; }
.log-item {
    display: flex; gap: 10px; align-items: baseline;
    background: var(--bg-2);
    border: 1px solid var(--border-dim);
    border-left: 3px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: .87rem;
    animation: logIn .3s ease both;
}
@keyframes logIn { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
.log-item .time { font-family: var(--mono); font-size: .68rem; color: var(--muted); white-space: nowrap; flex: none; }
.log-item .ico { flex: none; font-size: .85rem; }
.log-item.roll { border-left-color: var(--hazard); }
.log-item.sector { border-left-color: #5a9ad4; }
.log-item.note { border-left-color: var(--accent-dim); }
.log-item.system { border-left-color: var(--border); color: var(--text-dim); font-size: .8rem; }

/* ---------- Модалка ---------- */
.modal {
    position: fixed; inset: 0; z-index: 100;
    background: rgba(4, 6, 4, .78);
    backdrop-filter: blur(3px);
    display: flex; align-items: flex-start; justify-content: center;
    overflow-y: auto;
    padding: 24px 14px;
    animation: fadeIn .18s ease both;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-box {
    width: 100%; max-width: 560px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 22px;
    animation: modalIn .25s cubic-bezier(.2, 1.2, .4, 1) both;
    box-shadow: 0 20px 60px rgba(0,0,0,.6);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: none; } }
.modal-box h3 { margin-bottom: 16px; color: var(--accent); letter-spacing: 1px; font-size: 1.05rem; }
.modal-box label { display: flex; flex-direction: column; gap: 5px; font-size: .78rem; color: var(--text-dim); }
.modal-box label.wide { margin-top: 10px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.attrs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 6px 0 12px; }
.attr {
    display: flex; flex-direction: column; gap: 4px; align-items: center;
    background: var(--bg-2); border: 1px solid var(--border-dim);
    border-radius: 8px; padding: 8px 4px;
}
.attr span { font-family: var(--mono); font-size: .62rem; letter-spacing: 1px; color: var(--text-dim); }
.attr input { width: 100%; text-align: center; padding: 6px 4px; font-family: var(--mono); font-weight: 700; font-size: 1rem; background: transparent; border-color: transparent; }
.attr input:focus { border-color: var(--accent-dim); background: var(--surface); }
.modal-actions { display: flex; gap: 8px; margin-top: 18px; align-items: center; }
.modal-actions .spacer { flex: 1; }

/* ---------- Мобильная версия ---------- */
@media (max-width: 720px) {
    header { padding: 12px; gap: 10px; }
    .logo { font-size: 1rem; width: 100%; }
    .campaign-info { width: 100%; order: 3; }
    .user-info { margin-left: auto; }
    .tab-label { display: none; }
    .tab { padding: 9px 13px; }
    .tab-ico { font-size: 1.15rem; }
    .tab-page { padding: 14px; }
    .chars-list { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .attrs { grid-template-columns: repeat(4, 1fr); gap: 6px; }
    .cell { width: 40px; height: 40px; }
    .map-wrap { flex-direction: column; }
    .sector-panel { max-width: none; width: 100%; }
    .modal { padding: 0; }
    .modal-box { min-height: 100vh; border-radius: 0; border: none; }
    .dice-custom { flex-direction: column; }
    .log-add { flex-direction: column; }
}

/* ============================================================
   v2.1 — карты Зоны и генератор
   ============================================================ */

/* --- выбор карты --- */
.map-selector { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.ms-btn {
    background: var(--bg-2);
    border: 1px solid var(--border-dim);
    border-radius: 20px;
    color: var(--text-dim);
    padding: 6px 14px;
    font-size: .78rem;
    font-family: var(--mono);
    cursor: pointer;
    transition: all .15s;
    touch-action: manipulation;
}
.ms-btn:hover { color: var(--text); border-color: var(--accent-dim); }
.ms-btn.active {
    background: rgba(159, 212, 74, .12);
    border-color: var(--accent-dim);
    color: var(--accent);
    box-shadow: var(--glow);
}

/* --- карта Зоны (изображение + сетка) --- */
.zmap-box { position: relative; max-width: none; }
.zmap-box img { display: block; border-radius: 8px; border: 1px solid var(--border); }
.zmap-grid { position: absolute; inset: 0; }
.zcell {
    position: absolute;
    box-sizing: border-box;
    border: 1px solid rgba(159, 212, 74, .14);
    border-radius: 2px;
    background: rgba(5, 8, 5, .55);
    cursor: pointer;
    transition: background .15s, border-color .15s;
    display: flex; align-items: flex-start; justify-content: flex-end;
    gap: 1px; padding: 1px;
}
.zcell i {
    font-style: normal; font-size: .5rem; line-height: 1;
    font-family: var(--mono); color: var(--hazard);
    text-shadow: 0 0 4px rgba(0,0,0,.9);
}
.zcell i.th { color: #e07a5a; }
.zcell:hover { border-color: rgba(232, 195, 58, .6); background: rgba(232, 195, 58, .08); z-index: 2; }
.zcell.open { background: rgba(159, 212, 74, .10); border-color: rgba(159, 212, 74, .35); }
.zcell.has-data:not(.open) { border-color: rgba(163, 113, 247, .4); background: rgba(163, 113, 247, .07); }
.zcell.selected { border-color: var(--hazard); box-shadow: 0 0 0 1px rgba(232, 195, 58, .5), 0 0 10px rgba(232, 195, 58, .3); z-index: 3; }

/* --- панель сектора: расширенная --- */
.zsec-gen { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.zsec-tl { font-size: .75rem; color: var(--text-dim); font-family: var(--mono); display: flex; align-items: center; gap: 6px; }
.zsec-tl input { width: 56px; padding: 4px 6px; font-size: .8rem; }
.zsec-out {
    background: var(--bg-2); border: 1px solid var(--border-dim);
    border-radius: 8px; padding: 10px 12px;
    font-size: .84rem; margin-bottom: 12px; min-height: 40px;
}
.zsec-out p { margin: 2px 0; }
.sector-panel p { margin: 4px 0; font-size: .86rem; }
.sector-panel p b { color: var(--text-dim); font-weight: 600; }
.sec-notes {
    margin-top: 8px !important; padding-top: 8px;
    border-top: 1px dashed var(--border-dim);
    white-space: pre-wrap;
}
.zsec-actions { display: flex; gap: 8px; margin-top: 10px; }
.sector-panel textarea { width: 100%; margin-top: 10px; font-size: .86rem; }

/* --- генератор (вкладка мастера) --- */
.gen-info { font-size: .82rem; color: var(--text-dim); margin-bottom: 16px; max-width: 640px; }
.gen-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}
.gen-card {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
}
.gen-card h4 {
    font-size: .78rem; letter-spacing: 1px; color: var(--hazard);
    font-family: var(--mono); margin-bottom: 10px;
}
.gen-field { margin-bottom: 8px; }
.gen-field label { display: block; font-size: .7rem; color: var(--text-dim); font-family: var(--mono); margin-bottom: 4px; }
.gen-field input { width: 100%; padding: 7px 9px; font-size: .88rem; }
.gen-out {
    margin-top: 10px; background: var(--bg-2);
    border: 1px solid var(--border-dim); border-left: 3px solid var(--accent-dim);
    border-radius: 8px; padding: 8px 10px;
}
.gen-out .lbl { font-size: .64rem; font-family: var(--mono); color: var(--muted); letter-spacing: 1px; }
.gen-out .val { font-size: .88rem; color: var(--text); margin-top: 2px; }
.gen-summary {
    background: rgba(159, 212, 74, .06);
    border: 1px solid rgba(159, 212, 74, .25);
    border-radius: var(--radius);
    padding: 14px; margin-bottom: 14px;
    animation: pageIn .2s ease both;
}
.gen-summary h4 { color: var(--accent); font-size: .9rem; margin-bottom: 10px; letter-spacing: 1px; }
.gen-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.gb {
    font-size: .72rem; font-family: var(--mono);
    border-radius: 5px; padding: 3px 8px;
    background: var(--bg-2); border: 1px solid var(--border-dim); color: var(--text-dim);
}
.gb.art { color: var(--hazard); border-color: rgba(232, 195, 58, .35); }
.gb.thr { color: #e07a5a; border-color: rgba(224, 122, 90, .35); }
.gb.warn { color: var(--danger); border-color: rgba(217, 83, 74, .35); }
.gen-summary p { font-size: .88rem; color: var(--text); }
.gen-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.gen-actions .big { flex: 1; min-width: 220px; }

@media (max-width: 720px) {
    .zcell { border-width: 1px; }
    .gen-grid { grid-template-columns: 1fr; }
}
