h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}
/* ---------- report action row (Run / Excel / Print) ---------- */
.rep-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.rep-actions .flex-grow-1 { flex-grow: 1; }

/* ---------- printing reports — professional letterhead ---------- */
.print-only { display: none; }

@page { size: A4; margin: 14mm 12mm 16mm 12mm; }

@media print {
    html, body { background: #fff !important; }
    body * { visibility: hidden; }
    #print-area, #print-area * { visibility: visible; }
    #print-area { position: absolute; top: 0; left: 0; width: 100%; }
    #print-area, #print-area * { color: #111 !important; background: #fff !important; box-shadow: none !important; }

    /* letterhead banner */
    .print-only { display: block !important; visibility: visible !important;
        border-bottom: 2.5px solid #0e7490; padding-bottom: 8px; margin-bottom: 16px; }
    .print-only h2 { font-size: 18px; color: #0e7490 !important; letter-spacing: .4px; font-weight: 800; }
    .print-only div { font-size: 11px; color: #555 !important; margin-top: 3px; }

    /* totals cards → clean bordered boxes */
    #print-area .mud-paper { border: 1px solid #cbd5e1 !important; border-radius: 6px !important; }

    /* tables — repeat header on each page, avoid row splits */
    #print-area table { width: 100%; border-collapse: collapse; font-size: 10.5px; }
    #print-area thead { display: table-header-group; }
    #print-area th { border-bottom: 1.6px solid #0e7490 !important; text-align: left;
        padding: 5px 6px !important; font-weight: 700; }
    #print-area td { border-bottom: 1px solid #e2e8f0 !important; padding: 4px 6px !important; }
    #print-area tr, #print-area .mud-paper { break-inside: avoid; }

    /* keep the horizontal bar chart legible on paper */
    #print-area .rep-bar-track { background: #e2e8f0 !important; }
    #print-area .rep-bar-fill { background: #0e7490 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .print-only, #print-area .print-only h2 { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

    /* hide interactive chrome */
    #print-area .mud-icon-button, #print-area .no-print,
    .actionbar, .rep-actions, .mud-table-pager, .mud-table-toolbar { display: none !important; }
}

/* ============================================================================
   Modern split-screen sign-in
   ============================================================================ */
.auth { position: fixed; inset: 0; z-index: 20; display: flex; overflow: auto;
    background: #0a1120; color: #e6edf6; font-family: 'Inter','Segoe UI',sans-serif; }

/* ---- left: brand hero ---- */
.auth-hero { position: relative; flex: 1.05; display: none; flex-direction: column; justify-content: space-between;
    padding: 52px 56px; overflow: hidden;
    background:
        radial-gradient(1100px 680px at 16% 6%, rgba(34,211,238,.22), transparent 60%),
        radial-gradient(920px 700px at 96% 100%, rgba(124,58,237,.30), transparent 55%),
        linear-gradient(140deg, #06323f 0%, #0a1120 66%); }
.auth-hero::after { content: ""; position: absolute; inset: 0; opacity: .5;
    background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
    background-size: 46px 46px;
    -webkit-mask-image: radial-gradient(circle at 28% 26%, #000, transparent 72%);
            mask-image: radial-gradient(circle at 28% 26%, #000, transparent 72%); }
.auth-hero-in { position: relative; z-index: 1; max-width: 440px; }
.auth-eyebrow { font-size: 12px; letter-spacing: 3px; text-transform: uppercase; color: #67e8f9; font-weight: 700; }
.auth-hero h1 { font-size: 42px; line-height: 1.08; font-weight: 800; letter-spacing: .4px; margin: 16px 0 12px; }
.auth-hero .lead { font-size: 16px; line-height: 1.65; color: #b6c2d4; margin: 0 0 32px; }
.auth-feats { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 15px; }
.auth-feats li { display: flex; align-items: center; gap: 13px; font-size: 14.5px; color: #dbe4f0; }
.auth-feats .fic { width: 36px; height: 36px; border-radius: 11px; flex: none; display: flex; align-items: center; justify-content: center;
    background: rgba(34,211,238,.14); color: #67e8f9; border: 1px solid rgba(34,211,238,.22); }
.auth-foot { position: relative; z-index: 1; align-self: flex-start;
    display: inline-flex; align-items: center; gap: 9px;
    font-size: 12px; font-weight: 500; letter-spacing: .3px; color: #a7b6ca;
    padding: 8px 15px; border-radius: 999px;
    background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.11);
    -webkit-backdrop-filter: blur(9px); backdrop-filter: blur(9px);
    box-shadow: 0 12px 28px rgba(0,0,0,.32), inset 0 1px 0 rgba(255,255,255,.06); }
.auth-foot::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%;
    background: #22d3ee; box-shadow: 0 0 9px #22d3ee; }

/* ---- right: form ---- */
.auth-panel { flex: 1; display: flex; align-items: center; justify-content: center; padding: 36px 24px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-logo { width: 60px; height: 60px; border-radius: 18px; flex: none; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #22d3ee, #0891b2); color: #04121b; box-shadow: 0 14px 34px rgba(34,211,238,.38); }
.auth-logo .mud-icon-root { font-size: 34px; }
.auth-brandline { display: flex; align-items: center; gap: 14px; margin-bottom: 30px; }
.auth-brandline .n { font-size: 20px; font-weight: 800; letter-spacing: .3px; line-height: 1.1; }
.auth-brandline .s { font-size: 12px; color: #8a97ab; }
.auth-card h2 { font-size: 27px; font-weight: 800; margin: 0 0 6px; }
.auth-card .sub { font-size: 14px; color: #8a97ab; margin: 0 0 28px; }
.auth-btn.mud-button-root { height: 52px; border-radius: 14px; font-size: 15px; font-weight: 700; text-transform: none;
    color: #ffffff; background: linear-gradient(135deg, #22c55e, #16a34a); box-shadow: 0 12px 30px rgba(34,197,94,.34); }
.auth-btn.mud-button-root:hover { background: linear-gradient(135deg, #2fd06b, #15903f); box-shadow: 0 14px 34px rgba(34,197,94,.44); }
.auth-hint { display: flex; align-items: center; justify-content: center; gap: 8px; width: fit-content; margin: 26px auto 0;
    font-size: 12px; font-weight: 500; letter-spacing: .2px; color: #8ea0b8;
    padding: 8px 16px; border-radius: 999px;
    background: rgba(34,197,94,.09); border: 1px solid rgba(34,197,94,.22);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.05); }
.auth-hint .mud-icon-root { font-size: 16px; color: #22c55e; }
.theme-light .auth-hint { color: #4b5563; background: rgba(22,163,74,.08); border-color: rgba(22,163,74,.22); }
.theme-light .auth-hint .mud-icon-root { color: #16a34a; }
.auth-card .mud-input.mud-input-outlined .mud-input-outlined-border { border-radius: 13px; }

/* desktop: reveal the hero, hide the small in-card brand */
@media (min-width: 900px) { .auth-hero { display: flex; } .auth-brandline { display: none; } }

/* light theme (ClientWeb only) */
.theme-light .auth { background: #eef2f9; color: #1e293b; }
.theme-light .auth-brandline .s, .theme-light .auth-card .sub { color: #64748b; }
.theme-light .auth-hint { color: #94a3b8; }

/* ============================ Admin · Roles page (ported from the AdminPanel) ============================ */
.roles-hero { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-radius: 18px;
    background: linear-gradient(135deg, rgba(124,58,237,.16), rgba(79,70,229,.05));
    border: 1px solid rgba(255,255,255,.08); flex-wrap: wrap; }
.roles-hero-badge { width: 46px; height: 46px; border-radius: 13px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; color: #fff;
    background: linear-gradient(135deg, #7c3aed, #4f46e5); box-shadow: 0 8px 20px rgba(79,70,229,.35); }
.roles-hero-badge .mud-icon-root { font-size: 1.6rem; }
.roles-hero-title { font-weight: 700; }

.stat-card { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-radius: 14px;
    background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.07); }
.stat-icon { width: 40px; height: 40px; border-radius: 11px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; }
.stat-value { font-size: 1.35rem; font-weight: 700; line-height: 1.1; }
.stat-label { font-size: .72rem; color: #94a3b8; text-transform: uppercase; letter-spacing: .05em; }

.role-card { border-radius: 18px; overflow: hidden; height: 100%; background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.08); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.role-card:hover { transform: translateY(-4px); box-shadow: 0 16px 36px rgba(0,0,0,.45); border-color: rgba(255,255,255,.16); }
.role-accent { position: relative; height: 62px; }
.role-avatar { position: absolute; left: 18px; bottom: -22px; width: 52px; height: 52px; border-radius: 15px;
    display: flex; align-items: center; justify-content: center; color: #fff;
    background: rgba(12,16,22,.9); border: 3px solid #10151d; box-shadow: 0 6px 16px rgba(0,0,0,.45); }
.role-avatar .mud-icon-root { font-size: 1.5rem; }
.role-menu { position: absolute; top: 8px; right: 6px; }
.role-menu .mud-icon-button { color: rgba(255,255,255,.92); }
.role-body { padding: 30px 18px 18px; }
.role-tag { font-size: .62rem; font-weight: 800; letter-spacing: .08em; padding: 2px 8px; border-radius: 999px;
    color: #fbbf24; background: rgba(245,158,11,.14); border: 1px solid rgba(245,158,11,.35); }
.perm-pill { font-size: .72rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; border: 1px solid; white-space: nowrap; }

/* light theme: solid card surfaces instead of white-alpha */
html.theme-light .role-card, html.theme-light .stat-card { background: #ffffff; border-color: rgba(15,23,42,.10); }
html.theme-light .role-avatar { background: #f1f5f9; border-color: #ffffff; color: #0f172a; }
html.theme-light .roles-hero { border-color: rgba(15,23,42,.08); }

/* Recipe editor on phones: the 6-column material grids get a horizontal scroll instead of crushing the inputs */
@media (max-width: 960px) {
    .recipe-dlg-body .matgrid { min-width: 620px; }
    .recipe-dlg-body .panel.apanel { overflow-x: auto; }
}

/* Recipe dialogs: full screen on phones, normal window on desktop */
@media (max-width: 700px) {
    .mud-dialog.recipe-fs-dlg {
        position: fixed !important; inset: 0 !important; margin: 0 !important;
        width: 100vw !important; max-width: 100vw !important;
        height: 100dvh !important; max-height: 100dvh !important;
        border-radius: 0 !important; display: flex; flex-direction: column;
    }
    .mud-dialog.recipe-fs-dlg .mud-dialog-content { max-height: none !important; flex: 1; overflow-y: auto; }
}

/* Recipe list table */
.recipe-list-tbl { border-radius: 10px; overflow: hidden; }
.recipe-list-tbl tbody tr.sel-row td { background: rgba(59,130,246,.16); }
.recipe-list-tbl tbody tr:active td { background: rgba(59,130,246,.10); }

/* Recipe list — selectable cards */
.rlist { display: flex; flex-direction: column; gap: 6px; }
.ritem { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px;
    background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.08);
    cursor: pointer; transition: border-color .15s ease, background .15s ease, transform .1s ease;
    -webkit-tap-highlight-color: transparent; user-select: none; }
.ritem:hover { border-color: rgba(59,130,246,.45); background: rgba(59,130,246,.06); }
.ritem:active { transform: scale(.995); }
.ritem.sel { border-color: rgba(34,197,94,.6); background: rgba(34,197,94,.10);
    box-shadow: 0 0 0 1px rgba(34,197,94,.35) inset; }
.ritem .rsel-ic { flex: none; display: flex; }
.ritem .rmain { flex: 1; min-width: 0; }
.ritem .rcode { font-weight: 700; font-size: .95rem; letter-spacing: .3px; }
.ritem .rsub { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 2px; }
.ritem .rchip { font-size: .66rem; font-weight: 600; padding: 1px 7px; border-radius: 999px;
    background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.10); color: #a9b4c4; white-space: nowrap; }
.ritem .rkg { flex: none; display: flex; gap: 8px; font-size: .82rem; font-weight: 600; }
@media (max-width: 480px) { .ritem .rkg { display: none; } }
html.theme-light .ritem { background: #ffffff; border-color: rgba(15,23,42,.12); }
html.theme-light .ritem:hover { background: rgba(59,130,246,.05); }
html.theme-light .ritem.sel { background: rgba(34,197,94,.08); }
html.theme-light .ritem .rchip { background: rgba(15,23,42,.05); border-color: rgba(15,23,42,.10); color: #475569; }

/* Recipe EDIT form on phones: stack label above a full-width input instead of the crushed
   label-left grid (the grid-template-columns are inline styles, hence the !important). */
@media (max-width: 700px) {
    .recipe-dlg-body .rgrid { grid-template-columns: 1fr 1fr !important; gap: 10px 10px; }
    .recipe-dlg-body .rcell { grid-template-columns: 1fr !important; gap: 3px; align-items: start; }
    .recipe-dlg-body .rcell > label { font-size: 10.5px; }
    .recipe-dlg-body .cfield input { font-size: 14px !important; }
    .recipe-dlg-body .cfield .mud-input-slot { min-height: 34px !important; height: auto; }
    .recipe-dlg-body .matgrid .cfield input { font-size: 13px !important; }
}

/* Slide-out HMI menu drawer */
.hmi-drawer .mud-drawer-header { padding: 16px 18px 10px; border-bottom: 1px solid rgba(255,255,255,.08); }
.hmi-drawer .mud-nav-link { margin: 2px 0; border-radius: 10px; }
.hmi-drawer .mud-nav-link.active { background: linear-gradient(90deg, rgba(59,130,246,.18), transparent); }
html.theme-light .hmi-drawer .mud-drawer-header { border-bottom-color: rgba(15,23,42,.10); }

/* Drawer: let it size to its content and hide the stray inner scrollbars the HMI pages' global
   scrollbar styling was leaving behind on the nav list. */
.hmi-drawer { display: flex; flex-direction: column; }
.hmi-drawer .mud-navmenu { flex: 1; overflow-y: auto; padding-bottom: 12px; }
.hmi-drawer .mud-navmenu::-webkit-scrollbar { width: 0; height: 0; }
.hmi-drawer .mud-navmenu { scrollbar-width: none; }
.hmi-drawer .mud-nav-link { min-height: 42px; }
.hmi-drawer .mud-nav-link .mud-nav-link-text { white-space: nowrap; }
.hmi-drawer .drawer-foot { border-top: 1px solid rgba(255,255,255,.08); padding: 8px 10px; }
html.theme-light .hmi-drawer .drawer-foot { border-top-color: rgba(15,23,42,.10); }

/* ── HMI drawer geometry ───────────────────────────────────────────────────────
   The drawer markup sits inside the page top bar, so MudDrawer's height:100%
   resolved against a ~46px parent and squashed the whole menu into a tiny
   scrolling box. Pin it to the viewport and lay it out header / scrolling nav /
   pinned footer. */
.mud-drawer.hmi-drawer {
    position: fixed !important;
    top: 0 !important; bottom: 0 !important; right: 0 !important; left: auto !important;
    height: 100dvh !important; max-height: 100dvh !important;
    display: flex !important; flex-direction: column !important;
    overflow: hidden !important;
}
.mud-drawer.hmi-drawer > .mud-drawer-content {
    display: flex; flex-direction: column;
    height: 100%; min-height: 0; overflow: hidden;
}
.mud-drawer.hmi-drawer .mud-drawer-header { flex: 0 0 auto; }
.mud-drawer.hmi-drawer .mud-navmenu {
    flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
    scrollbar-width: none;
}
.mud-drawer.hmi-drawer .mud-navmenu::-webkit-scrollbar { width: 0; height: 0; }
.mud-drawer.hmi-drawer .drawer-foot { flex: 0 0 auto; }

/* Remote-start ARM control */
.arm-box { border-radius: 12px; padding: 10px 12px; border: 1px solid; }
.arm-box.off { background: rgba(239,68,68,.08); border-color: rgba(239,68,68,.35); }
.arm-box.on  { background: rgba(34,197,94,.10); border-color: rgba(34,197,94,.45); }
.arm-head { display: flex; align-items: center; gap: 7px; }
.arm-box.off .arm-head { color: #f87171; }
.arm-box.on  .arm-head { color: #34d399; }
.arm-title { font-weight: 700; font-size: .85rem; letter-spacing: .02em; }
.arm-count { margin-left: auto; font-weight: 700; font-size: .82rem; }
.arm-sub { font-size: .72rem; opacity: .7; margin-top: 2px; }
.arm-btns { display: flex; gap: 6px; flex-wrap: wrap; }

/* ============================ Activity dashboard ============================ */
.act-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 14px 0 4px; }
.act-stat { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 16px;
    background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.08); }
.act-stat .ic { width: 42px; height: 42px; border-radius: 12px; flex: none; display: flex; align-items: center; justify-content: center; }
.act-stat .v { font-size: 1.5rem; font-weight: 800; line-height: 1; }
.act-stat .k { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: #94a3b8; margin-top: 3px; }
html.theme-light .act-stat { background: #fff; border-color: rgba(15,23,42,.1); }

/* user presence cards */
.pcard { padding: 14px; border-radius: 16px; position: relative; overflow: hidden;
    background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.08);
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; }
.pcard:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(0,0,0,.4); }
.pcard.online { border-color: rgba(34,197,94,.4); }
.pcard .glow { position: absolute; inset: 0 auto 0 0; width: 3px; }
.pcard.online .glow { background: linear-gradient(#22c55e, #16a34a); box-shadow: 0 0 12px #22c55e; }
.pcard.offline .glow { background: #475569; }
html.theme-light .pcard { background: #fff; border-color: rgba(15,23,42,.1); }
.pavatar { width: 42px; height: 42px; border-radius: 12px; flex: none; display: flex; align-items: center; justify-content: center;
    font-weight: 800; color: #fff; }
.pdot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 5px; }
.pdot.on { background: #22c55e; box-shadow: 0 0 8px #22c55e; animation: pdotpulse 1.6s ease-in-out infinite; }
.pdot.off { background: #64748b; }
@keyframes pdotpulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.pmeta { display: flex; align-items: center; gap: 6px; font-size: .76rem; color: #94a3b8; }
.pmeta .mono { font-family: "Cascadia Mono", Consolas, monospace; }

/* live activity feed (timeline) */
.feed { display: flex; flex-direction: column; }
.feed-row { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; padding: 9px 4px; align-items: start;
    border-bottom: 1px solid rgba(255,255,255,.05); animation: feedin .35s ease; }
html.theme-light .feed-row { border-bottom-color: rgba(15,23,42,.07); }
@keyframes feedin { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.feed-ic { width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center; flex: none; }
.feed-main { min-width: 0; }
.feed-top { font-size: .88rem; }
.feed-sub { font-size: .74rem; color: #94a3b8; display: flex; gap: 8px; flex-wrap: wrap; margin-top: 1px; }
.feed-time { font-size: .74rem; color: #94a3b8; white-space: nowrap; font-family: "Cascadia Mono", Consolas, monospace; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; display: inline-block; margin-right: 6px;
    box-shadow: 0 0 7px #22c55e; animation: pdotpulse 1.4s ease-in-out infinite; }

/* Activity details: full screen on phones, normal dialog on desktop */
@media (max-width: 700px) {
    .mud-dialog.act-fs-dlg {
        position: fixed !important; inset: 0 !important; margin: 0 !important;
        width: 100vw !important; max-width: 100vw !important;
        height: 100dvh !important; max-height: 100dvh !important; border-radius: 0 !important;
        display: flex; flex-direction: column;
    }
    .mud-dialog.act-fs-dlg .mud-dialog-content { max-height: none !important; flex: 1; overflow-y: auto; }
}

/* ============================ Modern top app bar (mobile-first) ============================ */
.mt-appbar {
    background: linear-gradient(180deg, rgba(17,22,29,.92), rgba(11,15,20,.78)) !important;
    -webkit-backdrop-filter: blur(16px) saturate(150%); backdrop-filter: blur(16px) saturate(150%);
    border-bottom: 1px solid rgba(255,255,255,.07);
}
html.theme-light .mt-appbar {
    background: linear-gradient(180deg, rgba(255,255,255,.94), rgba(248,250,252,.82)) !important;
    border-bottom-color: rgba(15,23,42,.08);
}
.mt-menu-btn { border-radius: 12px; }

.mt-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mt-logo {
    width: 34px; height: 34px; border-radius: 11px; flex: none;
    display: flex; align-items: center; justify-content: center; color: #fff;
    background: linear-gradient(135deg, #3b82f6, #22d3ee);
    box-shadow: 0 6px 16px rgba(34,211,238,.4), inset 0 1px 0 rgba(255,255,255,.25);
}
.mt-logo .mud-icon-root { font-size: 1.15rem; }
.mt-wordmark { display: flex; flex-direction: column; min-width: 0; line-height: 1.05; }
.mt-name {
    font-size: 1.05rem; font-weight: 800; letter-spacing: .04em; white-space: nowrap;
    background: linear-gradient(90deg, #e6edf6, #93c5fd 55%, #67e8f9);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent;
}
.mt-name b { font-weight: 900; }
html.theme-light .mt-name {
    background: linear-gradient(90deg, #0f172a, #1d4ed8 55%, #0e7490);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.mt-plant {
    font-size: .66rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
    color: #7cc7f5; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 44vw;
}
html.theme-light .mt-plant { color: #0e7490; }

@media (min-width: 600px) {
    .mt-logo { width: 38px; height: 38px; }
    .mt-name { font-size: 1.2rem; }
    .mt-plant { font-size: .72rem; max-width: none; }
}

/* PLC log & telegram viewer */
.plc-log { background: #0b0f14; border: 1px solid rgba(255,255,255,.08); border-radius: 8px;
    padding: 8px 10px; height: 62vh; overflow-y: auto;
    font-family: "Cascadia Mono", Consolas, monospace; font-size: .78rem; }
.plc-log-line { padding: 1px 0; color: #c9d1d9; white-space: pre-wrap; word-break: break-word; border-bottom: 1px solid rgba(255,255,255,.03); }
.plc-hex { background: #0b0f14; border: 1px solid rgba(255,255,255,.08); border-radius: 8px;
    padding: 8px 10px; height: 62vh; overflow: auto; }
.plc-hex pre { margin: 0; font-family: "Cascadia Mono", Consolas, monospace; font-size: .72rem; color: #9ecbff; white-space: pre; }
html.theme-light .plc-log, html.theme-light .plc-hex { background: #f8fafc; border-color: rgba(15,23,42,.12); }
html.theme-light .plc-log-line { color: #334155; }
html.theme-light .plc-hex pre { color: #1d4ed8; }
