/*
 * openLoxTouchDisplay - admin UI styles. Everything is scoped under #oltd so
 * nothing leaks into LoxBerry, and the few jQuery Mobile globals that reach
 * in (labels, text shadow, fieldsets, fonts of form elements) are reset.
 * Colours follow LoxBerry 4's design tokens (--lb-*) where they exist and
 * fall back to neutral greys on LoxBerry 2/3. LoxBerry green only for
 * primary actions.
 */
#oltd {
    --o-font: var(--lb-font, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);
    --o-text: var(--lb-text, #1f2328);
    --o-text2: var(--lb-text-secondary, #4b535c);
    --o-muted: var(--lb-text-muted, #6e7781);
    --o-border: var(--lb-border-color, #dfe3e7);
    --o-border2: rgba(128, 128, 128, 0.35);
    --o-card: var(--lb-card-bg, #ffffff);
    --o-subtle: rgba(128, 128, 128, 0.08);
    --o-subtle2: rgba(128, 128, 128, 0.14);
    --o-input: var(--lb-input-bg, #ffffff);
    --o-input-border: var(--lb-input-border, #c6ccd2);
    --o-input-text: var(--lb-input-text, #1f2328);
    --o-primary: var(--lb-primary, #6dac20);
    --o-primary-hover: var(--lb-primary-hover, #5a9418);
    --o-danger: var(--lb-danger, #c9302c);
    --o-warn: #b7791f;
    --o-ok: #3c9a37;
    --o-info: #2f6fb5;
    --o-radius: 10px;
    --o-radius-sm: 7px;
    --o-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 1px 1px rgba(0, 0, 0, 0.03);
    font-family: var(--o-font);
    font-size: 15px;
    line-height: 1.45;
    color: var(--o-text);
    text-shadow: none;
    text-align: left;
    -webkit-font-smoothing: antialiased;
    max-width: 1500px;
    margin: 0 auto;
}
#oltd *,
#oltd *::before,
#oltd *::after {
    box-sizing: border-box;
}
/* jQuery Mobile (LoxBerry 3) gives its page and content overflow-x: hidden,
 * which turns them into scroll containers and breaks position: sticky of
 * the preview column. */
.ui-mobile .ui-page-active:has(#oltd),
.ui-content:has(#oltd),
.ui-body:has(#oltd) {
    overflow-x: visible;
}
#oltd label {
    display: inline;
    margin: 0;
    font-size: inherit;
    font-weight: inherit;
}
#oltd fieldset {
    display: block;
    border: 0;
    margin: 0;
    padding: 0;
    min-width: 0;
}
#oltd h2,
#oltd h3,
#oltd h4,
#oltd p {
    margin: 0;
    text-shadow: none;
}
#oltd a {
    color: var(--o-info);
    font-weight: inherit;
    text-decoration: none;
}
#oltd a:hover {
    text-decoration: underline;
}
#oltd code {
    font-family: var(--lb-font-mono, ui-monospace, Consolas, Menlo, monospace);
    font-size: 0.9em;
    background: var(--o-subtle2);
    padding: 1px 5px;
    border-radius: 4px;
}
#oltd [hidden] {
    display: none !important;
}
#oltd :focus-visible {
    outline: 2px solid var(--o-primary);
    outline-offset: 2px;
}

/* ---- icons from the display's icon font ---- */
#oltd .oltd-ic {
    font-family: "OLTD Icons";
    font-style: normal;
    font-weight: normal;
    line-height: 1;
    display: inline-block;
    font-size: 1.15em;
    vertical-align: -0.2em;
    flex: none;
    speak: never;
}

/* ---- page structure ---- */
#oltd .oltd-view {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
#oltd .oltd-viewhead {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px 24px;
}
#oltd .oltd-viewhead-t {
    min-width: 0;
    flex: 1 1 360px;
}
#oltd .oltd-viewhead-x {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
#oltd .oltd-h1 {
    font-size: 22px;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.01em;
}
#oltd .oltd-lead {
    margin-top: 4px;
    color: var(--o-text2);
    max-width: 72ch;
}
#oltd .oltd-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
#oltd .oltd-h4 {
    font-size: 14px;
    font-weight: 600;
    margin: 6px 0 2px;
}
#oltd .oltd-muted {
    color: var(--o-muted);
}
#oltd .oltd-text-err {
    color: var(--o-danger);
}
#oltd .oltd-sep {
    color: var(--o-muted);
    margin: 0 2px;
}
#oltd .oltd-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--o-muted);
    padding: 6px 0;
}
#oltd .oltd-spinner {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid var(--o-subtle2);
    border-top-color: var(--o-primary);
    animation: oltd-spin 0.8s linear infinite;
    flex: none;
}
@keyframes oltd-spin {
    to { transform: rotate(360deg); }
}

/* While a page is still fetching its parts, nothing of it is shown: a half
   filled form invites reading and clicking what is about to change. The
   waiting stands alone, and the line grows with every part that arrives, so
   the waiting has a length. */
#oltd .is-loading > .oltd-detail-grid {
    display: none;
}
#oltd .oltd-pageload {
    display: flex;
    justify-content: center;
    padding: 48px 0;
}
#oltd .oltd-pageload-box {
    width: min(320px, 100%);
}
#oltd .oltd-pageload-t {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--o-muted);
    margin-bottom: 10px;
}
#oltd .oltd-pageload-rail {
    height: 4px;
    border-radius: 2px;
    background: var(--o-subtle2);
    overflow: hidden;
}
#oltd .oltd-pageload-fill {
    height: 100%;
    width: 0;
    border-radius: 2px;
    background: var(--o-primary);
    transition: width 0.25s ease;
}

/* ---- cards ---- */
#oltd .oltd-card {
    background: var(--o-card);
    border: 1px solid var(--o-border);
    border-radius: var(--o-radius);
    box-shadow: var(--o-shadow);
    min-width: 0;
}
#oltd .oltd-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px 0;
}
#oltd .oltd-card-titles {
    min-width: 0;
}
#oltd .oltd-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
}
#oltd .oltd-card-title .oltd-ic {
    color: var(--o-muted);
    font-size: 20px;
    vertical-align: 0;
}
#oltd .oltd-card-sub {
    margin-top: 2px;
    color: var(--o-muted);
    font-size: 13.5px;
}
#oltd .oltd-card-actions {
    flex: none;
    display: flex;
    gap: 6px;
    align-items: center;
}
#oltd .oltd-card-body {
    padding: 14px 18px 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
