/* Platform foundation — tokens, Site.Master header, tasks drawer, page shells, shared buttons/dialogs.
 *
 * CSS layer contract (each page loads Master + its own layers):
 *   1. platform.css — always (this file)
 *   2. dashboard.css — Dashboard, DDG, TextForm document pages
 *   3. module-toolbar.css — dhtmlx toolbars on module pages
 *   4. feature CSS — admin.css, deep_dedup_pages.css, …
 * Legacy island (no shell tokens): ProjectGrid, Qualify, v1 Text/Graphics modules.
 */

:root {
    --bg: #f4f6f9;
    --panel: #ffffff;
    --ink: #1f2a37;
    --muted: #6b7280;
    --line: #e5e7eb;
    --brand: #2c3e50;
    --brand-2: #34495e;
    --accent: #2563eb;
    --accent-soft: #eff4ff;
    --ok: #16a34a;
    --warn: #d97706;
    --danger: #b91c1c;
    --wionet: #7c3aed;
    --wionet-soft: #f3e8ff;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 8px 24px rgba(16, 24, 40, .06);
    --font: "Segoe UI", system-ui, -apple-system, sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.plt-skip {
    position: absolute;
    left: -999px;
    top: 8px;
    z-index: 10000;
    padding: 8px 12px;
    background: #fff;
    color: var(--brand);
    font-family: var(--font);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 6px;
}

.plt-skip:focus {
    left: 8px;
}

.header {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 76px;
    padding: 0 16px;
    box-sizing: border-box;
    background: var(--brand);
    color: #fff;
    font-family: var(--font);
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    padding-right: 4px;
}

.header-rule {
    flex-shrink: 0;
    width: 2px;
    height: 28px;
    margin: 0;
    background: rgba(255, 255, 255, .22);
}

.header-end {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    margin-left: auto;
}

.header-global {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.header-tasks-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    padding: 7px 12px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #fff;
    font-family: var(--font);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

.header-tasks-btn:hover {
    background: rgba(255, 255, 255, .12);
}

.header-tasks-btn__icon {
    flex-shrink: 0;
    width: 15px;
    height: 15px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 15px 15px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01'/%3E%3C/svg%3E");
}

.header-tasks-btn__badge,
.header .header-tasks-btn__badge.plt-tasks-trigger__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #fbbf24;
    color: #1f2a37;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
}

.header-tasks-btn__badge[hidden],
.header .header-tasks-btn__badge.plt-tasks-trigger__badge[hidden] {
    display: none;
}

.header-account {
    position: relative;
    flex-shrink: 0;
}

.header-account__trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 240px;
    margin: 0;
    padding: 4px 10px 4px 4px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 999px;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    font-family: var(--font);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    text-align: left;
}

.header-account__trigger:hover,
.header-account.is-open .header-account__trigger {
    background: rgba(255, 255, 255, .18);
    border-color: rgba(255, 255, 255, .32);
}

.header-account__avatar {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #fbbf24;
    color: #1f2a37;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .02em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.header-account__meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 1px;
}

.header-account__label {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .62);
    line-height: 1.2;
}

.header-account__name {
    overflow: hidden;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-account__chevron {
    flex-shrink: 0;
    width: 10px;
    height: 10px;
    margin-left: 2px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 10px 10px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%23fff' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
}

.header-account.is-open .header-account__chevron {
    transform: rotate(180deg);
}

.header-account__menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 10050;
    min-width: 220px;
    padding: 6px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .18);
}

.header-account__menu[hidden] {
    display: none;
}

.header-account__item,
.header a.header-account__item {
    display: block;
    padding: 9px 12px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #1f2a37;
    font-family: var(--font);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
    text-decoration: none;
    text-align: left;
    cursor: pointer;
}

.header a.header-account__item:hover,
.header-account__item:hover {
    background: #f3f4f6;
    color: #111827;
    text-decoration: none;
}

.header a.header-account__item--danger,
.header-account__item--danger {
    color: #b91c1c;
}

