:root {
    --navy: #14365c;
    --navy-deep: #0d2744;
    --gold: #e6b325;
    --gold-deep: #c99612;
    --ink: #172033;
    --muted: #5d6b7e;
    --line: #e4e9f0;
    --paper: #f6f8fb;
    --white: #ffffff;
    --danger: #9f1239;
    --danger-bg: #fff1f4;
    --ok: #166534;
    --ok-bg: #f0fdf4;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Avenir Next", "Segoe UI", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(900px 320px at 100% -10%, rgba(230, 179, 37, 0.18), transparent 60%),
        var(--paper);
}

img { display: block; max-width: 100%; }

button, input, textarea, select { font: inherit; color: inherit; }

.page { max-width: 1080px; margin: 0 auto; padding: 28px 20px 64px; }

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
}

.brand img { height: 42px; width: auto; }

.session {
    display: flex;
    align-items: center;
    gap: 16px;
    text-align: right;
}

.session strong, .session span { display: block; }
.session span { color: var(--muted); font-size: 13px; }

.login-screen {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-card {
    width: min(440px, 100%);
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 32px 28px;
    box-shadow: 0 18px 50px rgba(13, 39, 68, 0.08);
}

.login-logo { height: 48px; width: auto; margin-bottom: 22px; }

h1 { margin: 0 0 8px; font-size: 32px; letter-spacing: -0.03em; }
h2, h3 { margin: 0; }
.lede, .hint, .desc, .ar { color: var(--muted); }
.lede { margin: 0 0 22px; line-height: 1.5; }
.eyebrow {
    margin: 0 0 6px;
    color: var(--gold-deep);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.panel, .category, .parent {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 18px;
}

.panel { padding: 22px; display: grid; gap: 16px; }

label, .choice { display: grid; gap: 8px; font-size: 13px; font-weight: 700; }
.wide { display: grid; gap: 8px; }

input, textarea, select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    padding: 12px 14px;
    font-weight: 500;
}

textarea { resize: vertical; }

input:focus, textarea:focus, select:focus {
    outline: 2px solid rgba(230, 179, 37, 0.45);
    border-color: var(--gold);
}

.counts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.count-tree, .count-branch { display: grid; gap: 10px; }
.count-branch {
    margin-left: 16px;
    padding-left: 16px;
    border-left: 2px solid rgba(230, 179, 37, 0.75);
}
.count-node small { color: var(--muted); font-weight: 600; }
.hint { margin: -4px 0 0; font-size: 13px; }

.providers { border: 0; margin: 0; padding: 0; display: grid; gap: 12px; }
.providers legend { font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.provider-row { display: flex; gap: 10px; flex-wrap: wrap; }

.choice {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
}

.choice input { width: auto; }
.choice small { color: var(--muted); font-weight: 600; }
.is-disabled { opacity: 0.55; }

.btn {
    height: 44px;
    border-radius: 12px;
    border: 1px solid transparent;
    padding: 0 18px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn:disabled { opacity: 0.65; cursor: default; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--navy-deep); }
.btn-secondary { background: #fff; color: var(--navy); border-color: var(--line); }
.text-btn { border: 0; background: transparent; color: var(--navy); font-weight: 700; cursor: pointer; padding: 0; }

.banner { border-radius: 12px; padding: 12px 14px; margin: 0 0 16px; }
.banner-error { background: var(--danger-bg); color: var(--danger); }
.banner-ok { background: var(--ok-bg); color: var(--ok); }

.preview-head, .preview-actions, .meta-row { display: flex; gap: 10px; }
.preview-head { justify-content: space-between; align-items: flex-end; margin-bottom: 18px; }
.meta-row { flex-wrap: wrap; margin-top: 12px; }
.cost-card {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin: 0 0 18px;
    padding: 16px 18px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
}
.cost-card strong { display: block; font-size: 22px; color: var(--navy); }
.cost-card span { color: var(--muted); font-size: 13px; }
.meta-row span, .level {
    background: rgba(20, 54, 92, 0.06);
    color: var(--navy);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 700;
}
.level { display: inline-flex; margin-bottom: 8px; }

.tree { display: grid; gap: 16px; }
.category { padding: 18px; }
.category header { margin-bottom: 14px; }
.parents, .collections { display: grid; gap: 12px; }
.parent { padding: 14px; background: #fbfcfe; }
.collection { padding: 12px; border-radius: 14px; background: #fff; border: 1px solid var(--line); }
.node-head { display: flex; gap: 12px; align-items: flex-start; }
.node-copy { flex: 1; min-width: 0; }
.node-copy .price { display: inline-block; margin-top: 8px; color: var(--navy); }
.btn-small { height: 36px; padding: 0 14px; }
.node-actions { display: flex; gap: 8px; margin-left: auto; flex: none; align-items: flex-start; }
.node-actions form { margin: 0; }
.photo-col { width: 128px; display: grid; gap: 6px; justify-items: stretch; flex: none; }
.photo-form { margin: 0; }
.photo-form .text-btn { width: 100%; font-size: 12px; text-align: center; }
.editor { display: none; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); gap: 12px; }
.editor.is-open { display: grid; }
.editor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.editor-grid .wide { grid-column: 1 / -1; }
.editor-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.check-line { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.check-line input { width: auto; }
.category .node-block { margin-bottom: 14px; }
.thumb { width: 128px; height: 96px; object-fit: cover; border-radius: 12px; flex: none; background: #eef2f7; }
.thumb-sm { width: 128px; height: 96px; }
.thumb-empty { border: 1px dashed var(--line); }
.catalog-link { margin: 10px 0 0; font-size: 13px; }
.catalog-link a { color: var(--navy); }
.history { display: grid; gap: 10px; margin-top: 22px; }
.history-head h2 { font-size: 20px; }
.history-card {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
}
.history-card strong, .history-card span { display: block; }
.history-card span { color: var(--muted); font-size: 13px; margin-top: 4px; }
.history-actions { display: flex; gap: 8px; align-items: center; }
.history-actions form { margin: 0; }
h4 { margin: 0; font-size: 16px; }
.ar { margin: 4px 0 0; }
.desc { margin: 8px 0 0; font-size: 14px; line-height: 1.45; }

.products { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.products li {
    display: block;
    padding: 10px 12px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid var(--line);
}
.products p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.products b { color: var(--navy); white-space: nowrap; }

.page-preview { max-width: 1180px; }

.preview-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 16px;
    padding: 22px 24px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: 0 14px 36px rgba(13, 39, 68, 0.05);
}
.preview-hero h1 { margin: 0; font-size: 34px; line-height: 1.15; letter-spacing: -0.03em; }
.preview-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.preview-actions form { margin: 0; }

.preview-page .cost-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    margin: 0 0 22px;
    padding: 16px 20px;
    box-shadow: 0 8px 24px rgba(13, 39, 68, 0.04);
}
.preview-page .cost-card > div + div {
    border-left: 1px solid var(--line);
    padding-left: 20px;
}

.preview-page .tree { gap: 22px; }
.preview-page .category {
    padding: 22px;
    border-top: 4px solid var(--gold);
    box-shadow: 0 14px 36px rgba(13, 39, 68, 0.05);
}
.preview-page .parents { gap: 16px; margin-top: 18px; }
.preview-page .parent {
    padding: 16px;
    background: #f7f9fc;
    border: 0;
    border-radius: 18px;
}
.preview-page .collections { gap: 18px; margin-top: 14px; }
.preview-page .collection {
    padding: 16px 0 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    border-top: 1px solid #e6ebf2;
}
.preview-page .products {
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 14px;
    margin-top: 16px;
}
.preview-page .products li {
    padding: 0;
    overflow: hidden;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 8px 20px rgba(13, 39, 68, 0.04);
}

.preview-page .node-card { display: grid; gap: 16px; align-items: start; }
.preview-page .category > .node-block .node-card,
.preview-page .parent > .node-block .node-card { grid-template-columns: 260px 1fr; }
.preview-page .collection > .node-block .node-card { grid-template-columns: 200px 1fr; }
.preview-page .product .node-card { grid-template-columns: 1fr; gap: 0; }
.preview-page .products li:has(.editor.is-open) { grid-column: 1 / -1; }
.preview-page .product:has(.editor.is-open) .node-card {
    grid-template-columns: 200px 1fr;
    gap: 16px;
    padding: 14px 14px 0;
}
.preview-page .product:has(.editor.is-open) .photo-frame { height: 150px; border-radius: 14px; }
.preview-page .product:has(.editor.is-open) .node-body { padding: 0; }
.preview-page .product .node-body { padding: 14px 14px 16px; }

.preview-page .photo-frame {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    background:
        linear-gradient(160deg, rgba(20, 54, 92, 0.16), rgba(230, 179, 37, 0.16)),
        #e8eef5;
}
.preview-page .category > .node-block .photo-frame { height: 210px; }
.preview-page .parent > .node-block .photo-frame { height: 168px; }
.preview-page .collection > .node-block .photo-frame { height: 140px; }
.preview-page .product .photo-frame { height: 210px; border-radius: 0; }
.preview-page .open-photo {
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in;
}
.preview-page .thumb,
.preview-page .thumb-sm,
.preview-page .thumb-empty {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 0;
    border-radius: 0;
}
.preview-page .photo-col {
    display: grid;
    gap: 6px;
    align-content: start;
}
.preview-page .photo-form {
    margin: 0;
}
.preview-page .photo-btn {
    width: 100%;
    height: 26px;
    padding: 0 8px;
    border: 1px solid #d7e0ea;
    border-radius: 8px;
    background: #fff;
    color: var(--navy);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}
.preview-page .photo-btn:hover { background: #f4f7fb; border-color: #c5d0dc; }

.preview-page .node-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}
.preview-page .level { margin: 0; background: #fff; border: 1px solid #e6ebf2; }
.preview-page .product .level {
    background: transparent;
    border: 0;
    padding: 0;
    color: var(--gold-deep);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 11px;
}
.preview-page .category > .node-block .level { background: rgba(230, 179, 37, 0.18); border-color: transparent; color: #8a6410; }
.preview-page .node-actions { margin: 0; flex-wrap: wrap; justify-content: flex-end; }
.preview-page .ghost-btn {
    height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid #d7e0eb;
    background: #fff;
    color: var(--navy);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}
.preview-page .ghost-btn:hover { border-color: var(--gold); }
.preview-page h2 { font-size: 28px; letter-spacing: -0.03em; }
.preview-page h3 { font-size: 20px; }
.preview-page h4 { font-size: 17px; }
.preview-page .product strong { display: block; font-size: 16px; line-height: 1.35; }
.preview-page .ar { margin-top: 4px; color: #3e4d61; font-size: 14px; }
.preview-page .desc {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: 8px;
    color: #526173;
    line-height: 1.5;
}
.preview-page .product .desc { -webkit-line-clamp: 2; }
.preview-page .price {
    display: inline-flex;
    margin-top: 12px;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(230, 179, 37, 0.2);
    color: #8a6410;
    font-size: 13px;
}

.preview-page .editor.is-open {
    margin-top: 16px;
    padding: 16px;
    background: #fbfcfe;
    border: 1px solid var(--line);
    border-top: 3px solid var(--gold);
    border-radius: 16px;
}
.preview-page .editor-kicker {
    margin: 0;
    color: var(--navy);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

@media (max-width: 860px) {
    .preview-hero,
    .preview-page .cost-card,
    .preview-page .category > .node-block .node-card,
    .preview-page .parent > .node-block .node-card,
    .preview-page .collection > .node-block .node-card {
        grid-template-columns: 1fr;
        display: grid;
    }
    .preview-hero { align-items: stretch; }
    .preview-actions { justify-content: flex-start; }
    .preview-page .cost-card > div + div { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 12px; }
    .preview-page .category > .node-block .photo-frame,
    .preview-page .parent > .node-block .photo-frame,
    .preview-page .collection > .node-block .photo-frame { height: 200px; }
    .session { display: none; }
}

@media (max-width: 720px) {
    .counts, .preview-head, .editor-grid, .history-card { grid-template-columns: 1fr; display: grid; }
    .preview-head { align-items: stretch; }
    .session { display: none; }
}

.is-studio {
    height: 100vh;
    overflow: hidden;
}

.studio-frame {
    height: 100vh;
    overflow: hidden;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 8px;
    padding: 10px 12px 12px;
}

.studio-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 44px;
    padding: 0 2px;
}

.studio-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    min-width: 0;
}

.studio-brand img { height: 22px; width: auto; }

.studio-brand span { display: grid; line-height: 1.1; }
.studio-brand strong {
    color: var(--navy);
    font-size: 16px;
    letter-spacing: -0.03em;
}
.studio-brand em {
    color: var(--gold-deep);
    font-style: normal;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.studio-session {
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: right;
}
.studio-session strong, .studio-session span { display: block; }
.studio-session strong { font-size: 13px; }
.studio-session span { color: var(--muted); font-size: 11px; }
.studio-session .text-btn { font-size: 12px; }

.studio-panels {
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 10px;
}

.studio-panel {
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 18px 14px;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 14px;
    border-top: 3px solid var(--gold);
}

.studio-panel-head { display: grid; gap: 4px; flex: none; }
.is-studio h1 { margin: 0; font-size: 20px; letter-spacing: -0.03em; }
.is-studio .lede { margin: 0; font-size: 13px; line-height: 1.4; }
.is-studio .eyebrow { margin: 0; font-size: 10px; letter-spacing: 0.14em; }
.is-studio .banner { margin: 0; padding: 8px 10px; font-size: 13px; flex: none; }
.is-studio .hint { margin: 0; font-size: 13px; line-height: 1.45; }

.is-studio .cost-card {
    margin: 0;
    padding: 8px 10px;
    border-radius: 10px;
    box-shadow: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 8px;
}
.is-studio .cost-card strong { font-size: 14px; }
.is-studio .cost-card span { font-size: 11px; }
.is-studio .cost-card > div + div {
    border-left: 1px solid var(--line);
    padding-left: 10px;
}

.studio-form {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.is-studio label { gap: 6px; font-size: 13px; }
.is-studio .studio-form .wide {
    flex: 0 1 112px;
    min-height: 68px;
    display: flex;
    flex-direction: column;
}
.is-studio input,
.is-studio textarea {
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 15px;
}
.is-studio textarea {
    flex: 1;
    min-height: 72px;
    resize: none;
    line-height: 1.45;
}

.is-studio .count-tree {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: grid;
    grid-template-rows: minmax(0, 1fr) minmax(0, 3fr);
    gap: 10px;
}
.is-studio .count-branch {
    min-height: 0;
    overflow: hidden;
    display: grid;
    gap: 10px;
    margin-left: 14px;
    padding-left: 14px;
    border-left: 2px solid rgba(230, 179, 37, 0.85);
}
.is-studio .count-tree > .count-branch { grid-template-rows: minmax(0, 1fr) minmax(0, 2fr); }
.is-studio .count-tree > .count-branch > .count-branch { grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); }
.is-studio .count-tree .count-branch .count-branch .count-branch { grid-template-rows: minmax(0, 1fr); }
.is-studio .count-node {
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 84px;
    column-gap: 14px;
    row-gap: 2px;
    align-content: center;
}
.is-studio .count-node span { grid-column: 1; grid-row: 1; font-size: 14px; }
.is-studio .count-node small {
    grid-column: 1;
    grid-row: 2;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}
.is-studio .count-node input {
    grid-column: 2;
    grid-row: 1 / span 2;
    height: 42px;
    max-height: 100%;
    align-self: center;
    text-align: center;
    font-size: 16px;
}
.is-studio .studio-form .hint,
.is-studio .studio-form .btn { flex: none; }

.is-studio .btn { height: 40px; border-radius: 10px; font-size: 14px; }
.is-studio .btn-small { height: 28px; padding: 0 10px; font-size: 12px; }

.studio-saved { min-height: 0; }
.studio-list {
    min-height: 0;
    display: grid;
    align-content: start;
    gap: 8px;
    overflow: hidden;
}
.studio-empty { padding-top: 4px; }

.is-studio .history-card {
    padding: 8px 10px;
    border-radius: 10px;
    gap: 8px;
}
.is-studio .history-card strong { font-size: 13px; }
.is-studio .history-card span { font-size: 11px; margin-top: 2px; }

body.preview-lock {
    height: 100vh;
    overflow: hidden;
}
body.preview-lock .page-preview {
    height: 100vh;
    max-width: none;
    padding: 8px 14px 10px;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
}
body.preview-lock .topbar { margin-bottom: 6px; }
body.preview-lock .brand img { height: 28px; }
body.preview-lock .preview-page {
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
body.preview-lock .preview-hero {
    margin: 0;
    padding: 8px 12px;
    align-items: center;
    border-radius: 14px;
    box-shadow: none;
}
body.preview-lock .preview-hero h1 { font-size: 18px; }
body.preview-lock .meta-row { margin-top: 6px; }
body.preview-lock .btn { height: 34px; }
.done-stack {
    display: grid;
    justify-items: end;
    gap: 3px;
}
.done-stack form { margin: 0; }
.done-cost {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
    text-align: right;
}
.category-stage {
    min-height: 0;
    flex: 1;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 8px;
}
.category-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.category-nav strong {
    color: var(--navy);
    font-size: 13px;
    text-align: center;
}
.category-scroller {
    min-height: 0;
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
}
.category-scroller > .category {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    margin: 0;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    overflow: auto;
}
body.preview-lock .preview-page .category { padding: 12px; }
body.preview-lock .preview-page .parents { margin-top: 8px; gap: 8px; }
body.preview-lock .preview-page .collections { margin-top: 8px; gap: 8px; }
body.preview-lock .preview-page .category > .node-block .node-card,
body.preview-lock .preview-page .parent > .node-block .node-card,
body.preview-lock .preview-page .collection > .node-block .node-card,
body.preview-lock .preview-page .product .node-card {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 10px;
}
body.preview-lock .preview-page .category > .node-block .photo-frame,
body.preview-lock .preview-page .parent > .node-block .photo-frame,
body.preview-lock .preview-page .collection > .node-block .photo-frame,
body.preview-lock .preview-page .product .photo-frame {
    width: 96px;
    height: 64px;
    border-radius: 10px;
}
body.preview-lock .preview-page .photo-btn {
    height: 22px;
    padding: 0 4px;
    font-size: 10px;
}
body.preview-lock .preview-page .product .node-body { padding: 0; }
body.preview-lock .preview-page .products {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 8px;
    margin-top: 8px;
}
body.preview-lock .preview-page h2 { font-size: 20px; }
body.preview-lock .preview-page h3 { font-size: 16px; }
body.preview-lock .preview-page h4 { font-size: 14px; }
body.preview-lock .preview-page .desc {
    -webkit-line-clamp: 1;
    margin-top: 2px;
    font-size: 12px;
}
body.preview-lock .preview-page .ar { font-size: 12px; }
body.preview-lock .open-photo {
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in;
}
body.preview-lock .open-photo img { width: 100%; height: 100%; object-fit: cover; }
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: grid;
    place-items: center;
    padding: 28px;
    background: rgba(8, 18, 32, 0.9);
}
.lightbox[hidden] { display: none; }
.lightbox img {
    max-width: min(1100px, 92vw);
    max-height: 86vh;
    object-fit: contain;
    border-radius: 14px;
    background: #0d2744;
}
.lightbox-close { position: absolute; top: 16px; right: 16px; }

.stream-head { flex: 1; min-width: 0; }
.stream-line {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}
.stream-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gold);
    flex: none;
    animation: stream-pulse 1.2s ease-out infinite;
}
@keyframes stream-pulse {
    70% { box-shadow: 0 0 0 6px rgba(230, 179, 37, 0); }
    100% { box-shadow: 0 0 0 0 rgba(230, 179, 37, 0); }
}
.stream-line p {
    margin: 0;
    color: var(--navy);
    font-size: 13px;
    font-weight: 700;
}
.stream-line b {
    margin-left: auto;
    color: var(--gold-deep);
    font-size: 12px;
}
.stream-log {
    max-height: 68px;
    overflow: auto;
    margin: 6px 0 0;
    padding: 0;
    list-style: none;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}
body.is-failed .stream-dot { animation: none; background: var(--danger); }
.node-block.is-waiting [data-field="name"] { color: #8b97a8; }
.node-block.is-writing .node-card { box-shadow: inset 0 0 0 2px rgba(230, 179, 37, 0.95); border-radius: 12px; }
.node-block.is-writing .thumb-empty,
.node-block.is-waiting .thumb-empty { animation: stream-pulse 1.6s ease-out infinite; }