#oltd .oltd-subsection {
    border-top: 1px solid var(--o-border);
    padding-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ---- banners, notices, badges, dots ---- */
#oltd .oltd-banner {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--o-radius-sm);
    border: 1px solid transparent;
    font-size: 14px;
}
#oltd .oltd-banner > .oltd-ic {
    font-size: 18px;
    margin-top: 1px;
}
#oltd .oltd-banner > div {
    flex: 1;
    min-width: 0;
}
#oltd .oltd-banner > .oltd-btn {
    flex: none;
    align-self: center;
}
#oltd .oltd-banner p + p,
#oltd .oltd-banner div + p,
#oltd .oltd-banner p + ol {
    margin-top: 6px;
}
#oltd .oltd-banner-sm {
    padding: 7px 10px;
    font-size: 13px;
}
#oltd .oltd-banner-err {
    background: rgba(201, 48, 44, 0.08);
    border-color: rgba(201, 48, 44, 0.28);
}
#oltd .oltd-banner-err > .oltd-ic {
    color: var(--o-danger);
}
#oltd .oltd-banner-warn {
    background: rgba(214, 151, 32, 0.1);
    border-color: rgba(214, 151, 32, 0.35);
}
#oltd .oltd-banner-warn > .oltd-ic {
    color: var(--o-warn);
}
#oltd .oltd-banner-info {
    background: rgba(47, 111, 181, 0.07);
    border-color: rgba(47, 111, 181, 0.22);
}
#oltd .oltd-banner-info > .oltd-ic {
    color: var(--o-info);
}
#oltd .oltd-imprint {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--o-border);
    color: var(--o-text2);
    font-size: 13.5px;
    font-style: normal;
    line-height: 1.6;
}
#oltd .oltd-banner-ok {
    background: rgba(60, 154, 55, 0.08);
    border-color: rgba(60, 154, 55, 0.25);
}
#oltd .oltd-banner-ok > .oltd-ic {
    color: var(--o-ok);
}
#oltd .oltd-conn {
    margin-bottom: 14px;
}
/* "This page is no longer the newest one" - the button sits at its end so
   the sentence is read before it is clicked. */
#oltd .oltd-stale {
    gap: 10px;
}
#oltd .oltd-stale button {
    margin-left: auto;
    flex: none;
}
#oltd .oltd-notice {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    min-width: 0;
}
#oltd .oltd-notice span {
    overflow-wrap: anywhere;
}
#oltd .oltd-notice-ok {
    color: var(--o-ok);
}
#oltd .oltd-notice-err {
    color: var(--o-danger);
}
#oltd .oltd-notice-warn {
    color: var(--o-warn);
}
#oltd .oltd-notice-info {
    color: var(--o-info);
}
#oltd .oltd-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 999px;
    background: var(--o-subtle2);
    color: var(--o-text2);
    white-space: nowrap;
    vertical-align: 1px;
    margin-left: 6px;
}
#oltd .oltd-summary .oltd-badge {
    margin-left: 0;
    font-size: 12.5px;
    padding: 5px 10px;
}
#oltd .oltd-badge-ok {
    background: rgba(60, 154, 55, 0.13);
    color: #2c7a28;
}
#oltd .oltd-badge-warn {
    background: rgba(214, 151, 32, 0.16);
    color: #8a5a0c;
}
#oltd .oltd-badge-err {
    background: rgba(201, 48, 44, 0.12);
    color: var(--o-danger);
}
#oltd .oltd-chip {
    font-size: 12px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 999px;
    white-space: nowrap;
}
#oltd .oltd-chip-warn {
    background: rgba(214, 151, 32, 0.16);
    color: #8a5a0c;
}
#oltd .oltd-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex: none;
    background: #9aa3ab;
    vertical-align: 0;
}
#oltd .oltd-dot-ok {
    background: #3fb33a;
    box-shadow: 0 0 0 3px rgba(63, 179, 58, 0.18);
}
#oltd .oltd-dot-warn {
    background: #e0a326;
}
#oltd .oltd-dot-err {
    background: #d9433f;
}
#oltd .oltd-dot-off {
    background: #a2aab2;
}

/* ---- buttons ---- */
#oltd .oltd-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 36px;
    padding: 0 14px;
    border-radius: var(--o-radius-sm);
    border: 1px solid var(--o-input-border);
    background: var(--o-card);
    color: var(--o-text);
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.2;
    text-shadow: none;
    box-shadow: none;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
    position: relative;
    transition: background-color 0.12s, border-color 0.12s;
}
#oltd .oltd-btn:hover {
    background: var(--o-subtle);
    text-decoration: none;
}
#oltd .oltd-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}
#oltd .oltd-btn .oltd-ic {
    font-size: 17px;
    vertical-align: 0;
}
#oltd .oltd-btn-primary {
    background: var(--o-primary);
    border-color: var(--o-primary);
    color: #fff;
}
#oltd .oltd-btn-primary:hover {
    background: var(--o-primary-hover);
    border-color: var(--o-primary-hover);
}
#oltd .oltd-btn-danger {
    color: var(--o-danger);
    border-color: rgba(201, 48, 44, 0.45);
}
#oltd .oltd-btn-danger:hover {
    background: rgba(201, 48, 44, 0.08);
}
#oltd .oltd-btn-warn {
    background: #e7a52b;
    border-color: #d79515;
    color: #2b1d00;
}
#oltd .oltd-btn-warn:hover {
    background: #dc9a1e;
}
#oltd .oltd-btn-sm {
    min-height: 30px;
    padding: 0 10px;
    font-size: 13px;
}
#oltd .oltd-btn-lg {
    min-height: 44px;
    padding: 0 22px;
    font-size: 15px;
}
#oltd .oltd-btn.is-busy {
    color: transparent !important;
    pointer-events: none;
}
#oltd .oltd-btn.is-busy::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border-radius: 50%;
    border: 2px solid rgba(128, 128, 128, 0.35);
    border-top-color: var(--o-text);
    animation: oltd-spin 0.8s linear infinite;
}
#oltd .oltd-btn-primary.is-busy::after {
    border-color: rgba(255, 255, 255, 0.45);
    border-top-color: #fff;
}
#oltd .oltd-iconbtn {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    margin: 0;
    border: 1px solid transparent;
    border-radius: var(--o-radius-sm);
    background: none;
    color: var(--o-text2);
    cursor: pointer;
    font: inherit;
    text-shadow: none;
    box-shadow: none;
    -webkit-appearance: none;
    appearance: none;
}
#oltd .oltd-iconbtn:hover {
    background: var(--o-subtle2);
    color: var(--o-text);
}
#oltd .oltd-iconbtn:disabled {
    opacity: 0.3;
    cursor: default;
    background: none;
}
#oltd .oltd-iconbtn .oltd-ic {
    font-size: 18px;
    vertical-align: 0;
}
#oltd .oltd-iconbtn-danger:hover {
    color: var(--o-danger);
    background: rgba(201, 48, 44, 0.08);
}
#oltd .oltd-linkbtn {
    border: 0;
    background: none;
    padding: 0;
    margin: 0;
    color: var(--o-info);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
    text-shadow: none;
    box-shadow: none;
    -webkit-appearance: none;
    appearance: none;
}
#oltd .oltd-linkbtn:hover {
    text-decoration: underline;
}
/* Leads out of the plugin, to a page the display serves itself. */
#oltd .oltd-linkout {
    color: var(--o-info);
    font-weight: 600;
    text-decoration: none;
}
#oltd .oltd-linkout:hover {
    text-decoration: underline;
}
#oltd .oltd-actions,
#oltd .oltd-btnrow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
}
#oltd .oltd-actions {
    margin-top: 2px;
}

