:root {
  font-family: "Avenir Next", "Segoe UI Variable", "Segoe UI", ui-sans-serif, system-ui, sans-serif;
  color: #152238;
  background: #eef2f6;
  --ink: #152238;
  --ink-soft: #50617a;
  --muted: #7b899e;
  --line: #d9e1ea;
  --line-soft: #e9eef3;
  --canvas: #eef2f6;
  --surface: #ffffff;
  --navy: #0b1728;
  --blue: #1769e0;
  --blue-dark: #0f57bf;
  --blue-wash: #e8f1ff;
  --green: #168b59;
  --green-wash: #e2f6ec;
  --amber: #a96d00;
  --amber-wash: #fff4d9;
  --red: #bd4437;
  --red-wash: #ffebe8;
  line-height: 1.45;
}
* { box-sizing: border-box; }
html { background: var(--canvas); }
body { margin: 0; background: var(--canvas); }
button, input, select, textarea { font: inherit; }
a { color: var(--blue); text-decoration: none; cursor: pointer; }
button { cursor: pointer; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 100; top: 10px; left: 12px; transform: translateY(-180%); background: var(--blue); color: #fff; padding: 9px 13px; border-radius: 5px; box-shadow: 0 8px 22px #10264d44; transition: transform .18s ease; }
.skip-link:focus { transform: translateY(0); outline: 3px solid #9bc5ff; outline-offset: 2px; }
.app-shell { min-height: 100vh; display: flex; }
.sidebar { width: 248px; flex: none; display: flex; flex-direction: column; padding: 24px 16px 18px; color: #c3d0e1; background: var(--navy); border-right: 1px solid #1d304b; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; margin: 0 10px 54px; }
.brand img { width: 38px; height: 38px; object-fit: contain; padding: 7px; background: #fff; border-radius: 9px; }
.brand-copy { display: grid; gap: 2px; }
.brand-copy strong { font-size: 16px; letter-spacing: .14em; line-height: 1; }
.brand-copy small { color: #91a6c2; font-size: 10px; letter-spacing: .02em; }
.sidebar nav { display: grid; gap: 3px; }
.nav-label { display: block; margin: 0 12px 8px; color: #7890af; font-size: 10px; font-weight: 700; letter-spacing: .17em; text-transform: uppercase; }
.nav-label:not(:first-child) { margin-top: 24px; }
.nav-item { display: flex; align-items: center; gap: 11px; min-height: 42px; padding: 10px 12px; color: #aebdd1; border: 1px solid transparent; border-radius: 7px; font-size: 13px; transition: color .18s ease, background .18s ease, border-color .18s ease; }
.nav-item:hover { color: #fff; background: #142844; }
.nav-item.active { color: #fff; background: #1b3a64; border-color: #2b578d; box-shadow: inset 3px 0 #4f9aff; }
.nav-icon { width: 19px; height: 19px; display: inline-flex; align-items: center; justify-content: center; color: #7faef0; text-align: center; }
.nav-icon morph-icon { display: block; width: 18px; height: 18px; }
.sidebar-footer { margin-top: auto; padding: 18px 10px 0; border-top: 1px solid #263852; }
.service-state { display: flex; align-items: center; gap: 8px; color: #c7d3e2; font-size: 12px; }
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #28b873; box-shadow: 0 0 0 3px #28b87320; }
.status-dot.offline { background: #ee6b5d; box-shadow: 0 0 0 3px #ee6b5d20; }
.logout-button { margin-top: 17px; padding: 0; color: #9db0c9; background: none; border: 0; font-size: 12px; }
.logout-button:hover { color: #fff; }
.main { flex: 1; min-width: 0; padding: 28px clamp(24px, 4vw, 64px) 70px; }
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; max-width: 1500px; margin: 0 auto 18px; }
.page-header > div { display: flex; align-items: baseline; gap: 16px; min-width: 0; }
.page-header h1 { margin: 0; color: var(--ink); font-size: clamp(28px, 2.4vw, 38px); font-weight: 760; letter-spacing: -.055em; line-height: 1.05; }
.eyebrow { margin: 0 0 10px; color: #6880a0; font-size: 10px; font-weight: 760; letter-spacing: .16em; text-transform: uppercase; }
.page-header > div > .eyebrow { margin: 0; white-space: nowrap; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 15px; color: #304765; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; font-size: 13px; font-weight: 700; transition: transform .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease; }
.button:hover { border-color: #b6c6d8; background: #f9fbfd; transform: translateY(-1px); }
.button.primary { color: #fff; background: var(--blue); border-color: var(--blue); box-shadow: 0 8px 18px #1769e02b; }
.button.primary:hover { color: #fff; background: var(--blue-dark); border-color: var(--blue-dark); box-shadow: 0 10px 22px #1769e03b; }
.button:active { transform: translateY(0); }
.button:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 3px solid #93c0ff; outline-offset: 2px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; max-width: 1500px; margin: 0 auto 24px; }
.stat-card { position: relative; min-height: 140px; padding: 22px 22px 19px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; box-shadow: 0 8px 24px #1a3b6410; }
.stat-card::after { content: ""; position: absolute; top: 0; left: 0; width: 38px; height: 3px; background: var(--blue); }
.stat-card span, .stat-card small, .storage-grid small { display: block; color: var(--muted); font-size: 12px; }
.stat-card strong { display: block; margin: 13px 0 5px; color: var(--ink); font-size: 32px; font-weight: 760; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.skeleton { min-height: 140px; background: linear-gradient(90deg, #e5ebf2 25%, #f2f5f8 37%, #e5ebf2 63%); background-size: 400% 100%; border-radius: 9px; animation: shimmer 1.4s ease infinite; }
@keyframes shimmer { to { background-position: -135% 0; } }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(320px, .85fr); gap: 18px; max-width: 1500px; margin: 0 auto; }
.panel { min-width: 0; padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; box-shadow: 0 8px 24px #1a3b640b; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.section-heading h2 { margin: 0; color: var(--ink); font-size: 17px; letter-spacing: -.025em; }
.section-heading a { font-size: 12px; font-weight: 700; }
.recent-row { display: flex; align-items: center; gap: 13px; min-height: 70px; padding: 11px 0; color: var(--ink); border-bottom: 1px solid var(--line-soft); }
.recent-row:last-child { border-bottom: 0; }
.recent-row > span:nth-child(2) { display: grid; flex: 1; min-width: 0; gap: 3px; }
.recent-row strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.recent-row small, .subline { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.health-row { display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 10px 0; color: var(--ink-soft); border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.health-row:last-child { border-bottom: 0; }
.health-row strong { font-size: 12px; }
.good { color: var(--green); }
.warning { color: var(--amber); }
.media-panel { max-width: 1500px; margin: 0 auto; padding: 18px 20px 21px; }
.page-header.media-page-header { margin-bottom: 8px; }
.page-header.media-page-header h1 { display: none; }
.page-header.media-page-header > div { gap: 0; }
.media-toolbar { display: grid; grid-template-columns: auto minmax(220px, 1fr) repeat(4, max-content); gap: 8px; align-items: center; margin-bottom: 20px; padding-bottom: 17px; border-bottom: 1px solid var(--line-soft); }
.media-toolbar > #upload { min-height: 36px; padding: 0 13px; white-space: nowrap; box-shadow: none; }
.media-toolbar select, .search input { width: 100%; height: 40px; padding: 0 12px; color: var(--ink-soft); background: #fbfcfe; border: 1px solid var(--line); border-radius: 6px; }
.media-toolbar select { min-width: 128px; }
.media-toolbar select:hover, .search input:hover { border-color: #afc0d3; }
.search { min-width: 0; }
.table-wrap { overflow: auto; }
.media-table { width: 100%; min-width: 1240px; border-collapse: collapse; }
.media-table th:nth-child(1), .media-table td:nth-child(1) { width: 88px; }
.media-table th:nth-child(2), .media-table td:nth-child(2) { width: 360px; min-width: 300px; }
.media-table th:nth-child(3), .media-table td:nth-child(3) { width: 72px; }
.media-table th:nth-child(4), .media-table td:nth-child(4) { width: 72px; }
.media-table th:nth-child(5), .media-table td:nth-child(5) { width: 110px; }
.media-table th:nth-child(6), .media-table td:nth-child(6) { width: 82px; }
.media-table th:nth-child(7), .media-table td:nth-child(7), .media-table th:nth-child(8), .media-table td:nth-child(8), .media-table th:nth-child(9), .media-table td:nth-child(9) { width: 62px; white-space: nowrap; }
.media-table th:nth-child(10), .media-table td:nth-child(10) { width: 110px; white-space: nowrap; }
.media-table th:nth-child(11), .media-table td:nth-child(11) { width: 58px; white-space: nowrap; }
.media-table th { padding: 0 10px 12px; color: #76879e; border-bottom: 1px solid var(--line); font-size: 10px; font-weight: 760; letter-spacing: .1em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.media-table td { padding: 13px 10px; border-bottom: 1px solid var(--line-soft); color: var(--ink-soft); font-size: 12px; vertical-align: middle; }
.media-table tbody tr:hover { background: #f8fbff; }
.preview-button { position: relative; display: block; width: 68px; height: 50px; padding: 0; overflow: hidden; background: #edf2f7; border: 1px solid var(--line); border-radius: 6px; }
.preview-button img { display: block; width: 100%; height: 100%; object-fit: cover; }
.video-thumb span, .pdf-thumb span, .model-thumb span { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; background: #0b1728a6; font-size: 14px; }
.model-thumb { background: linear-gradient(135deg, #0d2846, #147d9b); color: #fff; }
.model-viewer-overlay { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 24px; background: #020914d9; }
.model-viewer { position: relative; width: min(960px, 96vw); height: min(720px, 90vh); overflow: hidden; background: #07172a; border: 1px solid #ffffff26; border-radius: 12px; box-shadow: 0 24px 80px #0009; }
.model-viewer-stage { height: calc(100% - 58px); position: relative; }
.model-viewer-stage canvas { display: block; width: 100%; height: 100%; }
.model-viewer-status { position: absolute; inset: 0; display: grid; place-items: center; color: #d9ecff; margin: 0; z-index: 1; }
.model-viewer-status.is-error { color: #ffb4a7; }
.model-viewer-close { position: absolute; top: 10px; right: 14px; z-index: 2; color: #fff; background: #07172acc; border: 1px solid #ffffff40; border-radius: 50%; width: 32px; height: 32px; font-size: 22px; cursor: pointer; }
.model-viewer-toolbar { min-height: 58px; display: flex; align-items: center; gap: 16px; padding: 8px 20px; color: #fff; background: #0d2239; }
.model-viewer-toolbar span { color: #9cb6cc; font-size: 12px; }
.model-viewer-actions { display: flex; gap: 6px; }
.model-viewer-actions button { border: 1px solid #ffffff33; border-radius: 5px; padding: 5px 9px; color: #d9ecff; background: #ffffff0d; cursor: pointer; font-size: 12px; }
.model-viewer-actions button:hover, .model-viewer-actions button.active { color: #07172a; background: #fdb813; border-color: #fdb813; }
.explode-control { display: inline-flex; align-items: center; gap: 7px; color: #d9ecff; font-size: 12px; white-space: nowrap; }
.explode-control output { min-width: 34px; color: #fdb813; font-variant-numeric: tabular-nums; }
.explode-control input { width: 108px; accent-color: #fdb813; cursor: ew-resize; }
.explode-control input:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
@media (max-width: 760px) {
  .model-viewer-toolbar { flex-wrap: wrap; gap: 8px 12px; padding: 9px 12px; }
  .model-viewer-toolbar > span { order: 4; width: 100%; }
  .explode-control input { width: 92px; }
  .model-viewer-download { margin-left: auto; }
}
.model-viewer-download { margin-left: auto; color: #fdb813; font-size: 13px; }
.pdf-thumb span { font-size: 10px; font-weight: 800; }
.asset-name { display: block; width: 100%; max-width: 340px; padding: 0; overflow: hidden; color: var(--ink); background: none; border: 0; font-size: 13px; font-weight: 750; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.media-table .subline { max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset-name:hover { color: var(--blue); }
.type-pill, .status { display: inline-block; padding: 4px 8px; border-radius: 4px; font-size: 10px; font-weight: 760; white-space: nowrap; }
.type-pill.image { color: var(--blue); background: var(--blue-wash); }
.type-pill.video { color: #6f4bb1; background: #f1eaff; }
.type-pill.pdf { color: #b34f32; background: #fff0eb; }
.status.synced { color: var(--green); background: var(--green-wash); }
.status.pending { color: #8a5a00; background: #fff4d6; }
.status.local_only, .status.not_configured { color: #63758d; background: #edf1f5; }
.status.failed { color: var(--red); background: var(--red-wash); }
.row-action { padding: 7px 8px; color: #456583; background: transparent; border: 1px solid transparent; border-radius: 5px; font-size: 12px; }
.row-action:hover { color: var(--blue); background: var(--blue-wash); border-color: #c5dbfb; }
.empty-cell, .loading-cell { padding: 60px !important; color: var(--muted); text-align: center !important; }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding-top: 17px; color: var(--muted); font-size: 12px; }
.pager-button { min-width: 64px; padding: 6px 10px; font-size: 12px; }
.pager-button:disabled { cursor: not-allowed; opacity: .45; }
.storage-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.storage-grid > div { min-height: 130px; padding: 20px; background: #fbfcfe; border: 1px solid var(--line); border-radius: 8px; }
.storage-grid span { display: block; color: var(--ink-soft); font-size: 13px; }
.storage-grid strong { display: block; margin: 15px 0 7px; font-size: 18px; }
.storage-detail { margin-top: 18px; padding: 22px; background: #fbfcfe; border: 1px solid var(--line); border-radius: 8px; }
.storage-detail .section-heading { margin-bottom: 18px; }
.storage-detail h2 { margin: 0; color: var(--ink); font-size: 17px; letter-spacing: -.025em; }
.storage-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; margin: 0; }
.storage-details div { padding: 13px 0; border-top: 1px solid var(--line-soft); }
.storage-details dt { color: var(--muted); font-size: 11px; }
.storage-details dd { margin: 5px 0 0; color: var(--ink-soft); font-size: 13px; overflow-wrap: anywhere; }
.modal-backdrop, .drawer-backdrop { position: fixed; z-index: 30; inset: 0; background: #07172aaa; }
.modal, .preview-modal, .drawer { position: fixed; z-index: 31; background: var(--surface); }
.modal { top: 50%; left: 50%; width: min(680px, calc(100vw - 30px)); max-height: 90vh; padding: 26px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 28px 80px #07172a45; transform: translate(-50%, -50%); }
.modal-head, .drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.modal h2, .drawer h2 { margin: 0; color: var(--ink); font-size: 22px; letter-spacing: -.035em; }
.close { padding: 0 4px; color: var(--muted); background: none; border: 0; font-size: 27px; line-height: 1; }
.close:hover { color: var(--ink); }
.drop-zone { display: grid; place-items: center; gap: 8px; min-height: 145px; padding: 18px; color: var(--ink-soft); background: #f7faff; border: 1px dashed #9db7d2; border-radius: 8px; text-align: center; }
.drop-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop-zone strong { color: #234a7c; }
.drop-zone b { color: var(--blue); font-size: 12px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-top: 18px; }
.form-grid .wide { grid-column: 1 / -1; }
label { position: relative; display: grid; gap: 7px; color: #52657d; font-size: 12px; font-weight: 700; }
input, select, textarea { padding: 10px 11px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 6px; }
textarea { resize: vertical; }
.auto-button { position: absolute; right: 6px; bottom: 7px; padding: 4px 7px; color: var(--blue); background: var(--blue-wash); border: 0; border-radius: 4px; font-size: 11px; }
.form-hint, .form-message, .muted { color: var(--muted); font-size: 12px; }
.seo-locale-editor { margin-top: 18px; border: 1px solid var(--line); border-radius: 8px; background: #fbfdff; }
.seo-locale-editor summary { cursor: pointer; padding: 12px 14px; color: var(--ink); font-size: 12px; font-weight: 760; }
.seo-locale-editor > summary { display: flex; align-items: center; gap: 8px; }
.seo-ai-action { margin-left: auto; padding: 5px 9px; font-size: 11px; line-height: 1.2; }
.seo-locale-editor > .form-hint { margin: 0 14px 12px; }
.seo-locale { margin: 0 14px 8px; padding: 0; border: 1px solid var(--line-soft); border-radius: 6px; }
.seo-locale summary { display: flex; align-items: center; gap: 6px; padding: 9px 10px; cursor: pointer; color: var(--ink-soft); font-size: 11px; font-weight: 760; list-style-position: inside; }
.seo-locale code { color: var(--muted); font-size: 10px; font-weight: 500; }
.seo-locale-fields { display: grid; gap: 8px; padding: 0 10px 10px; }
.seo-status { margin-left: auto; color: var(--muted); font-size: 10px; font-weight: 600; }
.seo-status.ready { color: var(--green); }
.seo-status.failed { color: var(--red); }
.seo-locale-editor [data-save-seo] { margin: 0 14px 14px; }
.upload-progress { margin-top: 16px; padding: 11px 12px; color: var(--ink-soft); background: #f7faff; border: 1px solid #d7e5f5; border-radius: 6px; }
.upload-progress-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; font-size: 11px; }
.upload-progress-meta strong { color: var(--blue); font-variant-numeric: tabular-nums; }
.upload-progress-track { height: 5px; overflow: hidden; background: #dce8f5; border-radius: 999px; }
.upload-progress-track span { display: block; width: 0; height: 100%; background: var(--blue); border-radius: inherit; transition: width .16s ease; }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 20px; }
.preview-modal { inset: 5vh 5vw; display: grid; place-items: center; padding: 35px; background: #07172af2; border-radius: 10px; }
.preview-modal img, .preview-modal video { max-width: 100%; max-height: 100%; object-fit: contain; }
.preview-modal iframe { width: 100%; height: 100%; background: #fff; border: 0; }
.preview-modal .close { position: absolute; top: 10px; right: 15px; color: #fff; }
.drawer { top: 50%; left: 50%; display: flex; flex-direction: column; box-sizing: border-box; width: min(760px, calc(100vw - 48px)); max-height: min(88vh, 900px); padding: 24px; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 24px 70px #07172a45; transform: translate(-50%, -50%); }
.drawer-head { flex: 0 0 auto; min-width: 0; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.drawer-head > div { min-width: 0; }
.drawer h2 { overflow-wrap: anywhere; }
.drawer-scroll { flex: 1 1 auto; min-height: 0; height: auto; overflow-y: auto; overscroll-behavior: contain; padding-bottom: 8px; }
.drawer-visual { display: flex; justify-content: center; margin-bottom: 12px; padding: 10px; background: #f1f5f9; border-radius: 8px; }
.detail-list { margin: 0; border-top: 1px solid var(--line); }
.detail-list div { display: flex; justify-content: space-between; gap: 15px; padding: 11px 0; border-bottom: 1px solid var(--line-soft); font-size: 12px; }
.detail-list dt { color: var(--muted); }
.detail-list dd { max-width: 68%; margin: 0; color: var(--ink-soft); text-align: right; word-break: break-word; }
.drawer form { display: grid; gap: 11px; margin-top: 14px; }
.drawer form .form-actions { position: sticky; bottom: 0; z-index: 1; margin: 6px 0 0; padding: 12px 0 2px; background: var(--surface); border-top: 1px solid var(--line); }
.toast-root { position: fixed; z-index: 50; right: 20px; bottom: 20px; display: grid; gap: 8px; }
.toast { padding: 11px 15px; color: #fff; background: #17243a; border-radius: 6px; box-shadow: 0 10px 25px #07172a2e; font-size: 13px; }
.toast.success { background: var(--green); }
.toast.error { background: var(--red); }
.popover { position: fixed; z-index: 45; min-width: 150px; padding: 5px; background: #fff; border: 1px solid var(--line); border-radius: 7px; box-shadow: 0 16px 35px #07172a2a; }
.popover button { display: block; width: 100%; padding: 9px 11px; color: #31445f; background: transparent; border: 0; border-radius: 5px; font-size: 12px; text-align: left; }
.popover button:hover, .popover button:focus-visible { color: var(--blue); background: var(--blue-wash); outline: none; }
.popover button.danger:hover, .popover button.danger:focus-visible { color: var(--red); background: var(--red-wash); }
.login-page { position: relative; isolation: isolate; display: grid; place-items: center; min-height: 100svh; padding: 28px; background: #edf2f7; }
.login-page::before { content: ""; position: fixed; z-index: -1; left: -260px; bottom: -290px; width: 560px; height: 560px; border-radius: 50%; background: #dce8f5; }
.login-page::after { content: ""; position: fixed; z-index: -1; top: -230px; right: -230px; width: 460px; height: 460px; border-radius: 50%; background: #f8fbfd; }
.login-card { display: grid; grid-template-columns: 190px minmax(0, 1fr); width: min(700px, 100%); min-height: 450px; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 25px 70px #17396220; }
.login-rail { display: flex; flex-direction: column; justify-content: space-between; padding: 32px 27px; color: #fff; background: var(--navy); border-right: 1px solid #1d304b; }
.login-brand { display: grid; justify-items: start; gap: 7px; margin: 0; }
.login-brand img { width: 52px; height: 52px; padding: 8px; object-fit: contain; background: #fff; border-radius: 9px; }
.login-brand strong { color: #fff; font-size: 15px; letter-spacing: .2em; }
.login-brand small { color: #91a6c2; font-size: 10px; }
.login-rail-meta { display: grid; gap: 10px; color: #94a8c1; font-size: 10px; font-weight: 700; letter-spacing: .16em; }
.login-rail-meta i { display: block; width: 28px; height: 1px; background: #3472b6; }
.login-rail-meta small { color: #89a1bd; font-size: 9px; letter-spacing: .14em; }
.login-panel { display: flex; flex-direction: column; justify-content: center; padding: 52px 55px 45px; }
.login-card .login-intro .eyebrow { margin-bottom: 12px; color: #57799d; font-size: 10px; font-weight: 760; letter-spacing: .16em; }
.login-card h1 { margin: 0; color: var(--ink); font-size: 30px; letter-spacing: -.055em; line-height: 1.15; }
.login-card > .login-panel .muted { max-width: 310px; margin: 13px 0 0; color: #5e738f; font-size: 13px; }
.login-card form { display: grid; gap: 18px; margin-top: 31px; }
.login-card label { gap: 8px; color: #354f6e; font-size: 12px; font-weight: 750; }
.login-card input { height: 50px; padding: 0 14px; background: #fff; border-color: #cbd9e7; border-radius: 5px; transition: border-color .16s ease, box-shadow .16s ease; }
.login-card input:hover { border-color: #9eb7d1; }
.login-card input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px #1769e01f; outline: 0; }
.password-wrap { position: relative; }
.password-wrap input { width: 100%; padding-right: 56px; border-radius: 5px; }
.login-card .password-toggle { position: absolute; top: 1px; right: 1px; bottom: 1px; display: inline-flex; align-items: center; justify-content: center; gap: 0; width: 46px; min-width: 46px; padding: 0; color: #355d87; background: transparent; border: 0; border-radius: 0 4px 4px 0; }
.login-card .password-toggle:hover { color: var(--blue); background: #edf4fc; }
.login-card .password-toggle morph-icon { display: block; width: 20px; height: 20px; }
.login-card .password-toggle:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.login-card .button.primary { height: 50px; border-radius: 5px; letter-spacing: .04em; }
.login-card .button.primary:disabled { cursor: wait; opacity: .72; box-shadow: none; transform: none; }
.login-card .form-message { min-height: 18px; margin: 0; color: var(--red); font-size: 12px; }
.login-footnote { margin: 30px 0 0; color: #5f7895; font-size: 10px; letter-spacing: .04em; }
.login-hint { margin: -4px 0 14px; color: #5f7895; font-size: 11px; line-height: 1.5; }
.login-remember { display: flex; align-items: center; gap: 8px; margin: 4px 0 8px; color: #355d87; font-size: 12px; }
.login-card .login-remember input[type="checkbox"] { width: 17px; height: 17px; min-height: 17px; margin: 0; padding: 0; accent-color: var(--blue); }
.login-footnote span { color: #2b83db; font-size: 8px; }
@media (max-width: 1100px) { .sidebar { width: 218px; } .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .dashboard-grid { grid-template-columns: 1fr; } }
@media (max-width: 720px) {
  .app-shell { display: block; }
  .sidebar { width: 100%; padding: 13px 14px 10px; }
  .brand { margin: 0 4px 13px; }
  .sidebar nav { display: flex; gap: 4px; overflow-x: auto; }
  .nav-label { display: none; }
  .nav-item { min-height: 38px; padding: 8px 10px; white-space: nowrap; }
  .sidebar-footer { display: none; }
  .main { padding: 27px 14px 50px; }
  .page-header { align-items: flex-start; margin-bottom: 16px; }
  .page-header > div { gap: 12px; flex-wrap: wrap; }
  .page-header h1 { font-size: 28px; }
  .page-header .button { min-height: 38px; padding: 0 11px; font-size: 12px; }
  .stats-grid, .storage-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { min-height: 122px; padding: 16px; }
  .stat-card strong { margin-top: 10px; font-size: 27px; }
  .panel { padding: 18px 15px; }
  .media-toolbar { grid-template-columns: auto 1fr 1fr; }
  .search { grid-column: 1 / -1; }
  .media-toolbar select { min-width: 0; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .wide { grid-column: auto; }
  .storage-details { grid-template-columns: 1fr; }
  .modal { padding: 20px; }
  .drawer { padding: 19px; }
  .login-page { padding: 16px; }
  .login-card { grid-template-columns: 1fr; min-height: 0; }
  .login-rail { display: block; padding: 22px 24px 20px; }
  .login-rail .login-brand { grid-template-columns: auto auto; grid-template-rows: auto auto; column-gap: 11px; align-items: center; }
  .login-rail .login-brand img { grid-row: span 2; width: 44px; height: 44px; }
  .login-rail .login-brand strong, .login-rail .login-brand small { align-self: end; }
  .login-rail .login-brand small { align-self: start; }
  .login-rail-meta { display: none; }
  .login-panel { padding: 32px 24px 28px; }
  .login-card h1 { font-size: 26px; }
}
@media (max-width: 430px) { .stats-grid, .storage-grid { grid-template-columns: 1fr; } .page-header { display: grid; grid-template-columns: 1fr; } .page-header .button { justify-self: start; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }

/* Media controls stay compact on narrow workspaces instead of forcing the panel wider than the viewport. */
.media-toolbar select, .search input { min-width: 0; font-size: 12px; }
@media (max-width: 720px) {
  .media-panel { overflow: hidden; }
  .media-toolbar { grid-template-columns: 1fr; gap: 8px; }
  .media-toolbar .toolbar-upload, .search { grid-column: auto; }
  .media-toolbar select, .search input { height: 38px; }
}
.confirm-dialog { position: fixed; z-index: 120; top: 50%; left: 50%; width: min(420px, calc(100vw - 32px)); padding: 24px; transform: translate(-50%, -50%); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 24px 70px #10264d40; }
.confirm-dialog h2 { margin: 0; color: var(--ink); font-size: 18px; }
.confirm-dialog p { margin: 12px 0 22px; color: var(--ink-soft); font-size: 13px; line-height: 1.65; }
.confirm-dialog .form-actions { justify-content: flex-end; margin-top: 0; }
.system-log-panel { margin-top: 18px; padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.storage-detail ~ .system-log-panel { display: none; }
.system-log-panel .section-heading { margin-bottom: 14px; }
.system-log-panel h2 { margin: 0; color: var(--ink); font-size: 17px; }
.log-count { color: var(--muted); font-size: 12px; }
.log-filters { display: grid; grid-template-columns: minmax(180px, 1fr) 130px auto auto; gap: 8px; margin-bottom: 14px; }
.log-filters input, .log-filters select { min-width: 0; height: 36px; padding: 0 10px; color: var(--ink-soft); background: #fbfcfe; border: 1px solid var(--line); border-radius: 6px; font-size: 12px; }
.log-filters .button { min-height: 36px; padding: 0 12px; font-size: 12px; }
.log-table { width: 100%; min-width: 720px; border-collapse: collapse; }
.log-table th { padding: 0 10px 10px; color: var(--muted); border-bottom: 1px solid var(--line); font-size: 10px; letter-spacing: .08em; text-align: left; }
.log-table td { padding: 11px 10px; color: var(--ink-soft); border-bottom: 1px solid var(--line-soft); font-size: 12px; vertical-align: top; }
.log-level { display: inline-flex; padding: 3px 7px; color: var(--blue); background: var(--blue-wash); border-radius: 999px; font-size: 11px; }
.log-level.warning { color: var(--amber); background: var(--amber-wash); }
.log-level.error { color: var(--red); background: var(--red-wash); }
.log-context { display: block; max-width: 420px; margin-top: 4px; color: var(--muted); font-size: 10px; overflow-wrap: anywhere; }
@media (max-width: 720px) { .log-filters { grid-template-columns: 1fr 1fr; } .log-filters input { grid-column: 1 / -1; } }
 .knowledge-panel{margin-top:24px;padding:18px;border:1px solid #d8e2ef;border-radius:10px;background:#f8fbff}.knowledge-panel .section-heading{display:flex;justify-content:space-between;align-items:center}.knowledge-panel h3{margin:0;font-size:16px}.knowledge-actions{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0}.knowledge-primary-actions{margin:16px 0 12px}.knowledge-help{margin:8px 0 14px;color:#637188;font-size:12px;line-height:1.6}.knowledge-section{margin-top:10px;border:1px solid #d8e2ef;border-radius:8px;background:#fff}.knowledge-section summary{display:flex;align-items:center;justify-content:space-between;min-height:44px;padding:0 13px;color:#23344d;font-size:13px;font-weight:600;cursor:pointer;list-style:none}.knowledge-section summary::-webkit-details-marker{display:none}.knowledge-section summary:before{content:'+';display:inline-flex;width:20px;height:20px;align-items:center;justify-content:center;margin-right:8px;color:#2768d8;border:1px solid #b9cceb;border-radius:50%;font-size:15px;font-weight:400}.knowledge-section[open] summary:before{content:'−'}.knowledge-section summary span{display:flex;align-items:center;flex:1}.knowledge-section summary small{color:#74839a;font-size:11px;font-weight:400}.knowledge-section-body{padding:0 13px 13px;border-top:1px solid #edf1f7}.knowledge-json{max-height:260px;overflow:auto;padding:12px;background:#0d1728;color:#d9e8ff;border-radius:8px;font-size:12px;white-space:pre-wrap}.knowledge-item{padding:10px 0;border-top:1px solid #e1e9f2}.knowledge-item p{margin:4px 0;color:#50627a}.knowledge-status{white-space:nowrap}.ai-unprocessed{color:#637188}.ai-processing{color:#b26b00}.ai-review_required{color:#9a5b00}.ai-published{color:#18844a}.ai-failed{color:#bb3d3d}
 .knowledge-result{display:block;width:100%;min-width:0;box-sizing:border-box;min-height:260px;margin-top:14px;padding:12px;line-height:1.6;resize:vertical}
 .knowledge-item-editor{padding:14px 0;border-top:1px solid #e5ebf3}.knowledge-item-editor:first-child{border-top:0}.knowledge-item-editor label{display:block;margin-top:10px;color:#52647d;font-size:12px}.knowledge-item-editor input,.knowledge-item-editor select,.knowledge-item-editor textarea{display:block;width:100%;box-sizing:border-box;margin-top:5px;padding:8px 10px;color:#24364f;background:#fff;border:1px solid #ccd8e7;border-radius:6px;font:inherit;font-size:12px}.knowledge-item-editor textarea{min-height:96px;resize:vertical;line-height:1.55}.knowledge-item-editor .section-heading{margin-bottom:4px}.knowledge-item-editor .button.link{padding:3px 0;color:#bb3d3d;background:transparent;box-shadow:none}