.header-quiet,
.header a.header-quiet {
    padding: 7px 9px;
    border-radius: 8px;
    color: rgba(255, 255, 255, .7);
    font-family: var(--font);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
}

.header a.header-quiet:hover,
.header-quiet:hover {
    color: #fff;
    background: rgba(255, 255, 255, .1);
    text-decoration: none;
}

.header-signin,
.header a.header-signin {
    display: inline-block;
    padding: 7px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .14);
    color: #fff;
    font-family: var(--font);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
}

.header a.header-signin:hover,
.header-signin:hover {
    background: rgba(255, 255, 255, .22);
    color: #fff;
    text-decoration: none;
}

.header a:focus-visible,
.header-tasks-btn:focus-visible,
.header-account__trigger:focus-visible,
.header .menu a:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.header-ver {
    opacity: .55;
    font-weight: 400;
    font-size: 12px;
    white-space: nowrap;
}

.header-beta {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    border-radius: 999px;
    background: #fbbf24;
    color: #1f2a37;
    font-size: 9px;
    font-weight: 500;
    letter-spacing: .12em;
    line-height: 1.2;
    flex-shrink: 0;
}

.header-anon-pad {
    display: none;
}

/* Viewport-fixed shell: no document scroll (Dashboard, dhtmlx modules). */
body.plt-shell--viewport-fixed {
    height: 100vh;
    overflow: hidden;
}

body.plt-shell--viewport-fixed form {
    height: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
}

body.plt-shell--viewport-fixed .page {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg);
}

body.plt-shell--viewport-fixed .header {
    flex-shrink: 0;
    border-bottom: none;
}

body.plt-shell--viewport-fixed .dash-subnav {
    flex-shrink: 0;
}

body.plt-shell--viewport-fixed .main {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
}

.mod-app {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg);
}

.mod-subnav {
    flex-shrink: 0;
    display: flex;
    align-items: stretch;
    min-height: 48px;
    padding: 0 16px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    font-family: var(--font);
}

.mod-subnav__toolbar {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: stretch;
}

.mod-app__body {
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* Document-scroll shell: page scrolls (Platform, Operations, DDG). Overrides Site.css overflow:hidden. */
body.plt-shell--document-scroll {
    background: var(--bg);
    overflow-y: auto !important;
    overflow-x: hidden !important;
    height: auto !important;
    min-height: 100%;
}

body.plt-shell--document-scroll form {
    height: auto;
    min-height: 100%;
}

body.plt-shell--document-scroll .page {
    min-height: 100%;
    background: var(--bg);
}

body.plt-shell--document-scroll .header {
    flex-shrink: 0;
    border-bottom: none;
}

body.plt-shell--document-scroll .main {
    padding: 0;
    margin: 0;
    height: auto;
    overflow: visible;
}

/* Wizard pages (Client delivery, Shop publication): full module area like Publish.
   Padding lives on the scrolling sheet. The viewport stays full size for dhtmlx windows. */
.mod-app__body:has(.mod-work) {
    display: flex;
    flex-direction: column;
}

.mod-work {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding: 16px 20px 28px;
    box-sizing: border-box;
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    color: var(--ink);
}

body.plt-shell .dash-page-header h1 {
    font-size: 28px;
    font-weight: 600;
    font-variant: normal;
    text-transform: none;
    color: var(--ink);
    margin: 0 0 6px;
    line-height: 1.25;
}

body.plt-shell .dash-app a:link,
body.plt-shell .dash-app a:visited,
body.plt-shell .admin-app a:link,
body.plt-shell .admin-app a:visited,
body.plt-shell .ddg-app a:link,
body.plt-shell .ddg-app a:visited {
    color: var(--accent);
}

.plt-filter__btn:focus-visible,
.plt-drawer__close:focus-visible,
.header-account__toggle:focus-visible,
.header-account__menu a:focus-visible,
.plt-confirm__close:focus-visible,
.plt-btn:focus-visible,
.ddg-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Tasks drawer */

.plt-tasks-trigger:not(.header-tasks-btn) {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 6px;
    padding: 4px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-family: var(--font);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    cursor: pointer;
    vertical-align: middle;
    transition: background 0.15s, border-color 0.15s;
}

.plt-tasks-trigger:not(.header-tasks-btn):hover {
    background: #dbeafe;
    border-color: var(--accent);
}

.plt-tasks-trigger__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
}