/* ---- form elements ---- */
#oltd .oltd-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 0;
}
#oltd .oltd-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}
#oltd .oltd-label {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--o-text2);
}
#oltd .oltd-hint {
    font-size: 13px;
    color: var(--o-muted);
    line-height: 1.4;
}
#oltd .oltd-input {
    display: block;
    width: 100%;
    min-height: 38px;
    padding: 7px 10px;
    margin: 0;
    border: 1px solid var(--o-input-border);
    border-radius: var(--o-radius-sm);
    background: var(--o-input);
    color: var(--o-input-text);
    font: inherit;
    font-size: 14.5px;
    line-height: 1.3;
    text-shadow: none;
    box-shadow: none;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color 0.12s, box-shadow 0.12s;
}
#oltd select.oltd-input {
    padding-right: 30px;
    background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
    background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    cursor: pointer;
    text-overflow: ellipsis;
}
#oltd select.oltd-input option,
#oltd select.oltd-input optgroup {
    color: #1f2328;
    background: #fff;
}
#oltd .oltd-input:focus {
    outline: none;
    border-color: var(--o-primary);
    box-shadow: 0 0 0 3px rgba(109, 172, 32, 0.22);
}
#oltd .oltd-input:disabled {
    opacity: 0.55;
}
#oltd .oltd-input.is-invalid {
    border-color: var(--o-danger);
}
#oltd .oltd-input.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(201, 48, 44, 0.2);
}
#oltd .oltd-num {
    max-width: 160px;
}
#oltd .oltd-hex {
    width: 104px;
    font-family: var(--lb-font-mono, ui-monospace, Consolas, Menlo, monospace);
    text-transform: uppercase;
}
#oltd .oltd-pass {
    position: relative;
}
#oltd .oltd-pass .oltd-input {
    padding-right: 42px;
}
#oltd .oltd-pass-eye {
    position: absolute;
    right: 3px;
    top: 50%;
    transform: translateY(-50%);
}
#oltd .oltd-pin {
    max-width: 180px;
    letter-spacing: 0.2em;
}
#oltd .oltd-pinrow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 18px;
}
#oltd .oltd-grid2,
#oltd .oltd-grid3 {
    display: grid;
    gap: 14px 18px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
}
#oltd .oltd-grid3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
#oltd .oltd-checks {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
#oltd .oltd-checkrow {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
#oltd .oltd-checkrow label {
    display: flex;
    flex-direction: column;
    gap: 1px;
    cursor: pointer;
}
#oltd .oltd-check {
    width: 18px;
    height: 18px;
    margin: 2px 0 0;
    flex: none;
    accent-color: var(--o-primary);
    cursor: pointer;
}
#oltd .oltd-check:disabled + label {
    opacity: 0.6;
    cursor: default;
}
#oltd .oltd-check-l {
    font-weight: 500;
}

/* segmented radio */
#oltd .oltd-seg {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 4px;
    border-radius: 10px;
    background: var(--o-subtle2);
    max-width: 100%;
}
#oltd .oltd-seg-in {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    margin: 0;
    pointer-events: none;
}
#oltd .oltd-seg-l {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 13px;
    border-radius: 7px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--o-text2);
    user-select: none;
    transition: background-color 0.12s, color 0.12s;
}
#oltd .oltd-seg-l .oltd-ic {
    font-size: 17px;
    vertical-align: 0;
}
#oltd .oltd-seg-l:hover {
    color: var(--o-text);
}
#oltd .oltd-seg-in:checked + .oltd-seg-l {
    background: var(--o-card);
    color: var(--o-text);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12), 0 0 0 1px var(--o-border);
}
#oltd .oltd-seg-in:focus-visible + .oltd-seg-l {
    outline: 2px solid var(--o-primary);
    outline-offset: 1px;
}
#oltd .oltd-seg-in:disabled + .oltd-seg-l {
    opacity: 0.45;
    cursor: default;
}

/* brightness */
#oltd .oltd-rangebox {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 420px;
}
#oltd .oltd-range {
    flex: 1;
    accent-color: var(--o-primary);
    margin: 0;
    min-width: 0;
}
#oltd .oltd-range-n {
    width: 4.5em;
    flex: none;
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}
#oltd .oltd-range-u {
    font-weight: 600;
    opacity: 0.7;
}

