.web-content.st-embed {
    --accent: #5a0dd6;
    --accent-2: #4900c2;
    --accent-soft: rgba(73, 0, 194, 0.22);
    --accent-text: #c4b5fd;
    --bg: #0b0c10;
    --panel: #121218;
    --panel-elevated: #18181f;
    --surface: rgba(255, 255, 255, 0.04);
    --surface-hover: rgba(255, 255, 255, 0.07);
    --border: rgba(255, 255, 255, 0.1);
    --text: #f2f4f8;
    --text-dim: #a8b0c0;
    --ok: #34d399;
    --warn: #fbbf24;
    --danger: #f87171;
    --stealth-cut: 12px 2px 2px 2px;
    --stealth-cut-sm: 8px 2px 2px 2px;
    --stealth-cut-lg: 14px 4px 4px 4px;
    --stealth-cut-panel: 22px 4px 4px 4px;
    --shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
    --transition: 0.15s ease;
}

.web-content.st-embed *,
.web-content.st-embed *::before,
.web-content.st-embed *::after {
    box-sizing: border-box;
}

.web-content.st-embed {
    width: 100%;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
}

.web-content.st-embed,
.web-content.st-embed,
.web-content.st-embed {
    background: var(--bg) !important;
    color: var(--text) !important;
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Open Sans', sans-serif;
    -webkit-font-smoothing: subpixel-antialiased;
    width: 100%;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
}

.web-content.st-embed {
    --bg: #0a0a0f;
    --panel: #121218;
    --panel-elevated: #18181f;
    --surface: rgba(255, 255, 255, 0.04);
    --surface-hover: rgba(255, 255, 255, 0.08);
    --border: rgba(255, 255, 255, 0.12);
    --text: #ffffff;
    --text-dim: #a1a1aa;
    --accent: #5a0dd6;
    --accent-2: #4900c2;
    --accent-text: #c4b5fd;
    --accent-soft: rgba(73, 0, 194, 0.22);
}

.web-content.st-embed[data-docs-unused-light] {
    --bg: #d4cec4;
    --panel: #f0ebe3;
    --panel-elevated: #f7f3ec;
    --surface: rgba(255, 255, 255, 0.72);
    --surface-hover: rgba(255, 255, 255, 0.9);
    --border: rgba(55, 48, 40, 0.16);
    --text: #1c1916;
    --text-dim: #5c574f;
    --accent: #5a0dd6;
    --accent-2: #4900c2;
    --accent-text: #5a0dd6;
    --accent-soft: rgba(90, 13, 214, 0.12);
}

.web-content.st-embed[data-docs-unused-stealth] {
    --bg: #0e0a16;
    --panel: #140f1c;
    --panel-elevated: #1a1426;
    --surface: rgba(124, 58, 237, 0.08);
    --surface-hover: rgba(124, 58, 237, 0.16);
    --border: rgba(168, 85, 247, 0.22);
    --text: #eae2ff;
    --text-dim: #c7b6f7;
    --accent: #5a0dd6;
    --accent-2: #4900c2;
    --accent-text: #c4b5fd;
    --accent-soft: rgba(90, 13, 214, 0.22);
}

.web-content.st-embed[data-docs-unused-glass] {
    --bg: #010103;
    --panel: #0c0c12;
    --panel-elevated: #12121a;
    --surface: rgba(255, 255, 255, 0.06);
    --surface-hover: rgba(255, 255, 255, 0.1);
    --border: rgba(255, 255, 255, 0.14);
    --text: #f2f4f8;
    --text-dim: #c7cdd8;
    --accent: #5a0dd6;
    --accent-2: #4900c2;
    --accent-text: #c4b5fd;
    --accent-soft: rgba(73, 0, 194, 0.22);
}

.web-content.st-embed[data-docs-unused-float] {
    --bg: #0b0c10;
    --panel: #10121a;
    --panel-elevated: #161922;
    --surface: rgba(16, 18, 26, 0.92);
    --surface-hover: rgba(28, 32, 44, 0.95);
    --border: rgba(255, 255, 255, 0.12);
    --text: #f2f4f8;
    --text-dim: #a8b0c0;
    --accent: #5a0dd6;
    --accent-2: #4900c2;
    --accent-text: #c4b5fd;
    --accent-soft: rgba(73, 0, 194, 0.22);
}

#st-boot[hidden],
#st-app[hidden] {
    display: none !important;
}

.st-app {
    width: 100%;
    max-width: min(1100px, 100%);
    margin: 0 auto;
    padding: 18px clamp(12px, 3vw, 36px) 48px;
    color: var(--text);
}

