:root { color-scheme: dark; font-family: Inter, system-ui, sans-serif; background: #0d1117; color: #e6edf3; }
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
a { color: #58dce8; text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); margin: .25rem 0 1rem; }
h2 { font-size: 1.2rem; margin: 0 0 1.2rem; }
.muted, small { color: #9da9b8; }
.eyebrow { color: #39ff14; letter-spacing: .14em; font-size: .75rem; font-weight: 700; }
.panel { background: #161b22; border: 1px solid #30363d; border-radius: 14px; padding: 1.5rem; }
.admin-header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem max(1.5rem, calc((100vw - 1100px)/2)); border-bottom: 1px solid #30363d; }
.brand { color: #e6edf3; font-weight: 800; }
.admin-header nav, .actions, .form-actions { display: flex; align-items: center; gap: 1.2rem; }
.admin-container { max-width: 1100px; margin: 2.5rem auto; padding: 0 1.5rem 4rem; }
.editor-container { max-width: 850px; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 2rem; margin-bottom: 2rem; }
.button, button[type=submit]:not(.text-button) { background: #39ff14; color: #0d1117; border: 0; border-radius: 8px; padding: .75rem 1.1rem; font: inherit; font-weight: 700; cursor: pointer; display: inline-block; }
.button:hover, button[type=submit]:not(.text-button):hover { background: #8bff76; text-decoration: none; }
.text-button { background: none; border: 0; padding: 0; color: #58dce8; cursor: pointer; font: inherit; }
.danger { color: #ff7979; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .85rem .65rem; text-align: left; border-bottom: 1px solid #30363d; }
th { color: #9da9b8; font-size: .8rem; }
td small { display: block; margin-top: .3rem; }
.badge { background: #273f30; color: #9cff8e; border-radius: 30px; padding: .25rem .6rem; text-transform: capitalize; }
.empty { padding: 2rem 0; color: #9da9b8; }
.form-section { margin: 1.5rem 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; }
label { display: block; font-weight: 600; margin-bottom: 1.15rem; }
label small { display: block; font-weight: 400; margin-top: .35rem; }
input:not([type=checkbox]), select, textarea { display: block; width: 100%; margin-top: .4rem; padding: .7rem .8rem; background: #0d1117; color: #e6edf3; border: 1px solid #49515a; border-radius: 7px; font: inherit; }
input:focus, select:focus, textarea:focus { outline: 2px solid #39ff14; outline-offset: 1px; }
textarea { resize: vertical; line-height: 1.55; }
.check { display: flex; align-items: center; gap: .55rem; font-weight: 400; }
.check input { width: 1.1rem; height: 1.1rem; accent-color: #39ff14; }
.required { color: #ff7979; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(125px, 1fr)); gap: 1rem; }
.media-item { padding: .6rem; border: 1px solid #30363d; border-radius: 8px; font-size: .8rem; }
.media-item img { width: 100%; aspect-ratio: 1; object-fit: contain; display: block; margin-bottom: .5rem; background: #0d1117; }
.media-item .check { margin-top: .5rem; }
.alert { background: #43252a; color: #ffd6db; border: 1px solid #9f4755; padding: .8rem 1rem; border-radius: 8px; }
.admin-login-page { display: grid; place-items: center; padding: 1.5rem; }
.login-panel { width: min(100%, 430px); }
.back-link { display: inline-block; margin: 1.25rem 0; }
.public-container { max-width: 820px; margin: 3rem auto; padding: 0 1.5rem 4rem; }
.policy-list { display: grid; gap: 1rem; margin-top: 2rem; }
.policy-item { display: flex; justify-content: space-between; gap: 1rem; }
.policy-body { line-height: 1.75; overflow-wrap: anywhere; margin-top: 2rem; }
.policy-body :first-child { margin-top: 0; }
.policy-body :last-child { margin-bottom: 0; }
.policy-body h2, .policy-body h3 { margin: 1.6em 0 .55em; }
.policy-body p, .policy-body ul, .policy-body ol, .policy-body blockquote { margin: 0 0 1.1em; }
.policy-body ul, .policy-body ol { padding-left: 1.5em; }
.policy-body a { text-decoration: underline; }
.policy-body img { display: block; max-width: 100%; height: auto; margin: 1.2em 0; }
.policy-body table { display: block; overflow-x: auto; margin: 1.2em 0; }
.policy-body th, .policy-body td { border: 1px solid #30363d; }
.policy-body pre { overflow-x: auto; padding: 1em; background: #0d1117; border-radius: 8px; }
@media (max-width: 640px) { .page-heading, .form-grid { display: block; } .admin-header { padding: 1rem; } .admin-header nav { gap: .6rem; } .policy-item { display: block; } .policy-item span { display: block; margin-top: .5rem; } }

/* CMS surfaces share the portfolio's terminal palette and proportions. */
:root { --cms-bg: #0a0e14; --cms-card: #161b22; --cms-border: #30363d; --cms-green: #39ff14; --cms-cyan: #58d1eb; --cms-muted: #8b98a7; }
.accent { color: var(--cms-green); }
.admin-login-page, .dashboard-page { background: var(--cms-bg); font-family: Inter, system-ui, sans-serif; }
.admin-login-page::before, .dashboard-page::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; background-image: linear-gradient(rgba(57,255,20,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(57,255,20,.025) 1px, transparent 1px); background-size: 56px 56px; mask-image: radial-gradient(ellipse 75% 80% at 50% 35%, #000, transparent); }
.admin-login-page { display: flex; align-items: center; justify-content: center; padding: 32px 20px; }
.login-shell { width: min(100%, 410px); }
.login-brand { display: block; margin: 0 0 24px; text-align: center; color: #f0f6fc; font: 700 16px 'Fira Code', Consolas, monospace; }
.login-brand span { color: var(--cms-green); }
.login-panel { width: 100%; border: 1px solid var(--cms-border); border-radius: 12px; background: #0d1117; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.4), 0 0 0 1px rgba(57,255,20,.035); }
.window-bar { height: 38px; display: grid; grid-template-columns: 55px 1fr 55px; align-items: center; gap: 6px; padding: 0 14px; border-bottom: 1px solid var(--cms-border); background: #1a1e26; color: #8b98a7; text-align: center; font: 11px 'Fira Code', Consolas, monospace; }
.window-dots { display: flex; gap: 5px; }
.window-dots i { width: 9px; height: 9px; border-radius: 50%; background: #ff5f57; }
.window-dots i:nth-child(2) { background: #ffbd2e; }
.window-dots i:nth-child(3) { background: #28c840; }
.window-bar-end { text-align: right; white-space: nowrap; }
.login-content { padding: 30px 32px 28px; }
.login-content .eyebrow { margin: 0 0 8px; font: 600 11px 'Fira Code', Consolas, monospace; }
.login-content h1 { margin: 0; font-size: clamp(1.5rem, 5vw, 1.85rem); line-height: 1.2; letter-spacing: -.035em; }
.login-intro { margin: 9px 0 25px; color: var(--cms-muted); font-size: 13px; line-height: 1.6; }
.login-content label { font-size: 12px; margin-bottom: 15px; }
.login-content input:not([type=checkbox]) { margin-top: 7px; height: 42px; padding: 0 12px; background: #10161d; border-color: #35414d; font-size: 13px; }
.login-content input::placeholder { color: #657383; }
.login-content .alert { margin: 0 0 18px; font-size: 12px; }
.login-content .login-submit { display: flex; width: 100%; align-items: center; justify-content: center; gap: 10px; min-height: 42px; margin-top: 20px; font-size: 13px; }
.login-back { display: block; width: fit-content; margin: 19px auto 0; color: #9da9b8; font: 12px 'Fira Code', Consolas, monospace; }
.login-back:hover { color: var(--cms-green); text-decoration: none; }

.dashboard-page .admin-header { padding: 0 24px; background: rgba(13,17,23,.92); backdrop-filter: blur(12px); }
.header-inner { width: min(100%, 1160px); min-height: 68px; margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.dashboard-page .brand { display: inline-flex; align-items: center; gap: 11px; font: 700 15px 'Fira Code', Consolas, monospace; white-space: nowrap; }
.dashboard-page .brand:hover { color: #fff; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 37px; height: 37px; border: 1px solid rgba(57,255,20,.3); border-radius: 9px; background: rgba(57,255,20,.08); color: var(--cms-green); }
.brand-sub { color: var(--cms-green); }
.dashboard-page .admin-header nav { display: flex; align-items: center; gap: 24px; font-size: 12px; }
.dashboard-page .admin-header nav a { color: #b5c0cc; }
.dashboard-page .admin-header nav a:hover { color: var(--cms-green); text-decoration: none; }
.dashboard-page .admin-header nav .text-button { color: #b5c0cc; }
.dashboard-page .admin-header nav .text-button:hover { color: #fff; }
.dashboard-container { max-width: 1208px; margin-top: 0; padding-top: 42px; }
.dashboard-hero { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.dashboard-hero .eyebrow, .section-heading .eyebrow { margin: 0 0 8px; font: 600 11px 'Fira Code', Consolas, monospace; }
.dashboard-hero h1 { margin: 0 0 8px; font-size: clamp(2rem, 4vw, 2.7rem); line-height: 1.12; letter-spacing: -.045em; }
.dashboard-hero-copy > p:last-child, .section-heading > p { margin: 0; color: var(--cms-muted); font-size: 13px; line-height: 1.6; }
.dashboard-hero .button { white-space: nowrap; font-size: 12px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stat-card { position: relative; min-height: 140px; display: flex; flex-direction: column; align-items: start; padding: 18px 20px; background: var(--cms-card); border: 1px solid var(--cms-border); border-radius: 12px; }
.stat-icon { position: absolute; right: 18px; top: 16px; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 7px; color: #b2a5ff; background: rgba(188,140,255,.1); font: 19px 'Fira Code', Consolas, monospace; }
.stat-icon-green { color: var(--cms-green); background: rgba(57,255,20,.09); }
.stat-icon-yellow { color: #e3b341; background: rgba(227,179,65,.1); }
.stat-icon-cyan { color: var(--cms-cyan); background: rgba(88,209,235,.1); }
.stat-label { margin-bottom: 17px; color: #aab6c3; font-size: 12px; }
.stat-card strong { color: #f0f6fc; font: 700 31px 'Fira Code', Consolas, monospace; line-height: 1; }
.stat-card small { margin-top: 8px; font-size: 11px; }
.project-section { margin-top: 44px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.section-heading h2 { display: flex; align-items: center; gap: 10px; margin: 0; color: #f0f6fc; font-size: 20px; letter-spacing: -.025em; }
.count-pill { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px; border: 1px solid #3d4a55; border-radius: 7px; color: var(--cms-green); font: 600 11px 'Fira Code', Consolas, monospace; }
.project-list { overflow: hidden; border: 1px solid var(--cms-border); border-radius: 12px; background: #10161d; }
.project-row { display: grid; grid-template-columns: 46px minmax(140px, 1.7fr) minmax(85px, .7fr) minmax(95px, .75fr) minmax(75px, .6fr) auto; align-items: center; gap: 16px; padding: 17px 20px; border-bottom: 1px solid #28313a; transition: background .15s ease; }
.project-row:last-child { border-bottom: 0; }
.project-row:hover { background: #18212a; }
.project-avatar { display: grid; place-items: center; width: 46px; height: 46px; overflow: hidden; border: 1px solid #34434e; border-radius: 10px; background: #1d2931; color: var(--cms-cyan); font: 22px 'Fira Code', Consolas, monospace; }
.project-avatar img { width: 100%; height: 100%; object-fit: cover; }
.project-main { min-width: 0; }
.project-name-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.project-name-line h3 { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 0; color: #f0f6fc; font-size: 13px; font-weight: 700; }
.category-pill { padding: 3px 6px; border: 1px solid #33424b; border-radius: 5px; color: var(--cms-cyan); font: 10px 'Fira Code', Consolas, monospace; text-transform: uppercase; }
.project-slug { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 5px 0 0; color: #82909e; font: 11px 'Fira Code', Consolas, monospace; }
.project-meta { display: flex; flex-direction: column; align-items: start; gap: 7px; color: #c6d0da; font-size: 12px; white-space: nowrap; }
.meta-label { color: #778594; font-size: 10px; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; }
.status i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-live { color: #83e879; }
.status-draft { color: #dfb76c; }
.project-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; font-size: 12px; }
.project-actions .edit-link { color: var(--cms-cyan); white-space: nowrap; }
.project-actions .text-button { font-size: 12px; }
.project-actions .danger { color: #ff8585; }
.project-actions .danger:hover { color: #ffb0b0; text-decoration: underline; }
.empty-state { display: flex; flex-direction: column; align-items: center; padding: 48px 20px; border: 1px dashed #40505a; border-radius: 12px; background: #10161d; text-align: center; }
.empty-state > span { color: var(--cms-green); font: 32px 'Fira Code', Consolas, monospace; }
.empty-state h3 { margin: 12px 0 4px; }
.empty-state p { color: var(--cms-muted); font-size: 13px; }
.empty-state .button { margin-top: 10px; }
.editor-page .editor-container { margin-top: 0; padding-top: 42px; }
.editor-page .editor-container > .eyebrow { margin: 0 0 7px; font: 600 11px 'Fira Code', Consolas, monospace; }
.editor-page .editor-container > h1 { margin: 0 0 26px; letter-spacing: -.035em; }
.editor-page .form-section { margin: 0 0 18px; padding: 25px; background: var(--cms-card); border-radius: 12px; }
.editor-page .form-section h2 { color: #f0f6fc; }
.editor-page .form-actions { justify-content: flex-end; margin-top: 24px; }
.editor-page .form-actions a { color: #aab6c3; }
.editor-page .editor-intro { margin: -18px 0 28px; color: var(--cms-muted); font-size: 13px; }
.editor-page .form-section-heading { display: flex; align-items: flex-start; gap: 14px; padding-bottom: 20px; margin-bottom: 23px; border-bottom: 1px solid #303a43; }
.editor-page .form-section-heading h2 { margin: 0 0 4px; font-size: 18px; }
.editor-page .form-section-heading p { margin: 0; color: var(--cms-muted); font-size: 12px; }
.section-number { display: grid; place-items: center; flex: 0 0 34px; height: 34px; border: 1px solid rgba(57,255,20,.3); border-radius: 8px; background: rgba(57,255,20,.08); color: var(--cms-green); font: 600 12px 'Fira Code', Consolas, monospace; }
.editor-page label { color: #dbe5ec; font-size: 13px; }
.editor-page input:not([type=checkbox]), .editor-page select, .editor-page textarea { background: #10161d; border-color: #3b4954; border-radius: 8px; }
.editor-page input:not([type=checkbox]):hover, .editor-page select:hover, .editor-page textarea:hover { border-color: #667784; }
.editor-page label small { color: var(--cms-muted); font-size: 11px; line-height: 1.55; }
.editor-page .check { color: #b9c6d0; }
.upload-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.upload-card { min-width: 0; padding: 10px; border: 1px solid #34424c; border-radius: 12px; background: #10161d; }
.editor-page .upload-zone { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 206px; gap: 7px; padding: 18px; margin: 0; border: 1px dashed #526675; border-radius: 9px; background: radial-gradient(circle at 50% 0%, rgba(88,209,235,.07), transparent 68%), #121b23; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.editor-page .upload-zone:hover, .editor-page .upload-zone.is-dragging, .editor-page .upload-zone:focus-within { border-color: var(--cms-green); background-color: #192720; }
.editor-page .upload-input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.upload-symbol { display: grid; place-items: center; width: 43px; height: 43px; margin-bottom: 5px; border: 1px solid rgba(57,255,20,.25); border-radius: 10px; background: rgba(57,255,20,.08); color: var(--cms-green); font: 24px 'Fira Code', Consolas, monospace; }
.upload-symbol-gallery { color: var(--cms-cyan); border-color: rgba(88,209,235,.25); background: rgba(88,209,235,.08); }
.upload-zone strong { color: #f0f6fc; font-size: 14px; }
.upload-description { color: #8997a5; font-size: 11px; line-height: 1.5; }
.upload-choose { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; padding: 7px 12px; border: 1px solid #587080; border-radius: 6px; color: #bceef4; font-size: 11px; }
.upload-status { min-height: 16px; margin: 10px 3px 0; color: #9da9b8; font: 11px 'Fira Code', Consolas, monospace; overflow-wrap: anywhere; }
.upload-status.is-error { color: #ff9d9d; }
.upload-preview { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.upload-preview:empty { display: none; }
.upload-preview img { width: 52px; height: 52px; object-fit: cover; border: 1px solid #40505c; border-radius: 7px; background: #0d1117; }
.upload-help { margin: 15px 0 0; color: var(--cms-muted); font-size: 11px; line-height: 1.5; }
.existing-media-heading { display: flex; align-items: baseline; gap: 12px; margin: 27px 0 12px; }
.existing-media-heading h3 { margin: 0; font-size: 13px; }
.existing-media-heading span { color: var(--cms-muted); font-size: 11px; }
.editor-page .media-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.editor-page .media-item { margin: 0; padding: 8px; border-color: #34424c; background: #10161d; cursor: pointer; }
.editor-page .media-item:has(input:checked) { border-color: #b85c69; background: #261b21; }
.editor-page .media-item img { border-radius: 5px; }
.media-kind { display: block; color: #dbe5ec; font-size: 11px; }
.editor-page .media-item .check { margin-top: 7px; color: #ff9999; font-size: 10px; }
.editor-page .media-item .check input { width: 14px; height: 14px; accent-color: #ff7979; }
.policy-location { display: inline-flex; flex-wrap: wrap; gap: 7px; max-width: 100%; margin: 0 0 21px; padding: 9px 12px; border: 1px solid #34424c; border-radius: 7px; background: #10161d; color: var(--cms-muted); font-size: 11px; }
.policy-location code { color: var(--cms-cyan); overflow-wrap: anywhere; }
.html-pill { display: inline-block; margin-left: 5px; padding: 3px 6px; border: 1px solid rgba(88,209,235,.3); border-radius: 5px; color: var(--cms-cyan); font: 10px 'Fira Code', Consolas, monospace; }
.editor-page .policy-editor-label textarea { min-height: 300px; margin-top: 9px; padding: 14px; font: 12px/1.7 'Fira Code', Consolas, monospace; tab-size: 2; }
.editor-page .ts-wrapper { width: 100%; min-height: 42px; margin-top: .4rem; font-size: 13px; }
.editor-page .ts-wrapper.single .ts-control, .editor-page .ts-wrapper.single.input-active .ts-control { min-height: 42px; align-items: center; padding: 9px 34px 9px 12px; border: 1px solid #3b4954; border-radius: 8px; background: #10161d; background-image: none; box-shadow: none; color: #e6edf3; }
.editor-page .ts-wrapper.single .ts-control:hover { border-color: #667784; }
.editor-page .ts-wrapper.focus .ts-control { border-color: var(--cms-green); outline: 2px solid var(--cms-green); outline-offset: 1px; }
.editor-page .ts-wrapper.single .ts-control::after { border-top-color: #aab6c3; }
.editor-page .ts-wrapper.single.dropdown-active .ts-control::after { border-bottom-color: var(--cms-green); }
.editor-page .ts-control > input { width: auto !important; height: auto; color: #e6edf3; font-size: 13px; }
.editor-page .ts-control > input::placeholder { color: #8795a3; }
.editor-page .ts-dropdown { margin-top: 5px; border: 1px solid #3b4954; border-radius: 9px; background: #161f27; box-shadow: 0 16px 35px rgba(0,0,0,.4); color: #e6edf3; font-size: 13px; overflow: hidden; }
.editor-page .ts-dropdown .option, .editor-page .ts-dropdown .no-results { padding: 10px 13px; }
.editor-page .ts-dropdown .option { color: #dce6ed; }
.editor-page .ts-dropdown .option.active { background: #234034; color: #d9ffdb; }
.editor-page .ts-dropdown .option.selected { color: var(--cms-green); }
.editor-page .ts-dropdown .no-results { color: var(--cms-muted); }
.editor-page .ts-dropdown .highlight { background: rgba(57,255,20,.2); color: #f0f6fc; }
.category-field { min-width: 0; }
.category-field > label { margin-bottom: 0; }
.category-links { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 8px 0 16px; font-size: 11px; }
.category-links a { color: var(--cms-cyan); }
.category-add-toggle { display: none; padding: 0; border: 0; background: none; color: var(--cms-green); font: inherit; cursor: pointer; }
.js-enabled .category-add-toggle { display: inline; }
.category-quick-add { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 15px; }
.category-quick-add[hidden] { display: none; }
.editor-page .category-quick-add input { width: min(100%, 210px); margin: 0; padding: 8px 10px; font-size: 12px; }
.category-quick-add button { padding: 8px 10px; border: 1px solid rgba(57,255,20,.4); border-radius: 7px; background: rgba(57,255,20,.1); color: var(--cms-green); font: 600 11px 'Fira Code', Consolas, monospace; cursor: pointer; }
.category-quick-add small { flex-basis: 100%; margin-top: 0; }
.category-quick-add small.is-error { color: #ff9d9d; }
.category-container { max-width: 900px; margin-top: 0; padding-top: 42px; }
.category-container > .eyebrow { margin: 0 0 7px; font: 600 11px 'Fira Code', Consolas, monospace; }
.category-container > h1 { margin: 0 0 8px; letter-spacing: -.035em; }
.category-intro { margin: 0 0 27px; color: var(--cms-muted); font-size: 13px; line-height: 1.6; }
.category-create { padding: 25px; margin-bottom: 36px; }
.category-create .form-section-heading { display: flex; align-items: center; gap: 14px; padding-bottom: 18px; margin-bottom: 20px; border-bottom: 1px solid #303a43; }
.category-create h2 { margin: 0 0 4px; font-size: 17px; }
.category-create .form-section-heading p { margin: 0; color: var(--cms-muted); font-size: 12px; }
.category-create-form { display: flex; align-items: end; gap: 12px; }
.category-create-form label { flex: 1; margin: 0; font-size: 12px; }
.categories-page .category-create-form input { height: 36px; margin-top: 5px; padding: 7px 10px; background: #10161d; font-size: 12px; }
.categories-page .category-create-form button[type=submit] { width: auto; min-height: 36px; padding: 7px 12px; border-radius: 7px; font: 600 11px 'Fira Code', Consolas, monospace; white-space: nowrap; }
.category-directory .section-heading { margin-bottom: 15px; }
.category-list { overflow: hidden; border: 1px solid var(--cms-border); border-radius: 12px; background: #10161d; }
.category-row { display: grid; grid-template-columns: minmax(140px, 1fr) minmax(220px, 1.3fr) auto; align-items: end; gap: 14px; padding: 13px 18px; border-bottom: 1px solid #28313a; }
.category-row:last-child { border-bottom: 0; }
.category-identity { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.category-identity strong { color: #f0f6fc; font-size: 13px; }
.category-identity code { color: var(--cms-cyan); font-size: 11px; overflow-wrap: anywhere; }
.category-identity small { font-size: 11px; }
.category-rename { display: flex; align-items: end; gap: 8px; }
.category-rename label { flex: 1; margin: 0; color: var(--cms-muted); font-size: 11px; }
.categories-page .category-rename input { height: 34px; min-width: 0; margin-top: 4px; padding: 7px 10px; background: #10161d; font-size: 12px; }
.categories-page .category-rename button[type=submit] { min-height: 34px; padding: 6px 11px; border: 1px solid rgba(57,255,20,.4); border-radius: 7px; background: rgba(57,255,20,.08); color: var(--cms-green); font: 600 11px 'Fira Code', Consolas, monospace; }
.categories-page .category-rename button[type=submit]:hover { background: rgba(57,255,20,.16); }
.category-row > form:last-child { padding-bottom: 8px; }
.category-row .text-button { font-size: 11px; }
.category-row .danger:disabled { color: #65707a; cursor: not-allowed; }

@media (max-width: 980px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-row { grid-template-columns: 46px minmax(130px, 1fr) minmax(78px, auto) minmax(90px, auto) auto; }
  .project-images { display: none; }
}
@media (max-width: 700px) {
  .category-row { grid-template-columns: 1fr auto; }
  .category-rename { grid-column: 1 / -1; grid-row: 2; }
  .category-row > form:last-child { grid-column: 2; grid-row: 1; padding: 0; }
  .category-create-form { align-items: stretch; flex-direction: column; }
  .category-create-form button { align-self: start; }
  .upload-grid { grid-template-columns: 1fr; }
  .editor-page .form-section { padding: 19px; }
  .dashboard-page .admin-header { padding: 0 16px; }
  .dashboard-page .admin-header nav { gap: 12px; }
  .dashboard-container { padding: 30px 16px 56px; }
  .dashboard-hero { align-items: start; flex-direction: column; }
  .section-heading { align-items: start; flex-direction: column; }
  .section-heading > p { display: none; }
  .project-row { grid-template-columns: 42px minmax(0, 1fr) auto; gap: 10px 12px; padding: 15px; }
  .project-avatar { width: 42px; height: 42px; }
  .project-meta { grid-row: 2; }
  .project-row .project-meta:nth-of-type(3) { grid-column: 2; }
  .project-row .project-meta:nth-of-type(4) { grid-column: 3; }
  .project-actions { grid-column: 3; grid-row: 1; justify-content: end; }
  .project-actions .edit-link { padding: 6px 8px; border: 1px solid #3b515e; border-radius: 6px; }
  .project-actions .danger { font-size: 11px; }
}
@media (max-width: 470px) {
  .login-content { padding: 26px 22px 24px; }
  .dashboard-page .brand { font-size: 12px; gap: 7px; }
  .brand-mark { width: 32px; height: 32px; }
  .dashboard-page .admin-header nav { font-size: 11px; }
  .dashboard-page .admin-header nav a { display: none; }
  .dashboard-page .admin-header nav a.admin-categories-link { display: inline; }
  .editor-page .admin-header nav a { display: block; font-size: 10px; }
  .categories-page .admin-header nav a { display: block; font-size: 10px; }
  .stat-grid { gap: 9px; }
  .stat-card { min-height: 128px; padding: 15px; }
  .stat-card strong { font-size: 26px; }
  .project-row { grid-template-columns: 40px minmax(0, 1fr); }
  .project-row .project-meta:nth-of-type(3) { grid-column: 1 / -1; }
  .project-row .project-meta:nth-of-type(4) { grid-column: 1 / -1; }
  .project-meta { display: inline-flex; flex-direction: row; align-items: center; }
  .project-actions { grid-column: 1 / -1; grid-row: 4; justify-content: start; margin-top: 2px; }
}

/* Server monitoring. Status colors are reserved for state and always ship with an icon and label. */
:root { --level-good: #83e879; --level-warning: #dfb76c; --level-critical: #ff7979; --meter-track: #26313b; }
.meter { width: 100%; height: 6px; overflow: hidden; border-radius: 999px; background: var(--meter-track); }
.meter > span { display: block; height: 100%; border-radius: 999px; background: var(--level-good); transition: width .4s ease; }
.meter-warning > span { background: var(--level-warning); }
.meter-critical > span { background: var(--level-critical); }
.level-badge { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; white-space: nowrap; }
.level-badge > span { font-family: 'Fira Code', Consolas, monospace; }
.level-good { color: var(--level-good); }
.level-warning { color: var(--level-warning); }
.level-critical { color: var(--level-critical); }
.status-down { color: var(--level-critical); }

.dashboard-page .admin-header nav a.admin-server-link { color: var(--cms-green); }
.server-strip { margin-top: 18px; padding: 18px 20px; border: 1px solid var(--cms-border); border-radius: 12px; background: #10161d; }
.server-strip-head { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.server-strip-head .eyebrow { margin: 0 0 6px; font: 600 11px 'Fira Code', Consolas, monospace; }
.server-strip-head h2 { margin: 0; color: #f0f6fc; font: 600 15px 'Fira Code', Consolas, monospace; overflow-wrap: anywhere; }
.server-strip-head .edit-link { color: var(--cms-cyan); font-size: 12px; white-space: nowrap; }
.server-strip-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.server-mini { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 14px; border: 1px solid #28313a; border-radius: 10px; background: var(--cms-card); }
.server-mini .stat-label { margin: 0; }
.server-mini strong { color: #f0f6fc; font: 700 22px 'Fira Code', Consolas, monospace; }
.server-mini small { font-size: 11px; overflow-wrap: anywhere; }

.monitor-controls { display: flex; flex-wrap: wrap; align-items: end; justify-content: end; gap: 10px 12px; }
.monitor-range { margin: 0; color: var(--cms-muted); font-size: 11px; font-weight: 500; }
.monitor-page .monitor-range select { height: 36px; margin-top: 4px; padding: 0 10px; background: #10161d; border-color: #3b4954; border-radius: 8px; font-size: 12px; }
.monitor-toggle { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 13px; border: 1px solid rgba(57,255,20,.4); border-radius: 8px; background: rgba(57,255,20,.08); color: var(--cms-green); font: 600 12px 'Fira Code', Consolas, monospace; cursor: pointer; }
.monitor-toggle:hover { background: rgba(57,255,20,.15); }
.monitor-toggle.is-paused { border-color: #4a5763; background: transparent; color: #b5c0cc; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: live-pulse 1.6s ease-in-out infinite; }
.is-paused .live-dot { animation: none; }
@keyframes live-pulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } .meter > span { transition: none; } }
.monitor-updated { flex-basis: 100%; margin: 0; color: var(--cms-muted); font: 11px 'Fira Code', Consolas, monospace; text-align: right; }
.monitor-page .alert { margin: 0 0 16px; font-size: 13px; }

.monitor-status { margin-bottom: 14px; }
.status-banner { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px 14px; padding: 15px 18px; border: 1px solid var(--cms-border); border-left: 3px solid var(--level-good); border-radius: 12px; background: var(--cms-card); }
.status-banner-warning { border-left-color: var(--level-warning); }
.status-banner-critical { border-left-color: var(--level-critical); }
.status-banner-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: rgba(131,232,121,.1); color: var(--level-good); font: 700 15px 'Fira Code', Consolas, monospace; }
.status-banner-warning .status-banner-icon { background: rgba(223,183,108,.12); color: var(--level-warning); }
.status-banner-critical .status-banner-icon { background: rgba(255,121,121,.12); color: var(--level-critical); }
.status-banner strong { color: #f0f6fc; font-size: 14px; }
.status-banner p { margin: 2px 0 0; color: var(--cms-muted); font-size: 12px; }
.alert-list { grid-column: 1 / -1; display: grid; gap: 7px; margin: 10px 0 0; padding: 12px 0 0; border-top: 1px solid #28313a; list-style: none; font-size: 12px; color: #c6d0da; }
.alert-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.alert-area { color: var(--cms-muted); font: 11px 'Fira Code', Consolas, monospace; }

.monitor-tile { min-height: 150px; }
.monitor-tile .meter { margin-top: 12px; }
.monitor-tile small { line-height: 1.5; }
.monitor-section { margin-top: 40px; }
.monitor-section .section-heading { margin-bottom: 14px; }
.monitor-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.monitor-columns-wide-end { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.monitor-panel { min-width: 0; padding: 18px 20px; border-radius: 12px; background: var(--cms-card); }
.monitor-columns + .monitor-panel, .monitor-panel + .monitor-columns, .monitor-panel + .monitor-panel { margin-top: 14px; }
.panel-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; margin-bottom: 14px; }
.panel-head h3 { margin: 0; color: #f0f6fc; font-size: 14px; }
.panel-head span { color: var(--cms-muted); font: 11px 'Fira Code', Consolas, monospace; overflow-wrap: anywhere; }
.panel-empty, .panel-note { margin: 0; color: var(--cms-muted); font-size: 12px; line-height: 1.6; }
.panel-note { margin-top: 12px; font-size: 11px; }
.kv { display: grid; grid-template-columns: minmax(110px, auto) minmax(0, 1fr); gap: 9px 16px; margin: 0; font-size: 12px; }
.kv dt { color: var(--cms-muted); }
.kv dd { margin: 0; color: #dbe5ec; overflow-wrap: anywhere; }
.kv .table-meter { max-width: 260px; }
.big-meter { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.big-meter strong { color: #f0f6fc; font: 700 26px 'Fira Code', Consolas, monospace; }
.core-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px 18px; }
.core { display: grid; grid-template-columns: 52px 1fr 48px; align-items: center; gap: 10px; font-size: 11px; }
.core span { color: var(--cms-muted); }
.core b { color: #dbe5ec; font: 500 11px 'Fira Code', Consolas, monospace; text-align: right; }

.monitor-table { font-size: 12px; }
.monitor-table th { padding: 8px 10px; color: var(--cms-muted); font-size: 11px; font-weight: 600; white-space: nowrap; }
.monitor-table td { padding: 9px 10px; border-color: #28313a; color: #dbe5ec; vertical-align: middle; }
.monitor-table tbody tr:last-child td { border-bottom: 0; }
.monitor-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mono { font-family: 'Fira Code', Consolas, monospace; font-size: 11px; overflow-wrap: anywhere; }
.monitor-page .muted { color: var(--cms-muted); }
.table-meter { display: grid; grid-template-columns: minmax(70px, 1fr) auto; align-items: center; gap: 10px; min-width: 130px; }
.table-meter b { font: 500 11px 'Fira Code', Consolas, monospace; white-space: nowrap; }
.tag { display: inline-block; margin-left: 7px; padding: 1px 5px; border: 1px solid #3d4a55; border-radius: 4px; color: var(--cms-cyan); font: 10px 'Fira Code', Consolas, monospace; }
.address-list { display: flex; flex-direction: column; gap: 2px; }
.http-classes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
.http-class { display: flex; flex-direction: column; gap: 3px; padding: 10px; border: 1px solid #28313a; border-radius: 8px; background: #10161d; }
.http-class span { color: var(--cms-muted); font: 600 11px 'Fira Code', Consolas, monospace; }
.http-class strong { color: #f0f6fc; font: 700 17px 'Fira Code', Consolas, monospace; }
.http-class small { font-size: 10px; }
.service-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; font-size: 12px; }
.service-list li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 11px; border: 1px solid #28313a; border-radius: 8px; background: #10161d; }

.chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.chart-card { min-width: 0; padding: 16px 18px 12px; border: 1px solid var(--cms-border); border-radius: 12px; background: var(--cms-card); }
.chart-card header { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.chart-card h3 { margin: 0; color: #f0f6fc; font-size: 13px; }
.chart-card header p { margin: 3px 0 0; color: var(--cms-muted); font-size: 11px; }
.chart-current { color: #f0f6fc; font: 600 18px 'Fira Code', Consolas, monospace; white-space: nowrap; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 8px 0 0; padding: 0; list-style: none; color: #c6d0da; font-size: 11px; }
.chart-legend li { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i, .chart-tooltip i { display: inline-block; width: 12px; height: 3px; border-radius: 2px; }
.chart-legend b { color: #f0f6fc; font: 600 11px 'Fira Code', Consolas, monospace; }
.chart-plot { position: relative; margin-top: 8px; }
.chart-svg { display: block; width: 100%; height: 190px; overflow: visible; touch-action: pan-y; }
.chart-axes line { stroke: #26313b; stroke-width: 1; }
.chart-axes text { fill: #7d8a98; font: 10px 'Fira Code', Consolas, monospace; font-variant-numeric: tabular-nums; }
.chart-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-dot { stroke: var(--cms-card); stroke-width: 2; }
.chart-cross { stroke: #56636f; stroke-width: 1; }
.chart-tooltip { position: absolute; top: 4px; z-index: 2; display: grid; gap: 4px; min-width: 130px; padding: 8px 10px; border: 1px solid #3b4954; border-radius: 8px; background: #0d1117; box-shadow: 0 10px 25px rgba(0,0,0,.4); color: #c6d0da; font-size: 11px; pointer-events: none; }
.chart-tooltip[hidden] { display: none; }
.chart-tooltip strong { color: #f0f6fc; font: 600 11px 'Fira Code', Consolas, monospace; }
.chart-tooltip span { display: flex; align-items: center; gap: 6px; }
.chart-tooltip b { margin-left: auto; padding-left: 10px; color: #f0f6fc; font: 600 11px 'Fira Code', Consolas, monospace; }
.chart-empty { position: absolute; inset: 0 0 26px 58px; display: grid; place-items: center; margin: 0; color: var(--cms-muted); font: 11px 'Fira Code', Consolas, monospace; }
.chart-empty[hidden] { display: none; }
.chart-table { margin-top: 6px; font-size: 11px; }
.chart-table summary { width: fit-content; color: var(--cms-cyan); cursor: pointer; }
.chart-table .table-wrap { max-height: 220px; margin-top: 8px; overflow-y: auto; }

@media (max-width: 980px) {
  .chart-grid, .monitor-columns, .monitor-columns-wide-end { grid-template-columns: minmax(0, 1fr); }
  .server-strip-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .monitor-controls { justify-content: start; }
  .monitor-updated { text-align: left; }
  .http-classes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .monitor-panel { padding: 16px; }
}
@media (max-width: 470px) {
  .dashboard-page .admin-header nav a.admin-server-link, .monitor-page .admin-header nav a.admin-dashboard-link { display: inline; }
  .monitor-page .admin-header nav a.admin-categories-link { display: none; }
  .server-strip-grid { grid-template-columns: minmax(0, 1fr); }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .kv dd { margin-bottom: 8px; }
}

/* App statistics (Play Console and AdMob). Reuses the monitor's panels, tiles, and charts. */
.apps-page .monitor-controls form { margin: 0; }
.apps-page .monitor-controls button.apps-sync { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 13px; border: 1px solid rgba(57,255,20,.4); border-radius: 8px; background: rgba(57,255,20,.08); color: var(--cms-green); font: 600 12px 'Fira Code', Consolas, monospace; }
.apps-page .monitor-controls button.apps-sync:hover { background: rgba(57,255,20,.15); }
.apps-page .monitor-controls button.apps-sync:disabled { cursor: progress; opacity: .7; }
.apps-sources { margin-bottom: 14px; }
.apps-sources > .monitor-panel { margin-top: 0; }
.apps-sources .panel-head { align-items: center; }
.apps-sources .panel-head .status { font: 600 11px Inter, system-ui, sans-serif; }
.apps-sources .panel-head .status-live { color: var(--level-good); }
.apps-sources .panel-head .status-draft { color: var(--level-warning); }
.apps-sources .panel-head .status-down { color: var(--level-critical); }
.apps-page .admin-header nav a.admin-server-link { color: #b5c0cc; }
.apps-page .admin-header nav a.admin-server-link:hover { color: var(--cms-green); }
.apps-page .panel-empty code { color: var(--cms-cyan); }
.apps-tiles .monitor-tile small + small { margin-top: 4px; }
.chart-card-wide { grid-column: 1 / -1; }
[data-apps] #apps-tiles, [data-apps] #apps-charts, [data-apps] #apps-table { transition: opacity .2s ease; }
[data-apps].is-loading #apps-tiles, [data-apps].is-loading #apps-charts, [data-apps].is-loading #apps-table { opacity: .6; }
.app-cell { display: flex; align-items: center; gap: 10px; min-width: 190px; }
.app-avatar { flex: 0 0 32px; width: 32px; height: 32px; border-radius: 8px; font-size: 15px; }
.app-name { display: flex; flex-direction: column; align-items: start; gap: 3px; min-width: 0; }
.app-name .text-button { color: #f0f6fc; font-size: 12px; font-weight: 600; text-align: left; }
.app-name .text-button:hover { color: var(--cms-green); }
.app-name small { margin: 0; color: var(--cms-muted); font-size: 10px; white-space: normal; }
.apps-table tbody th, .apps-table tfoot th { padding: 9px 10px; color: #dbe5ec; font-size: 12px; font-weight: 400; white-space: normal; }
.apps-table tr.is-selected th, .apps-table tr.is-selected td { background: rgba(57,255,20,.05); }
.apps-table tr.is-selected .app-name .text-button { color: var(--cms-green); }
.apps-table tfoot th, .apps-table tfoot td { border-top: 1px solid var(--cms-border); border-bottom: 0; color: #f0f6fc; font-weight: 600; }
@media (max-width: 470px) {
  .dashboard-page:not(.monitor-page) .admin-header nav a.admin-apps-link { display: inline; }
}

/* ---------- Profile and messages ---------- */
.notice { background: rgba(57,255,20,.08); color: #d6ffd0; border: 1px solid rgba(57,255,20,.35); padding: .8rem 1rem; border-radius: 8px; font-size: 13px; }
.notice a { color: var(--cms-green); }
.editor-page .notice { margin: 0 0 18px; }
.dashboard-hero-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; }
.dashboard-hero .button-ghost, .button-ghost { background: transparent; color: #d7e0e8; border: 1px solid #3d4a55; }
.dashboard-hero .button-ghost:hover, .button-ghost:hover { background: rgba(57,255,20,.06); color: var(--cms-green); border-color: rgba(57,255,20,.45); }
.nav-count { display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 999px; background: var(--cms-green); color: #0d1117; font: 700 10px/16px 'Fira Code', Consolas, monospace; }
.profile-page code { color: var(--cms-green); font-family: 'Fira Code', Consolas, monospace; }
.profile-current { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 12px 3px 2px; font-size: 12px; }
.profile-current img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; border: 1px solid #34424c; }
.profile-current .check { margin: 0; color: #ff9999; font-size: 11px; }
.profile-current .check input { accent-color: #ff7979; }
.message-list { display: grid; gap: 12px; }
.message-item { padding: 18px 20px; }
.message-item.is-unread { border-color: rgba(57,255,20,.45); }
.message-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.message-head strong { color: #f0f6fc; }
.message-head time { color: var(--cms-muted); font: 11px 'Fira Code', Consolas, monospace; }
.message-new { margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: rgba(57,255,20,.12); color: var(--cms-green); font: 600 10px 'Fira Code', Consolas, monospace; }
.message-contact { margin: 6px 0 10px; font-size: 12px; overflow-wrap: anywhere; }
.message-body { margin: 0 0 12px; color: #d7e0e8; font-size: 13px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.message-item form { text-align: right; }
.message-item .text-button { font-size: 11px; }
@media (max-width: 760px) {
  .dashboard-hero-actions { justify-content: flex-start; }
}

/* ---------- Scan job (DeepSeek vision form fill) ---------- */
.scan-page .scan-container { max-width: 1208px; }
.scan-page .alert { margin: 0 0 16px; font-size: 13px; }
.scan-page .alert code { color: #ffe4e8; font-family: 'Fira Code', Consolas, monospace; }
.scan-layout { display: grid; grid-template-columns: minmax(290px, 380px) minmax(0, 1fr); gap: 18px; align-items: start; }
.scan-side { position: sticky; top: 16px; display: grid; gap: 18px; }
.scan-side .form-section { margin: 0; }
.scan-page .upload-zone { min-height: 180px; }
.scan-page .upload-zone[hidden] { display: none; }
.scan-preview { margin: 0; }
.scan-preview-frame { display: block; width: 100%; max-height: 62vh; padding: 0; overflow: auto; border: 1px solid #34424c; border-radius: 9px; background: #0d1117; cursor: zoom-in; }
.scan-preview-frame img { display: block; width: 100%; height: auto; }
.scan-preview-frame.is-zoomed { cursor: zoom-out; }
.scan-preview-frame.is-zoomed img { width: 220%; max-width: none; }
.scan-preview figcaption { display: flex; justify-content: space-between; gap: 10px; margin-top: 8px; color: var(--cms-muted); font: 11px 'Fira Code', Consolas, monospace; overflow-wrap: anywhere; }
.scan-preview figcaption .text-button { flex: none; color: #ff9d9d; font-size: 11px; }
.scan-page .scan-run { display: inline-flex; align-items: center; justify-content: center; gap: 9px; width: 100%; margin-top: 16px; font-size: 13px; }
.scan-page .scan-run:disabled { background: #2b3a31; color: #8fa596; cursor: not-allowed; }
.scan-page .scan-run.is-busy { cursor: progress; }
.scan-spinner { display: none; width: 13px; height: 13px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: scan-spin .8s linear infinite; }
.scan-run.is-busy .scan-spinner { display: inline-block; }
@keyframes scan-spin { to { transform: rotate(360deg); } }
.scan-notes { margin: 0; padding-left: 18px; color: #d7e0e8; font-size: 12px; line-height: 1.6; }
.scan-notes li + li { margin-top: 6px; }
.scan-transcript { margin-top: 14px; font-size: 12px; }
.scan-transcript summary { color: var(--cms-cyan); cursor: pointer; }
.scan-transcript pre { max-height: 320px; margin: 10px 0 0; padding: 12px; overflow: auto; border: 1px solid #34424c; border-radius: 8px; background: #10161d; color: #c9d4dd; font: 11px/1.6 'Fira Code', Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.scan-form .form-section:first-of-type { margin-top: 0; }
.scan-grid .scan-field-wide { grid-column: 1 / -1; }
.scan-field { position: relative; }
.scan-label { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; }
fieldset.scan-field { min-width: 0; margin: 0 0 1.15rem; padding: 0; border: 0; }
fieldset.scan-field legend { padding: 0; color: #dbe5ec; font-size: 13px; font-weight: 600; }
.scan-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; margin-top: .5rem; }
.scan-page .scan-check { margin: 0; padding: 8px 10px; border: 1px solid #34424c; border-radius: 7px; background: #10161d; font-size: 12px; cursor: pointer; }
.scan-page .scan-check:has(input:checked) { border-color: rgba(57,255,20,.5); background: rgba(57,255,20,.07); color: #e6ffe0; }
.scan-tag { margin-left: 4px; padding: 1px 6px; border-radius: 999px; background: rgba(88,209,235,.14); color: var(--cms-cyan); font: 600 10px 'Fira Code', Consolas, monospace; }
.scan-tag:empty { display: none; }
.scan-tag.scan-tag-check { background: rgba(255,189,46,.15); color: #ffcf6b; }
.scan-field.is-ai input:not([type=checkbox]), .scan-field.is-ai select, .scan-field.is-ai textarea, .scan-field.is-ai .ts-control { border-color: rgba(88,209,235,.55); }
.scan-field.is-uncertain input:not([type=checkbox]), .scan-field.is-uncertain select, .scan-field.is-uncertain textarea, .scan-field.is-uncertain .ts-control, .scan-field.is-uncertain .scan-check { border-color: rgba(255,189,46,.7); }
.scan-field.is-invalid input:not([type=checkbox]), .scan-field.is-invalid select, .scan-field.is-invalid textarea, .scan-field.is-invalid .ts-control, .scan-field.is-invalid .scan-check { border-color: #ff7979; }
.scan-page input[type=date], .scan-page input[type=time] { color-scheme: dark; }
.scan-page .ts-wrapper.multi .ts-control { min-height: 42px; padding: 6px 8px; border: 1px solid #3b4954; border-radius: 8px; background: #10161d; box-shadow: none; color: #e6edf3; }
.scan-page .ts-wrapper.multi .ts-control > div { margin: 2px 4px 2px 0; padding: 3px 4px 3px 8px; border: 1px solid rgba(57,255,20,.35); border-radius: 6px; background: rgba(57,255,20,.1); color: #e6ffe0; font-size: 12px; }
.scan-page .ts-wrapper.plugin-remove_button .item .remove { border-left-color: rgba(57,255,20,.3); color: #b5c0cc; }
.scan-page .ts-wrapper.plugin-remove_button .item .remove:hover { background: rgba(255,121,121,.15); color: #ff9d9d; }
.scan-page .ts-dropdown .ts-dropdown-content { max-height: 280px; }
.scan-layout.is-scanning .scan-form { opacity: .6; pointer-events: none; transition: opacity .2s ease; }
.scan-page .scan-actions { flex-wrap: wrap; gap: 12px 18px; }
.scan-page .admin-header nav a.admin-server-link { color: #b5c0cc; }
.scan-page .admin-header nav a.admin-server-link:hover { color: var(--cms-green); }
.scan-page .scan-actions .text-button { font-size: 13px; }
.scan-page .scan-actions .button-ghost { padding: .7rem 1rem; font-size: 13px; }
.scan-page .scan-actions button[type=submit] { font-size: 13px; }
.scan-page [data-scan-form-error], .scan-page .scan-sent { margin: 6px 0 0; }
.scan-page .scan-actions button[type=submit]:disabled { background: #2b3a31; color: #8fa596; cursor: not-allowed; }
@media (max-width: 900px) {
  .scan-layout { grid-template-columns: minmax(0, 1fr); }
  .scan-side { position: static; }
  .scan-preview-frame { max-height: 50vh; }
}
@media (max-width: 470px) {
  .scan-page .admin-header nav a { display: none; }
  .scan-page .admin-header nav a.admin-dashboard-link { display: inline; }
  .scan-page .form-section { padding: 18px; }
  .scan-checks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