/* colours */
#oltd .oltd-colorfield {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
#oltd .oltd-swatches {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
#oltd .oltd-swatchrow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
#oltd .oltd-swatch-l {
    width: 92px;
    flex: none;
    font-size: 13px;
    color: var(--o-muted);
}
#oltd .oltd-swatch {
    width: 42px;
    height: 30px;
    border-radius: 7px;
    border: 1px solid rgba(0, 0, 0, 0.18);
    padding: 0;
    margin: 0;
    cursor: pointer;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
    -webkit-appearance: none;
    appearance: none;
    transition: transform 0.1s;
}
#oltd .oltd-swatch:hover {
    transform: translateY(-1px);
}
#oltd .oltd-swatch.is-on {
    outline: 2px solid var(--o-primary);
    outline-offset: 2px;
}
#oltd .oltd-customcolor {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
}
#oltd .oltd-color {
    width: 46px;
    height: 34px;
    padding: 2px;
    border: 1px solid var(--o-input-border);
    border-radius: var(--o-radius-sm);
    background: var(--o-input);
    cursor: pointer;
    margin: 0;
}

/* ---- key/value lists ---- */
#oltd .oltd-kv {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 6px 14px;
    margin: 0;
    font-size: 14px;
}
#oltd .oltd-kv dt {
    color: var(--o-muted);
    font-weight: 400;
}
#oltd .oltd-kv dd {
    margin: 0;
    min-width: 0;
    overflow-wrap: anywhere;
}
#oltd .oltd-kv dd .oltd-badge {
    margin-left: 6px;
}
#oltd .oltd-kv-wide {
    grid-template-columns: minmax(120px, max-content) minmax(0, 1fr);
}
#oltd .oltd-plainlist {
    list-style: none;
    margin: 6px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
#oltd .oltd-plainlist li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
}
#oltd .oltd-plainlist .oltd-ic {
    color: var(--o-muted);
    margin-right: 3px;
}
#oltd .oltd-ol {
    margin: 6px 0 0;
    padding-left: 22px;
}
#oltd .oltd-ol li + li {
    margin-top: 5px;
}
/* A secondary route folded away: one line until someone wants it. */
#oltd .oltd-details {
    margin-top: 12px;
}
#oltd .oltd-details > summary {
    cursor: pointer;
    color: var(--o-info);
    font-size: 13px;
}
#oltd .oltd-details > summary:hover {
    text-decoration: underline;
}
#oltd .oltd-details[open] > summary {
    margin-bottom: 6px;
}

/* ---- empty states ---- */
#oltd .oltd-empty {
    text-align: center;
    padding: 44px 20px;
    border: 1px dashed var(--o-border2);
    border-radius: var(--o-radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
#oltd .oltd-empty p {
    color: var(--o-text2);
    max-width: 56ch;
}
#oltd .oltd-empty h3 {
    font-size: 17px;
    font-weight: 600;
}
#oltd .oltd-empty-ic {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: var(--o-subtle2);
    color: var(--o-text2);
}
#oltd .oltd-empty-ic .oltd-ic {
    font-size: 34px;
    vertical-align: 0;
}
#oltd .oltd-empty .oltd-btn {
    margin-top: 6px;
}

/* ---- display list ---- */
#oltd .oltd-devgrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
    gap: 16px;
}
#oltd .oltd-dev {
    position: relative;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: border-color 0.12s, box-shadow 0.12s;
}
#oltd .oltd-dev:hover {
    border-color: var(--o-border2);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.07);
}
#oltd .oltd-dev.has-warn {
    border-color: rgba(214, 151, 32, 0.55);
}
#oltd .oltd-dev-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
#oltd .oltd-dev-ic {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    background: #121212;
    color: #fff;
    display: grid;
    place-items: center;
    flex: none;
}
#oltd .oltd-dev-ic .oltd-ic {
    font-size: 22px;
    vertical-align: 0;
}
#oltd .is-offline .oltd-dev-ic {
    background: #8b949c;
}
#oltd .oltd-dev-ic-lg {
    width: 52px;
    height: 52px;
    border-radius: 13px;
}
#oltd .oltd-dev-ic-lg .oltd-ic {
    font-size: 27px;
}
#oltd .oltd-dev-titles {
    flex: 1;
    min-width: 0;
}
#oltd .oltd-dev-name {
    font-size: 17px;
    font-weight: 600;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
#oltd .oltd-dev-link {
    color: var(--o-text);
}
#oltd .oltd-dev-link::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: var(--o-radius);
}
#oltd .oltd-dev-link:hover {
    text-decoration: none;
}
#oltd .oltd-dev-link:focus-visible {
    outline: none;
}
#oltd .oltd-dev-link:focus-visible::after {
    outline: 2px solid var(--o-primary);
    outline-offset: 2px;
}
#oltd .oltd-dev-state {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 13.5px;
    color: var(--o-text2);
    margin-top: 2px;
}
#oltd .oltd-dev-upd {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(214, 151, 32, 0.16);
    color: #8a5a0c;
    flex: none;
}
#oltd .oltd-dev-upd .oltd-ic {
    vertical-align: 0;
}
#oltd .oltd-dev .oltd-kv {
    font-size: 13.5px;
    gap: 5px 14px;
}
#oltd .oltd-dev-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 12px;
    border-top: 1px solid var(--o-border);
    padding-top: 12px;
    font-size: 13.5px;
    position: relative;
}
#oltd .oltd-dev-foot .oltd-btn,
#oltd .oltd-dev-foot .oltd-notice {
    position: relative;
    z-index: 1;
}
#oltd .oltd-dev-warn {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #8a5a0c;
    font-weight: 500;
}
#oltd .oltd-dev-go {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    color: var(--o-info);
    font-weight: 500;
}

/* ---- miniserver ---- */
#oltd .oltd-msgrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 16px;
}

/* ---- flash ---- */
#oltd .oltd-flash {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
#oltd .oltd-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    counter-reset: none;
}
#oltd .oltd-steps li {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--o-radius);
    background: var(--o-card);
    border: 1px solid var(--o-border);
    box-shadow: var(--o-shadow);
}
#oltd .oltd-steps p {
    margin-top: 3px;
    color: var(--o-text2);
    font-size: 14px;
}
#oltd .oltd-step-n {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #121212;
    color: #fff;
    font-weight: 600;
    display: grid;
    place-items: center;
    flex: none;
}
#oltd .oltd-flash-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding-top: 23px;
}
#oltd .oltd-flash-install {
    min-width: 0;
}

/* donation note: dialog when the flash view opens, card at its end */
#oltd .oltd-donate {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}
#oltd .oltd-donate-ic {
    flex: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(201, 48, 44, 0.1);
    color: var(--o-danger);
}
#oltd .oltd-donate-ic .oltd-ic {
    font-size: 26px;
    vertical-align: 0;
}
#oltd .oltd-donate-t {
    min-width: 0;
}
#oltd .oltd-donate-t p {
    margin: 0 0 8px;
}
#oltd .oltd-donate-amount {
    font-weight: 600;
    font-size: 1.05em;
}

