


.switch { position: relative; width: 48px; height: 26px; flex-shrink: 0; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch__slot {
    position: absolute; inset: 0;
    background: var(--surface-3);
    border: 1px solid var(--border-mid);
    border-radius: 999px;
    cursor: pointer;
    transition: 0.2s;
}
.switch__slot::before {
    content: "";
    position: absolute;
    top: 2px; right: 3px;
    width: 18px; height: 18px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: 0.22s;
}
.switch input:checked + .switch__slot {
    background: var(--accent);
    border-color: var(--accent);
}
.switch input:checked + .switch__slot::before {
    background: #fff;
    right: calc(100% - 21px);
}


.alert {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13.5px;
}
.alert-success { background: var(--color-success-soft); border: 1px solid var(--color-success); color: var(--color-success); }
.alert-danger  { background: var(--color-danger-soft);  border: 1px solid var(--color-danger);  color: var(--color-danger); }
.alert-warning { background: var(--color-warning-soft); border: 1px solid var(--color-warning); color: var(--color-warning); }


.setting-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(360px, 100%), 1fr));
    gap: 18px;
}
.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px dashed var(--border-soft);
    gap: 14px;
}
.setting-row:last-child { border-bottom: 0; }
.setting-row__label {
    font-size: 13px;
    color: var(--text-main);
    font-weight: 600;
    flex: 1 1 auto;
    line-height: 1.7;
}
.setting-row__hint {
    display: block;
    font-size: 11.5px;
    color: var(--text-muted);
    font-weight: 400;
    margin-top: 2px;
}
.setting-row__control { flex-shrink: 0; }
.setting-row input[type="number"],
.setting-row input[type="text"] {
    width: 130px;
    padding: 7px 10px;
    border-radius: 7px;
    background: var(--surface-3);
    border: 1px solid var(--border-mid);
    color: var(--text-main);
    font-family: 'Arad', sans-serif;
    font-size: 13px;
    text-align: center;
}
.setting-row input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
@media (max-width: 480px) {
    .setting-row { flex-wrap: wrap; }
    .setting-row input[type="text"] { width: 100%; }
}

.save-bar {
    position: sticky;
    bottom: 0;
    margin-top: 24px;
    padding: 14px 0;
    background: linear-gradient(180deg, transparent, var(--bg-grad-bot) 30%);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    align-items: center;
    z-index: 5;
}


.panel-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(380px, 100%), 1fr));
    gap: 16px;
}
.panel-card {
    background: linear-gradient(180deg, var(--glass-sheen), transparent 38%), var(--surface-2);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    overflow: hidden;
    transition: border-color .15s;
    backdrop-filter: blur(18px) saturate(135%);
    -webkit-backdrop-filter: blur(18px) saturate(135%);
    box-shadow: var(--shadow-1), var(--glass-edge);
}
.panel-card:hover { border-color: var(--accent-mid); }
.panel-card__head {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 14px;
    background: rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid var(--border-soft);
    gap: 10px;
    flex-wrap: wrap;
}
[data-theme="light"] .panel-card__head { background: rgba(0, 0, 0, 0.03); }
.panel-card__name {
    display: flex; align-items: center; gap: 8px;
    font-weight: 700; font-size: 14px;
    flex-wrap: wrap;
}
.panel-card__name .badge { font-size: 11px; }
.panel-card__actions { display: flex; gap: 6px; flex-shrink: 0; }
.panel-card__body { padding: 14px; }
.panel-card__info {
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 1px dashed var(--border-soft);
    font-size: 12.5px;
}
.info-line { display: flex; gap: 6px; padding: 3px 0; flex-wrap: wrap; }
.info-line__k { color: var(--text-muted); font-weight: 600; min-width: 70px; }
.info-line__v { color: var(--text-main); word-break: break-all; }
.info-line__v.ltr { direction: ltr; font-family: 'JetBrains Mono', monospace; font-size: 11.5px; }

.panel-card__toggles {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}
.toggle-row {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}
.toggle-row .switch__slot {
    position: relative !important;
    width: 36px; height: 20px;
    inset: auto;
    flex-shrink: 0;
}
.toggle-row input { display: none; }
.toggle-row .switch__slot::before {
    width: 14px; height: 14px; top: 2px; right: 3px;
}
.toggle-row input:checked + .switch__slot { background: var(--accent); border-color: var(--accent); }
.toggle-row input:checked + .switch__slot::before {
    background: #fff;
    right: calc(100% - 17px);
}
.toggle-row__label {
    font-size: 12.5px;
    color: var(--text-main);
}
.emergency-config {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--accent-mid);
}
@media (max-width: 480px) {
    .panel-card__toggles { grid-template-columns: 1fr; }
}


.view-toggle {
    display: inline-flex;
    background: var(--surface-2);
    border: 1px solid var(--border-mid);
    border-radius: 10px;
    padding: 3px;
    gap: 2px;
}
.view-toggle__btn {
    background: transparent;
    border: 0;
    padding: 7px 11px;
    border-radius: 7px;
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    transition: background .15s, color .15s;
}
.view-toggle__btn:hover { color: var(--text-main); }
.view-toggle__btn.active {
    background: var(--accent);
    color: #fff;
}
.view-toggle__btn.active .svg-icon { stroke: #fff; }
@media (max-width: 480px) {
    .view-toggle__btn { padding: 6px 9px; }
}


.saved-toast {
    background: var(--color-success-soft);
    border: 1px solid var(--color-success);
    color: var(--color-success);
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}