.plt-tasks-trigger__badge[hidden] {
    display: none;
}

.plt-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: rgba(15, 23, 42, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.plt-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}

.plt-drawer {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 9999;
    width: min(600px, 100vw);
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: #f8fafc;
    border-left: 1px solid #e2e8f0;
    box-shadow: -12px 0 40px rgba(15, 23, 42, 0.12);
    font-family: var(--font);
    font-size: 13px;
    line-height: 1.5;
    color: #0f172a;
    transform: translateX(100%);
    transition: transform 0.25s ease;
}

.plt-drawer.is-open {
    transform: translateX(0);
}

.plt-report {
    position: fixed;
    top: 4vh;
    left: 4vw;
    z-index: 10000;
    width: 92vw;
    height: 92vh;
    display: none;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.28);
    font-family: var(--font);
    color: #0f172a;
}

.plt-report.is-open {
    display: flex;
}

.plt-report__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
}

.plt-report__title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.plt-report__frame {
    flex: 1;
    width: 100%;
    border: 0;
    background: #fff;
}

.plt-ico {
    display: block;
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

.plt-priority-wrap {
    position: relative;
    display: inline-flex;
    z-index: 1;
}

.plt-priority-wrap.is-open {
    z-index: 4;
}

.plt-priority {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: auto;
    width: auto;
    padding: 2px 8px 2px 6px;
    border: 0;
    border-radius: 999px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.5;
}

.plt-priority--high { background: #ffedd5; color: #c2410c; }
.plt-priority--normal { background: #e0f2fe; color: #0369a1; }
.plt-priority--low { background: #f1f5f9; color: #64748b; }

.plt-priority--btn {
    cursor: pointer;
}

.plt-priority--btn:hover,
.plt-priority-option:hover {
    filter: brightness(0.97);
}

.plt-priority--btn:focus,
.plt-priority-option:focus {
    outline: 2px solid currentColor;
    outline-offset: 1px;
}

.plt-priority-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 7.5rem;
    padding: 6px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14);
}

.plt-priority-option {
    width: 100%;
    justify-content: center;
    cursor: pointer;
}

.plt-priority-option.is-current {
    box-shadow: inset 0 0 0 1px currentColor;
}

.plt-lane {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #64748b;
    font-size: 11px;
    font-weight: 600;
}

.plt-report-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border: 1px solid var(--accent);
    border-radius: 8px;
    background: #fff;
    color: var(--accent);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    cursor: pointer;
}

.plt-report-btn:hover {
    background: var(--accent-soft);
}

.plt-report-btn:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.plt-drawer__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px 14px;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
}

.plt-drawer__title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
}

.plt-drawer__sub {
    margin: 4px 0 0;
    font-size: 12px;
    color: #64748b;
}

.plt-drawer__close {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: #f1f5f9;
    color: #475569;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.plt-drawer__close:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.plt-drawer__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 20px;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
}

.plt-filter {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 3px;
    border-radius: 8px;
    background: #f1f5f9;
}

.plt-filter--scope {
    flex-shrink: 0;
}

.plt-filter--lanes {
    margin-left: auto;
    justify-content: flex-end;
    text-align: right;
}

.plt-filter__btn {
    border: none;
    border-radius: 6px;
    padding: 6px 8px;
    background: transparent;
    color: #64748b;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.plt-filter--scope .plt-filter__btn.is-active {
    background: var(--brand);
    color: #fff;
    box-shadow: none;
}

.plt-filter__btn--lane {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #fff;
    box-shadow: inset 0 0 0 1px #cbd5e1;
}