/* ---- settings ---- */
#oltd .oltd-setgrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
    gap: 16px;
    align-items: start;
}

/* ---- detail ---- */
#oltd .oltd-back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 500;
    align-self: flex-start;
}
#oltd .oltd-detail {
    gap: 14px;
}
#oltd .oltd-detail-title {
    display: flex;
    align-items: center;
    gap: 14px;
}
#oltd .oltd-detail-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 14px;
    color: var(--o-text2);
    font-size: 13.5px;
    margin-top: 3px;
}
#oltd .oltd-detail-meta .oltd-badge {
    margin-left: 0;
}
#oltd .oltd-detail-meta .oltd-dev-state {
    margin-top: 0;
}
#oltd .oltd-detail-alerts {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
#oltd .oltd-detail-alerts:empty {
    display: none;
}
#oltd .oltd-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(340px, 460px);
    gap: 16px;
    align-items: start;
}
#oltd .oltd-detail-grid-1 {
    grid-template-columns: minmax(0, 1fr);
}
#oltd .oltd-detail-main,
#oltd .oltd-detail-side {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}
#oltd .oltd-detail-side {
    position: sticky;
    top: calc(12px + var(--oltd-savehead-h, 0px));
}
#oltd .oltd-danger-zone {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px 16px;
}
#oltd .oltd-danger-zone .oltd-notice {
    grid-column: 1 / -1;
}
#oltd .oltd-inline-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px;
    margin: 0;
}
#oltd .oltd-inline-form .oltd-field {
    flex: 1 1 260px;
}
#oltd .oltd-inline-form > .oltd-btn {
    margin-bottom: 1px;
}
#oltd .oltd-inline-form .oltd-hint {
    position: absolute;
    left: -9999px;
}

/* tabs (automatic) */
#oltd .oltd-tablist {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
#oltd .oltd-tabitem {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--o-radius-sm);
    background: var(--o-subtle);
}
#oltd .oltd-tabglyph {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: #121212;
    color: #fff;
    display: grid;
    place-items: center;
    flex: none;
}
#oltd .oltd-tabglyph .oltd-ic {
    font-size: 21px;
    vertical-align: 0;
}
#oltd .oltd-tabitem-t {
    min-width: 0;
    font-size: 14px;
}
#oltd .oltd-tabitem-c {
    color: var(--o-text2);
    font-size: 13px;
    margin-top: 2px;
}

/* structure tree (manual pages): tabs, folders, blocks */
#oltd .oltd-tree,
#oltd .oltd-tree-kids {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}
#oltd .oltd-tree {
    gap: 12px;
}
#oltd .oltd-tree-kids {
    gap: 4px;
    margin: 6px 0 0 18px;
    padding-left: 10px;
    border-left: 2px solid var(--o-border);
}
#oltd .oltd-tree-item.is-tab {
    border: 1px solid var(--o-border);
    border-radius: var(--o-radius);
    background: var(--o-subtle);
    padding: 8px 8px 10px;
}
#oltd .oltd-tree-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    border-radius: 8px;
}
#oltd .oltd-tree-item.is-folder > .oltd-tree-row,
#oltd .oltd-tree-item.is-block > .oltd-tree-row {
    background: var(--o-card);
    border: 1px solid var(--o-border);
    padding: 3px 4px 3px 2px;
    font-size: 14px;
}
#oltd .oltd-tree-item.is-dragging > .oltd-tree-row {
    opacity: 0.45;
}
#oltd .oltd-tree-row.is-drop-before {
    box-shadow: inset 0 3px 0 var(--o-primary);
}
#oltd .oltd-tree-row.is-drop-after {
    box-shadow: inset 0 -3px 0 var(--o-primary);
}
#oltd .is-drop-in {
    outline: 2px dashed var(--o-primary);
    outline-offset: -2px;
    background: rgba(109, 172, 32, 0.08);
}
#oltd .oltd-tree-grip {
    flex: none;
    width: 18px;
    display: grid;
    place-items: center;
    color: var(--o-muted);
    cursor: grab;
    touch-action: none;
}
#oltd .oltd-tree-grip .oltd-ic {
    font-size: 16px;
    vertical-align: 0;
}
#oltd .oltd-tree-caret {
    width: 26px;
    flex: none;
}
#oltd .oltd-tree-title {
    flex: 1 1 auto;
    min-width: 80px;
}
#oltd .oltd-tree-row select {
    flex: 0 0 150px;
    width: 150px;
}
#oltd .oltd-tree-count {
    flex: none;
    color: var(--o-muted);
    font-size: 12.5px;
    white-space: nowrap;
}
#oltd .oltd-tree-ci {
    flex: none;
    color: var(--o-muted);
}
#oltd .oltd-tree-name {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0 8px;
    align-items: baseline;
}
#oltd .oltd-tree-name .oltd-muted {
    font-size: 12.5px;
}
#oltd .oltd-tree-name .oltd-badge {
    align-self: center;
}
#oltd .oltd-tree-tools {
    display: flex;
    gap: 2px;
    flex: none;
    margin-left: auto;
}
#oltd .oltd-tree-empty {
    padding: 8px 10px;
    border: 1px dashed var(--o-border);
    border-radius: 8px;
    color: var(--o-muted);
    font-size: 13.5px;
}
#oltd .oltd-tree-add {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 4px 0 0;
    border-radius: 8px;
}
#oltd .oltd-tabed-icon {
    width: 40px;
    height: 38px;
    border-radius: 9px;
    border: 0;
    margin: 0;
    padding: 0;
    background: #121212;
    color: #fff;
    display: grid;
    place-items: center;
    cursor: pointer;
    flex: none;
    -webkit-appearance: none;
    appearance: none;
    box-shadow: none;
    text-shadow: none;
}
#oltd .oltd-tabed-icon:hover {
    background: #333;
}
#oltd .oltd-tabed-icon.is-folder {
    width: 36px;
    height: 34px;
    background: var(--o-subtle);
    color: var(--o-text);
    border: 1px solid var(--o-border);
}
#oltd .oltd-tabed-icon.is-folder:hover {
    background: var(--o-subtle2);
}
#oltd .oltd-tabed-icon .oltd-ic {
    font-size: 21px;
    vertical-align: 0;
}

