.ssb-page {
    --ssb-bg: #090f1d;
    --ssb-panel: #101a2d;
    --ssb-panel-strong: #15223a;
    --ssb-border: rgba(148, 163, 184, 0.16);
    --ssb-border-strong: rgba(103, 232, 249, 0.42);
    --ssb-text: #f8fafc;
    --ssb-muted: #94a3b8;
    --ssb-primary: #22d3ee;
    --ssb-primary-strong: #0891b2;
    width: min(1580px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 64px;
    color: var(--ssb-text);
}

.ssb-page *,
.ssb-page *::before,
.ssb-page *::after {
    box-sizing: border-box;
}

.ssb-page button,
.ssb-page input,
.ssb-page textarea,
.ssb-page select {
    font: inherit;
}

.ssb-pagebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 4px 4px 14px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--ssb-border);
}

.ssb-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    color: #67e8f9;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.ssb-pagebar h1 {
    margin: 0;
    font-family: var(--font-pixel, inherit);
    font-size: clamp(20px, 2vw, 25px);
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.ssb-pagebar p {
    margin: 5px 0 0;
    color: var(--ssb-muted);
    font-size: 13px;
}

.ssb-pagebar__facts {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.ssb-pagebar__facts span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 32px;
    padding: 0 10px;
    border: 1px solid var(--ssb-border);
    border-radius: 10px;
    background: rgba(30, 41, 59, 0.56);
    color: #cbd5e1;
    font-size: 12px;
    font-weight: 700;
}

.ssb-workspace {
    display: grid;
    grid-template-columns: minmax(370px, 470px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.ssb-editor,
.ssb-preview-panel {
    border: 1px solid var(--ssb-border);
    border-radius: 18px;
    background: rgba(9, 15, 29, 0.9);
    box-shadow: 0 22px 70px rgba(2, 6, 23, 0.28);
}

.ssb-editor {
    overflow: hidden;
}

.ssb-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 10px;
    gap: 6px;
    border-bottom: 1px solid var(--ssb-border);
    background: rgba(15, 23, 42, 0.76);
}

.ssb-steps button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-width: 0;
    min-height: 42px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease;
}

.ssb-steps button:hover,
.ssb-steps button:focus-visible {
    color: #cbd5e1;
    background: rgba(30, 41, 59, 0.68);
    outline: none;
}

.ssb-steps button.is-active {
    color: #ecfeff;
    border-color: rgba(34, 211, 238, 0.34);
    background: rgba(8, 145, 178, 0.2);
}

.ssb-steps b {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 7px;
    background: rgba(100, 116, 139, 0.16);
    font-size: 11px;
}

.ssb-steps button.is-active b {
    background: #0891b2;
    color: white;
}

.ssb-steps span {
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 12px;
    font-weight: 800;
}

.ssb-panel {
    min-height: 584px;
    padding: 24px;
}

.ssb-panel[hidden] {
    display: none;
}

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

.ssb-panel__heading > svg {
    color: var(--ssb-primary);
}

.ssb-panel__heading span {
    display: block;
    margin-bottom: 3px;
    color: #67e8f9;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.ssb-panel__heading h2 {
    margin: 0;
    font-size: 21px;
    line-height: 1.25;
}

.ssb-panel__intro {
    margin: -10px 0 18px;
    color: var(--ssb-muted);
    font-size: 13px;
    line-height: 1.7;
}

.ssb-field {
    display: block;
    margin-bottom: 17px;
}

.ssb-field > span {
    display: block;
    margin-bottom: 8px;
    color: #dbeafe;
    font-size: 12px;
    font-weight: 800;
}

.ssb-field input,
.ssb-field textarea,
.ssb-field select {
    width: 100%;
    border: 1px solid var(--ssb-border);
    border-radius: 10px;
    background: rgba(2, 6, 23, 0.62);
    color: var(--ssb-text);
    padding: 11px 12px;
    outline: none;
    transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.ssb-field textarea {
    min-height: 104px;
    resize: vertical;
    line-height: 1.6;
}

.ssb-field input::placeholder,
.ssb-field textarea::placeholder {
    color: #475569;
}

.ssb-field input:focus,
.ssb-field textarea:focus,
.ssb-field select:focus {
    border-color: rgba(34, 211, 238, 0.68);
    background: rgba(8, 15, 31, 0.9);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.1);
}

.ssb-field small {
    display: block;
    margin-top: 7px;
    color: #64748b;
    font-size: 11px;
    line-height: 1.55;
}

.ssb-inline-field {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

.ssb-field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.ssb-field-grid--compact {
    margin-top: 18px;
}

.ssb-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: 10px;
    color: white;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 160ms ease, border-color 160ms ease, background-color 160ms ease, opacity 160ms ease;
}

.ssb-button:hover:not(:disabled) {
    transform: translateY(-1px);
}

.ssb-button:focus-visible {
    outline: 3px solid rgba(34, 211, 238, 0.24);
    outline-offset: 2px;
}

.ssb-button:disabled {
    opacity: 0.5;
    cursor: wait;
}