.plt-filter__btn--lane::before {
    content: "\2713";
    display: inline-block;
    width: 11px;
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    opacity: 0;
    color: var(--brand);
}

.plt-filter__btn--lane.is-active {
    color: var(--brand);
    box-shadow: inset 0 0 0 1px var(--brand);
}

.plt-filter__btn--lane.is-active::before {
    opacity: 1;
}

.plt-filter__btn[hidden] {
    display: none;
}

.plt-drawer__body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px 20px;
}

.plt-empty {
    padding: 32px 16px;
    text-align: center;
    color: #64748b;
    font-size: 13px;
}

.plt-load-more-wrap {
    display: flex;
    justify-content: center;
    padding: 8px 0 4px;
}

.plt-load-more {
    min-width: 140px;
    padding: 8px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    color: #0f172a;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.plt-load-more:hover:not(:disabled) {
    background: #f8fafc;
}

.plt-load-more:disabled {
    opacity: 0.65;
    cursor: default;
}

.plt-run {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 12px;
}

.plt-run__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.plt-run__title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 0 100%;
    min-width: 0;
}

.plt-run__name {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
    font-size: 14px;
    color: #0f172a;
}

.plt-run__meta {
    margin-left: auto;
    font-size: 11px;
    color: #64748b;
    white-space: nowrap;
}

.plt-run__actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin-left: 4px;
}

.plt-force {
    padding: 2px 8px;
    border: 1px solid #fdba74;
    border-radius: 999px;
    background: #fff7ed;
    color: #c2410c;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
}

.plt-force:disabled,
.plt-cancel:disabled {
    opacity: 0.55;
    cursor: default;
}

.plt-cancel {
    width: 22px;
    height: 22px;
    padding: 0;
    border: 1px solid #fecaca;
    border-radius: 999px;
    background: #fef2f2;
    color: #b91c1c;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}

.plt-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.5;
}