/* icon picker, control picker */
#oltd .oltd-icongrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
    gap: 8px;
}
#oltd .oltd-iconpick {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 6px 10px;
    border-radius: 10px;
    border: 1px solid var(--o-border);
    background: var(--o-card);
    color: var(--o-text);
    cursor: pointer;
    font: inherit;
    font-size: 12.5px;
    margin: 0;
    text-shadow: none;
    box-shadow: none;
    -webkit-appearance: none;
    appearance: none;
}
#oltd .oltd-iconpick .oltd-ic {
    font-size: 28px;
    vertical-align: 0;
}
#oltd .oltd-iconpick:hover {
    background: var(--o-subtle);
}
#oltd .oltd-iconpick.is-on {
    border-color: var(--o-primary);
    box-shadow: 0 0 0 2px rgba(109, 172, 32, 0.25);
}
#oltd .oltd-picker-wrap {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
#oltd .oltd-picker-top {
    display: flex;
    align-items: center;
    gap: 12px;
}
#oltd .oltd-picker-top .oltd-input {
    flex: 1;
}
/* the Miniserver whose blocks are listed (several in LoxBerry only) */
#oltd .oltd-picker-top .oltd-mspick {
    flex: 0 1 auto;
    width: auto;
    max-width: 35%;
}
#oltd .oltd-picker-top .oltd-input[type="search"] {
    min-width: 8em;
}

/* a block of any Miniserver: which Miniserver, then which of its blocks */
#oltd .oltd-refpick {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
}
#oltd .oltd-refpick > .oltd-mspick {
    flex: 0 1 11em;
    min-width: 0;
}
#oltd .oltd-refpick > :last-child {
    flex: 1 1 14em;
    min-width: 0;
}
#oltd .oltd-picker-top .oltd-muted {
    font-size: 13px;
    white-space: nowrap;
}
#oltd .oltd-picker {
    max-height: min(56vh, 520px);
    overflow-y: auto;
    border: 1px solid var(--o-border);
    border-radius: var(--o-radius-sm);
    padding: 4px;
}
#oltd .oltd-picker-g {
    position: sticky;
    top: -4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: var(--o-card);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--o-muted);
    padding: 10px 8px 4px;
    z-index: 1;
}
#oltd .oltd-picker-all {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12.5px;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
}
#oltd .oltd-picker-all[hidden] {
    display: none;
}
#oltd .oltd-picker-row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    margin: 0;
    border: 0;
    border-radius: 7px;
    background: none;
    color: var(--o-text);
    font: inherit;
    font-size: 14px;
    text-align: left;
    cursor: pointer;
    text-shadow: none;
    box-shadow: none;
    -webkit-appearance: none;
    appearance: none;
}
#oltd .oltd-picker-row:hover {
    background: var(--o-subtle);
}
#oltd .oltd-picker-row.is-on {
    background: rgba(109, 172, 32, 0.12);
}
#oltd .oltd-picker-ic {
    color: var(--o-muted);
}
#oltd .oltd-picker-n {
    font-weight: 500;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
#oltd .oltd-picker-t {
    flex: 1;
    min-width: 0;
    color: var(--o-muted);
    font-size: 12.5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
#oltd .oltd-picker-state {
    color: var(--o-muted);
}
#oltd .oltd-picker-row.is-on .oltd-picker-state {
    color: var(--o-primary);
}

/* preview card */
#oltd .oltd-pv-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
#oltd .oltd-pv-bar select.oltd-input {
    width: auto;
    flex: 1 1 150px;
    min-height: 32px;
    padding-top: 4px;
    padding-bottom: 4px;
    font-size: 13.5px;
}
#oltd .oltd-toggles {
    display: inline-flex;
    gap: 4px;
    padding: 3px;
    border-radius: 9px;
    background: var(--o-subtle2);
}
#oltd .oltd-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 9px;
    border-radius: 6px;
    border: 0;
    margin: 0;
    background: none;
    color: var(--o-text2);
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-shadow: none;
    box-shadow: none;
    -webkit-appearance: none;
    appearance: none;
}
#oltd .oltd-toggle .oltd-ic {
    font-size: 15px;
    vertical-align: 0;
}
#oltd .oltd-toggle.is-on {
    background: #121212;
    color: #fff;
}
#oltd .oltd-pv-hint:empty {
    display: none;
}
#oltd .oltd-pv-host {
    padding: 6px 0 2px;
    min-height: 120px;
}
#oltd .oltd-live-img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    border-radius: 6px;
    border: 8px solid #0b0b0b;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25);
    image-rendering: auto;
}
#oltd .oltd-pv-live {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
#oltd .oltd-pv-live .oltd-hint {
    text-align: center;
    margin-top: 6px;
}

/* ---- virtual display summary (display detail) ---- */
#oltd .oltd-vdinfo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--o-radius-sm);
    background: var(--o-subtle);
}
#oltd .oltd-vdinfo-t {
    flex: 1;
    min-width: 0;
    font-size: 14px;
}
#oltd .oltd-vdinfo-t .oltd-muted {
    font-size: 13px;
}
#oltd .oltd-devlist li {
    padding: 4px 0;
}
#oltd .oltd-devlist .oltd-iconbtn {
    margin-left: auto;
    width: 28px;
    height: 28px;
}
#oltd .oltd-dev-err {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--o-danger);
    font-weight: 500;
}

/* ---- page head with "Save" at the top right (editor pages) ----
 * Sticks to the top while the page scrolls (top -1px: the observer in
 * OLTD.saveHead then sees it cut by one pixel and gives it the card look). */
#oltd .oltd-savehead {
    position: sticky;
    top: -1px;
    z-index: 6;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 20px;
    padding: 10px 14px;
    border-radius: var(--o-radius);
    transition: background-color 0.15s, box-shadow 0.15s;
}
#oltd .oltd-savehead.is-stuck {
    background: var(--o-card);
    box-shadow: 0 0 0 1px var(--o-border2), 0 8px 28px rgba(0, 0, 0, 0.16);
}
#oltd .oltd-savehead-t {
    min-width: 0;
    flex: 1 1 320px;
}
#oltd .oltd-savehead-act {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px 12px;
    margin-left: auto;
}
#oltd .oltd-savehead-extra {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* a bound Loxone state with its options */
#oltd .oltd-bindrow {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px 24px;
    padding: 10px 0;
    border-top: 1px solid var(--o-border);
}
#oltd .oltd-bindrow:first-of-type {
    border-top: 0;
}
#oltd .oltd-bindrow > .oltd-field {
    flex: 1 1 260px;
    min-width: 0;
}
#oltd .oltd-bindopts {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px 20px;
}
#oltd .oltd-bind-hold {
    width: 8em;
}