.ssb-button--primary {
    background: #0891b2;
    border-color: #22d3ee;
}

.ssb-button--primary:hover:not(:disabled) {
    background: #0e7490;
}

.ssb-button--secondary,
.ssb-button--quiet {
    background: rgba(30, 41, 59, 0.74);
    border-color: var(--ssb-border);
    color: #cbd5e1;
}

.ssb-button--secondary:hover:not(:disabled),
.ssb-button--quiet:hover:not(:disabled) {
    border-color: rgba(148, 163, 184, 0.35);
    background: rgba(51, 65, 85, 0.78);
}

.ssb-button--download {
    min-height: 46px;
    background: #7c3aed;
    border-color: #a78bfa;
    box-shadow: 0 10px 24px rgba(76, 29, 149, 0.25);
}

.ssb-button--download:hover:not(:disabled) {
    background: #6d28d9;
}

.ssb-notice {
    margin: -4px 0 16px;
    padding: 11px 12px;
    border: 1px solid rgba(34, 211, 238, 0.24);
    border-radius: 10px;
    background: rgba(8, 145, 178, 0.1);
    color: #a5f3fc;
    font-size: 12px;
    line-height: 1.55;
}

.ssb-notice.is-error {
    border-color: rgba(248, 113, 113, 0.34);
    background: rgba(127, 29, 29, 0.16);
    color: #fecaca;
}

.ssb-template-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.ssb-template-card {
    position: relative;
    min-height: 184px;
    padding: 16px;
    border: 1px solid var(--ssb-border);
    border-radius: 3px;
    background: rgba(9, 15, 29, 0.76);
    color: #e2e8f0;
    text-align: left;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.ssb-template-card:hover,
.ssb-template-card:focus-visible {
    transform: translateY(-2px);
    border-color: rgba(148, 163, 184, 0.38);
    outline: none;
}

.ssb-template-card.is-active {
    border-color: var(--template-accent, #22d3ee);
    background: rgba(15, 23, 42, 0.94);
    box-shadow: inset 3px 0 0 var(--template-accent, #22d3ee);
}

.ssb-template-card__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 17px;
}

.ssb-template-card__icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid color-mix(in srgb, var(--template-accent, #22d3ee) 52%, transparent);
    border-radius: 1px;
    background: transparent;
    color: var(--template-accent, #22d3ee);
}

.ssb-template-card__code {
    color: #475569;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.ssb-template-card strong,
.ssb-template-card small {
    display: block;
}

.ssb-template-card strong {
    margin-bottom: 5px;
    color: #f8fafc;
    font-size: 14px;
}

.ssb-template-card small {
    color: #94a3b8;
    font-size: 11px;
    line-height: 1.5;
}

.ssb-template-card__traits {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 13px;
}

.ssb-template-card__traits em {
    padding: 3px 6px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    color: #64748b;
    font-size: 9px;
    font-style: normal;
    font-weight: 750;
}

.ssb-template-card__check {
    position: absolute;
    top: 12px;
    right: 12px;
    display: none;
    color: #67e8f9;
}

.ssb-template-card.is-active .ssb-template-card__check {
    display: block;
}

.ssb-smart-layout {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 11px;
    margin-bottom: 14px;
    padding: 13px 14px;
    border: 1px solid rgba(34, 211, 238, 0.24);
    border-radius: 11px;
    background: rgba(8, 145, 178, 0.09);
    color: #a5f3fc;
}

.ssb-smart-layout svg,
.ssb-smart-layout img {
    margin-top: 2px;
}

.ssb-smart-layout b,
.ssb-smart-layout span {
    display: block;
}

.ssb-smart-layout b {
    color: #ecfeff;
    font-size: 12px;
}

.ssb-smart-layout span {
    margin-top: 4px;
    color: #94a3b8;
    font-size: 11px;
    line-height: 1.55;
}

.ssb-toggle-list {
    display: grid;
    gap: 8px;
    margin-bottom: 20px;
}

.ssb-toggle-list label {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--ssb-border);
    border-radius: 11px;
    background: rgba(15, 23, 42, 0.6);
    cursor: pointer;
}

.ssb-toggle-list label:hover {
    border-color: rgba(148, 163, 184, 0.34);
}

.ssb-toggle-list input {
    width: 18px;
    height: 18px;
    accent-color: #0891b2;
}

.ssb-toggle-list b,
.ssb-toggle-list small {
    display: block;
}

.ssb-toggle-list b {
    color: #e2e8f0;
    font-size: 12px;
}

.ssb-toggle-list small {
    margin-top: 3px;
    color: #64748b;
    font-size: 10px;
    line-height: 1.45;
}

.ssb-slides {
    display: grid;
    gap: 10px;
}

.ssb-slide-card {
    border: 1px solid var(--ssb-border);
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.7);
    overflow: hidden;
}

.ssb-slide-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 42px;
    padding: 0 12px;
    border-bottom: 1px solid var(--ssb-border);
}

.ssb-slide-card__head strong {
    font-size: 12px;
}

.ssb-slide-card__actions {
    display: flex;
    gap: 4px;
}

.ssb-slide-card__actions button {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
}

.ssb-slide-card__actions button:hover,
.ssb-slide-card__actions button:focus-visible {
    background: rgba(51, 65, 85, 0.72);
    color: white;
    outline: none;
}

.ssb-slide-card__body {
    padding: 12px;
}

.ssb-slide-card__body .ssb-field:last-child {
    margin-bottom: 0;
}

.ssb-slide-card__body .ssb-field {
    margin-bottom: 10px;
}

.ssb-add-slide {
    width: 100%;
    margin-top: 10px;
}

.ssb-editor__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-top: 1px solid var(--ssb-border);
    background: rgba(15, 23, 42, 0.7);
}

.ssb-preview-panel {
    position: sticky;
    top: 86px;
    overflow: hidden;
}

.ssb-preview-toolbar,
.ssb-export-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    background: rgba(15, 23, 42, 0.76);
}

