#app #reeflight .reeflight-workspace-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    max-width: 540px;
    margin: 8px 0 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}
#app #reeflight .reeflight-workspace-nav button {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    min-width: 0;
    min-height: 48px;
    padding: 10px 12px;
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere;
}
#app #reeflight .reeflight-workspace-nav .nav-icon { width: 20px; height: 20px; flex: 0 0 20px; }
#app #reeflight .reeflight-workspace-nav button[aria-current] {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--surface-raised);
}
#app #reeflight { width: 100%; max-width: 100%; min-width: 0; touch-action: pan-y; }
#reeflight .reeflight-workspace { display: block; width: 100%; max-width: 100%; min-width: 0; }
#reeflight .reeflight-page-head { align-items: center; }
#reeflight .reeflight-page-head > div { min-width: 0; }
#reeflight .reeflight-page-head > button { flex: 0 0 auto; width: auto; }
.reeflight-demo-notice {
    display:grid;
    grid-template-columns:auto minmax(0, 1fr);
    gap:6px 12px;
    align-items:center;
    margin:0 0 18px;
    padding:13px 15px;
    border:1px solid color-mix(in srgb, #ffd17a 58%, var(--border-color));
    border-radius:12px;
    background:color-mix(in srgb, #ffd17a 12%, var(--surface-card));
    color:var(--text-secondary);
    line-height:1.45;
}
.reeflight-demo-notice[hidden] { display:none; }
.reeflight-demo-notice strong { color:#ffd17a; white-space:nowrap; }
.reeflight-demo-controller[hidden] { display:none; }
.reeflight-demo-controller {
    margin-top:14px;
    border:1px solid var(--border-color, #315b55);
    border-radius:10px;
    overflow:hidden;
    background:#071315;
}
.reeflight-demo-controller iframe {
    display:block;
    width:100%;
    height:min(900px, calc(100vh - 176px));
    min-height:620px;
    border:0;
    background:#071315;
}
.reeflight-page.is-demo-mode #reeflightSimulatorToggle { border-color:#ffd17a; color:#ffd17a; }
@media (max-width: 760px) {
    #reeflight .reeflight-page-head { display:grid; grid-template-columns:1fr; align-items:stretch; }
    #reeflight .reeflight-page-head .btn-group { display:grid; grid-template-columns:1fr 1fr; width:100%; gap:8px; }
    #reeflight .reeflight-page-head .btn-group button { min-width:0; min-height:44px; white-space:normal; line-height:1.25; }
    #reeflight #reeflightSimulatorToggle { grid-column:1 / -1; }
    .reeflight-demo-controller { margin-top:10px; border-radius:8px; }
    .reeflight-demo-controller iframe { height:calc(100vh - 154px); min-height:610px; }
}
@media (min-width: 1024px) {
    body:has(#reeflight.active) #app {
        width: min(1540px, calc(100% - var(--nav-width) - 32px));
        max-width: none;
    }
    body:has(#reeflight.active) #reeflight {
        width: 100%;
        max-width: none;
    }
    body:has(#reeflight.active) .app-footer { width: calc(100% - var(--nav-width)); }
}
@media (max-width: 900px) {
    #app #reeflight .reeflight-workspace-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 540px) {
    #app #reeflight .reeflight-workspace-nav { display: flex; gap: 6px; margin: 4px -12px 10px; padding: 0 12px 10px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; }
    #app #reeflight .reeflight-workspace-nav::-webkit-scrollbar { display: none; }
    #app #reeflight .reeflight-workspace-nav button { flex: 0 0 auto; min-height: 42px; padding: 8px 10px; font-size: 12px; white-space: nowrap; scroll-snap-align: start; }
    #app #reeflight .reeflight-workspace-nav button span { display: none; }
    #app #reeflight .reeflight-workspace-nav button[aria-current] span { display: inline; }
    #app #reeflight .reeflight-workspace-nav button:last-child { grid-column: auto; }
    #reeflight .reeflight-page-head { align-items:stretch; }
    #reeflight .reeflight-page-head p, #reeflight .reeflight-page-head .section-eyebrow { display: none; }
    #reeflight .reeflight-page-head h2 { margin: 0; }
    .reeflight-demo-notice { grid-template-columns:1fr; margin-top:6px; }
}

/* The controller tools use the app's colors and the page's single scroll area. */
:host {
    --bg: var(--app-bg, #0e1719);
    --panel: var(--surface-card, #172225);
    --raised: var(--surface-raised, #203034);
    --line: var(--border-color, #30454a);
    --text: var(--text-primary, #edf4f5);
    --muted: var(--text-secondary, #a6b9be);
    --mint: var(--accent, #52d1c5);
    display: block;
    min-width: 0;
    max-width: 100%;
    touch-action: pan-y;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    color: var(--text);
    font: inherit;
    color-scheme: inherit;
}
.reeflight-runtime { width: 100%; max-width: 100%; min-width: 0; min-height: 0; background: transparent; color: var(--text); }
.reeflight-runtime * { letter-spacing: 0; }
.reeflight-runtime :is(.top, .crumb, .hero, .statusrow, .sidebar, .tabs) { display: none !important; }
.reeflight-runtime .layout { display: block; }
.reeflight-runtime .main { min-width: 0; }
.reeflight-runtime .modebar { padding: 0 0 16px; margin-bottom: 16px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; }
.reeflight-runtime .mode-toggle { border-radius: 8px; background: var(--bg); }
.reeflight-runtime .mode-toggle button { border-radius: 4px; }
.reeflight-runtime .mode-toggle button.active { background: var(--raised); color: var(--mint); box-shadow: none; }
.reeflight-runtime .workspacebar { margin-bottom: 16px; border: 0; border-left: 3px solid var(--line); border-radius: 0; background: transparent; }
.reeflight-runtime .workspacebar.offline .workspace-status i { background: var(--muted); box-shadow: none; }
.reeflight-runtime .card { background: transparent; box-shadow: none; border: 0; border-radius: 0; padding: 16px 0; margin-bottom: 0; }
.reeflight-runtime .card + .card { border-top: 1px solid var(--line); }
.reeflight-runtime .grid2 { gap: 28px; align-items: start; }
.reeflight-runtime #setup .reeflight-setup-grid {
    grid-template-columns: minmax(0, 1.22fr) minmax(340px, .78fr);
    gap: 18px;
}
.reeflight-runtime #setup .reeflight-setup-grid > .card,
.reeflight-runtime #setup .reeflight-setup-flow > .card {
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: color-mix(in srgb, var(--panel) 76%, transparent);
}
.reeflight-runtime #setup .reeflight-setup-grid > .card + .card,
.reeflight-runtime #setup .reeflight-setup-flow > .card + .card {
    border-top: 1px solid var(--line);
}
.reeflight-runtime #setup .reeflight-board-guide {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: minmax(260px, .8fr) minmax(420px, 1.2fr);
    gap: 24px;
    align-items: center;
}
.reeflight-runtime #setup .reeflight-board-guide .cardhead { margin-bottom: 0; }
.reeflight-runtime #setup .reeflight-updater-card {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(260px, .82fr) minmax(420px, 1.18fr);
    gap: 24px;
    align-items: center;
}
.reeflight-runtime #setup .reeflight-updater-card .cardhead { margin-bottom: 0; }
.reeflight-runtime .reeflight-updater-content { display: grid; grid-template-columns: minmax(0, .82fr) minmax(320px, 1.18fr); gap: 18px; align-items: center; }
.reeflight-runtime .reeflight-updater-steps { margin: 0; padding-left: 19px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.reeflight-runtime .reeflight-updater-download { text-align: center; white-space: nowrap; }
.reeflight-runtime .reeflight-updater-gate { display: grid; gap: 7px; min-width: 0; }
.reeflight-runtime .reeflight-updater-gate > label { color: var(--muted); font-size: 12px; font-weight: 700; }
.reeflight-runtime .reeflight-updater-gate-actions { display: grid; grid-template-columns: minmax(150px, 1fr) auto; gap: 8px; align-items: stretch; }
.reeflight-runtime .reeflight-updater-gate-status { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.reeflight-runtime #setup .reeflight-board-controls { display: grid; grid-template-columns: minmax(220px, .72fr) minmax(300px, 1.28fr); gap: 12px; align-items: end; }
.reeflight-runtime #setup .reeflight-board-controls .info { margin: 0; min-height: 44px; display: flex; align-items: center; }
.reeflight-runtime #setup .reeflight-setup-installer { align-self: start; }
.reeflight-runtime #setup .reeflight-setup-flow {
    grid-column: 1 / -1;
    min-width: 0;
    column-count: 2;
    column-gap: 18px;
}
.reeflight-runtime #setup .reeflight-setup-flow > .card {
    display: inline-block;
    width: 100%;
    margin: 0 0 18px;
    break-inside: avoid;
    vertical-align: top;
}
.reeflight-runtime :is(.card, .controller-card, .field, .step > div, .controller-title > div) { min-width: 0; }
.reeflight-runtime :is(h2, h3, p, .info, .warning, .controller-meta, .online-state, .pill) { overflow-wrap: anywhere; }
.reeflight-runtime :is(.cardhead h2, .simple-head h2) { font-size: 18px; }
.reeflight-runtime .basic-dashboard { margin-top: 0; }
.reeflight-runtime .basic-dashboard:has(.logical-dashboard) > :not(.logical-dashboard) { display: none !important; }
.reeflight-runtime.basic-mode[data-view]:not([data-view="control"]) .basic-dashboard { display: none; }
.reeflight-runtime.basic-mode[data-view] .section.active { display: block !important; }
.reeflight-runtime.basic-mode[data-view="control"] #control { display: none !important; }
.reeflight-runtime.reef-no-controller .basic-dashboard > :not(.reeflight-empty-state),
.reeflight-runtime.reef-no-controller #control > .grid2,
.reeflight-runtime.reef-no-controller #schedule > .grid2,
.reeflight-runtime.reef-no-controller #lamps > .card:not(.reeflight-empty-state) { display: none !important; }
.reeflight-runtime .reeflight-empty-state { padding: 24px 0; }
.reeflight-runtime .reeflight-empty-state p { max-width: 60ch; color: var(--muted); line-height: 1.6; }
.reeflight-runtime :is(.controller-card, .group-card, .controller-stat, .info, .warning, .btn, .mini, input, select, .timelinebox) { border-radius: 8px; box-shadow: none; }
.reeflight-runtime :is(.controller-card, .group-card, .controller-stat, .info, .warning) { background: var(--panel); color: var(--text); }
.reeflight-runtime .reeflight-browser-support { margin: 12px 0 10px; }
.reeflight-runtime .firmware-method-card { border-top: 3px solid var(--line); }
.reeflight-runtime .firmware-method-usb { border-top-color: var(--mint); }
.reeflight-runtime .firmware-method-ota { border-top-color: var(--blue); }
.reeflight-runtime .firmware-method-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.reeflight-runtime .ota-show-code { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; }
.reeflight-runtime .ota-fallback { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
.reeflight-runtime .ota-fallback summary { cursor: pointer; color: var(--text); font-weight: 700; }
.reeflight-runtime .ota-fallback p { color: var(--muted); line-height: 1.55; }
.reeflight-runtime .ota-fallback .firmware-method-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.reeflight-runtime :is(.btn, .mini, input, select) { min-height: 44px; max-width: 100%; letter-spacing: 0; }
.reeflight-runtime :is(.btn, .mini) { white-space: normal; }
.reeflight-runtime input:not([type="checkbox"]):not([type="range"]), .reeflight-runtime select { background: var(--bg); }
.reeflight-runtime :is(.btn, .mini) { background: var(--raised); color: var(--text); }
.reeflight-runtime .btn.primary { background: var(--mint); color: var(--app-bg, #0e1719); }
.reeflight-runtime .controller-actions { display: flex; flex-wrap: wrap; }
.reeflight-runtime .modalback { z-index: 4000; padding: 16px; background: #0009; }
.reeflight-runtime .modal { max-height: calc(100dvh - 32px); overflow-y: auto; border-radius: 8px; background: var(--panel); }
.reeflight-runtime .toast { z-index: 4100; bottom: calc(var(--mobile-nav-height, 72px) + env(safe-area-inset-bottom, 0px) + 12px); }
@media (max-width: 1023px), (any-pointer: coarse) {
    #reeflight input, #reeflight select,
    body:has(#reeflight.active) #appDialog input,
    body:has(#reeflight.active) #appDialog select { font-size: 16px; }
    .reeflight-runtime :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea) { font-size: 16px; min-width: 0; }
    .reeflight-runtime :is(.grid2, .simple-grid, .simple-schedule-grid) { grid-template-columns: minmax(0, 1fr); }
    .reeflight-runtime #setup .reeflight-setup-grid,
    .reeflight-runtime #setup .reeflight-board-guide,
    .reeflight-runtime #setup .reeflight-updater-card,
    .reeflight-runtime #setup .reeflight-board-controls { grid-template-columns: minmax(0, 1fr); }
    .reeflight-runtime .reeflight-updater-content,
    .reeflight-runtime .reeflight-updater-gate-actions { grid-template-columns: 1fr; }
    .reeflight-runtime .reeflight-updater-download { white-space: normal; }
    .reeflight-runtime #setup .reeflight-setup-flow { column-count: 1; }
    .reeflight-runtime :is(.cardhead, .controller-title, .show-head) { flex-wrap: wrap; }
    .reeflight-runtime :is(.cardhead > div, .simple-schedule-control, .show-panel, .master-control, .pointlist, .ledmeta) { min-width: 0; max-width: 100%; }
}
@media (max-width: 700px) {
    .reeflight-runtime .grid2 { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .reeflight-runtime .modebar { display: flex; flex-wrap: wrap; gap: 12px; }
    .reeflight-runtime .mode-toggle { width: 100%; }
    .reeflight-runtime .mode-toggle button { width: 100%; min-width: 0; }
    .reeflight-runtime .workspacebar { display: grid; gap: 6px; padding: 10px 12px; }
    .reeflight-runtime .card { padding: 12px 0; }
    .reeflight-runtime .controller-form { grid-template-columns: minmax(0, 1fr); }
    .reeflight-runtime .controller-title { flex-wrap: wrap; }
    .reeflight-runtime .controller-group-row { grid-template-columns: minmax(0, 1fr) auto; }
    .reeflight-runtime .step { gap: 10px; }
    .reeflight-runtime .firmware-method-actions,
    .reeflight-runtime .ota-fallback .firmware-method-actions { grid-template-columns: minmax(0, 1fr); }
    .reeflight-runtime :is(input:not([type="checkbox"]):not([type="range"]), select) { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
    .reeflight-runtime *, .reeflight-runtime *::before, .reeflight-runtime *::after { animation: none !important; transition: none !important; }
}

/* Compact multi-controller cockpit. One logical lamp may span any number of D1 minis. */
.logical-dashboard, .logical-manager { min-width: 0; color: var(--text); }
.logical-dashboard { margin-bottom: 14px; }
.logical-kicker { display: block; margin-bottom: 4px; color: var(--mint); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.logical-empty, .logical-cockpit-head, .logical-manager-head, .logical-lamp-card { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.logical-empty { padding: 18px; border: 1px solid var(--line); background: var(--panel); border-radius: 8px; }
.logical-empty h2, .logical-cockpit-head h2, .logical-manager-head h2 { margin: 0; font-size: 20px; }
.logical-empty p, .logical-cockpit-head p, .logical-manager-head p, .logical-lamp-card p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.logical-head-actions, .logical-lamp-card > div:last-child, .logical-editor-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.logical-head-actions select { width: auto; min-width: 150px; }
.logical-device-strip { display: flex; gap: 7px; margin: 12px 0; overflow-x: auto; scrollbar-width: none; }
.logical-device-strip::-webkit-scrollbar { display: none; }
.logical-device { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 11px; }
.logical-device i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.logical-device.online { color: var(--mint); border-color: color-mix(in srgb, var(--mint) 45%, var(--line)); }
.logical-device.online i { background: var(--mint); box-shadow: 0 0 8px var(--mint); }
.logical-master { display: grid; grid-template-columns: minmax(130px, .7fr) minmax(180px, 1.4fr) 50px; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.logical-master span, .logical-channel > span { min-width: 0; }
.logical-master b, .logical-master small, .logical-channel b, .logical-channel small { display: block; }
.logical-master small, .logical-channel small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.logical-master input, .logical-channel input { width: 100%; accent-color: var(--mint); }
.logical-master output, .logical-channel output { text-align: right; color: var(--mint); font-weight: 800; font-variant-numeric: tabular-nums; }
.logical-channel-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px 18px; margin-top: 10px; }
.logical-channel { display: grid; grid-template-columns: minmax(110px, .8fr) minmax(90px, 1fr) 44px; gap: 9px; align-items: center; min-height: 54px; border-bottom: 1px solid var(--line); }
.logical-acclimation, .logical-individual-settings { margin-top: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.logical-acclimation summary, .logical-individual-settings > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 14px; cursor: pointer; list-style: none; }
.logical-acclimation summary::-webkit-details-marker, .logical-individual-settings > summary::-webkit-details-marker { display: none; }
.logical-acclimation summary b, .logical-acclimation summary small, .logical-individual-settings summary b, .logical-individual-settings summary small { display: block; }
.logical-acclimation summary small, .logical-individual-settings summary small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.logical-acclimation summary > span:last-child { color: var(--mint); font-size: 11px; font-weight: 800; }
.logical-acclimation-controls { display: grid; grid-template-columns: repeat(2, minmax(130px, 1fr)) auto auto; gap: 8px; padding: 0 14px 12px; }
.logical-acclimation-controls label, .logical-schedule-fields label { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.logical-acclimation-controls input { width: 76px; }
.logical-acclimation > p { margin: 0; padding: 0 14px 13px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.logical-manager { padding: 4px 0 18px; }
.logical-manager-head { margin-bottom: 12px; }
.logical-lamp-card { padding: 12px 0; border-bottom: 1px solid var(--line); }
.logical-lamp-card h3 { margin: 0; font-size: 15px; }
.logical-editor { margin-top: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.logical-editor-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.logical-editor-head h2 { margin: 0; font-size: 18px; }
.logical-controller-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.logical-controller-choice { padding: 11px; border: 1px solid var(--line); border-radius: 8px; }
.logical-controller-choice.selected { border-color: color-mix(in srgb, var(--mint) 55%, var(--line)); }
.logical-controller-choice > label:first-child { display: flex; gap: 8px; align-items: center; }
.logical-controller-choice > label:first-child span, .logical-controller-choice > label:first-child b, .logical-controller-choice > label:first-child small { display: block; min-width: 0; }
.logical-controller-choice small { color: var(--muted); font-size: 10px; overflow-wrap: anywhere; }
.logical-count { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; color: var(--muted); font-size: 11px; }
.logical-count select { width: 76px; }
.logical-channel-names { margin-top: 8px; }
.logical-channel-names > label { display: grid; grid-template-columns: 52px minmax(100px, 1fr) auto; gap: 7px; align-items: center; padding: 5px 0; color: var(--muted); font-size: 10px; }
.logical-channel-names > label > span { display: flex; align-items: center; gap: 4px; }
.logical-channel-names > label > span input { width: 58px; }
.logical-schedule-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin: 14px 0; }
.logical-schedule-fields label { display: flex; flex-wrap: wrap; }
.logical-schedule-fields input { flex: 1 1 110px; }
.logical-individual-settings > div { padding: 0 14px 14px; }
.logical-day-preview { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); gap: 18px; align-items: center; padding: 16px !important; border-color: color-mix(in srgb, var(--mint) 38%, var(--line)) !important; background: linear-gradient(135deg, color-mix(in srgb, var(--mint) 9%, var(--panel)), var(--panel)) !important; }
.logical-day-preview h2 { margin: 0; font-size: 20px; }
.logical-day-preview p { margin: 5px 0 0; max-width: 680px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.logical-day-preview-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 10px; align-items: center; }
.logical-day-preview-state { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 11px; }
.logical-day-preview-state strong { color: var(--text); font-size: 17px; font-variant-numeric: tabular-nums; }
.logical-day-preview-state.active span, .logical-day-preview-state.active strong { color: var(--mint); }
.logical-day-preview progress { grid-column: 1 / -1; width: 100%; height: 8px; overflow: hidden; border: 0; border-radius: 999px; background: var(--raised); accent-color: var(--mint); }
.logical-day-preview progress::-webkit-progress-bar { background: var(--raised); }
.logical-day-preview progress::-webkit-progress-value { background: var(--mint); }
.logical-day-preview progress::-moz-progress-bar { background: var(--mint); }
.logical-day-preview-controls .btn { grid-column: 1 / -1; width: 100%; }
.reeflight-runtime #editorChart { touch-action: none; }
.reeflight-runtime #editorChart [data-dot] { cursor: grab !important; touch-action: none; }
.reeflight-runtime #editorChart [data-dot]:active { cursor: grabbing !important; }
.schedule-channel-legend { align-items: center; }
.schedule-channel-key { display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); color: var(--muted); font: inherit; font-size: 11px; }
.schedule-channel-key i { width: 10px !important; height: 10px !important; flex: 0 0 10px; border-radius: 50%; background: var(--channel-color) !important; box-shadow: 0 0 8px color-mix(in srgb, var(--channel-color) 55%, transparent); }
.schedule-channel-key.active { border-color: var(--channel-color); color: var(--text); box-shadow: inset 0 -2px 0 var(--channel-color); }
.schedule-drag-note { margin-left: auto; }
.schedule-channel-appearance { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; margin: 12px 0 16px; }
.schedule-channel-appearance label { display: grid; gap: 6px; color: var(--muted); font-size: 11px; }
.schedule-channel-appearance input[type="text"], .schedule-channel-appearance input:not([type]) { width: 100%; min-height: 42px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg); }
.schedule-color-control { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 8px; }
.schedule-color-control input[type="color"] { width: 48px; min-height: 42px; padding: 3px; border: 1px solid var(--line); border-radius: 7px; background: var(--raised); }
.schedule-color-control output { display: grid; place-items: center; min-width: 0; border: 1px solid var(--line); border-radius: 7px; color: #081416; font-size: 10px; font-weight: 800; text-shadow: 0 1px 1px #fff8; }
.schedule-channel-appearance .mini { grid-column: 1 / -1; }
.schedule-ramp-shape { margin: 12px 0; padding: 13px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.schedule-ramp-shape > label { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.schedule-ramp-shape b, .schedule-ramp-shape small { display: block; }
.schedule-ramp-shape small { margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.schedule-ramp-shape output { color: var(--mint); font-weight: 800; font-variant-numeric: tabular-nums; }
.schedule-ramp-shape input { width: 100%; min-height: 38px; margin-top: 8px; accent-color: var(--mint); }
.schedule-ramp-scale { display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; }
.schedule-ramp-shape.disabled { opacity: .55; }
.schedule-master-control { margin: 0 0 14px; }
.show-profile-editor { display: grid; grid-template-columns: minmax(180px, 1fr) auto auto; gap: 8px; margin-top: 10px; }
.show-profile-editor input { min-width: 0; min-height: 42px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); }
.show-profile-editor .show-save { width: auto; margin: 0; }
.show-profile-manager { margin-top: 10px; border-top: 1px solid var(--line); }
.show-profile-manager summary { padding: 12px 0 7px; color: var(--muted); cursor: pointer; font-weight: 700; }
.show-profile-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.show-profile-row strong, .show-profile-row small { display: block; }
.show-profile-row small, .show-profile-empty { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.show-profile-row > div:last-child { display: flex; gap: 7px; }
.reeflight-runtime .danger { border-color: color-mix(in srgb, var(--red) 65%, var(--line)); color: var(--red); }
.reeflight-runtime .firmware-method-reset { border-top-color: var(--red); }
.reeflight-runtime .point { grid-template-columns: 11px minmax(140px, max-content) minmax(110px, 1fr) 72px auto 44px; }
.reeflight-runtime .point > i { width: 9px; height: 9px; border-radius: 50%; background: var(--channel-color); box-shadow: 0 0 7px color-mix(in srgb, var(--channel-color) 55%, transparent); }
.reeflight-runtime .point [data-time] { box-sizing: border-box; width: 100%; min-width: 140px; padding-inline: 12px 8px; font-variant-numeric: tabular-nums; letter-spacing: 0; white-space: nowrap; }
.reeflight-runtime .point [data-time]::-webkit-date-and-time-value { min-width: 5ch; text-align: left; }
.reeflight-runtime .point [data-time]::-webkit-calendar-picker-indicator { flex: 0 0 auto; margin: 0; padding: 2px; }
.point-position-controls { display: grid; grid-template-columns: repeat(3, minmax(76px, 1fr)); gap: 6px; }
.point-position-controls .mini { min-height: 40px; padding: 7px 9px; white-space: nowrap; }

@media (max-width: 700px) {
    .logical-empty, .logical-cockpit-head, .logical-manager-head, .logical-lamp-card { align-items: stretch; flex-direction: column; }
    .logical-empty .btn, .logical-manager-head .btn { width: 100%; }
    .logical-head-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
    .logical-head-actions select { width: 100%; min-width: 0; }
    .logical-master { grid-template-columns: minmax(0, 1fr) 46px; gap: 7px 9px; }
    .logical-master > span { grid-column: 1 / -1; }
    .logical-channel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; margin-top: 4px; }
    .logical-channel { grid-template-columns: minmax(0, 1fr) 38px; grid-template-rows: auto auto; gap: 3px 7px; min-height: 64px; padding: 6px 0; }
    .logical-channel > span { grid-column: 1 / -1; }
    .logical-channel input { grid-column: 1; grid-row: 2; }
    .logical-channel output { grid-column: 2; grid-row: 2; }
    .logical-acclimation-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .logical-acclimation-controls label { display: flex; flex-wrap: wrap; justify-content: space-between; }
    .logical-acclimation-controls input { width: 72px; }
    .logical-controller-choices, .logical-schedule-fields { grid-template-columns: minmax(0, 1fr); }
    .logical-channel-names > label { grid-template-columns: 46px minmax(0, 1fr); }
    .logical-channel-names > label > span { grid-column: 2; }
    .logical-editor { padding: 12px; }
    .logical-editor-actions { display: grid; grid-template-columns: minmax(0, 1fr); }
    .logical-lamp-card > div:last-child { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .logical-day-preview { grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 14px !important; }
    .logical-day-preview-controls { grid-template-columns: minmax(0, 1fr); }
    .reeflight-runtime .point { grid-template-columns: minmax(140px, 1fr) 82px 46px; grid-template-rows: auto auto auto; }
    .reeflight-runtime .point > i { display: none; }
    .reeflight-runtime .point [data-time] { grid-column: 1; grid-row: 1; }
    .reeflight-runtime .point [data-value] { grid-column: 2; grid-row: 1; }
    .reeflight-runtime .point > span { grid-column: 1 / 4; grid-row: 2; }
    .reeflight-runtime .point .remove { grid-column: 3; grid-row: 1; }
    .reeflight-runtime .point-position-controls { grid-column: 1 / 4; grid-row: 3; }
    .point-position-controls .mini { min-height: 46px; }
    .schedule-drag-note { width: 100%; margin-left: 0; }
    .show-profile-editor { grid-template-columns: minmax(0, 1fr); }
    .show-profile-editor .mini { width: 100%; }
    .show-profile-row { align-items: stretch; flex-direction: column; }
    .show-profile-row > div:last-child { display: grid; grid-template-columns: 1fr 1fr; }
}
@media (max-width: 350px) {
    .logical-channel-grid { grid-template-columns: minmax(0, 1fr); }
    .reeflight-runtime .point { grid-template-columns: minmax(132px, 1fr) 70px 44px; gap: 6px; }
    .reeflight-runtime .point [data-time] { min-width: 132px; padding-inline: 9px 6px; }
    .schedule-channel-appearance { grid-template-columns: minmax(0, 1fr); }
    .schedule-channel-appearance .mini { grid-column: 1; }
    .point-position-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .point-position-controls [data-point-after] { grid-column: 1 / -1; }
}