/* firmware window: the weekdays as toggles */
#oltd .oltd-days {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
#oltd .oltd-day {
    min-width: 46px;
    padding: 7px 10px;
    border: 1px solid var(--o-border);
    border-radius: var(--o-radius-sm);
    background: var(--o-card);
    color: inherit;
    font: inherit;
    cursor: pointer;
}
#oltd .oltd-day:hover {
    border-color: var(--o-primary);
}
#oltd .oltd-day.is-on {
    background: var(--o-primary);
    border-color: var(--o-primary);
    color: #fff;
    font-weight: 600;
}
#oltd .oltd-time {
    width: 9em;
}

/* arranging a page: the raster and its tiles */
#oltd .oltd-arrange {
    position: relative;
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    border: 1px solid var(--o-border);
    border-radius: var(--o-radius-sm);
    background-color: var(--o-subtle);
    /* one line per cell, so it is obvious what a tile snaps to */
    background-image:
        repeating-linear-gradient(to right, var(--o-border) 0 1px, transparent 1px calc(100% / 12)),
        repeating-linear-gradient(to bottom, var(--o-border) 0 1px, transparent 1px calc(100% / 8));
    touch-action: none;
    overflow: hidden;
}
#oltd .oltd-artile {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px;
    box-sizing: border-box;
    border: 1px solid var(--o-primary);
    border-radius: var(--o-radius-sm);
    background: var(--o-card);
    cursor: grab;
    overflow: hidden;
    user-select: none;
}
#oltd .oltd-artile.is-dragging {
    cursor: grabbing;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
    z-index: 2;
}
#oltd .oltd-artile-n {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.85em;
}
#oltd .oltd-artile-grip {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 14px;
    height: 14px;
    cursor: nwse-resize;
    background: linear-gradient(135deg, transparent 50%, var(--o-primary) 50%);
}

/* the panels the firmware can drive */
#oltd .oltd-boardlist {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}
#oltd .oltd-boarditem {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--o-radius-sm);
    background: var(--o-subtle);
}
#oltd .oltd-boarditem > div {
    flex: 1;
    min-width: 0;
}
#oltd .oltd-savehead-hint {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--o-text2);
    font-size: 14px;
}
#oltd .oltd-savehead-hint .oltd-ic {
    color: var(--o-warn);
}

/* ---- import results ---- */
#oltd .oltd-result {
    border: 1px solid var(--o-border);
    border-radius: var(--o-radius-sm);
    padding: 10px 12px;
    font-size: 14px;
}
#oltd .oltd-result-h {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--o-ok);
}
#oltd .oltd-result-h.is-skip {
    color: var(--o-warn);
    margin-top: 8px;
}
#oltd .oltd-result ul {
    margin: 4px 0 0;
    padding-left: 26px;
    color: var(--o-text2);
}

/* ---- installation mode, units ---- */
#oltd .oltd-install {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 16px;
    padding: 12px 14px;
    border-radius: var(--o-radius-sm);
    background: var(--o-subtle);
}
#oltd .oltd-install-state {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
    flex: 1 1 260px;
}
#oltd .oltd-install-state.is-on {
    color: var(--o-text);
}
#oltd .oltd-install-dot {
    padding-top: 5px;
}
#oltd .oltd-until {
    font-variant-numeric: tabular-nums;
}
#oltd .oltd-unit {
    display: flex;
    align-items: center;
    gap: 8px;
}
#oltd .oltd-unit .oltd-input {
    width: 110px;
}
#oltd .oltd-shared {
    gap: 8px;
}
#oltd .oltd-shared .oltd-h4 {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}
#oltd .oltd-transfer .oltd-h4:first-child {
    margin-top: 0;
}
#oltd .oltd-transfer .oltd-checks {
    max-height: 40vh;
    overflow-y: auto;
}

/* ---- what shall travel: the list of the export and import dialog ---- */
#oltd .oltd-picklist {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 52vh;
    overflow-y: auto;
}
#oltd .oltd-pickgroup {
    border: 1px solid var(--o-border);
    border-radius: 10px;
    padding: 10px 12px;
}
#oltd .oltd-pick-head {
    margin-bottom: 6px;
}
#oltd .oltd-pick-kids {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-left: 28px;
}
#oltd .oltd-pick-n {
    font-size: 13px;
    color: var(--o-muted);
}
#oltd .oltd-pick-warn {
    border: 1px solid var(--o-warn);
    border-radius: 10px;
    padding: 10px 12px;
    background: var(--o-subtle2);
}
#oltd .oltd-io-over {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--o-border);
}

/* ---- dialog ---- */
#oltd dialog.oltd-dialog {
    width: min(560px, calc(100vw - 24px));
    max-height: calc(100vh - 40px);
    padding: 0;
    border: 1px solid var(--o-border);
    border-radius: 14px;
    background: var(--o-card);
    color: var(--o-text);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
    font-family: var(--o-font);
    font-size: 15px;
    overflow: hidden;
}
#oltd dialog.oltd-dialog-wide {
    width: min(760px, calc(100vw - 24px));
}
#oltd dialog.oltd-dialog[open] {
    display: flex;
    flex-direction: column;
}
#oltd dialog.oltd-dialog::backdrop {
    background: rgba(15, 18, 22, 0.45);
}
#oltd .oltd-dialog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px 10px 20px;
}
#oltd .oltd-dialog-head h3 {
    font-size: 17px;
    font-weight: 600;
}
#oltd .oltd-dialog-body {
    padding: 4px 20px 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    color: var(--o-text2);
}
#oltd .oltd-dialog-foot {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 20px 16px;
    border-top: 1px solid var(--o-border);
}

