:root {
    color-scheme: dark;
    scrollbar-color: #67517e #141021;
    font-family: 'Segoe UI', system-ui, sans-serif;
    color: #f3f0ff;
    background: #0c0918;
    --accent: #a44dff;
    --cyan: #52ddff;
    --card: #171127;
    --line: #352a4f;
    --text-soft: #c3b8d8;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
a { color: inherit; }
.workspace {
    min-height: 100vh; display: grid; grid-template-columns: 246px minmax(0, 1fr);
    background: radial-gradient(ellipse at 60% 0, #24173e 0, transparent 45%), #0c0918;
}
.sidebar {
    position: sticky; top: 0; height: 100dvh; overflow: auto; padding: 20px 16px;
    background: linear-gradient(165deg, #19112e, #100d20 72%); border-right: 1px solid #3b3055;
}
.brand { display: inline-block; width: 172px; height: 70px; border-radius: 8px; overflow: hidden; }
.brand img { width: 100%; height: 100%; object-fit: cover; object-position: center 38%; display: block; }
.sidebar .brand { margin: 0 0 14px 9px; }
.sidebar-menu > summary { display: none; }
.sector-nav { display: grid; gap: 13px; }
.nav-group { display: grid; gap: 2px; align-content: start; }
.nav-group p, .sector-label {
    margin: 0 0 4px; color: #c2a8ec; font-size: .74rem; font-weight: 700;
    line-height: 1.3; letter-spacing: .08em; text-transform: uppercase;
}
.nav-group p { padding: 0 11px; }
.sidebar nav a, .quiet {
    display: block; padding: 6px 11px; text-decoration: none; border: 1px solid transparent;
    border-radius: 8px; color: var(--text-soft); font-size: .90rem;
}
.sidebar nav a:hover { color: #fff; background: #29203c; }
.sidebar nav a[aria-current] {
    color: #fff; background: linear-gradient(100deg, #402362, #211e41);
    border-color: #5f407d; box-shadow: inset 3px 0 var(--cyan); font-weight: 650;
}
.sidebar .quiet { margin-top: 17px; background: transparent; border-color: #4b3c66; }
.main { width: min(100%, 1270px); margin-inline: auto; min-width: 0; padding: 32px clamp(18px, 4vw, 52px) 56px; }
.page-header {
    display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 14px;
    padding-bottom: 17px; margin-bottom: 20px; border-bottom: 1px solid #46365e;
}
.page-header .sector-label { display: block; }
.page-header p { margin: .4rem 0 0; }
h1, h2 { margin: 0; line-height: 1.17; letter-spacing: -.035em; }
h1 { font-size: clamp(1.75rem, 5vw, 2.6rem); }
h2 { font-size: 1.2rem; }
p { color: var(--text-soft); line-height: 1.55; margin: .7rem 0 1rem; }
.card { border: 1px solid #45365f; background: var(--card); border-radius: 16px; padding: clamp(15px, 2.35vw, 24px); min-width: 0; }
.overview { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; }
.overview-card { display: flex; flex-direction: column; align-items: stretch; gap: 12px; }
.overview-card .actions { margin-top: auto; }
.overview-card p, .overview-card .endpoint { margin: 0; }
.overview-card .overview-value { color: #f3ebff; font-weight: 650; }
.primary-card { background: linear-gradient(135deg, #322051, #1b1936 75%); border-color: #6a4c8d; }
.stack { display: grid; gap: 16px; }
.endpoint { display: block; word-break: break-all; font-size: 1rem; color: #9bebff; background: #100d23; border-radius: 8px; border: 1px solid var(--line); padding: .85rem; margin-top: 1rem; }
.form { display: grid; gap: 17px; }
.form p { margin: 0; }
.form .endpoint { margin-top: 0; }
.form label { display: grid; gap: 6px; font-size: .94rem; font-weight: 600; }
.form label small { color: var(--text-soft); font-weight: 400; }
.form input:not([type=checkbox]), .form select, .form textarea { background: #100c1e; border: 1px solid #625179; border-radius: 7px; padding: 10px 12px; max-width: 100%; min-width: 0; color: #f3f0ff; }
.form textarea { resize: vertical; }
.form .toggle { display: flex; align-items: center; gap: 10px; min-height: 30px; }
.appearance-fields { display: grid; gap: 11px; min-width: 0; }
.appearance-fields input:not([type=checkbox]) { padding-block: 8px; }
.appearance-preview { width: min(100%, 320px); min-width: 0; }
.appearance-preview h2 { margin-bottom: 10px; }
.appearance-preview p { margin-top: 5px; }
.appearance-preview .preview-status { font-size: .84rem; color: #ffc8d6; }
.preview-screen {
    position: relative; isolation: isolate; aspect-ratio: 16 / 9; overflow: hidden;
    background: linear-gradient(145deg, #222544, #100d22); border: 1px solid #655382; border-radius: 10px;
    display: grid; grid-template-rows: auto 1fr; padding: 9px; gap: 7px;
}
.preview-wallpaper { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .5; z-index: -1; }
.preview-brand { color: #ded4ff; font-weight: 800; letter-spacing: .06em; font-size: .7rem; }
.preview-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; min-height: 0; }
.preview-tile {
    display: grid; grid-template-rows: minmax(0, 1fr) auto; justify-items: center; align-items: center; gap: 3px;
    padding: 4px; border: 1px solid #53587a; border-radius: 7px; background: #1a1c35db; font-size: .67rem;
}
.preview-tile img { width: 100%; height: 100%; max-width: 48px; max-height: 48px; object-fit: contain; }
.preview-tile span { grid-row: 2; text-align: center; }
@media (min-width: 1050px) {
    .appearance-form { grid-template-columns: minmax(0, 1fr) minmax(220px, 320px); align-items: start; }
    .appearance-fields { grid-area: 1 / 1; }
    .appearance-preview { grid-area: 1 / 2; }
    .appearance-form .actions { grid-column: 1 / -1; }
}
.toggle input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.protocol-nav { margin-bottom: 16px; }
details summary { cursor: pointer; margin-bottom: 8px; }
[data-tone] { --notice-color: #d5bfff; --notice-edge: #604d81; }
[data-tone="maintenance"] { --notice-color: #ff9ea9; --notice-edge: #884a5b; }
[data-tone="attention"] { --notice-color: #ffd48c; --notice-edge: #8c633d; }
[data-tone="resolved"] { --notice-color: #9af0b2; --notice-edge: #487a62; }
.notice-current {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px;
    border-inline-start: 3px solid var(--notice-edge);
}
.notice-current > div { flex: 1 1 280px; min-width: 0; }
.notice-current p { margin: 6px 0 0; color: #f3edff; overflow-wrap: anywhere; }
.notice-current .notice-tone { display: inline-block; margin-top: 7px; }
.notice-tone { color: var(--notice-color); font-size: .82rem; }
.notice-form-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.notice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.notice-group, .notice-model {
    min-width: 0; margin: 0; padding: 8px; border: 1px solid var(--notice-edge, #564370);
    border-radius: 10px; background: #151025;
}
.notice-group legend { padding: 0 5px; font-weight: 650; }
.form .notice-choice {
    display: flex; align-items: flex-start; gap: 8px; padding: 7px 6px; border-radius: 7px;
    font-size: .87rem; font-weight: 500; line-height: 1.4; cursor: pointer;
}
.notice-choice:hover, .notice-choice:has(input:checked) { background: #2c2243; }
.notice-choice input { flex: 0 0 auto; margin: 3px 0 0; accent-color: var(--notice-color, var(--accent)); }
.notice-choice span { min-width: 0; overflow-wrap: anywhere; }
.notice-choice strong { display: block; color: var(--notice-color); font-size: .78rem; margin-bottom: 3px; }
.notice-models { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 8px; }
.notice-model a { display: inline-block; margin: 3px 6px 1px; color: #cbb2fa; font-size: .82rem; }
.notice-editor summary { font-weight: 650; margin: 0; }
.notice-editor[open] summary { margin-bottom: 14px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
button, .button { background: linear-gradient(110deg, #8634d8, #4248bb); color: white; border-radius: 8px; border: 1px solid transparent; padding: 9px 15px; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-block; }
button:hover, .button:hover { filter: brightness(1.13); }
.secondary { background: #211835; border-color: #655382; color: #eadbff; }
.danger { background: #2c1727; border-color: #784353; color: #ffb8c5; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.alert { padding: 12px 16px; border-radius: 9px; margin: 0 0 16px; color: #acf3e9; background: #123437; }
.alert.error { color: #ffc8d6; background: #3c1c31; }
.result { margin-bottom: 16px; }
dl { padding: 0; margin-bottom: 0; }
dl div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
dd { margin: 0; font-weight: 600; }
pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; border-radius: 8px; padding: 14px; background: #100d23; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(ellipse at 26% 0%, #33135a 0, transparent 51%), radial-gradient(ellipse at 95% 80%, #11244a 0, transparent 49%), #0c0918; }
.login-card { width: min(100%, 430px); padding: 34px; box-shadow: 0 18px 80px #080512b3; }
.login-card h1 { font-size: 1.75rem; margin: 18px 0 20px; }
.login-card .brand { width: 218px; height: 92px; }
@media (max-width: 750px) {
    .workspace { grid-template-columns: minmax(0, 1fr); }
    .sidebar {
        position: static; height: auto; display: grid; grid-template-columns: minmax(0, 1fr) auto;
        align-items: center; gap: 4px 12px; padding: 10px 15px; border-right: 0; border-bottom: 1px solid #3b3055;
    }
    .sidebar .brand { margin: 0 0 0 4px; height: 50px; width: 145px; }
    .sidebar-menu { grid-row: 2; grid-column: 1 / -1; }
    .sidebar-menu > summary { display: list-item; margin: 0; padding: 8px; color: #e7d9ff; font-weight: 650; }
    .sector-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 8px; padding: 8px 0; }
    .sidebar .quiet { margin-top: 0; }
    .main { padding-top: 20px; }
    .overview, .two, .notice-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (min-width: 751px) and (max-width: 950px) {
    .notice-grid { grid-template-columns: minmax(0, 1fr); }
}