.st-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.st-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.st-logo {
    width: 28px;
    height: 28px;
    border-radius: var(--stealth-cut-sm);
    display: block;
    object-fit: contain;
    filter: brightness(0) saturate(100%) invert(82%) sepia(28%) saturate(1400%) hue-rotate(210deg) brightness(1.05) contrast(98%);
}

.web-content.st-embed[data-docs-unused-light] .st-logo {
    filter: brightness(0) saturate(100%) invert(25%) sepia(98%) saturate(6421%) hue-rotate(270deg) brightness(95%) contrast(120%);
}

.st-title {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--accent-text);
    line-height: 1.15;
}

.st-subtitle {
    color: var(--text-dim);
    font-size: 12px;
    margin-top: 2px;
}

.st-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.st-status-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.st-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--stealth-cut-panel);
    box-shadow: var(--shadow);
}

.st-status-card {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 76px;
}

.st-status-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-dim);
}

.st-status-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.st-status-value.is-on {
    color: var(--ok);
}

.st-status-value.is-off {
    color: var(--text-dim);
}

.st-status-value.is-warn {
    color: var(--warn);
}

.st-section {
    margin-bottom: 18px;
    padding: 18px 18px 16px;
}

.st-section > .st-section-title,
.st-section > .st-section-desc {
    margin-left: 2px;
}

.st-section-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.st-section-desc {
    font-size: 12px;
    color: var(--text-dim);
    margin-bottom: 14px;
    line-height: 1.45;
    max-width: 62ch;
}

.st-row-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.st-mode-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 16px;
    max-width: 420px;
}

.st-field-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-dim);
}

.st-switch {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.st-switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.st-switch-track {
    width: 42px;
    height: 24px;
    border-radius: var(--stealth-cut-sm);
    background: var(--surface);
    border: 1px solid var(--border);
    position: relative;
    flex-shrink: 0;
    transition: background var(--transition), border-color var(--transition);
}

.st-switch-track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 2px;
    background: var(--text-dim);
    transition: transform var(--transition), background var(--transition);
}

.st-switch input:checked + .st-switch-track {
    background: var(--accent-soft);
    border-color: rgba(73, 0, 194, 0.65);
}

.st-switch input:checked + .st-switch-track::after {
    transform: translateX(18px);
    background: linear-gradient(135deg, #5a0dd6, #4900c2);
}

.st-switch input:focus-visible + .st-switch-track {
    box-shadow: 0 0 0 2px var(--accent-soft);
    border-color: var(--accent);
}

.st-switch-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

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

.st-feature-panel {
    display: block;
    padding: 14px 16px;
    cursor: pointer;
    background: var(--panel-elevated);
    transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}

.st-feature-panel:hover {
    border-color: color-mix(in srgb, var(--accent) 45%, transparent);
    background: var(--surface-hover);
}

.st-feature-panel:has(input:checked) {
    border-color: rgba(73, 0, 194, 0.65);
    box-shadow: 0 0 0 1px var(--accent-soft);
    background: linear-gradient(145deg, var(--accent-soft), var(--panel-elevated));
}

.st-feature-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}

.st-feature-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}

.st-feature-desc {
    font-size: 12px;
    color: var(--text-dim);
    line-height: 1.4;
}

.st-feature-panel input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #5a0dd6;
    cursor: pointer;
    flex-shrink: 0;
}

.st-add-form {
    display: grid;
    grid-template-columns: 140px minmax(0, 1.4fr) minmax(0, 1fr) auto;
    gap: 8px;
    margin-bottom: 10px;
}

.st-form-hint {
    font-size: 12px;
    color: var(--danger);
    margin-bottom: 10px;
}

.st-form-hint.is-ok {
    color: var(--ok);
}

.st-input,
.st-select {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: var(--stealth-cut);
    background: var(--surface);
    color: var(--text);
    font-size: 13px;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.st-input::placeholder {
    color: var(--text-dim);
    opacity: 0.85;
}

.st-input:focus,
.st-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-soft);
}

.st-input-narrow {
    width: 96px;
}

.st-select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-color: var(--panel-elevated);
    background-image: linear-gradient(45deg, transparent 50%, var(--text-dim) 50%),
        linear-gradient(135deg, var(--text-dim) 50%, transparent 50%);
    background-position: calc(100% - 16px) calc(50% - 2px), calc(100% - 11px) calc(50% - 2px);
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    padding-right: 28px;
    color: var(--text);
}

.st-select option,
.st-select optgroup {
    background: var(--panel-elevated) !important;
    background-color: #16161f !important;
    color: #f2f4f8 !important;
}

.st-select option:checked,
.st-select option:hover,
.st-select option:focus {
    background: #5a0dd6 !important;
    background-color: #5a0dd6 !important;
    color: #ffffff !important;
}

.web-content.st-embed[data-docs-unused-light] .st-select {
    background-color: #ffffff;
    color: #1c1916;
}