/* ---- responsive ---- */
@media (max-width: 1000px) {
    #oltd .oltd-detail-grid {
        grid-template-columns: minmax(0, 1fr);
    }
    #oltd .oltd-detail-side {
        position: static;
        order: -1;
    }
    #oltd .oltd-detail-side .oltd-pv-host {
        max-width: 560px;
        margin: 0 auto;
        width: 100%;
    }
}
@media (max-width: 900px) {
    #oltd .oltd-steps {
        grid-template-columns: minmax(0, 1fr);
    }
    #oltd .oltd-setgrid,
    #oltd .oltd-msgrid {
        grid-template-columns: minmax(0, 1fr);
    }
}
@media (max-width: 640px) {
    #oltd {
        font-size: 14.5px;
    }
    #oltd .oltd-grid2,
    #oltd .oltd-grid3 {
        grid-template-columns: minmax(0, 1fr);
    }
    #oltd .oltd-devgrid {
        grid-template-columns: minmax(0, 1fr);
    }
    #oltd .oltd-card-head {
        padding: 12px 14px 0;
    }
    #oltd .oltd-card-body {
        padding: 12px 14px 14px;
    }
    #oltd .oltd-tree-row {
        flex-wrap: wrap;
    }
    #oltd .oltd-tree-grip {
        display: none;
    }
    #oltd .oltd-tree-title {
        flex: 1 1 calc(100% - 140px);
    }
    #oltd .oltd-tree-row select {
        flex: 1 1 100px;
        width: auto;
        min-width: 0;
    }
    #oltd .oltd-tree-name {
        flex: 1 1 calc(100% - 40px);
    }
    #oltd .oltd-tree-kids {
        margin-left: 4px;
        padding-left: 8px;
    }
    #oltd .oltd-tree-item.is-block > .oltd-tree-row,
    #oltd .oltd-tree-item.is-folder > .oltd-tree-row {
        padding-left: 6px;
    }
    #oltd .oltd-kv-wide {
        grid-template-columns: minmax(0, 1fr);
        gap: 1px 0;
    }
    #oltd .oltd-kv-wide dd {
        margin-bottom: 7px;
    }
    #oltd .oltd-swatch-l {
        width: 100%;
    }
    #oltd .oltd-danger-zone {
        grid-template-columns: minmax(0, 1fr);
    }
    #oltd .oltd-seg {
        display: flex;
    }
    #oltd .oltd-seg-l {
        flex: 1 1 auto;
        justify-content: center;
    }
    #oltd .oltd-flash-btn {
        padding-top: 0;
    }
}

/* ---- desktop picture: focus editor ---- */
#oltd .oltd-desk-focus {
    position: relative;
    display: inline-block;
    max-width: 100%;
    line-height: 0;
    overflow: hidden;
    border-radius: var(--o-radius-sm);
    background: #000;
    cursor: crosshair;
}
#oltd .oltd-desk-focus:focus-visible {
    outline: 3px solid var(--o-primary);
    outline-offset: 2px;
}
#oltd .oltd-desk-img {
    display: block;
    max-width: 100%;
    max-height: 360px;
    user-select: none;
}
#oltd .oltd-desk-frame {
    position: absolute;
    outline: 2px solid #fff;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.45);
    pointer-events: none;
}
#oltd .oltd-desk-frame + .oltd-desk-frame {
    outline-style: dashed;
    box-shadow: none;
}
#oltd .oltd-desk-frame-l {
    position: absolute;
    left: 4px;
    top: 4px;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font: 600 11px/1.3 var(--o-font);
    white-space: nowrap;
}
#oltd .oltd-desk-dot {
    position: absolute;
    width: 14px;
    height: 14px;
    margin: -7px 0 0 -7px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: var(--o-primary);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45);
    pointer-events: none;
}

/* ---- the open site: pages without a LoxBerry (open.js) ---- */
#oltd .oltd-open-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
#oltd .oltd-open-clock {
    font: 600 13px/1.3 var(--o-font);
    color: var(--o-muted);
    white-space: nowrap;
}
/* How long the work stays: the three ways side by side, the one in force
   marked, and under them one line saying what it means. A visitor should be
   able to read the consequence without clicking anything. */
#oltd .oltd-open-keep {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0 0 14px;
}
#oltd .oltd-open-keep-t {
    font-weight: 600;
}
#oltd .oltd-open-keep-h {
    flex: 1 1 100%;
    color: var(--o-muted);
    font-size: 13px;
}
#oltd .oltd-open-step {
    margin: 18px 0;
    padding: 14px 16px;
    border: 1px solid var(--o-border);
    border-radius: 10px;
    background: var(--o-card);
}
#oltd .oltd-open-rooms {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}
#oltd .oltd-open-steps {
    margin: 16px 0 0 18px;
    padding: 0;
    color: var(--o-muted);
    font-size: 14px;
    line-height: 1.6;
}
/* the open site's steps: the texts a pixel larger, the button apart from them */
#oltd .oltd-open-step .oltd-hint {
    font-size: 14px;
}
#oltd .oltd-open-step > .oltd-btn {
    margin-top: 14px;
}
/* saving for later sits apart from the file that goes to the display */
#oltd .oltd-open-keep {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--o-border);
}
#oltd .oltd-open-keep .oltd-hint {
    flex: 1 1 260px;
    margin: 0;
}

/* ---- settings: widget templates ---- */
#oltd .oltd-wt-list {
    margin-top: 12px;
}
#oltd .oltd-wt-rows {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 8px 0;
}
#oltd .oltd-wt-row {
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
}
#oltd .oltd-wt-fam {
    min-width: 110px;
    font-weight: 600;
}
#oltd .oltd-wt-sizes {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
#oltd .oltd-wt-item {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}
#oltd .oltd-wt-size {
    background: var(--o-subtle);
    color: inherit;
    text-decoration: none;
}
#oltd .oltd-wt-size:hover {
    text-decoration: underline;
}
#oltd .oltd-wt-size.is-own {
    background: var(--o-primary);
    color: #fff;
}
#oltd .oltd-wt-results li.is-err {
    color: var(--o-danger);
}

/* development server only (index.php oltd_test): which way the page plays */
#oltd .oltd-devbar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    align-items: center;
    margin: 0 0 12px;
    padding: 6px 12px;
    border-radius: 8px;
    background: var(--o-subtle);
    font-size: 13px;
}
#oltd .oltd-devbar a.is-on {
    font-weight: 600;
    text-decoration: none;
}