.plt-pill--running { background: #fef3c7; color: #b45309; }

/* Same fade as ProcesResult.aspx .heartbeat — alive while Hangfire is running */
.plt-heartbeat {
    display: inline-block;
    flex-shrink: 0;
    color: #dc2626;
    font-size: 14px;
    line-height: 1;
    opacity: 0;
    animation: plt-heartbeat 4s ease-in-out infinite;
}

@keyframes plt-heartbeat {
    0%, 50%, 100% { opacity: 0; }
    12.5%, 37.5% { opacity: 1; }
    25% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .plt-heartbeat {
        animation: none;
        opacity: 0.85;
    }
}
.plt-pill--completed { background: #d1fae5; color: #047857; }
.plt-pill--warnings { background: #fef3c7; color: #92400e; }
.plt-pill--failed { background: #fee2e2; color: #b91c1c; }
.plt-pill--cancelled { background: #f1f5f9; color: #64748b; }
.plt-pill--pending { background: var(--wionet-soft); color: var(--wionet); }
.plt-pill--enqueued { background: #dbeafe; color: #1d4ed8; }
.plt-pill--neutral { background: #f1f5f9; color: #475569; }
.plt-pill--low { background: #f1f5f9; color: #64748b; }
.plt-pill--normal { background: #e0f2fe; color: #0369a1; }
.plt-pill--high { background: #ffedd5; color: #c2410c; }

.plt-progress-wrap {
    margin-bottom: 10px;
}

.plt-progress-labels {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 11px;
    color: #64748b;
}

.plt-progress-labels strong {
    color: #334155;
    font-weight: 600;
}

.plt-progress {
    height: 8px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
}

.plt-progress__fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.35s ease;
}

.plt-progress__fill--running { background: var(--warn); }
.plt-progress__fill--completed { background: var(--ok); }
.plt-progress__fill--warnings { background: #d97706; }
.plt-progress__fill--failed { background: #ef4444; }
.plt-progress__fill--pending { background: #94a3b8; }

.plt-error {
    margin-top: 8px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #fff5f5;
    border: 1px solid #fecaca;
    color: #991b1b;
    font-size: 12px;
    word-break: break-word;
}

.plt-steps {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}

.plt-steps th,
.plt-steps td {
    padding: 6px 8px;
    border-top: 1px solid #f1f5f9;
    text-align: left;
    vertical-align: top;
}

.plt-steps th {
    color: #64748b;
    font-weight: 600;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.plt-drawer__foot {
    padding: 12px 20px 16px;
    background: #fff;
    border-top: 1px solid #e2e8f0;
}

.plt-notify-opt {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
}

.plt-notify-opt input {
    margin: 0;
}

.plt-status-msg {
    margin-top: 8px;
    font-size: 11px;
    color: #94a3b8;
}

.plt-status-msg--error {
    color: #b91c1c;
}

/* Platform confirm dialog */
.plt-confirm-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(16, 24, 40, .45);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1200;
    padding: 20px;
}

.plt-confirm-backdrop.is-open {
    display: flex;
}

.plt-confirm {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 440px;
    max-height: calc(100dvh - 80px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.plt-confirm__head {
    padding: 16px 18px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 10px;
}

.plt-confirm__head h3 {
    margin: 0;
    font-size: 15px;
    flex: 1;
    font-weight: 600;
    font-variant: normal;
    text-transform: none;
    color: #1f2a37;
}

.plt-confirm__close {
    border: none;
    background: transparent;
    color: #6b7280;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}

.plt-confirm__close:hover {
    color: #1f2a37;
}

.plt-confirm__body {
    padding: 16px 18px;
}

.plt-confirm__body p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: #4b5563;
}

.plt-confirm__foot {
    padding: 12px 18px 16px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.plt-btn,
.ddg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 14px;
    font: inherit;
    font-family: var(--font);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    background: #fff;
    color: var(--ink);
    margin: 0;
    text-decoration: none;
    box-sizing: border-box;
}

.plt-btn--outline,
.ddg-btn-secondary {
    border-color: #d1d5db;
    background: #fff;
    color: var(--ink);
}

.plt-btn--outline:hover,
.ddg-btn-secondary:hover {
    background: #f9fafb;
    color: var(--ink);
}

.ddg-btn-secondary:link,
.ddg-btn-secondary:visited {
    color: var(--ink);
    text-decoration: none;
}

.plt-btn--primary,
.ddg-btn-primary {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
}

.plt-btn--primary:hover,
.ddg-btn-primary:hover {
    background: #1d4ed8;
    color: #fff;
}

.plt-btn--danger,
.ddg-btn-danger {
    border-color: var(--danger);
    background: var(--danger);
    color: #fff;
}

.plt-btn--danger:hover,
.ddg-btn-danger:hover {
    background: #991b1b;
    color: #fff;
}

/* In-page dialogs (Text2, TextForm, DDG) — same tokens as .plt-confirm */
.ddg-backdrop {
    position: fixed;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    background: rgba(16, 24, 40, .45);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

.ddg-modal {
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    max-width: 440px;
    width: 100%;
    padding: 22px 24px 20px;
    position: relative;
}

.ddg-modal-title {
    margin: 0 0 6px 0;
    font-size: 1.15rem;
    font-weight: 600;
    font-variant: normal;
    text-transform: none;
    color: var(--ink);
}

.ddg-modal-sub {
    margin: 0 0 16px 0;
    font-size: 0.95rem;
    color: var(--muted);
    line-height: 1.45;
}

.ddg-modal-sub code {
    font-size: 1.05rem;
    font-weight: 700;
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 4px;
}

.ddg-field {
    margin-bottom: 14px;
}

.ddg-field label {
    display: block;
    font-size: 0.88rem;
    color: var(--muted);
    margin-bottom: 4px;
}

.ddg-field input[type="text"],
.ddg-field input[type="number"] {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 0.95rem;
}

.ddg-modal-err {
    color: var(--danger);
    font-size: 0.88rem;
    margin: -6px 0 12px 0;
    min-height: 1.2em;
}

.ddg-modal-actions {
    margin-top: 18px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.ddg-backdrop--confirm .ddg-modal {
    max-width: 500px;
    text-align: center;
}

.ddg-backdrop--confirm .ddg-modal-title,
.ddg-backdrop--confirm .ddg-modal-sub {
    text-align: center;
}

.ddg-backdrop--confirm .ddg-modal-actions {
    justify-content: center;
}

.path-picker-item {
    height: auto !important;
}

.path-picker-host {
    overflow: visible !important;
    position: relative;
    height: auto !important;
}

.path-picker__native {
    display: none !important;
}

.path-picker {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    box-sizing: border-box;
    max-width: 100%;
}

.path-picker__path {
    flex: 1 1 0;
    min-width: 0;
    padding: 5px 8px;
    font-size: 13px;
    line-height: 1.4;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #f9fafb;
    color: var(--ink);
    white-space: normal;
    word-break: normal;
    overflow-wrap: normal;
    hyphens: none;
    font-family: var(--mono);
    user-select: text;
}

.path-picker__seg {
    white-space: nowrap;
}

.path-picker__path.is-empty {
    color: var(--muted);
    font-style: italic;
    font-family: inherit;
}

.path-picker__browse {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-width: 30px;
    margin-top: 1px;
    padding: 5px 8px;
    font-size: 14px;
    line-height: 1;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fff;
    color: var(--ink);
}

.path-picker__browse:hover {
    background: #f9fafb;
}

.path-picker-list,
.path-picker-list .dhx_list {
    height: auto !important;
    min-height: 8px;
    overflow: visible !important;
}

.path-picker-list .dhx_list_item {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    width: 100% !important;
    height: auto !important;
    box-sizing: border-box;
    padding: 8px !important;
    border-bottom: 1px solid var(--line);
    background: #fff;
    overflow: visible;
}

.path-picker-list .dhx_list_item.dhx_dataview_default_item_selected,
.path-picker-list .dhx_list_item.dhx_list_item_selected {
    background: var(--accent-soft);
}

.path-picker-list-card__name {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.path-picker-list-card__path {
    font-size: 13px;
    line-height: 1.4;
    font-family: var(--mono);
    color: var(--ink);
    padding: 5px 8px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #f9fafb;
    white-space: normal;
    word-break: normal;
    overflow-wrap: normal;
    hyphens: none;
}

.maint-banner {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 13px 20px;
    background: #ffe7a3;
    color: #243140;
    border-bottom: 1px solid rgba(36, 49, 64, .08);
    position: sticky;
    top: 0;
    z-index: 40;
    flex-shrink: 0;
}

.maint-banner--alert {
    background: #f6c1c1;
    color: #6f1212;
    border-bottom-color: rgba(111, 18, 18, .12);
}

.maint-banner__mark {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: rgba(36, 49, 64, .1);
}

.maint-banner--alert .maint-banner__mark {
    background: rgba(111, 18, 18, .1);
}

.maint-banner__mark span {
    width: 4px;
    height: 13px;
    border-radius: 99px;
    background: #243140;
}

.maint-banner--alert .maint-banner__mark span {
    background: #6f1212;
}

.maint-banner__body {
    min-width: 0;
    flex: 1;
}

.maint-banner__heading {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 14px;
    margin: 0;
}

.maint-banner__title {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.3;
}

.maint-banner__lead {
    font-size: 13px;
    font-weight: 400;
    line-height: 1.3;
}

.maint-banner__facts {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 0;
    margin: 4px 0 0;
    font-size: 13px;
    line-height: 1.35;
}

.maint-banner__facts span + span {
    margin-left: 14px;
    padding-left: 14px;
    border-left: 1px solid rgba(36, 49, 64, .22);
}

.maint-banner--alert .maint-banner__facts span + span {
    border-left-color: rgba(111, 18, 18, .28);
}

.maint-banner__facts em {
    font-style: normal;
    font-weight: 600;
    margin-right: 6px;
    opacity: .7;
}

.maint-banner__hide {
    flex-shrink: 0;
    border: 0;
    background: transparent;
    color: inherit;
    border-radius: 8px;
    padding: 6px 2px;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .01em;
    opacity: .7;
}

.maint-banner__hide:hover {
    opacity: 1;
}

.maint-pin {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0 8px 0 0;
    padding: 7px 12px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #fff;
    font-family: var(--font);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
}

.maint-pin:hover {
    background: rgba(255, 255, 255, .12);
}

.maint-pin__mark {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    width: 15px;
    height: 15px;
    justify-content: center;
}

.maint-pin__mark i {
    width: 3px;
    height: 11px;
    border-radius: 99px;
    background: #f5d78e;
}

.maint-modal {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, .45);
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.maint-modal[hidden],
.maint-banner[hidden],
.maint-pin[hidden] {
    display: none;
}

.maint-modal__card {
    width: min(480px, 100%);
    background: #fff;
    color: var(--ink);
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(16, 24, 40, .18);
    padding: 28px 28px 22px;
}

.maint-modal__mark {
    width: 34px;
    height: 34px;
    margin-bottom: 14px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: #fde8e8;
    border: 1px solid #f0b4b4;
}

.maint-modal__mark span {
    width: 4px;
    height: 13px;
    border-radius: 99px;
    background: #b91c1c;
}

.maint-modal__card h2 {
    margin: 0 0 8px;
    font-size: 22px;
    letter-spacing: -0.02em;
    line-height: 1.25;
}

.maint-modal__card p {
    margin: 0 0 20px;
    color: var(--muted);
    line-height: 1.5;
}

.maint-modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.maint-lock {
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    box-sizing: border-box;
    color: var(--ink);
    font-family: var(--font);
    background:
        radial-gradient(900px 420px at 50% -10%, rgba(217, 119, 6, .16), transparent 70%),
        var(--bg);
}

.maint-lock__card {
    width: min(640px, 100%);
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 36px 40px 32px;
}

.maint-lock__mark {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background: #fff4d6;
    border: 1px solid #e6c97a;
    margin-bottom: 18px;
}

.maint-lock__mark span {
    width: 5px;
    height: 16px;
    border-radius: 99px;
    background: #9a6700;
}

.maint-lock__brand {
    margin: 0 0 8px;
    color: var(--muted);
    letter-spacing: .08em;
    text-transform: uppercase;
    font-size: 12px;
    font-weight: 600;
}

.maint-lock__card h1 {
    margin: 0;
    font-size: 30px;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.maint-lock__lead {
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.5;
}

.maint-lock__facts {
    margin: 22px 0 0;
    display: grid;
    gap: 12px;
}

.maint-lock__facts div {
    display: grid;
    grid-template-columns: 190px 1fr;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.maint-lock__facts dt {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.maint-lock__facts dd {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
}

.maint-lock__count {
    margin-top: 22px;
    padding: 16px 18px;
    border-radius: 12px;
    background: #fff8eb;
    border: 1px solid #f0ddb0;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
}

.maint-lock__count span {
    color: #7a5b16;
    font-size: 13px;
}

.maint-lock__count strong {
    font-family: var(--mono);
    font-size: 28px;
    font-weight: 600;
    letter-spacing: .04em;
    font-variant-numeric: tabular-nums;
}

.maint-lock__login {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 22px;
    padding: 10px 16px;
    border-radius: 8px;
    background: var(--brand);
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}

.maint-lock__login:hover {
    background: var(--brand-2);
}

@media (max-width: 640px) {
    .maint-lock__card {
        padding: 28px 22px 24px;
    }

    .maint-lock__card h1 {
        font-size: 26px;
    }

    .maint-lock__facts div,
    .maint-lock__count {
        grid-template-columns: 1fr;
        display: grid;
    }
}