.web-content.st-embed[data-docs-unused-light] .st-select option,
.web-content.st-embed[data-docs-unused-light] .st-select optgroup {
    background: #ffffff !important;
    background-color: #ffffff !important;
    color: #1c1916 !important;
}

.web-content.st-embed[data-docs-unused-light] .st-select option:checked,
.web-content.st-embed[data-docs-unused-light] .st-select option:hover,
.web-content.st-embed[data-docs-unused-light] .st-select option:focus {
    background: #5a0dd6 !important;
    background-color: #5a0dd6 !important;
    color: #ffffff !important;
}

.st-rules-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.st-rule-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--stealth-cut);
    background: var(--surface);
}

.st-rule-row.is-disabled {
    opacity: 0.62;
}

.st-rule-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.st-rule-top {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.st-rule-value {
    font-size: 13px;
    font-weight: 650;
    color: var(--text);
    word-break: break-all;
}

.st-rule-note {
    font-size: 12px;
    color: var(--text-dim);
    word-break: break-word;
}

.st-rule-note-input {
    width: 100%;
    max-width: 420px;
    padding: 5px 8px;
    font-size: 12px;
}

.st-type-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    border-radius: var(--stealth-cut-sm);
    border: 1px solid rgba(73, 0, 194, 0.45);
    background: var(--accent-soft);
    color: var(--accent-text);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.st-rule-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.st-empty {
    text-align: center;
    padding: 28px 16px 18px;
    color: var(--text-dim);
}

.st-empty[hidden] {
    display: none !important;
}

.st-empty i {
    font-size: 28px;
    color: var(--accent-text);
    margin-bottom: 10px;
}

.st-empty h3 {
    font-size: 15px;
    color: var(--text);
    margin-bottom: 6px;
}

.st-empty p {
    font-size: 12px;
    max-width: 42ch;
    margin: 0 auto;
    line-height: 1.45;
}

.st-apply-section {
    margin-bottom: 8px;
}

.st-apply-row {
    align-items: flex-end;
}

.st-dns-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.st-apply-hint {
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-dim);
    min-height: 1.2em;
}

.st-apply-hint.is-ok {
    color: var(--ok);
}

.st-apply-hint.is-err {
    color: var(--danger);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid var(--border);
    border-radius: var(--stealth-cut);
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
    color: var(--text);
    background: var(--surface);
    box-shadow: none;
    transform: none;
    white-space: nowrap;
}

.btn i {
    font-size: 11px;
}

.btn:disabled {
    opacity: 0.55;
    cursor: default;
}

.btn-ghost {
    background: transparent;
    border-color: var(--border);
    color: var(--text-dim);
    font-weight: 500;
}

.btn-ghost:hover:not(:disabled) {
    color: var(--accent-text);
    border-color: rgba(73, 0, 194, 0.55);
    background: var(--accent-soft);
}

.btn-primary {
    background: linear-gradient(135deg, #5a0dd6, #4900c2);
    border-color: rgba(73, 0, 194, 0.75);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(73, 0, 194, 0.28);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #6b1ee0, #5a0dd6);
    border-color: rgba(92, 26, 209, 0.95);
    box-shadow: 0 4px 14px rgba(73, 0, 194, 0.38);
}

.btn-icon {
    width: 30px;
    height: 30px;
    border: 1px solid var(--border);
    border-radius: var(--stealth-cut-sm);
    background: transparent;
    color: var(--text-dim);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.btn-icon:hover {
    color: var(--accent-text);
    border-color: rgba(73, 0, 194, 0.55);
    background: var(--accent-soft);
}

.btn-icon.danger:hover {
    color: #fecaca;
    border-color: rgba(248, 113, 113, 0.55);
    background: rgba(248, 113, 113, 0.12);
}

@media (max-width: 900px) {
    .st-status-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .st-feature-grid {
        grid-template-columns: 1fr;
    }

    .st-add-form {
        grid-template-columns: 1fr 1fr;
    }

    .st-add-form #btn-add-rule {
        grid-column: 1 / -1;
    }
}

@media (max-width: 560px) {
    .st-status-grid {
        grid-template-columns: 1fr;
    }

    .st-add-form {
        grid-template-columns: 1fr;
    }

    .st-rule-row {
        grid-template-columns: 1fr;
    }

    .st-rule-actions {
        justify-content: flex-start;
    }

    .st-apply-row {
        align-items: stretch;
    }

    .st-apply-row .btn-primary {
        width: 100%;
    }
}

.st-app.is-locked .st-status-grid,
.st-app.is-locked .st-section {
    opacity: 0.42;
    filter: grayscale(0.6);
    pointer-events: none;
}

.st-app.is-locked #btn-open-vpn-settings {
    pointer-events: auto;
}
