:root {
    --black: #000;
    --surface-0: #050505;
    --surface-1: #0a0a0a;
    --surface-2: #141414;
    --surface-red: #1c0808;
    --red-dark: #480000;
    --red: #9d1111;
    --red-bright: #ff3030;
    --cyan: #55b8dd;
    --green: #25d366;
    --amber: #d6a82a;
    --white: #f2f2f2;
    --grey-1: #c8c8c8;
    --grey-2: #8b8b8b;
    --grey-3: #555;
    --line: #2a2a2a;
    --side: 292px;
    --top: 48px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--black); color-scheme: dark; scroll-behavior: smooth; }
body { margin: 0; min-width: 280px; background: var(--black); color: var(--white); font: 15px/1.5 "Courier New", Courier, monospace; }
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea, summary { outline: none; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
code, kbd { font-family: inherit; }
kbd { border: 1px solid var(--grey-3); background: #000; color: var(--grey-2); padding: 1px 6px; }
.skip-link { position: fixed; left: 10px; top: -100px; z-index: 999; background: #fff; color: #000; padding: 8px 12px; }
.skip-link:focus { top: 10px; }

/* Global telemetry */
.topbar { position: sticky; top: 0; z-index: 60; min-height: var(--top); display: flex; align-items: center; gap: 20px; padding: 0 18px; border-bottom: 1px solid #333; background: #080808; color: var(--grey-2); font-size: 11px; letter-spacing: .05em; }
.topbar-brand { color: #fff; font-weight: bold; white-space: nowrap; }
.topbar-menu, .sidebar-close { display: none; flex: 0 0 auto; border: 1px solid var(--red); background: #180000; color: #fff; cursor: pointer; padding: 5px 8px; white-space: nowrap; }
.topbar-telemetry { min-width: 0; margin-right: auto; display: flex; align-items: stretch; align-self: stretch; border-left: 1px solid var(--line); }
.topbar-telemetry > span { display: flex; align-items: center; padding: 0 12px; border-right: 1px solid var(--line); white-space: nowrap; }
.topbar-telemetry b { color: var(--white); margin-right: 5px; }
.topbar-status i, .connection-stamp i, .module-status i, .permission-row i { display: inline-block; width: 7px; height: 7px; flex: 0 0 7px; margin-right: 7px; background: var(--green); box-shadow: 0 0 8px rgba(37, 211, 102, .55); }
.topbar-status.fault i, .connection-stamp.fault i { background: var(--red-bright); box-shadow: 0 0 8px rgba(255, 48, 48, .55); }
.sync-stamp { color: #626262; }
.topbar-links { display: flex; align-items: center; gap: 14px; }
.topbar-links a, .topbar-links button { color: #aaa; background: none; border: 0; padding: 0; cursor: pointer; font: inherit; }
.topbar-links a:hover, .topbar-links button:hover { color: #fff; }
.topbar-links form { margin: 0; }

/* Main frame and sidebar */
.dashboard-shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: calc(100vh - var(--top) - 28px); }
.sidebar { position: sticky; top: var(--top); height: calc(100vh - var(--top)); overflow-y: auto; scrollbar-color: var(--red-dark) #080808; background: #0b0303; border-right: 2px solid var(--red); padding: 18px; display: flex; flex-direction: column; gap: 15px; z-index: 50; }
.identity { display: flex; align-items: center; gap: 12px; color: #fff; border-bottom: 2px solid var(--red); padding: 0 0 14px; font-size: 18px; letter-spacing: 2px; font-weight: bold; }
.identity:hover { color: var(--red-bright); text-decoration: none; }
.identity img { width: 58px; height: 58px; object-fit: contain; }
.side-block { border: 1px dotted #6a2020; background: #110606; padding: 10px; }
.side-title { display: block; color: var(--red-bright); border-bottom: 1px solid #4b2525; padding-bottom: 5px; margin-bottom: 7px; letter-spacing: 1px; }
.side-block a { display: block; color: #aaa; padding: 4px 5px; margin: 1px 0; font-size: 12px; }
.side-block a:hover, .side-block a.active-control { color: #fff; background: var(--red-dark); text-decoration: none; }
.side-module-nav { display: grid; gap: 11px; }
.side-module-group { border-top: 1px dashed #542222; padding-top: 8px; }
.side-module-group > strong { display: block; color: #796060; font-size: 9px; letter-spacing: .15em; margin-bottom: 3px; }
.side-module-group a { display: grid; grid-template-columns: 52px 1fr; gap: 5px; color: #888; padding: 4px 6px; font-size: 10px; }
.side-module-group a span { color: #9f3434; font-weight: bold; }
.side-module-group a:hover { color: #fff; background: #170b0b; text-decoration: none; }
.side-module-group a.active-control { background: var(--red); color: #fff; }
.side-module-group a.active-control span { color: #fff; }
.system-block p { font-size: 10px; color: #717171; margin: 4px 0; }
.guild-mini { display: flex; gap: 9px; align-items: center; }
.guild-mini img { width: 42px; height: 42px; object-fit: cover; border: 1px solid var(--red); }
.guild-mini b, .guild-mini small { display: block; }
.guild-mini b { max-width: 170px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.guild-mini small { color: #666; font-size: 8px; word-break: break-all; }
.operator { display: flex; gap: 9px; align-items: center; margin-top: auto; border-top: 1px solid #420000; padding-top: 12px; font-size: 10px; color: #777; }
.operator img { width: 34px; height: 34px; object-fit: cover; border: 1px solid var(--red); }
.operator small { display: block; color: #fff; font-size: 12px; }

/* Shared content hierarchy */
.control-content { width: 100%; max-width: 1640px; margin: 0 auto; padding: 30px 38px 70px; min-width: 0; }
.pathline { color: #666; border-bottom: 1px solid var(--line); padding-bottom: 8px; margin-bottom: 25px; font-size: 10px; text-transform: uppercase; word-break: break-all; }
.pathline b { color: #bbb; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; border-bottom: 3px double #777; padding-bottom: 15px; margin-bottom: 22px; }
.page-heading h1 { margin: 0; color: #fff; font-size: clamp(30px, 4vw, 54px); line-height: .95; letter-spacing: -2px; text-transform: uppercase; word-break: break-word; }
.page-heading p { max-width: 780px; color: #aaa; margin: 9px 0 0; }
.eyebrow { color: var(--red-bright) !important; font-size: 11px; letter-spacing: .13em; margin: 0 0 8px !important; }
.heading-counter, .connection-stamp { border: 1px solid var(--red); background: var(--surface-red); padding: 9px 12px; color: #aaa; white-space: nowrap; }
.heading-counter b { color: #fff; font-size: 20px; }
.warning-strip, .notice { margin: 17px 0; padding: 10px 14px; border-left: 5px solid var(--amber); background: #171306; color: #c8bd92; }
.warning-strip b { color: #fff; margin-right: 18px; }
.notice { border-left-width: 3px; }
.muted { color: #727272; }
.tone-text-good { color: var(--green) !important; }
.tone-text-warning { color: var(--amber) !important; }
.tone-text-danger { color: var(--red-bright) !important; }
.tone-text-idle { color: #777 !important; }

/* Health console */
.health-console { --tone: var(--green); margin: 22px 0; border: 1px solid #323232; border-left: 6px solid var(--tone); background: var(--surface-0); padding: 18px; }
.health-console.tone-warning { --tone: var(--amber); }
.health-console.tone-danger { --tone: var(--red-bright); }
.health-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.health-head h2 { margin: 0; font-size: 23px; letter-spacing: .04em; }
.health-score { min-width: 105px; text-align: right; color: var(--tone); }
.health-score b { font-size: 42px; line-height: .8; }
.health-score span { color: #777; }
.health-meter { display: block; width: 100%; height: 6px; margin: 17px 0; border: 0; border-radius: 0; background: #252525; color: var(--tone); overflow: hidden; appearance: none; }
.health-meter::-webkit-progress-bar { background: #252525; }
.health-meter::-webkit-progress-value { background: var(--tone); }
.health-meter::-moz-progress-bar { background: var(--tone); }
.telemetry-grid { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid #292929; }
.telemetry-grid div { min-width: 0; padding: 13px; border-right: 1px solid #292929; background: #0c0c0c; }
.telemetry-grid div:nth-child(even) { background: #111; }
.telemetry-grid div:last-child { border-right: 0; }
.telemetry-grid small, .telemetry-grid b { display: block; }
.telemetry-grid small { color: #686868; font-size: 9px; }
.telemetry-grid b { margin-top: 3px; color: #ddd; font-size: 16px; }
.notification-stack { display: grid; gap: 6px; margin-top: 13px; }
.system-notice { --notice: var(--cyan); display: flex; gap: 11px; border: 1px solid #292929; background: #0a0a0a; padding: 10px 12px; }
.system-notice.tone-good { --notice: var(--green); }
.system-notice.tone-warning { --notice: var(--amber); background: #151206; }
.system-notice.tone-danger { --notice: var(--red-bright); background: #190606; }
.notice-lamp { width: 8px; height: 8px; flex: 0 0 8px; margin-top: 6px; background: var(--notice); }
.system-notice b { color: #eee; }
.system-notice p { margin: 2px 0 0; color: #8d8d8d; font-size: 11px; }
.health-details { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.health-details details { border: 1px dashed #3b3b3b; background: #080808; }
.health-details summary { display: flex; justify-content: space-between; gap: 10px; padding: 10px; color: #aaa; cursor: pointer; font-size: 11px; }
.health-details summary:hover { background: #121212; color: #fff; }
.health-details summary span { color: var(--tone); }
.health-details details > p, .reference-list { margin: 0; padding: 10px; border-top: 1px dashed #333; font-size: 10px; }
.permission-grid { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px dashed #333; }
.permission-row { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 8px 9px; border-right: 1px solid #222; border-bottom: 1px solid #222; font-style: normal; }
.permission-row i { margin: 0; }
.permission-row.missing i { background: var(--red-bright); box-shadow: none; }
.permission-row span { min-width: 0; margin-right: auto; }
.permission-row b, .permission-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.permission-row b { font-size: 10px; }
.permission-row small { color: #666; font-size: 8px; }
.permission-row em { color: var(--green); font-size: 8px; font-style: normal; }
.permission-row.missing em { color: var(--red-bright); }
.reference-list p { margin: 4px 0; color: #aaa; }
.reference-list code { color: var(--amber); word-break: break-all; }

/* Module catalogue */
.control-toolbar { display: flex; align-items: flex-end; gap: 12px; margin: 28px 0 5px; padding: 14px; border: 1px solid #292929; background: var(--surface-1); }
.module-search { position: relative; flex: 1; }
.module-search span { display: block; margin-bottom: 5px; color: #888; font-size: 9px; }
.module-search input { width: 100%; border: 1px solid #444; border-left: 4px solid var(--cyan); background: #000; color: #fff; padding: 10px 45px 10px 11px; }
.module-search kbd { position: absolute; right: 9px; bottom: 9px; }
.empty-filter { border: 1px dashed var(--amber); color: var(--amber); padding: 20px; text-align: center; }
.module-section, .audit-panel, .settings-group, .record-panel, .action-panel { margin-top: 30px; }
.module-section h2, .audit-panel h2, .settings-group h2, .record-panel h2, .action-panel h2 { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin: 0 0 12px; padding: 7px 10px; border-left: 4px solid var(--red); border-bottom: 1px dashed #633; background: #100707; color: #ddd; font-size: 16px; letter-spacing: .05em; }
.module-section h2 small, .audit-panel h2 small, .settings-group h2 small, .record-panel h2 small, .action-panel h2 small { color: #777; font-size: 9px; }
.module-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 9px; }
.module-card { --tone: #666; display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 98px; border: 1px solid #292929; border-left: 5px solid var(--tone); background: var(--surface-1); color: #fff; padding: 12px; transition: background .12s, border-color .12s, transform .12s; }
.module-card.tone-good { --tone: var(--green); }
.module-card.tone-info { --tone: var(--cyan); }
.module-card.tone-idle { --tone: #555; }
.module-card.tone-danger { --tone: var(--red-bright); }
.module-card:hover { background: var(--surface-red); border-color: var(--tone); text-decoration: none; transform: translateX(2px); }
.module-code { color: var(--tone); font-size: 12px; font-weight: bold; word-break: break-word; }
.module-copy b, .module-copy small { display: block; }
.module-copy small { margin-top: 4px; color: #8d8d8d; font-size: 10px; }
.module-status { color: #999; font-size: 9px; white-space: nowrap; }
.module-status i { background: var(--tone); box-shadow: none; }
.module-error { opacity: .65; }

/* Cards and server index */
.guild-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 14px; }
.guild-card { border: 1px solid #292929; border-top: 5px solid var(--green); background: var(--surface-1); padding: 16px; }
.guild-card.guild-missing { border-top-color: var(--amber); }
.guild-card-head { display: flex; gap: 13px; align-items: center; margin-bottom: 18px; }
.guild-card-head img { width: 62px; height: 62px; object-fit: cover; border: 1px solid var(--red); }
.guild-card-head span, .guild-card-head small, .guild-card-head b { display: block; min-width: 0; }
.guild-card-head small { color: #666; font-size: 8px; word-break: break-all; }
.guild-card-head b { overflow: hidden; color: #fff; font-size: 18px; text-overflow: ellipsis; white-space: nowrap; }
.guild-state { border-top: 1px dashed #333; padding: 10px 0; color: #888; font-size: 10px; }
.guild-state i { display: inline-block; width: 7px; height: 7px; margin-right: 7px; background: var(--green); }
.guild-state i.offline { background: var(--amber); }
.guild-card .button { width: 100%; text-align: center; }
.empty-state { border: 1px dashed var(--red); background: #100000; padding: 35px; text-align: center; }
.empty-state b { color: var(--red-bright); }

/* Forms */
.button { display: inline-block; border: 1px solid #656565; border-radius: 0; background: #141414; color: #ddd; padding: 9px 14px; cursor: pointer; font-weight: bold; text-transform: uppercase; }
.button:hover:not(:disabled) { background: #333; color: #fff; text-decoration: none; }
.button-primary { border-color: var(--red-bright); background: var(--red-dark); color: #fff; }
.button-primary:hover:not(:disabled) { background: var(--red-bright); color: #000; }
.button-large { padding: 14px 22px; font-size: 16px; }
.button:disabled { cursor: not-allowed; opacity: .42; }
.module-heading .button { margin-bottom: 2px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); border: 1px solid #333; margin: 18px 0; }
.stat-grid div { padding: 17px; border-right: 1px solid #333; background: #080808; }
.stat-grid div:nth-child(even) { background: #111; }
.stat-grid b, .stat-grid span { display: block; }
.stat-grid b { color: #fff; font-size: 27px; }
.stat-grid span { color: #777; font-size: 9px; text-transform: uppercase; }
.settings-form, .action-panel { border: 1px solid #303030; background: var(--surface-0); padding: 17px; }
.settings-form { border-top: 5px solid #555; }
.settings-form.is-dirty { border-top-color: var(--amber); }
.settings-group { margin-top: 0; margin-bottom: 25px; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; }
.field-grid.compact { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-bottom: 14px; }
.field { min-width: 0; padding: 8px; border: 1px solid transparent; background: #0a0a0a; }
.field:focus-within { border-color: #3d3d3d; background: #0e0e0e; }
.field label, .check-grid legend { display: block; margin-bottom: 5px; color: #d2d2d2; font-size: 11px; font-weight: bold; }
.field input[type=text], .field input[type=password], .field input[type=number], .field select, .field textarea { display: block; width: 100%; border: 1px solid #4a4a4a; border-left: 4px solid #777; border-radius: 0; background: #020202; color: #eee; padding: 10px; }
.field textarea { min-height: 96px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--cyan); box-shadow: 0 0 0 1px var(--cyan); }
.field-help, .switch-row small { display: block; margin-top: 4px; color: #777; font-size: 9px; font-weight: normal; }
.field-toggle { border: 1px dotted #422; background: #100909; padding: 10px; }
.switch-row { display: flex !important; justify-content: space-between; align-items: center; gap: 10px; margin: 0 !important; cursor: pointer; }
.switch-row input { position: absolute; opacity: 0; pointer-events: none; }
.switch-row i { position: relative; width: 49px; height: 23px; flex: 0 0 49px; border: 1px solid #666; background: #191919; }
.switch-row i:after { position: absolute; left: 5px; color: #888; font-size: 8px; line-height: 21px; content: "OFF"; }
.switch-row input:checked + i { border-color: var(--green); background: #063116; }
.switch-row input:checked + i:after { left: 27px; color: #fff; content: "ON"; }
.check-grid { border: 1px dotted #633; margin: 0; padding: 10px; }
.check-grid label { display: inline-block; margin: 5px 16px 5px 0; font-weight: normal; }
.check-grid input { accent-color: var(--red); }
.commit-bar { position: sticky; bottom: 0; z-index: 15; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-top: 2px solid #555; background: #0c0c0c; padding: 13px; box-shadow: 0 -10px 22px rgba(0, 0, 0, .72); }
.is-dirty .commit-bar { border-color: var(--amber); background: #161306; }
.commit-state b, .commit-state small { display: block; }
.commit-state b { color: #777; }
.is-dirty .commit-state b { color: var(--amber); }
.commit-state small { color: #777; font-size: 9px; }
.commit-actions { display: flex; gap: 8px; }

/* Diff preview */
.change-overlay { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 18px; background: rgba(0, 0, 0, .86); }
.change-dialog { width: min(900px, 100%); max-height: 88vh; overflow: auto; border: 2px solid var(--amber); background: #080808; box-shadow: 16px 16px 0 #310f00; }
.change-dialog > header { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; gap: 15px; padding: 16px; border-bottom: 1px solid #4b401e; background: #151206; }
.change-dialog h2 { margin: 0; }
.change-dialog header button { border: 1px solid #777; background: #000; color: #fff; cursor: pointer; }
.change-intro { margin: 0; padding: 13px 16px; color: #999; }
.change-list { display: grid; gap: 7px; padding: 0 16px 16px; }
.change-item { border: 1px solid #303030; background: #0d0d0d; }
.change-item > b { display: block; padding: 7px 10px; border-bottom: 1px dashed #393939; color: #ddd; }
.change-values { display: grid; grid-template-columns: 1fr 34px 1fr; align-items: center; padding: 10px; }
.change-values span { min-width: 0; color: #777; font-size: 9px; }
.change-values code { display: block; overflow-wrap: anywhere; margin-top: 3px; color: #bbb; font-size: 11px; white-space: pre-wrap; }
.change-values span:last-child code { color: var(--amber); }
.change-values i { color: var(--amber); text-align: center; font-style: normal; }
.change-dialog > footer { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid #333; background: #0c0c0c; padding: 13px 16px; }
body.overlay-open { overflow: hidden; }

/* Records and audit */
.table-wrap { width: 100%; overflow: auto; border: 1px solid #292929; }
table { width: 100%; min-width: 650px; border-collapse: collapse; background: #050505; font-size: 10px; }
th { background: #1b0707; color: #f66; text-align: left; }
th, td { max-width: 320px; padding: 9px; border-bottom: 1px solid #252525; vertical-align: top; word-break: break-word; }
tr:nth-child(even) td { background: #090909; }
tr:hover td { background: #130909; }
.audit-action { border: 1px solid #554; background: #161306; color: var(--amber); padding: 2px 5px; text-transform: uppercase; }
.table-action { border: 1px solid var(--red); background: #240000; color: #f66; padding: 4px 8px; cursor: pointer; }
.table-action:hover { background: var(--red-bright); color: #000; }

/* Configuration transfer */
.transfer-grid { display: grid; grid-template-columns: 1fr 1.25fr; gap: 12px; }
.transfer-panel { position: relative; overflow: hidden; border: 1px solid #353535; border-top: 5px solid var(--cyan); background: var(--surface-1); padding: 22px; }
.restore-panel { border-top-color: var(--amber); }
.transfer-panel h2 { margin: 0 0 10px; font-size: 22px; }
.transfer-panel > p:not(.eyebrow) { color: #999; }
.panel-index { position: absolute; right: 12px; top: -20px; color: #282828; font-size: 88px; font-weight: bold; line-height: 1; }
.terminal-list { margin: 20px 0; padding: 12px 12px 12px 32px; border: 1px dashed #343434; background: #050505; color: #999; font-size: 11px; }
.file-control { display: block; margin: 18px 0 12px; border: 1px dashed #665522; background: #151206; padding: 12px; cursor: pointer; }
.file-control > span, .file-control b { display: block; }
.file-control > span { color: #888; font-size: 9px; }
.file-control input { width: 100%; margin: 8px 0; color: #aaa; }
.file-control b { color: var(--amber); font-size: 11px; }
.module-selector { margin: 0 0 12px; border: 1px solid #333; padding: 10px; }
.module-selector legend { color: #aaa; font-size: 10px; }
.selector-tools { display: flex; gap: 7px; margin-bottom: 9px; }
.selector-tools button { border: 1px solid #444; background: #111; color: #999; cursor: pointer; font-size: 8px; }
.module-selector > label { display: block; border-top: 1px solid #252525; padding: 7px 4px; cursor: pointer; }
.module-selector input { accent-color: var(--red); }
.module-selector label span { display: grid; grid-template-columns: 64px 1fr auto; align-items: center; gap: 6px; margin-left: 24px; margin-top: -20px; font-size: 10px; }
.module-selector label span > b { color: var(--red-bright); }
.module-selector label small { font-size: 8px; }
.security-note { display: flex; gap: 16px; margin: 16px 0; border-left: 5px solid var(--cyan); background: #071217; padding: 12px 15px; color: #8eb4c3; }
.security-note b { color: #fff; white-space: nowrap; }
.security-note p { margin: 0; }
.restore-preview { scroll-margin-top: 70px; margin-top: 28px; border: 2px solid var(--amber); background: #080806; padding: 17px; }
.restore-preview > header { display: flex; justify-content: space-between; gap: 15px; border-bottom: 1px solid #53451c; padding-bottom: 12px; }
.restore-preview h2 { margin: 0; }
.restore-preview > header > span { color: var(--amber); }
.restore-module { margin-top: 8px; border: 1px solid #343434; background: #090909; }
.restore-module summary { display: flex; justify-content: space-between; gap: 15px; padding: 10px; cursor: pointer; }
.restore-module summary span { color: var(--amber); font-size: 10px; }
.restore-module > p { padding: 0 10px 10px; }
.server-diff { display: grid; gap: 5px; padding: 10px; border-top: 1px dashed #333; }
.server-diff article { border: 1px solid #2d2d2d; }
.server-diff article > b { display: block; padding: 6px 8px; background: #141414; }
.server-diff article > div { display: grid; grid-template-columns: 1fr 35px 1fr; align-items: center; padding: 8px; }
.server-diff span { min-width: 0; color: #777; font-size: 8px; }
.server-diff code { display: block; overflow-wrap: anywhere; color: #bbb; font-size: 10px; white-space: pre-wrap; }
.server-diff span:last-child code { color: var(--amber); }
.server-diff i { color: var(--amber); text-align: center; font-style: normal; }
.restore-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; border-top: 1px solid #444; padding-top: 14px; }
.restore-actions form { margin: 0; }

/* Flash, landing and error */
.flash { display: flex; gap: 18px; margin: 12px 0; border: 1px solid; padding: 11px 14px; }
.flash-success { border-color: #087b32; background: #001a0a; }
.flash-success b { color: var(--green); }
.flash-error { border-color: var(--red-bright); background: #210000; }
.flash-error b { color: var(--red-bright); }
.landing-main { min-height: calc(100vh - var(--top) - 28px); display: grid; grid-template-columns: 68px minmax(420px, 1fr) minmax(260px, 390px); overflow: hidden; background: linear-gradient(90deg, #0b0000 0, #000 35%); }
.landing-rail { display: flex; flex-direction: column; justify-content: space-around; align-items: center; border-right: 2px solid var(--red); background: #180000; padding: 20px 0; }
.landing-rail span { color: #680000; font-weight: bold; letter-spacing: .25em; writing-mode: vertical-rl; transform: rotate(180deg); }
.landing-panel { position: relative; padding: 8vh 7vw; }
.landing-logo { position: absolute; right: 3vw; top: 4vh; width: min(22vw, 260px); opacity: .22; filter: grayscale(1) contrast(1.5); }
.landing-panel h1 { position: relative; margin: 4vh 0; color: #fff; font-size: clamp(50px, 8vw, 112px); line-height: .76; letter-spacing: -.08em; }
.landing-copy { max-width: 650px; border-left: 5px solid var(--red); padding-left: 16px; color: #aaa; font-size: 17px; }
.landing-facts { max-width: 800px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 45px; background: #333; }
.landing-facts span { background: #070707; padding: 14px; color: #777; font-size: 10px; }
.landing-facts b { display: block; color: var(--red-bright); font-size: 24px; }
.landing-readout { border-left: 1px solid #333; background: #0b0b0b; padding: 8vh 28px; color: #888; }
.landing-readout > b { display: block; border-bottom: 1px dashed var(--red); padding-bottom: 8px; color: var(--red-bright); }
.terminal-lines { margin-top: 50px; border: 1px solid #252525; background: #000; padding: 15px; color: var(--green); font-size: 10px; line-height: 2; }
.error-terminal { min-height: calc(100vh - var(--top) - 28px); border-left: 14px solid var(--red); background: linear-gradient(135deg, #120000, #000 55%); padding: 10vh 10vw; }
.error-code { color: #340000; font-size: clamp(90px, 23vw, 300px); font-weight: bold; line-height: .7; }
.error-terminal h1 { margin: 8px 0; font-size: clamp(32px, 6vw, 72px); }
.error-terminal > p:not(.eyebrow) { max-width: 650px; margin-bottom: 30px; color: #aaa; }
.dashboard-footer { min-height: 28px; border-top: 1px solid #222; background: #080808; color: #494949; padding: 6px 18px; font-size: 8px; text-align: right; }

@media (max-width: 1100px) {
    .topbar-telemetry > span:not(.topbar-status) { display: none; }
    .health-details { grid-template-columns: 1fr; }
    .permission-grid { grid-template-columns: 1fr 1fr; }
    .transfer-grid { grid-template-columns: 1fr; }
}

@media (max-width: 920px) {
    :root { --top: 55px; }
    .topbar { gap: 10px; padding: 7px 10px; }
    .topbar-menu { display: block; }
    .topbar-brand { margin-right: auto; font-size: 10px; }
    .topbar-telemetry { flex: 0 0 auto; margin: 0; border: 0; }
    .topbar-telemetry > span { border: 0; padding: 0; }
    .topbar-links a { display: none; }
    .dashboard-shell { display: block; }
    .sidebar { position: fixed; top: 0; left: 0; width: min(330px, 88vw); height: 100vh; transform: translateX(-105%); transition: transform .16s; box-shadow: 18px 0 40px rgba(0, 0, 0, .8); }
    body.sidebar-open { overflow: hidden; }
    body.sidebar-open .sidebar { transform: translateX(0); }
    body.sidebar-open:after { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .7); content: ""; }
    .sidebar-close { display: block; align-self: flex-end; }
    .control-content { padding: 24px 18px 60px; }
    .landing-main { min-height: calc(100vh - var(--top) - 28px); }
}

@media (max-width: 650px) {
    .topbar { flex-wrap: nowrap; }
    .topbar-brand { overflow: hidden; text-overflow: ellipsis; }
    .topbar-status { font-size: 0; }
    .topbar-status i { margin: 0; }
    .page-heading { align-items: flex-start; flex-direction: column; }
    .page-heading h1 { font-size: 34px; }
    .heading-counter, .connection-stamp { align-self: stretch; }
    .health-console { padding: 12px; }
    .health-head h2 { font-size: 18px; }
    .health-score b { font-size: 34px; }
    .telemetry-grid { grid-template-columns: 1fr 1fr; }
    .telemetry-grid div { border-bottom: 1px solid #292929; }
    .permission-grid { grid-template-columns: 1fr; }
    .control-toolbar { align-items: stretch; flex-direction: column; }
    .module-grid, .guild-grid { grid-template-columns: 1fr; }
    .module-card { grid-template-columns: 58px minmax(0, 1fr); }
    .module-status { grid-column: 2; }
    .field-grid { grid-template-columns: 1fr; }
    .commit-bar { align-items: stretch; flex-direction: column; }
    .commit-actions { display: grid; grid-template-columns: 1fr; }
    .commit-actions .button { width: 100%; }
    .stat-grid { grid-template-columns: 1fr 1fr; }
    .change-overlay { padding: 8px; }
    .change-dialog { max-height: 96vh; box-shadow: 7px 7px 0 #310f00; }
    .change-values, .server-diff article > div { grid-template-columns: 1fr; gap: 6px; }
    .change-values i, .server-diff i { transform: rotate(90deg); }
    .change-dialog > footer, .restore-actions { align-items: stretch; flex-direction: column; }
    .change-dialog > footer .button, .restore-actions .button { width: 100%; }
    .module-selector label span { grid-template-columns: 52px 1fr; }
    .module-selector label small { grid-column: 2; }
    .security-note { flex-direction: column; gap: 4px; }
    .flash { flex-direction: column; gap: 3px; }
    .landing-main { grid-template-columns: 20px 1fr; }
    .landing-rail span { font-size: 8px; }
    .landing-panel { padding: 6vh 7vw; }
    .landing-panel h1 { font-size: 54px; }
    .landing-copy { font-size: 14px; }
    .landing-logo { width: 180px; }
    .landing-facts { grid-template-columns: 1fr; }
    .landing-readout { grid-column: 2; border-left: 0; border-top: 1px solid #333; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *:before, *:after { transition: none !important; }
}