.ssb-preview-toolbar {
    border-bottom: 1px solid var(--ssb-border);
}

.ssb-preview-toolbar > div:first-child {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.ssb-preview-toolbar strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    color: #cbd5e1;
}

.ssb-preview-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #67e8f9;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.ssb-preview-status i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.1);
}

.ssb-device-switch {
    display: flex;
    gap: 4px;
    padding: 3px;
    border: 1px solid var(--ssb-border);
    border-radius: 10px;
    background: rgba(2, 6, 23, 0.58);
}

.ssb-device-switch button {
    display: grid;
    place-items: center;
    width: 34px;
    height: 30px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #64748b;
    cursor: pointer;
}

.ssb-device-switch button.is-active {
    background: #1e293b;
    color: #67e8f9;
}

.ssb-preview-stage {
    display: flex;
    justify-content: center;
    min-height: 720px;
    padding: 14px;
    background: #050914;
    overflow: auto;
}

.ssb-preview-stage iframe {
    width: 100%;
    min-height: 690px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 12px;
    background: #0b1220;
    transition: width 220ms ease, border-radius 220ms ease;
}

.ssb-preview-stage.is-mobile iframe {
    width: min(390px, 100%);
    border-radius: 22px;
    box-shadow: 0 20px 70px rgba(0, 0, 0, 0.42);
}

.ssb-export-bar {
    border-top: 1px solid var(--ssb-border);
}

.ssb-export-bar strong,
.ssb-export-bar span {
    display: block;
}

.ssb-export-bar strong {
    margin-bottom: 3px;
    font-size: 13px;
}

.ssb-export-bar span {
    color: #64748b;
    font-size: 11px;
}

.ssb-export-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.ssb-export-status {
    min-height: 22px;
    margin: 0;
    padding: 0 16px 12px;
    background: rgba(15, 23, 42, 0.76);
    color: #67e8f9;
    font-size: 11px;
    text-align: right;
}

@media (max-width: 1180px) {
    .ssb-workspace {
        grid-template-columns: minmax(330px, 410px) minmax(0, 1fr);
    }

    .ssb-preview-stage {
        min-height: 620px;
    }

    .ssb-preview-stage iframe {
        min-height: 590px;
    }

    .ssb-export-bar {
        align-items: flex-start;
        flex-direction: column;
    }

    .ssb-export-actions {
        width: 100%;
    }

    .ssb-export-actions .ssb-button {
        flex: 1;
    }
}

@media (max-width: 900px) {
    .ssb-page {
        width: min(100% - 24px, 760px);
        padding-top: 18px;
    }

    .ssb-pagebar {
        align-items: flex-start;
        flex-direction: column;
    }

    .ssb-pagebar__facts {
        justify-content: flex-start;
    }

    .ssb-workspace {
        grid-template-columns: minmax(0, 1fr);
    }

    .ssb-preview-panel {
        position: relative;
        top: auto;
    }
}

@media (max-width: 560px) {
    .ssb-page {
        width: min(100% - 16px, 520px);
    }

    .ssb-pagebar {
        padding: 2px 2px 12px;
    }

    .ssb-pagebar__facts {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        width: 100%;
    }

    .ssb-pagebar__facts span {
        justify-content: center;
        padding: 0 7px;
        text-align: center;
    }

    .ssb-steps {
        grid-template-columns: repeat(4, 1fr);
    }

    .ssb-steps button {
        flex-direction: column;
        gap: 3px;
        min-height: 52px;
    }

    .ssb-panel {
        min-height: 0;
        padding: 18px;
    }

    .ssb-field-grid,
    .ssb-template-grid,
    .ssb-inline-field {
        grid-template-columns: minmax(0, 1fr);
    }

    .ssb-inline-field .ssb-button {
        width: 100%;
    }

    .ssb-editor__footer,
    .ssb-export-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ssb-preview-stage {
        min-height: 620px;
        padding: 8px;
    }

    .ssb-preview-stage iframe {
        min-height: 600px;
    }

    .ssb-preview-toolbar > div:first-child strong {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ssb-page *,
    .ssb-page *::before,
    .ssb-page *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
