.db-root { max-width: none !important; }
.db-shell { --db-row: 56px; --db-gap: 12px; position: relative; min-width: 0; }
.db-page-head { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-block-end: 24px; }
.db-page-head h1 { margin: 0; font-size: clamp(1.5rem, 2vw, 2rem); letter-spacing: -.025em; line-height: 1.25; }
.db-page-head p { margin-block: 8px 0; }
.db-save-state { display: inline-block; color: var(--text-3); font-size: .78rem; margin-block-start: 6px; }
.db-save-state.is-dirty { color: var(--degraded); }
.db-create { display: flex; gap: 8px; align-items: center; }
.db-create input { width: min(260px, 35vw); }
.db-create .btn { white-space: nowrap; }
.db-group-heading { display: flex; align-items: center; gap: 12px; margin-block: 32px 12px; }
.db-group-heading h2 { font-size: 1.05rem; margin: 0; }
.db-list { border-block-start: 1px solid var(--line); }
.db-list-row { display: flex; align-items: center; gap: 16px; color: var(--text); padding: 20px 12px; border-block-end: 1px solid var(--line); text-decoration: none; transition: background 150ms ease-out; }
.db-list-row:hover { background: var(--surface-raised, var(--surface)); }
.db-list-row > div { flex: 1; display: grid; gap: 6px; }
.db-list-row .muted { font-size: .8rem; }
.db-list-row svg, .db-shell .btn svg, .db-page-head .btn svg { width: 18px; height: 18px; flex: none; }
.db-list-row > svg:first-child { width: 24px; height: 24px; color: var(--accent); }
.db-empty-line { padding: 28px 12px; color: var(--text-3); border-block: 1px solid var(--line); }
.db-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding-block: 12px; border-block: 1px solid var(--line); margin-block-end: 16px; background: var(--bg); }
.db-toolbar .db-field { display: flex; align-items: center; gap: 8px; margin: 0; }
.db-toolbar .db-field > span { color: var(--text-3); font-size: .78rem; white-space: nowrap; }
.db-toolbar select { width: auto; min-width: 80px; }
.db-zoom-tools { display: flex; align-items: center; gap: 6px; margin-inline-start: auto; }
.db-zoom-tools input[type=range] { width: 100px; padding: 0; accent-color: var(--accent); }
.db-zoom-value { min-width: 48px; font-variant-numeric: tabular-nums; text-align: center; font-size: .85rem; }
.db-icon-btn { padding: 8px; min-width: 36px; display: inline-flex; align-items: center; justify-content: center; }
.db-icon-btn > span, .db-resize > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.db-notice { margin: 0; color: var(--text-2); }
.db-notice:not(:empty) { padding-block: 8px 16px; }
.db-notice.is-error { color: var(--down); }
.db-notice .btn { margin-inline-start: 12px; }
.db-delete-dashboard { color: var(--text-3); }
.db-name-input { font-size: 1.5rem; max-width: 600px; }
.db-viewport { width: 100%; overflow: auto; min-height: 280px; padding-block-end: 16px; scrollbar-color: var(--edge) transparent; scrollbar-width: thin; outline-offset: 3px; }
.db-canvas { position:relative; overflow:clip; }
.db-canvas > .db-grid { position:absolute; inset-block-start:0; inset-inline-start:0; }
.db-grid { display: grid; grid-template-columns: repeat(var(--db-columns, 12), minmax(0, 1fr)); grid-auto-rows: var(--db-row); gap: var(--db-gap); position: relative; min-width: 0; align-items: stretch; }
.db-widget { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; position: relative; overflow: hidden; transition: border-color 150ms ease-out, box-shadow 180ms ease-out; }
.db-widget:hover { border-color: var(--edge); }
.db-widget-head { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 14px 4px; flex: none; }
.db-widget-head h2 { margin: 0; flex: 1; min-width: 0; font-size: .86rem; font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.db-widget-tools { display: flex; align-items: center; gap: 4px; }
.db-widget-tools .btn:not(.db-icon-btn) { font-size: .72rem; padding: 4px 7px; }
.db-widget-content { flex: 1; display: flex; flex-direction: column; min-height: 0; position: relative; overflow: auto; }
.db-number-body { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 10px 24px; gap: 6px; }
.db-number { font-size: clamp(1.5rem, 2.7vw, 3.3rem); font-weight: 600; line-height: 1.15; letter-spacing: -.035em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.db-value-caption { font-size: .72rem; color: var(--text-3); }
.db-widget-foot { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 4px; padding: 8px 14px 12px; font-size: .75rem; color: var(--text-3); }
.db-stale .db-reading-status { color: var(--degraded); }
.db-plot { flex: 1; min-height: 100px; width: 100%; direction: ltr; }
.db-widget-placeholder { flex: 1; display: grid; place-items: center; color: var(--text-3); padding: 16px; text-align: center; font-size: .85rem; }
.db-data-table { flex: none; padding: 2px 14px; font-size: .72rem; }
.db-data-table summary { cursor: pointer; color: var(--text-3); }
.db-data-table[open] { overflow: auto; max-height: 200px; }
.db-data-table table { width: 100%; white-space: nowrap; font-variant-numeric: tabular-nums; }
.db-empty { grid-column: 1 / -1; grid-row: span 5; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 32px; }
.db-empty > svg { width: 40px; height: 40px; color: var(--accent); margin-block-end: 16px; }
.db-empty h2 { margin: 0; font-size: 1.2rem; }
.db-empty p { color: var(--text-3); margin-block: 10px 24px; }
.db-editing .db-widget { border-style: dashed; }
.db-grip { touch-action: none; cursor: grab; color: var(--text-3); }
.db-grip:active { cursor: grabbing; }
.db-resize { position: absolute; inset-inline-end: 2px; inset-block-end: 0; padding: 4px; background: transparent; border: none; color: var(--text-3); cursor: nwse-resize; touch-action: none; }
[dir=rtl] .db-resize { cursor: nesw-resize; transform: scaleX(-1); }
.db-grabbed { z-index: 2; border-color: var(--accent); box-shadow: 0 14px 32px #0004; }
.db-drop-preview { border: 1px dashed var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); border-radius: 14px; pointer-events: none; z-index: 0; }
.db-accessible-layout { display: flex; align-items: center; gap: 6px; padding: 0 12px 8px; flex-wrap: wrap; }
.db-accessible-layout .btn { padding: 3px 7px; font-size: .7rem; }
.db-accessible-layout .db-field { display: flex; align-items: center; gap: 4px; margin: 0; font-size: .7rem; }
.db-accessible-layout select { width: auto; padding: 3px 6px; font-size: .7rem; }
.db-mobile-grid { grid-template-columns: 1fr; grid-auto-rows: auto; }
.db-drawer-layer { position: fixed; inset-block: 0; inset-inline-end: 0; z-index: 80; pointer-events: none; }
.db-drawer { width: min(420px, 100vw); height: 100%; overflow: auto; background: var(--surface); border-inline-start: 1px solid var(--edge); box-shadow: -12px 0 36px #0003; pointer-events: auto; animation: db-panel-enter 220ms cubic-bezier(.16,1,.3,1); }
[dir=rtl] .db-drawer { box-shadow: 12px 0 36px #0003; }
.db-drawer > header { position: sticky; inset-block-start: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; background: var(--surface); border-block-end: 1px solid var(--line); }
.db-drawer h2 { font-size: 1.05rem; margin: 0; }
.db-drawer h3 { font-size: .9rem; margin-block: 28px 12px; }
.db-drawer-body { padding: 20px; }
.db-field { display: grid; gap: 7px; margin-block-end: 16px; }
.db-field > span { color: var(--text-2); font-size: .8rem; }
.db-field input, .db-field select, .db-sensor-picker input, .db-link-result input { width: 100%; min-width: 0; }
.db-field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.db-field-pair[hidden] { display: none; }
.db-sensor-picker { padding-block: 16px; border-block: 1px solid var(--line); margin-block: 20px; }
.db-selected-sensors { display: grid; gap: 8px; margin-block: 12px; }
.db-sensor-chip { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); padding: 8px 12px; border-radius: 8px; }
.db-sensor-chip > div { flex: 1; display: grid; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
.db-sensor-chip strong { font-size: .78rem; font-weight: 500; }
.db-sensor-chip small { color: var(--text-3); }
.db-preview { min-height: 100px; display: grid; align-content: center; gap: 6px; padding: 16px; margin-block: 16px 24px; background: var(--bg); border-radius: 8px; color: var(--text-3); font-size: .78rem; }
.db-preview strong { font-size: 1.6rem; color: var(--text); font-variant-numeric: tabular-nums; }
.db-drawer-actions { display: flex; gap: 10px; margin-block-start: 24px; }
.db-share-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-block: 10px; border-block-end: 1px solid var(--line); font-size: .8rem; }
.db-share-row span { overflow-wrap: anywhere; }
.db-link-result:not(:empty) { margin-block-start: 20px; }
.db-link-result .btn { margin-block-start: 8px; }
.db-wall .db-viewport { height: calc(100dvh - 170px); }
.dashboard-wall #rail, .dashboard-wall .topbar, .dashboard-wall #topbar, .dashboard-wall #breadcrumb, .dashboard-wall .breadcrumbs, .dashboard-wall #footer { display: none !important; }
.dashboard-wall #view { margin-inline: 0; max-width: none !important; }
.dashboard-wall #shell { grid-template-columns: minmax(0, 1fr); }
.dashboard-wall #crumbs { display: none; }
.db-shell:fullscreen { background: var(--bg); padding: 20px; overflow: auto; }
.db-shell:fullscreen .db-drawer-layer { position: absolute; }
.db-wall.db-hide-chrome:not(:focus-within) .db-toolbar { opacity: 0; pointer-events: none; }
.db-wall .db-toolbar { transition: opacity 180ms ease-out; }
.db-public { margin: 0; padding: 24px; background: var(--bg); color: var(--text); }
.db-public-top { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-block-end: 12px; }
.db-shell :focus-visible, .db-list-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.db-shell ::selection { background: color-mix(in srgb, var(--accent) 30%, transparent); }
.db-shell input { caret-color: var(--accent); }
@keyframes db-panel-enter { from { opacity: .6; translate: 16px 0; } to { opacity: 1; translate: 0 0; } }
@media (max-width: 900px) { .db-page-head { align-items: flex-start; flex-direction: column; } .db-create { width: 100%; } .db-create input { width: 100%; } .db-zoom-tools { margin-inline-start: 0; flex-wrap: wrap; } .db-toolbar .db-field > span { display: none; } }
@media (max-width: 600px) { .db-toolbar { gap: 6px; } .db-zoom-tools input[type=range] { width: 70px; } .db-public { padding: 12px; } .db-resize, .db-grip { display: none; } .db-widget-tools .btn { padding: 6px; } .db-number { font-size: 2.4rem; } }
@media (pointer: coarse) { .db-shell button, .db-shell input, .db-shell select { min-height: 44px; } .db-drawer input, .db-drawer select { font-size: 16px; } .db-accessible-layout .btn { min-height: 44px; } }
@media (prefers-reduced-motion: reduce) { .db-shell *, .db-shell *::before, .db-shell *::after { animation: none !important; transition: none !important; } }

.db-gauge-range { display: flex; justify-content: space-between; padding: 0 18px 4px; font-size: .72rem; font-variant-numeric: tabular-nums; color: var(--text-3); }
.db-gauge-range[hidden] { display: none; }
/* Dense dashboard canvas: quarter-column/quarter-row placement, no card scrollbars. */
.db-shell { --db-row: 15px; --db-gap: 2px; }
.db-page-head { margin-block-end: 10px; gap: 12px; }
.db-page-head > div { display:flex; align-items:center; gap:12px; }
.db-page-head h1 { font-size:1.2rem; }
.db-name-input { width:min(320px,65vw); font-size:1rem; padding:6px 10px; height:34px; }
.db-save-state { margin:0; }
.db-toolbar { gap:6px; padding-block:8px; margin-block-end:10px; }
.db-shell .btn { min-height:28px; padding:4px 8px; font-size:.74rem; line-height:1.25; }
.db-shell .db-icon-btn { min-width:26px; width:26px; height:26px; min-height:26px; padding:4px; border-color:transparent; background:transparent; }
.db-shell .db-icon-btn:hover { background:color-mix(in srgb,var(--accent) 12%,transparent); border-color:var(--line); }
.db-shell .btn svg { width:15px; height:15px; }
.db-toolbar input[type=number] { width:68px; }
.db-toolbar input[type=checkbox] { width:16px; height:16px; }
.db-toolbar select { padding:4px 8px; min-height:30px; font-size:.76rem; }
.db-widget { border-radius:10px; margin:3px; container-type:inline-size; }
.db-widget-head { min-height:30px; padding:4px 9px 0; gap:5px; }
.db-widget-head h2 { font-size:.78rem; }
.db-widget-content { overflow:hidden; }
.db-widget-foot { flex-wrap:nowrap; padding:3px 10px 6px; font-size:.65rem; white-space:nowrap; gap:8px; }
.db-reading-status { overflow:hidden; text-overflow:ellipsis; }
.db-accessible-layout { display:none; }
.db-metrics { display:grid; grid-template-columns:repeat(attr(data-count type(<number>),1),minmax(0,1fr)); height:100%; min-height:0; }
.db-metrics[data-count="2"] { grid-template-columns:repeat(2,minmax(0,1fr)); }
.db-metrics[data-count="3"] { grid-template-columns:repeat(3,minmax(0,1fr)); }
.db-metric { min-width:0; min-height:0; display:flex; flex-direction:column; justify-content:center; padding:2px 10px 4px; color:var(--text); }
.db-metric + .db-metric { border-inline-start:1px solid var(--line); }
.db-sensor-heading { display:flex; gap:3px; align-items:center; justify-content:space-between; width:100%; min-height:24px; }
.db-sensor-heading > span { font-size:.68rem; color:var(--text-2); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.db-sensor-tools { display:flex; gap:0; flex:none; }
.db-metric .db-number { font-size:clamp(1.2rem,9cqi,2.8rem); line-height:1.12; white-space:nowrap; letter-spacing:-.025em; direction:ltr; text-align:start; }
.db-metrics[data-count="2"] .db-number { font-size:clamp(1rem,5cqi,2rem); }
.db-metrics[data-count="3"] .db-number { font-size:clamp(.85rem,3.8cqi,1.8rem); }
.db-severity-label { font-size:.6rem; margin-block:3px; }
.db-probes { display:flex; flex-wrap:wrap; gap:2px 8px; font-size:.58rem; line-height:1.45; color:var(--text-2); }
.db-probes > span { white-space:nowrap; font-variant-numeric:tabular-nums; }
.db-probe-stale { opacity:.55; }
[data-severity="warning"] .db-number, .db-probes [data-severity="warning"], .db-metric[data-severity="warning"] .db-severity-label { color:#facc15; }
[data-severity="critical"] .db-number, .db-probes [data-severity="critical"], .db-metric[data-severity="critical"] .db-severity-label { color:#f87171; }
.db-metric[data-severity="normal"] .db-number { color:var(--text); }
.db-widget[data-severity="warning"] { border-color:#eab308; box-shadow:inset 0 0 0 1px #eab30838; }
.db-widget[data-severity="critical"] { border-color:#ef4444; box-shadow:inset 0 0 0 1px #ef444459; }
.db-gauge { display:block; width:100%; height:clamp(36px,19cqi,100px); flex:1 1 80px; min-height:25px; max-height:100px; }
.db-metrics:has(.db-gauge) .db-number { text-align:center; font-size:clamp(1rem,6cqi,1.8rem); }
.db-metrics[data-count="3"]:has(.db-gauge) .db-number { font-size:clamp(.85rem,3.5cqi,1.5rem); }
.db-gauge-endpoints { display:flex; justify-content:space-between; font-size:.58rem; color:var(--text-3); direction:ltr; }
.db-chart-sensors { display:flex; flex-wrap:wrap; gap:2px 12px; padding:0 8px; flex:none; font-size:.63rem; }
.db-chart-sensors > div { display:flex; align-items:center; gap:4px; }
.db-plot { min-height:40px; }
.db-drawer-layer { inset:0; width:100%; }
.db-drawer { position:fixed; inset:0; margin:auto; width:min(820px,calc(100vw - 32px)); max-width:none; height:auto; max-height:calc(100dvh - 40px); border:1px solid var(--edge); border-radius:16px; color:var(--text); padding:0; box-shadow:0 24px 100px #0006; animation:db-modal-enter 180ms cubic-bezier(.16,1,.3,1); }
.db-drawer::backdrop { background:#020817a6; backdrop-filter:blur(5px); }
.db-drawer > header { padding:12px 18px; }
.db-drawer-body { padding:18px; }
.db-widget-form { display:grid; grid-template-columns:1fr 1fr; gap:8px 18px; }
.db-widget-form > .db-sensor-picker, .db-widget-form > .db-selected-sensors, .db-widget-form > .db-preview, .db-widget-form > .db-notice, .db-widget-form > .db-drawer-actions, .db-widget-form > input { grid-column:1 / -1; }
.db-field { margin-block-end:8px; gap:5px; }
.db-field > span { font-size:.75rem; }
.db-field input, .db-field select { padding:7px 10px; font-size:.82rem; }
.db-sensor-picker { display:grid; grid-template-columns:1fr 1fr auto; align-items:end; gap:8px; padding:14px; margin:4px 0; background:var(--bg); border:1px solid var(--line); border-radius:10px; }
.db-sensor-picker > .db-field:first-child { grid-column:1 / -1; }
.db-sensor-picker input[type=search] { border-radius:9px; padding:12px 14px; }
.db-sensor-picker .btn { margin-block-end:8px; }
.db-selected-sensors { margin:0; }
.db-sensor-config { border:1px solid var(--line); border-radius:9px; padding:6px 10px; }
.db-sensor-config .db-sensor-chip { padding:0; border:0; }
.db-sensor-config details { font-size:.72rem; padding-block:6px; }
.db-sensor-config summary { cursor:pointer; color:var(--text-2); }
.db-threshold-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; }
.db-thresholds { margin-block:12px; }
.db-thresholds small { font-size:.7rem; }
.db-preview { min-height:0; padding:10px 14px; margin:0 0 8px; grid-template-columns:auto 1fr auto; align-items:center; }
.db-preview strong { font-size:1.2rem; }
.db-drawer-actions { margin-block-start:6px; justify-content:flex-end; }
.db-history-dialog { width:min(1680px,calc(100vw - 40px)); }
.db-history-title { margin:0 0 8px; font-size:.76rem; }
.db-history-controls { display:flex; flex-wrap:wrap; align-items:end; gap:6px; }
.db-history-controls .db-field { gap:3px; margin:0; flex:0 1 auto; min-width:0; }
.db-history-controls .db-field > span { font-size:.66rem; }
.db-history-controls input, .db-history-controls select { height:30px; min-height:30px; padding:3px 6px; font-size:.7rem; width:auto; }
.db-history-controls input { width:185px; max-width:100%; }
.db-history-controls .btn, .db-history-tabs .btn { min-height:28px; height:28px; padding:3px 7px; font-size:.68rem; }
.db-history-controls .db-history-nav { margin:0; gap:4px; flex-wrap:nowrap; }
.db-history-stage { position:relative; }
.db-history-loading { position:absolute; inset:0; z-index:2; display:flex; align-items:center; justify-content:center; gap:9px; background:color-mix(in srgb,var(--surface) 80%,transparent); color:var(--text); font-size:.8rem; cursor:progress; }
.db-history-spinner { width:18px; height:18px; border:2px solid var(--line); border-top-color:var(--accent); border-radius:50%; animation:db-history-spin .8s linear infinite; }
@keyframes db-history-spin { to { transform:rotate(360deg); } }
@media(prefers-reduced-motion:reduce) { .db-history-spinner { animation:none; } }
.db-history-loading[hidden], .db-history-stage[hidden] { display:none; }
.db-history-dialog .db-notice:empty { display:none; }
.db-history-nav, .db-history-tabs { display:flex; flex-wrap:wrap; gap:6px; margin-block:10px; }
.db-history-tabs [aria-pressed="true"], .db-toolbar [aria-pressed="true"] { color:var(--accent); border-color:var(--accent); background:color-mix(in srgb,var(--accent) 10%,transparent); }
.db-history-plot { height:min(45vh,360px); min-height:200px; direction:ltr; }
.db-history-table { max-height:45vh; overflow:auto; }
.db-history-table table { width:100%; font-size:.76rem; font-variant-numeric:tabular-nums; white-space:nowrap; }
.db-history-table th { position:sticky; top:0; background:var(--surface); }
.db-history-table td, .db-history-table th { padding:8px; text-align:start; border-bottom:1px solid var(--line); }
.db-history-table[hidden], .db-history-plot[hidden], .db-threshold-grid[hidden], .db-widget-form > [hidden] { display:none; }
.db-wall.db-hide-chrome .db-page-head, .db-wall.db-hide-chrome .db-toolbar { display:none; }
.db-wall.db-hide-chrome .db-viewport { height:100dvh; padding:0; }
.db-tv-reveal { display:none !important; }
.db-wall.db-hide-chrome .db-tv-reveal { display:flex !important; position:fixed; top:8px; inset-inline-end:12px; z-index:50; opacity:.4; background:var(--surface); border:1px solid var(--edge); }
.db-tv-reveal:hover, .db-tv-reveal:focus-visible { opacity:1 !important; }
.db-monitor-thresholds { margin-block:16px; }
@keyframes db-modal-enter { from { opacity:0; transform:translateY(8px) scale(.985); } to { opacity:1; transform:translateY(0) scale(1); } }
@media(max-width:600px) { .db-widget-form { grid-template-columns:1fr; } .db-widget-form > * { grid-column:1 !important; } .db-threshold-grid { grid-template-columns:1fr 1fr; } .db-sensor-picker { grid-template-columns:1fr; } .db-sensor-picker > * { grid-column:1; } .db-history-controls { display:grid; grid-template-columns:1fr 1fr; } .db-history-controls .db-history-nav { grid-column:1/-1; flex-wrap:wrap; } .db-history-controls input { width:100%; } .db-page-head > div { flex-wrap:wrap; } }
@media(pointer:coarse) { .db-shell .btn, .db-shell .db-icon-btn { min-width:44px; min-height:44px; height:auto; } .db-sensor-heading { flex-wrap:wrap; } }
:root { --db-warning:#facc15; --db-critical:#f87171; --db-normal:#5ee0ad; --db-unknown:#94a3b8; }
:root[data-theme="light"] { --db-warning:#946000; --db-critical:#b91c1c; --db-normal:#137955; --db-unknown:#64748b; }
@media(prefers-color-scheme:light) { :root:not([data-theme="dark"]) { --db-warning:#946000; --db-critical:#b91c1c; --db-normal:#137955; --db-unknown:#64748b; } }
.db-metric[data-severity="warning"] .db-number, .db-probes [data-severity="warning"], .db-metric[data-severity="warning"] .db-severity-label { color:var(--db-warning); }
.db-metric[data-severity="critical"] .db-number, .db-probes [data-severity="critical"], .db-metric[data-severity="critical"] .db-severity-label { color:var(--db-critical); }
.dashboard-wall #view { padding:6px; }
.dashboard-wall #app-foot { display:none; }
.db-monitor-results { grid-column:1 / -1; display:flex; flex-wrap:wrap; gap:6px; }
.db-monitor-results > small { width:100%; font-size:.65rem; }
.db-shell .db-monitor-result { border:1px solid var(--line); background:var(--surface); padding:8px 10px; border-radius:7px; gap:6px; }
.db-monitor-result[aria-pressed="true"] { border-color:var(--accent); color:var(--accent); }
.db-refresh-help { font-size:.68rem; align-self:center; }
.db-drawer { height:fit-content; }
.dashboard-wall:has(.db-hide-chrome) .db-public-top { display:none; }
.db-public:has(.db-hide-chrome) { padding:4px; }
/* Each sensor starts on the same baseline; probe lists determine natural height. */
.db-metrics { height:100%; min-height:0; flex:1; align-items:stretch; grid-template-columns:minmax(0,1fr); }
.db-metric { justify-content:flex-start; }
.db-metric > * { flex-shrink:0; }
.db-probes > span { white-space:normal; overflow-wrap:anywhere; }
.db-metric > .db-gauge { flex:0 0 auto; }
.db-probes { gap:0 2px; align-items:center; }
.db-probe-dot { display:inline-grid; place-items:center; width:20px; height:22px; min-width:20px; min-height:22px; padding:0; border:0; border-radius:5px; background:transparent; cursor:help; flex:none; }
.db-probe-dot::before { content:''; display:block; width:9px; height:9px; border-radius:50%; background:var(--unknown); }
.db-probe-dot[data-state="normal"]::before { background:var(--up); }
.db-probe-dot[data-state="warning"]::before { background:var(--degraded); }
.db-probe-dot[data-state="critical"]::before { background:var(--down); }
.db-probe-dot[data-state="stale"]::before { background:var(--unknown); opacity:.45; }
.db-probe-dot:hover, .db-probe-dot:focus-visible { background:color-mix(in srgb,var(--accent) 12%,transparent); }
.db-probe-tooltip { position:fixed; z-index:1000; width:max-content; max-width:min(300px,calc(100vw - 16px)); padding:10px 12px; display:grid; gap:5px; border:1px solid var(--edge); border-radius:9px; color:var(--text); background:var(--surface); box-shadow:0 8px 24px #0004; font-size:.75rem; overflow-wrap:anywhere; pointer-events:auto; }
.db-probe-tooltip[hidden] { display:none; }
.db-probe-tooltip-value { font-size:1rem; font-variant-numeric:tabular-nums; }
.db-probe-tooltip small { color:var(--text-3); font-size:.68rem; }
.db-probe-tooltip-status { display:flex; align-items:center; gap:5px; font-size:.72rem; }
.db-probe-tooltip-status::before { content:''; width:7px; height:7px; border-radius:50%; background:var(--unknown); }
.db-probe-tooltip-status[data-state="normal"] { color:var(--db-normal); }
.db-probe-tooltip-status[data-state="normal"]::before { background:var(--up); }
.db-probe-tooltip-status[data-state="warning"] { color:var(--db-warning); }
.db-probe-tooltip-status[data-state="warning"]::before { background:var(--degraded); }
.db-probe-tooltip-status[data-state="critical"] { color:var(--db-critical); }
.db-probe-tooltip-status[data-state="critical"]::before { background:var(--down); }
@media(pointer:coarse) { .db-probe-dot { width:44px; height:44px; } }
.db-probe-dot { box-shadow:none; }
.db-probe-tooltip-value { direction:ltr; }
.db-widget-head { min-height:26px; padding-block:2px 0; }
.db-metric { padding:0 9px 2px; }
.db-sensor-heading { min-height:22px; }
.db-severity-label { margin-block:1px; }
.db-probes { line-height:1; }
.db-widget-foot { padding-block:2px 4px; font-size:.62rem; }
.db-chart-sensors .db-icon-btn { height:22px; min-height:22px; }
.db-plot { cursor:crosshair; }
.db-gauge { height:clamp(30px,15cqi,80px); max-height:80px; }
.db-defaults-table { overflow:auto; margin-block:12px; }
.db-defaults-table table { width:100%; border-collapse:collapse; font-size:.78rem; }
.db-defaults-table td, .db-defaults-table th { padding:9px; text-align:start; border-bottom:1px solid var(--line); }
.db-defaults-table td small { display:block; margin-top:4px; }
.db-defaults-table td:last-child { white-space:nowrap; }
.db-global-rule-editor { background:var(--surface); border:1px solid var(--line); padding:14px; border-radius:10px; margin-block:16px; }
.db-global-rule-editor h2 { font-size:1rem; margin:0 0 12px; }
.db-global-rule-form { display:grid; grid-template-columns:1fr 1fr 2fr; gap:12px; }
.db-global-rule-form > div, .db-global-rule-form > small { grid-column:1 / -1; }
.db-global-rule-form > button { width:max-content; }
.db-defaults-filters { display:flex; gap:10px; }
.db-defaults-filters input { flex:1; }
@media(max-width:600px) { .db-global-rule-form { grid-template-columns:1fr; } }
.db-series-label { display:inline-flex; align-items:center; gap:5px; }
.db-series-label::before { content:''; width:7px; height:7px; background:var(--db-series-color); border-radius:50%; }
.db-widget[data-display="number"] .db-widget-content { flex:1; }
.db-widget[data-display="number"] .db-widget-foot { margin-top:3px; }
.db-defaults-filters input { flex:1 1 300px; width:auto; min-width:140px; }
.db-defaults-filters select { flex:0 1 260px; width:auto; max-width:50%; }

/* Scale the visualization to the space allocated by the user. */
.db-metric > .db-metric-visual { flex:1 1 0; min-height:0; min-width:0; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px; overflow:hidden; }
.db-metric-visual .db-number { flex:none; font-size:inherit; width:max-content; max-width:100%; line-height:1.12; text-align:center; }
.db-gauge-face { position:relative; flex:none; max-width:100%; }
.db-gauge-face .db-gauge { width:100%; height:100%; min-height:0; max-height:none; }
.db-gauge-face .db-number { position:absolute; top:50%; left:50%; transform:translate(-50%,-50%); }
[data-appearance="speedometer"] .db-gauge-face .db-number { top:75%; }
.db-metric-visual .db-gauge-endpoints { width:100%; flex:none; }
.db-widget[data-severity="warning"] { background:color-mix(in srgb,var(--surface) 85%,var(--db-warning) 15%); border-color:var(--db-warning); }
.db-widget[data-severity="critical"] { background:color-mix(in srgb,var(--surface) 84%,var(--db-critical) 16%); border-color:var(--db-critical); }
.db-toolbar .db-icon-btn[data-pending="true"] { color:var(--db-warning); border-color:color-mix(in srgb,var(--db-warning) 40%,transparent); }
.db-model-picker { grid-column:1/-1; }
.db-model-picker h3 { margin:0 0 7px; font-size:.75rem; color:var(--text-2); }
.db-models { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:7px; }
.db-model-card { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:5px; min-width:0; border:1px solid var(--line); background:var(--bg); color:var(--text-2); border-radius:9px; padding:8px; cursor:pointer; transition:background 150ms,border-color 150ms; }
.db-model-card:hover { border-color:var(--accent); }
.db-model-card[aria-pressed="true"] { border-color:var(--accent); background:color-mix(in srgb,var(--accent) 10%,var(--surface)); color:var(--text); box-shadow:inset 0 0 0 1px var(--accent); }
.db-model-card > span { font-size:.7rem; }
.db-model-preview { width:100%; height:58px; display:flex; align-items:center; justify-content:center; direction:ltr; gap:3px; }
.db-model-preview strong { font-size:1.9rem; font-variant-numeric:tabular-nums; }
.db-model-preview small { font-size:.6rem; }
.db-model-preview svg { width:100%; height:100%; max-height:100%; min-height:0; }
@media(max-width:600px) { .db-models { grid-template-columns:repeat(2,minmax(0,1fr)); } .db-history-dialog { width:calc(100vw - 20px); } }

.db-metrics[data-stacked="true"] .db-metric + .db-metric { border-inline-start:0; border-block-start:1px solid var(--line); }

/* Scalar cards reserve their area for the reading; supporting facts share one line. */
.db-widget-foot[hidden] { display:none; }
.db-widget-sensors:empty { display:none; }
.db-widget-sensors { display:flex; flex:1; min-width:0; gap:8px; }
.db-widget-sensors .db-sensor-heading { flex:1; min-width:0; min-height:22px; }
.db-widget-sensors .db-sensor-heading > span { min-width:0; font-size:.68rem; }
.db-widget[data-display="number"] .db-widget-head,
.db-widget[data-display="gauge"] .db-widget-head { gap:6px; padding:2px 8px; }
.db-widget[data-display="number"] .db-widget-head h2,
.db-widget[data-display="gauge"] .db-widget-head h2 { flex:0 1 auto; max-width:45%; font-size:.75rem; }
.db-widget-sensors .db-icon-btn { min-width:20px; width:20px; min-height:22px; height:22px; padding:3px; background:transparent; box-shadow:none; }
.db-widget-sensors .db-icon-btn svg { width:12px; height:12px; }
.db-metric { padding:0 8px 4px; }
.db-metric-foot { display:flex; align-items:center; gap:5px; min-width:0; min-height:20px; font-size:.68rem; color:var(--text-2); white-space:nowrap; }
.db-metric-foot .db-probes { flex:none; min-width:0; flex-wrap:nowrap; gap:0; }
.db-metric-foot .db-probe-dot { width:10px; min-width:10px; height:20px; min-height:20px; border-radius:3px; }
.db-metric-foot .db-probe-dot::before { width:7px; height:7px; }
.db-metric-foot .db-severity-label { min-width:0; overflow:hidden; text-overflow:ellipsis; font-size:inherit; margin:0; }
.db-metric-foot abbr { flex:none; text-decoration:none; cursor:help; }

/* Keep the widget title centered while sensor labels and tools stay at the edges. */
.db-widget-head { display:grid; grid-template-columns:minmax(0,1fr) auto minmax(0,1fr); grid-template-rows:minmax(26px,auto) auto; align-content:start; align-items:center; }
.db-widget-head h2 { grid-column:2; grid-row:1; justify-self:center; width:max-content; max-width:58%; text-align:center; line-height:1.05; font-size:.95rem; unicode-bidi:plaintext; }
.db-widget-head .db-grip { grid-column:1; grid-row:1; justify-self:start; }
.db-widget-head .db-widget-tools { grid-column:3; grid-row:1; justify-self:end; }
.db-widget-head .db-widget-sensors { grid-column:1/-1; grid-row:2; width:100%; }
.db-widget[data-display="number"] .db-widget-head h2 { max-width:58%; font-size:.75rem; }
.db-widget[data-display="chart"] .db-widget-head h2 { max-width:65%; font-size:1rem; }
.db-widget[data-display="gauge"] .db-widget-head h2 { display:none; }
.db-widget[data-title-size="small"] .db-widget-head h2, .db-widget[data-title-size="small"] .db-gauge-title { font-size:.72rem; }
.db-widget[data-title-size="medium"] .db-widget-head h2, .db-widget[data-title-size="medium"] .db-gauge-title { font-size:.9rem; }
.db-widget[data-title-size="large"] .db-widget-head h2, .db-widget[data-title-size="large"] .db-gauge-title { font-size:1.1rem; }
.db-gauge-face .db-gauge-title { position:absolute; z-index:1; top:2px; left:50%; transform:translateX(-50%); max-width:90%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; text-align:center; line-height:1.05; font-weight:600; }
.db-metric-visual > .db-gauge-title { flex:none; max-width:96%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; text-align:center; line-height:1.05; font-weight:600; }
.db-metric-foot time { margin-inline-start:auto; flex:none; direction:ltr; font-variant-numeric:tabular-nums; }
@media(pointer:coarse) {
  .db-widget-sensors .db-icon-btn { min-width:44px; width:44px; min-height:44px; height:44px; }
  .db-widget-sensors .db-sensor-heading { flex-wrap:nowrap; }
  .db-metric-foot { flex-wrap:wrap; }
  .db-metric-foot .db-probes { flex-wrap:wrap; }
  .db-metric-foot .db-probe-dot { width:24px; min-width:24px; height:44px; min-height:44px; }
}

.db-comparison-controls { display:flex; align-items:center; flex-wrap:wrap; gap:8px; min-width:0; }
.db-comparison-controls[hidden], .db-comparison-controls select[hidden] { display:none; }
.db-comparison-controls label { display:inline-flex; align-items:center; gap:6px; font-size:.78rem; white-space:nowrap; }
.db-comparison-controls input[type=checkbox] { width:16px; height:16px; margin:0; accent-color:var(--accent); }
.db-comparison-controls select { width:auto; min-width:0; max-width:100%; padding:4px 24px 4px 8px; font-size:.75rem; }
.db-widget-form > .db-comparison-controls { grid-column:1/-1; }
.db-history-tabs { flex-wrap:wrap; }
.db-history-tabs .db-comparison-controls { margin-inline-start:auto; }
@media(pointer:coarse) { .db-comparison-controls label { min-height:44px; } .db-comparison-controls input[type=checkbox] { width:24px; height:24px; } .db-comparison-controls select { min-height:44px; font-size:16px; } }

/* Kiosks reuse the console's list and form hierarchy; playback gives the canvas
   the whole screen and reserves only a two-pixel timing indicator. */
.db-kiosk-list { display:grid; }
.db-kiosk-list-row { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:16px 0; border-block-end:1px solid var(--line); }
.db-kiosk-list-row h2 { margin:0 0 4px; font-size:1rem; overflow-wrap:anywhere; }
.db-kiosk-actions { display:flex; gap:6px; align-items:center; flex-wrap:wrap; }
.db-kiosk-empty { padding:48px 16px; text-align:center; color:var(--text-2); }
.db-kiosk-empty > svg { width:36px; height:36px; }
.db-kiosk-editor { max-width:1000px; }
.db-kiosk-editor > .db-field { max-width:420px; }
.db-kiosk-picker { display:flex; align-items:center; gap:8px; padding-block:12px; }
.db-kiosk-picker input, .db-kiosk-picker select { flex:1; min-width:0; }
.db-kiosk-entries { padding:0; margin-block:12px; list-style:none; }
.db-kiosk-entry { display:grid; grid-template-columns:26px 24px minmax(0,1fr) 140px auto; align-items:center; gap:8px; padding:10px 0; border-block-end:1px solid var(--line); }
.db-kiosk-entry strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:.85rem; }
.db-kiosk-entry .db-field { margin:0; gap:3px; }
.db-kiosk-entry .db-field > span { font-size:.7rem; }
.db-kiosk-entry .db-field input { padding:5px 8px; font-variant-numeric:tabular-nums; }
.db-kiosk-order { color:var(--text-3); font-variant-numeric:tabular-nums; }
.db-kiosk-grip { cursor:grab; }
.db-kiosk-up svg { transform:rotate(-90deg); }
.db-kiosk-down svg { transform:rotate(90deg); }
.dashboard-kiosk #rail, .dashboard-kiosk #topbar, .dashboard-kiosk .topbar, .dashboard-kiosk #crumbs, .dashboard-kiosk #app-foot { display:none !important; }
.db-kiosk-player { position:fixed; inset:0; z-index:60; overflow:auto; background:var(--bg); }
.db-kiosk-stage { min-height:100dvh; padding:6px; }
.db-kiosk-stage .db-viewport { height:calc(100dvh - 12px) !important; }
.db-kiosk-progress { position:fixed; inset:0 0 auto; height:2px; z-index:100; background:var(--line); direction:ltr; pointer-events:none; }
.db-kiosk-progress-fill { width:100%; height:100%; background:var(--accent); transform:scaleX(0); transform-origin:left center; }
.db-kiosk-controls { position:fixed; inset:auto auto 12px 50%; transform:translateX(-50%); z-index:70; display:flex; align-items:center; gap:8px; max-width:calc(100% - 24px); width:max-content; padding:8px 10px; border:1px solid var(--line); border-radius:12px; background:var(--raised); color:var(--text); font-size:.75rem; opacity:0; pointer-events:none; transition:opacity 150ms ease-out; }
.db-kiosk-show-controls .db-kiosk-controls, .db-kiosk-controls:focus-within, .db-kiosk-player.is-paused .db-kiosk-controls { opacity:1; pointer-events:auto; }
.db-kiosk-caption { display:grid; gap:2px; min-width:0; max-width:260px; }
.db-kiosk-caption strong, .db-kiosk-caption small { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.db-kiosk-caption small { color:var(--text-2); font-size:.7rem; }
.db-kiosk-controls output { min-width:60px; font-variant-numeric:tabular-nums; }
.db-kiosk-controls .btn { padding:4px 7px; font-size:.72rem; }
.db-kiosk-controls .db-icon-btn { width:28px; min-width:28px; min-height:28px; padding:5px; }
.db-kiosk-controls svg { width:16px; height:16px; }
.db-kiosk-message:empty { display:none; }
.db-kiosk-message { max-width:220px; }
.db-kiosk-failure { display:grid; min-height:80dvh; place-content:center; text-align:center; padding:24px; color:var(--text-2); }
@media(max-width:600px) {
  .db-kiosk-list-row { align-items:start; flex-direction:column; gap:8px; }
  .db-kiosk-picker { flex-wrap:wrap; }
  .db-kiosk-picker input { flex-basis:100%; }
  .db-kiosk-entry { grid-template-columns:24px 18px minmax(0,1fr) 90px; gap:4px; }
  .db-kiosk-entry .db-kiosk-actions { grid-column:3/-1; justify-content:end; }
  .db-kiosk-controls { flex-wrap:wrap; justify-content:center; }
  .db-kiosk-caption { flex:1; min-width:120px; }
}
@media(pointer:coarse) { .db-kiosk-controls .db-icon-btn, .db-kiosk-controls .btn { min-width:44px; min-height:44px; } .db-kiosk-controls { gap:4px; } }
@media(prefers-reduced-motion:reduce) { .db-kiosk-controls { transition:none; } }

.db-kiosk-dashboard .db-page-head, .db-kiosk-dashboard .db-toolbar, .db-kiosk-dashboard .db-tv-reveal { display:none !important; }
/* The console's settled-view transform would make a fixed player relative to
   a zero-height view root. Playback must use the viewport as its containing box. */
.dashboard-kiosk #shell[data-chrome='app'] main > * { animation:none !important; transform:none !important; }
.db-kiosk-entry { grid-template-columns:28px 24px minmax(0,1fr) 140px auto; }
.db-kiosk-entry .db-icon-btn { width:28px; min-width:28px; height:28px; min-height:28px; padding:5px; }
.db-kiosk-entry .db-icon-btn svg { width:14px; height:14px; }
.db-kiosk-order { text-align:center; }
@media(max-width:600px) { .db-kiosk-entry { grid-template-columns:28px 20px minmax(0,1fr) 90px; } }
@media(pointer:coarse) { .db-kiosk-entry { grid-template-columns:44px 24px minmax(0,1fr) 100px; } .db-kiosk-entry .db-icon-btn { width:44px; min-width:44px; height:44px; min-height:44px; } .db-kiosk-entry .db-kiosk-actions { grid-column:3/-1; justify-content:end; } }
/* Alerts: a spotlighted widget covers the screen, toasts stack from the top, and the settings table lists each state. */
.db-shell.db-alert-stage { position:fixed; inset:0; z-index:95; display:flex; flex-direction:column; gap:10px; padding:14px 16px; margin:0; background:color-mix(in srgb,var(--bg) 94%,transparent); backdrop-filter:blur(6px); }
.db-alert-stage > .db-alert-focus { flex:1; min-height:0; min-width:0; width:auto; height:auto; margin:0; border-width:2px; }
.db-alert-slot { min-height:0; }
.db-alert-head { display:flex; align-items:center; gap:10px; min-width:0; }
.db-alert-head strong { font-size:1rem; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.db-alert-head span { flex:1; min-width:0; color:var(--text-3); font-size:.9rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.db-alert-toasts { position:fixed; inset-block-start:12px; inset-inline:0; margin-inline:auto; width:min(440px,calc(100vw - 24px)); z-index:100; display:flex; flex-direction:column; gap:8px; pointer-events:none; }
.db-alert-toast { pointer-events:auto; display:flex; align-items:center; gap:10px; padding:10px 12px; border:1px solid color-mix(in srgb,var(--db-unknown) 40%,var(--line)); border-radius:12px; background:var(--raised); color:var(--text); box-shadow:0 14px 34px #0005; animation:db-toast-enter 260ms cubic-bezier(.16,1,.3,1); }
.db-alert-toast::before { content:""; flex:none; width:8px; height:8px; border-radius:50%; background:var(--db-unknown); }
.db-alert-toast[data-state="down"], .db-alert-toast[data-state="critical"] { border-color:color-mix(in srgb,var(--db-critical) 45%,var(--line)); }
.db-alert-toast[data-state="down"]::before, .db-alert-toast[data-state="critical"]::before { background:var(--db-critical); }
.db-alert-toast[data-state="degraded"], .db-alert-toast[data-state="warning"] { border-color:color-mix(in srgb,var(--db-warning) 45%,var(--line)); }
.db-alert-toast[data-state="degraded"]::before, .db-alert-toast[data-state="warning"]::before { background:var(--db-warning); }
.db-alert-body { display:grid; flex:1; min-width:0; }
.db-alert-body strong { font-size:.9rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.db-alert-body small { color:var(--text-3); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
@keyframes db-toast-enter { from { opacity:0; transform:translateY(-10px); } to { opacity:1; transform:none; } }
.db-alert-table { width:100%; border-collapse:collapse; font-size:.85rem; }
.db-alert-table th, .db-alert-table td { padding:8px 6px; border-block-end:1px solid var(--line); text-align:center; }
.db-alert-table th[scope="row"] { text-align:start; }
.db-alert-table input[type=number] { width:72px; }
.db-drawer-body .db-field { margin-block-start:18px; }
@media (max-width:600px) { .db-alert-table th, .db-alert-table td { padding:6px 3px; font-size:.78rem; } .db-alert-table input[type=number] { width:56px; } }
@media (prefers-reduced-motion: reduce) { .db-alert-toast { animation:none; } }
