:root
{
    --bg: #f4f6f2;
    --bg-2: #ffffff;
    --panel: #ffffff;
    --panel-2: #f3f6f1;
    --line: #e2e8de;
    --line-2: #d3dccf;
    --text: #1d2a26;
    --muted: #5b6660;
    --faint: #8a948e;
    --accent: #214d40;
    --accent-2: #2f6f5b;
    --accent-grad: linear-gradient(135deg, #214d40, #2f6f5b);
    --brand-grad: linear-gradient(135deg, #ec4c8a, #f59a3e);
    --ok: #1f9d63;
    --warn: #b7791f;
    --danger: #c0392b;
    --info: #2563eb;
    --radius: 10px;
    --shadow: 0 18px 50px rgba(20, 40, 30, .14);
    color-scheme: light;
}
*
{
    box-sizing: border-box;
}
html, body
{
    height: 100%;
    margin: 0;
}
body
{
    background: var(--bg);
    color: var(--text);
    font: 14px/1.45 "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
}
button, input, select
{
    font: inherit;
    color: inherit;
}
button
{
    cursor: pointer;
}
svg
{
    width: 18px;
    height: 18px;
    flex: none;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.hidden
{
    display: none !important;
}
#app
{
    height: 100%;
}
/* ---------- sign in ---------- */
.login
{
    height: 100%;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(900px 500px at 15% 10%, rgba(33, 77, 64, .10), transparent 60%),
        radial-gradient(800px 500px at 90% 90%, rgba(236, 76, 138, .06), transparent 60%),
        var(--bg);
}
.login-card
{
    width: min(400px, 100%);
    padding: 34px 32px 28px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, .97);
    box-shadow: var(--shadow);
}
.brand
{
    display: flex;
    align-items: center;
    gap: 12px;
}
.brand img
{
    width: 40px;
    height: 40px;
}
.brand strong
{
    font-size: 21px;
    letter-spacing: .2px;
}
.brand strong span
{
    background: var(--brand-grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.login-card h1
{
    margin: 26px 0 4px;
    font-size: 19px;
    font-weight: 600;
}
.login-card p
{
    margin: 0 0 22px;
    color: var(--muted);
}
.field
{
    display: grid;
    gap: 6px;
    margin-bottom: 14px;
    color: var(--muted);
    font-size: 12.5px;
}
.input
{
    width: 100%;
    height: 42px;
    padding: 0 12px;
    border: 1px solid var(--line-2);
    border-radius: 8px;
    background: var(--bg-2);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.input:focus
{
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(33, 77, 64, .16);
}
.btn
{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 36px;
    padding: 0 14px;
    border: 1px solid var(--line-2);
    border-radius: 8px;
    background: var(--panel-2);
    white-space: nowrap;
    transition: background .15s, border-color .15s, opacity .15s;
}
.btn:hover:not(:disabled)
{
    background: #eef3ec;
    border-color: #c4d0bf;
}
.btn:disabled
{
    opacity: .45;
    cursor: default;
}
.btn.primary
{
    border: 0;
    background: var(--accent-grad);
    color: #fff;
    font-weight: 600;
}
.btn.primary:hover:not(:disabled)
{
    background: var(--accent-grad);
    filter: brightness(1.08);
}
.btn.danger
{
    border-color: rgba(192, 57, 43, .35);
    color: #a32e30;
    background: #fff2f1;
}
.btn.on
{
    border-color: rgba(31, 157, 99, .45);
    background: #e8f5ee;
    color: #17603f;
}
.btn.block
{
    width: 100%;
    height: 44px;
    margin-top: 6px;
}
.btn.icon
{
    width: 36px;
    padding: 0;
}
.login-error
{
    min-height: 20px;
    margin: 10px 0 0;
    color: var(--danger);
    font-size: 13px;
}
.login-foot
{
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 22px;
    color: var(--faint);
    font-size: 12px;
}
.lang
{
    display: inline-flex;
    gap: 2px;
    padding: 2px;
    border: 1px solid var(--line);
    border-radius: 7px;
}
.lang button
{
    padding: 2px 8px;
    border: 0;
    border-radius: 5px;
    background: none;
    color: var(--muted);
    font-size: 12px;
}
.lang button.active
{
    background: var(--panel-2);
    color: var(--text);
}
/* ---------- shell ---------- */
.shell
{
    height: 100%;
    display: grid;
    grid-template-rows: 54px auto minmax(0, 1fr);
}
.topbar
{
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 16px;
    border-bottom: 1px solid var(--line);
    background: var(--bg-2);
}
.topbar .brand img
{
    width: 28px;
    height: 28px;
}
.topbar .brand strong
{
    font-size: 16px;
}
.topbar-spacer
{
    flex: 1;
}
.pill
{
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 28px;
    padding: 0 11px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    font-size: 12.5px;
}
.pill.warn
{
    border-color: rgba(183, 121, 31, .45);
    color: #8a5a00;
}
.dot
{
    width: 8px;
    height: 8px;
    flex: none;
    border-radius: 50%;
    background: var(--faint);
}
.dot.on
{
    background: var(--ok);
    box-shadow: 0 0 0 3px rgba(31, 157, 99, .18);
}
.dot.busy
{
    background: var(--info);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .18);
}
.user
{
    position: relative;
}
.user-button
{
    display: flex;
    align-items: center;
    gap: 9px;
    height: 36px;
    padding: 0 8px 0 4px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: none;
}
.user-button:hover
{
    border-color: var(--line);
    background: var(--panel);
}
.avatar
{
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--brand-grad);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}
.main
{
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    min-height: 0;
}
/* ---------- sidebar ---------- */
.sidebar
{
    display: flex;
    flex-direction: column;
    min-height: 0;
    border-right: 1px solid var(--line);
    background: var(--bg-2);
}
.sidebar-head
{
    padding: 14px 14px 10px;
    border-bottom: 1px solid var(--line);
}
.search
{
    position: relative;
}
.search svg
{
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--faint);
}
.search .input
{
    height: 38px;
    padding-left: 36px;
}
.stats
{
    display: flex;
    gap: 6px;
    margin-top: 10px;
    font-size: 12px;
    color: var(--muted);
}
.stats span
{
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--panel);
}
.tree
{
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 8px 8px 24px;
}
.group
{
    margin-bottom: 4px;
    border: 1px dashed transparent;
    border-radius: var(--radius);
    transition: border-color .12s, background .12s;
}
.group.drop
{
    border-color: var(--accent);
    background: rgba(33, 77, 64, .07);
}
.group-head
{
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 8px;
    border: 0;
    border-radius: 8px;
    background: none;
    text-align: left;
}
.group-head:hover
{
    background: var(--panel);
}
.group-head .chev
{
    width: 14px;
    height: 14px;
    color: var(--faint);
    transition: transform .15s;
}
.group.open .chev
{
    transform: rotate(90deg);
}
.group-title
{
    flex: 1;
    min-width: 0;
}
.group-title strong
{
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 600;
}
.group-title small
{
    display: block;
    color: var(--faint);
    font-size: 11.5px;
}
.group.unassigned .group-title strong
{
    color: #8a5a00;
}
.count
{
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--panel-2);
    color: var(--muted);
    font-size: 11.5px;
}
.device
{
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin: 1px 0;
    padding: 8px 10px 8px 14px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: none;
    text-align: left;
    user-select: none;
}
.device:hover
{
    background: var(--panel);
}
.device.active
{
    border-color: rgba(33, 77, 64, .45);
    background: #e8f1ec;
}
.device.offline .device-name
{
    color: var(--muted);
}
.device-icon
{
    position: relative;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    flex: none;
    border-radius: 8px;
    background: var(--panel-2);
    color: var(--muted);
}
.device-icon .dot
{
    position: absolute;
    right: -2px;
    bottom: -2px;
    border: 2px solid var(--bg-2);
    width: 11px;
    height: 11px;
    box-shadow: none;
}
.device-text
{
    flex: 1;
    min-width: 0;
}
.device-name
{
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}
.device-sub
{
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--faint);
    font-size: 11.5px;
}
.eye
{
    color: var(--info);
}
.empty
{
    padding: 26px 16px;
    color: var(--faint);
    text-align: center;
    font-size: 13px;
}
/* ---------- content ---------- */
.content
{
    position: relative;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg);
}
.welcome
{
    overflow: auto;
    padding: 34px 38px;
}
.welcome h2
{
    margin: 0 0 6px;
    font-size: 24px;
    font-weight: 600;
}
.welcome > p
{
    max-width: 720px;
    margin: 0 0 26px;
    color: var(--muted);
}
.cards
{
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 26px;
}
.card
{
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel);
}
.card small
{
    color: var(--muted);
}
.card b
{
    display: block;
    margin-top: 6px;
    font-size: 28px;
    font-weight: 600;
}
.card.ok b
{
    color: var(--ok);
}
.card.warn b
{
    color: var(--warn);
}
.section-title
{
    margin: 0 0 10px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .6px;
    text-transform: uppercase;
}
.activity
{
    margin: 0;
    padding: 0;
    list-style: none;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel);
}
.activity li
{
    display: grid;
    grid-template-columns: 130px minmax(0, 1fr);
    gap: 12px;
    padding: 10px 16px;
    border-top: 1px solid var(--line);
    font-size: 13px;
}
.activity li:first-child
{
    border-top: 0;
}
.activity time
{
    color: var(--faint);
    font-variant-numeric: tabular-nums;
}
.activity b
{
    font-weight: 600;
}
.activity em
{
    color: var(--muted);
    font-style: normal;
}
.note
{
    display: flex;
    gap: 10px;
    margin-top: 18px;
    color: var(--faint);
    font-size: 12.5px;
}
/* ---------- session ---------- */
.session-head
{
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
    background: var(--bg-2);
}
.session-title
{
    min-width: 0;
    flex: 1;
}
.session-title strong
{
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 16px;
}
.session-title small
{
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--muted);
}
.toolbar
{
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-bottom: 1px solid var(--line);
    background: var(--bg-2);
}
.toolbar .sep
{
    width: 1px;
    height: 22px;
    margin: 0 4px;
    background: var(--line);
}
.segmented
{
    display: inline-flex;
    padding: 2px;
    border: 1px solid var(--line-2);
    border-radius: 8px;
    background: var(--panel);
}
.segmented button
{
    height: 30px;
    padding: 0 11px;
    border: 0;
    border-radius: 6px;
    background: none;
    color: var(--muted);
    font-size: 13px;
}
.segmented button.active
{
    background: var(--panel-2);
    color: var(--text);
    box-shadow: inset 0 0 0 1px var(--line-2);
}
.toolbar-spacer
{
    flex: 1;
}
.work
{
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
}
.work.with-files
{
    grid-template-columns: minmax(0, 1fr) 340px;
}
.stage
{
    position: relative;
    min-width: 0;
    min-height: 0;
    display: grid;
    grid-template-rows: minmax(0, 1fr);
    grid-template-columns: minmax(0, 1fr);
    place-items: center;
    overflow: hidden;
    padding: 14px;
    background:
        radial-gradient(circle at 50% 40%, #f1f4ef, #e3e8e0 70%);
    outline: none;
}
.stage img
{
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 10px 40px rgba(20, 40, 30, .25);
    user-select: none;
    -webkit-user-drag: none;
}
.stage.control img
{
    cursor: default;
    outline: 2px solid rgba(31, 157, 99, .6);
}
.stage:fullscreen
{
    padding: 0;
    background: #000;
}
.stage:fullscreen img
{
    border-radius: 0;
    box-shadow: none;
}
.stage.dragging
{
    box-shadow: inset 0 0 0 3px var(--accent);
}
.stage-message
{
    display: grid;
    justify-items: center;
    gap: 10px;
    max-width: 380px;
    color: var(--muted);
    text-align: center;
}
.stage-message svg
{
    width: 42px;
    height: 42px;
    color: var(--faint);
}
.stage-message strong
{
    color: var(--text);
    font-size: 16px;
}
.spinner
{
    width: 30px;
    height: 30px;
    border: 3px solid var(--line-2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}
@keyframes spin
{
    to
    {
        transform: rotate(360deg);
    }
}
.statusbar
{
    display: flex;
    gap: 18px;
    align-items: center;
    height: 30px;
    padding: 0 16px;
    border-top: 1px solid var(--line);
    background: var(--bg-2);
    color: var(--faint);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}
.statusbar .live
{
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--ok);
}
/* ---------- files ---------- */
.files
{
    display: flex;
    flex-direction: column;
    min-height: 0;
    border-left: 1px solid var(--line);
    background: var(--bg-2);
}
.files.dragging
{
    box-shadow: inset 0 0 0 2px var(--accent);
}
.files-head
{
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
}
.files-head strong
{
    flex: 1;
}
.files-path
{
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-size: 12px;
}
.files-path span
{
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    direction: rtl;
    text-align: left;
}
.files-list
{
    flex: 1;
    min-height: 0;
    overflow: auto;
    margin: 0;
    padding: 6px;
    list-style: none;
}
.files-list button
{
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 7px 8px;
    border: 0;
    border-radius: 7px;
    background: none;
    text-align: left;
}
.files-list button:hover
{
    background: var(--panel);
}
.files-list .name
{
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.files-list small
{
    color: var(--faint);
}
.files-foot
{
    padding: 10px 12px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 12px;
}
.files-foot .error
{
    color: var(--danger);
}
.progress
{
    height: 4px;
    margin-top: 6px;
    border-radius: 2px;
    background: var(--line);
    overflow: hidden;
}
.progress i
{
    display: block;
    height: 100%;
    background: var(--accent-grad);
    transition: width .2s;
}
/* ---------- menus, dialogs, toasts ---------- */
.menu
{
    position: fixed;
    z-index: 50;
    min-width: 220px;
    padding: 6px;
    border: 1px solid var(--line-2);
    border-radius: 10px;
    background: var(--panel);
    box-shadow: var(--shadow);
}
.menu button
{
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    border: 0;
    border-radius: 7px;
    background: none;
    text-align: left;
}
.menu button:hover:not(:disabled)
{
    background: var(--panel-2);
}
.menu button:disabled
{
    opacity: .4;
    cursor: default;
}
.menu button.danger
{
    color: var(--danger);
}
.menu hr
{
    margin: 5px 4px;
    border: 0;
    border-top: 1px solid var(--line);
}
.menu-label
{
    padding: 6px 10px 4px;
    color: var(--faint);
    font-size: 11.5px;
}
.backdrop
{
    position: fixed;
    inset: 0;
    z-index: 60;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(20, 30, 25, .35);
    backdrop-filter: blur(3px);
}
.dialog
{
    width: min(520px, 100%);
    max-height: 86vh;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--line-2);
    border-radius: 14px;
    background: var(--panel);
    box-shadow: var(--shadow);
}
.dialog-head
{
    padding: 18px 20px 6px;
}
.dialog-head h3
{
    margin: 0;
    font-size: 17px;
}
.dialog-head p
{
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 13px;
}
.dialog-body
{
    min-height: 0;
    overflow: auto;
    padding: 12px 20px;
}
.dialog-foot
{
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 20px 18px;
}
.results
{
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
}
.results button
{
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    padding: 9px 12px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: none;
    text-align: left;
}
.results button:hover, .results button.active
{
    border-color: var(--line-2);
    background: var(--panel-2);
}
.results small
{
    color: var(--faint);
}
.results .muted, .dialog .muted
{
    padding: 10px 12px;
    color: var(--faint);
}
.facts
{
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 7px 14px;
    margin: 0;
    font-size: 13px;
}
.facts dt
{
    color: var(--muted);
}
.facts dd
{
    margin: 0;
    overflow-wrap: anywhere;
}
.toasts
{
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 80;
    display: grid;
    gap: 8px;
}
.toast
{
    max-width: 380px;
    padding: 11px 14px;
    border: 1px solid var(--line-2);
    border-left: 3px solid var(--info);
    border-radius: 9px;
    background: var(--panel);
    box-shadow: var(--shadow);
    animation: rise .18s ease-out;
}
.toast.ok
{
    border-left-color: var(--ok);
}
.toast.error
{
    border-left-color: var(--danger);
}
@keyframes rise
{
    from
    {
        opacity: 0;
        transform: translateY(6px);
    }
}
.banner
{
    padding: 8px 16px;
    background: #fff6e0;
    color: #8a5a00;
    font-size: 13px;
    text-align: center;
}
@media (max-width: 900px)
{
    .main
    {
        grid-template-columns: minmax(0, 1fr);
        grid-auto-rows: auto;
        overflow: auto;
    }
    .main .sidebar
    {
        order: 2;
        max-height: 60vh;
    }
    .cards
    {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .work.with-files
    {
        grid-template-columns: minmax(0, 1fr);
    }
    .work.with-files .stage
    {
        display: none;
    }
}
.section-title.spaced
{
    margin-top: 18px;
}
.session
{
    display: contents;
}

.boot-wait
{
    height: 100%;
    display: grid;
    place-items: center;
}
.topbar, .sidebar, .session-head, .toolbar, .statusbar, .files
{
    background: #fbfcfa;
}
/* Inside Piqhub: Piqhub's own header is above, so the console has none. */
.shell.embedded
{
    grid-template-rows: auto minmax(0, 1fr);
}
.shell.embedded .sidebar-head .pill
{
    margin-top: 10px;
}

/* ---------- tabs ---------- */
.tabrow
{
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px 0;
    border-bottom: 1px solid var(--line);
    background: #fbfcfa;
}
.tabs
{
    display: flex;
    gap: 2px;
    min-width: 0;
    overflow-x: auto;
}
.tab
{
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 38px;
    padding: 0 12px;
    border: 1px solid transparent;
    border-bottom: 0;
    border-radius: 9px 9px 0 0;
    background: none;
    color: var(--muted);
    white-space: nowrap;
}
.tab.active
{
    border-color: var(--line);
    background: var(--bg);
    color: var(--text);
    font-weight: 600;
    margin-bottom: -1px;
}
.tab-main
{
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 0;
    background: none;
    padding: 0;
    color: inherit;
    font-weight: inherit;
}
.tab-name
{
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tab-close
{
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border: 0;
    border-radius: 6px;
    background: none;
    color: var(--faint);
}
.tab-close:hover
{
    background: var(--panel-2);
    color: var(--danger);
}
.tab-close svg
{
    width: 14px;
    height: 14px;
}
/* Pages fill exactly the height left under the tabs; nothing grows past the window. */
.pages
{
    min-height: 0;
    display: grid;
    grid-template-rows: minmax(0, 1fr);
    grid-template-columns: minmax(0, 1fr);
    overflow: hidden;
}
.page
{
    grid-area: 1 / 1;
    min-height: 0;
    min-width: 0;
    height: 100%;
}
.session-page
{
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--bg);
}
.session-page .work
{
    flex: 1;
    min-height: 0;
    grid-template-rows: minmax(0, 1fr);
}
/* The register screen is scaled down to the free area, keeping its aspect ratio. */
.session-page .stage
{
    min-height: 0;
    height: 100%;
}
.session-page > .stage
{
    flex: 1;
}
.session-page .stage img
{
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.stage-actions
{
    display: flex;
    gap: 8px;
    margin-top: 6px;
}
/* ---------- home ---------- */
.home-grid
{
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 14px;
    margin-bottom: 14px;
}
.connect-card
{
    padding: 22px 24px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--panel);
    box-shadow: 0 6px 20px rgba(20, 40, 30, .06);
}
.connect-card h2
{
    margin: 0 0 14px;
    font-size: 20px;
}
.connect-card small
{
    color: var(--faint);
}
.connect-row
{
    display: flex;
    gap: 8px;
}
.partner-input
{
    height: 46px;
    font-size: 22px;
    letter-spacing: 2px;
    font-variant-numeric: tabular-nums;
}
.connect-row .btn
{
    height: 46px;
    padding: 0 20px;
}
.recent-card .section-title
{
    margin-bottom: 8px;
}
.recent-list
{
    margin: 0;
    padding: 0;
    list-style: none;
}
.recent-list button
{
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 7px 8px;
    border: 0;
    border-radius: 8px;
    background: none;
    text-align: left;
}
.recent-list button:hover
{
    background: var(--panel-2);
}
.recent-list span
{
    display: grid;
}
.recent-list small, .recent-card .muted
{
    color: var(--faint);
}
.cards.three
{
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.device-go
{
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    color: var(--accent);
    opacity: 0;
}
.device:hover .device-go
{
    opacity: 1;
}
.device-go:hover
{
    background: var(--panel-2);
}
@media (max-width: 900px)
{
    .home-grid, .cards.three
    {
        grid-template-columns: minmax(0, 1fr);
    }
}

.top-extra
{
    min-width: 0;
}
.tab-home
{
    padding: 0 10px;
}
.results
{
    max-height: 55vh;
    overflow: auto;
}

.market-on
{
    color: var(--ok) !important;
    font-weight: 600;
}
.market-title
{
    margin: 0 0 6px;
}
.market-note
{
    margin: 22px 0 0 !important;
    color: var(--text) !important;
}

/* Recent connections: one compact line each; the big stat numbers (.card b) do not apply here. */
.recent-card
{
    padding: 12px 14px;
}
.recent-list button
{
    gap: 8px;
    padding: 5px 6px;
    font-size: 13px;
}
.recent-list svg
{
    width: 15px;
    height: 15px;
    color: var(--faint);
}
.recent-name
{
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
}
.recent-list small
{
    flex: none;
    font-size: 12px;
}
.recent-card .muted
{
    margin: 0;
    font-size: 12.5px;
}
.recent-name
{
    display: block;
}
/* ---------- phones ---------- */
@media (max-width: 900px)
{
    /* One scrolling column instead of two half-height panes: connect card, then the book. */
    .main.page
    {
        display: flex;
        flex-direction: column;
        overflow-y: auto;
    }
    .main.page .content
    {
        flex: none;
        order: 1;
    }
    .main.page .sidebar
    {
        flex: none;
        order: 2;
        max-height: none;
        border-right: 0;
        border-top: 1px solid var(--line);
    }
    .main.page .tree
    {
        overflow: visible;
        flex: none;
    }
    /* Store view: its registers come first. */
    .main.page.market .sidebar
    {
        order: 0;
        border-top: 0;
        border-bottom: 1px solid var(--line);
    }
    .welcome
    {
        overflow: visible;
        padding: 14px;
    }
    .main.page .cards.three, .main.page .note
    {
        display: none;
    }
    .home-grid
    {
        gap: 10px;
        margin-bottom: 0;
    }
    .connect-card
    {
        padding: 16px;
    }
    .connect-card h2
    {
        font-size: 18px;
        margin-bottom: 10px;
    }
    .connect-row
    {
        flex-direction: column;
    }
    .partner-input
    {
        width: 100%;
        font-size: 20px;
    }
    .connect-row .btn
    {
        width: 100%;
    }
    .market-title
    {
        font-size: 18px;
    }
    .sidebar-head
    {
        padding: 12px;
    }
    /* Session: compact toolbar, more room for the register screen. */
    .session-head
    {
        padding: 8px 12px;
        gap: 10px;
    }
    .session-title strong
    {
        font-size: 15px;
    }
    .session-head .pill
    {
        display: none;
    }
    .toolbar
    {
        gap: 5px;
        padding: 6px 10px;
    }
    .toolbar .btn
    {
        height: 32px;
        padding: 0 9px;
        font-size: 12.5px;
    }
    .toolbar .btn.icon
    {
        width: 32px;
        padding: 0;
    }
    .toolbar .segmented button
    {
        height: 26px;
        padding: 0 8px;
        font-size: 12px;
    }
    .toolbar .sep, .toolbar-spacer
    {
        display: none;
    }
    .stage
    {
        padding: 6px;
    }
    .statusbar
    {
        gap: 10px;
        padding: 0 10px;
        font-size: 11.5px;
    }
    .tabrow
    {
        padding: 4px 8px 0;
    }
    .tab
    {
        height: 34px;
        padding: 0 10px;
    }
}
@media (max-width: 900px)
{
    /* Store view on a phone: the list already carries the store name. */
    .main.page.market .content
    {
        display: none;
    }
}

/* ---------- touch screens ---------- */
/* The stage handles every touch itself: no page scroll, no browser zoom, no long-press menu. */
.stage
{
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}
.stage img
{
    will-change: transform;
}
/* Off-screen but focusable, so the phone keyboard opens. */
.soft-keyboard
{
    position: absolute;
    left: 0;
    bottom: 0;
    width: 1px;
    height: 1px;
    opacity: 0;
    border: 0;
    padding: 0;
    font-size: 16px;
}
@media (pointer: coarse)
{
    .toolbar .btn, .btn
    {
        min-height: 40px;
    }
    .toolbar .btn.icon, .btn.icon
    {
        min-width: 40px;
    }
    .toolbar .segmented button
    {
        height: 34px;
    }
    .device
    {
        padding-top: 11px;
        padding-bottom: 11px;
    }
    .tab
    {
        height: 40px;
    }
    .tab-close
    {
        width: 30px;
        height: 30px;
    }
}

/* ---------- iOS Safari ---------- */
html
{
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}
/* The visible height, without Safari's address bar. */
@supports (height: 100dvh)
{
    #app, .login, .shell
    {
        height: 100dvh;
    }
}
@media (pointer: coarse)
{
    /* Below 16px Safari zooms the page when a field gets focus. */
    .input, input, select, textarea
    {
        font-size: 16px;
    }
}

/* ==========================================================================
   Compact console (0.5.8): the systematic scale of Piqoff admin, PiqRemote colors.
   13px text, 10.5px uppercase labels, 1px-bordered cards, thin table rows, mono IDs.
   ========================================================================== */
:root
{
    --mono: ui-monospace, "Cascadia Mono", Consolas, "SF Mono", monospace;
    --row: #eef1ec;
    --hover: #f5f7f4;
    --side: #f8f9f7;
    --ok-bg: #eaf6ef;
    --warn-bg: #fdf3e4;
    --warn-text: #8f5410;
}
body
{
    font-size: 13px;
}
.mono
{
    font-family: var(--mono);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}
.faint
{
    color: var(--faint);
}
.small
{
    font-size: 12px;
}
.label
{
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--faint);
}
.shell
{
    grid-template-rows: 48px auto minmax(0, 1fr);
}
.topbar
{
    padding: 0 14px;
}
.topbar .brand img
{
    width: 24px;
    height: 24px;
}
.topbar .brand strong
{
    font-size: 15px;
}
.user-button
{
    height: 32px;
    font-size: 13px;
}
.avatar
{
    width: 24px;
    height: 24px;
    font-size: 10.5px;
}
.btn
{
    height: 32px;
    padding: 0 12px;
    font-size: 13px;
}
/* ---------- sidebar: one line per register ---------- */
.main
{
    grid-template-columns: 264px minmax(0, 1fr);
}
.sidebar
{
    background: var(--side);
}
.sidebar-head
{
    padding: 12px 12px 8px;
}
.sidebar-head .section-title
{
    margin: 0 0 8px;
    font-size: 10.5px;
    letter-spacing: .06em;
}
.search .input
{
    height: 32px;
    font-size: 13px;
}
.stats
{
    margin-top: 8px;
    font-size: 11.5px;
}
.stats span
{
    padding: 1px 8px;
}
.tree
{
    padding: 6px 6px 20px;
}
.group
{
    margin-bottom: 2px;
}
.group-head
{
    gap: 6px;
    padding: 5px 6px;
    border-radius: 6px;
}
.group-title strong
{
    font-size: 12.5px;
}
.group-title small
{
    font-size: 10.5px;
}
.count
{
    padding: 0 6px;
    font-size: 10.5px;
}
.device
{
    gap: 8px;
    min-height: 28px;
    margin: 0;
    padding: 3px 6px 3px 26px;
    border-radius: 6px;
}
.device .dot
{
    width: 7px;
    height: 7px;
    box-shadow: none;
}
.device-name
{
    flex: 1;
    min-width: 0;
    font-size: 13px;
    font-weight: 500;
}
.device-id
{
    color: var(--faint);
    font-size: 11px;
}
.device-go
{
    width: 22px;
    height: 22px;
}
.device-go svg
{
    width: 14px;
    height: 14px;
}
.tag
{
    display: inline-block;
    margin-left: 6px;
    padding: 0 6px;
    border-radius: 4px;
    background: var(--panel-2);
    color: var(--muted);
    font-size: 10.5px;
    font-weight: 600;
    line-height: 17px;
    vertical-align: 1px;
}
.tag.warn
{
    background: var(--warn-bg);
    color: var(--warn-text);
}
.device .tag
{
    margin-left: 0;
}
/* ---------- home page ---------- */
.welcome
{
    padding: 20px 24px 28px;
}
.page-head
{
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 16px;
}
.crumb
{
    color: var(--muted);
    font-size: 12.5px;
    text-transform: capitalize;
}
.h1
{
    margin: 2px 0 0;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -.02em;
}
.page-head .connect-card
{
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
}
.page-head .connect-row
{
    gap: 6px;
}
.page-head .partner-input
{
    width: 168px;
    height: 34px;
    font-family: var(--mono);
    font-size: 15px;
    letter-spacing: 1px;
}
.page-head .connect-row .btn
{
    height: 34px;
    padding: 0 14px;
}
.card
{
    padding: 0;
    border-radius: 10px;
}
.home-grid
{
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 12px;
    margin-bottom: 12px;
}
.home-card
{
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 16px;
}
.home-state
{
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
}
.kv
{
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 5px 16px;
    font-size: 12.5px;
}
.kv > span:nth-child(odd)
{
    color: var(--muted);
}
.kv > span:nth-child(even)
{
    justify-self: end;
}
.notice
{
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 7px;
    background: var(--hover);
    color: var(--muted);
    font-size: 12.5px;
}
.notice svg
{
    width: 15px;
    height: 15px;
}
.notice.ok
{
    background: var(--ok-bg);
    color: var(--ok);
}
.notice.warn
{
    background: var(--warn-bg);
    color: var(--warn-text);
}
.card-title
{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.count-badge
{
    padding: 0 7px;
    border-radius: 4px;
    background: var(--warn-bg);
    color: var(--warn-text);
    font-size: 11px;
    font-weight: 600;
}
.check
{
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 6px 0;
    border: 0;
    border-bottom: 1px solid var(--row);
    background: none;
    font-size: 13px;
    text-align: left;
}
.check:last-child
{
    border-bottom: 0;
}
.check b
{
    min-width: 22px;
    font-family: var(--mono);
    font-size: 13px;
    color: var(--muted);
}
.check b.warn
{
    color: var(--warn-text);
}
.check span
{
    flex: 1;
}
.check svg
{
    width: 12px;
    height: 12px;
    color: var(--faint);
}
.check:hover span
{
    color: var(--accent);
}
.home-main
{
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 12px;
    align-items: start;
    margin-bottom: 12px;
}
.table-card
{
    overflow: hidden;
}
.table-tools
{
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
}
.chips
{
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}
.chip
{
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 26px;
    padding: 0 9px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel);
    color: var(--muted);
    font-size: 12px;
}
.chip:hover
{
    border-color: var(--line-2);
    color: var(--text);
}
.chip.active
{
    border-color: var(--accent);
    background: rgba(33, 77, 64, .07);
    color: var(--accent);
    font-weight: 600;
}
.chip-count
{
    font-family: var(--mono);
    font-size: 11px;
    color: var(--faint);
}
.chip.active .chip-count
{
    color: var(--accent);
}
.table-count
{
    margin-left: auto;
    color: var(--faint);
    font-size: 12px;
    white-space: nowrap;
}
.table-wrap
{
    max-height: calc(100vh - 380px);
    min-height: 220px;
    overflow: auto;
}
.table
{
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.table th
{
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 8px 12px;
    border-bottom: 1px solid var(--line);
    background: var(--side);
    color: var(--faint);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .06em;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
}
.table th.sorted
{
    color: var(--accent);
}
.table th .sort
{
    margin-left: 4px;
}
.table td
{
    padding: 7px 12px;
    border-bottom: 1px solid var(--row);
    white-space: nowrap;
    vertical-align: middle;
}
.table td.strong
{
    font-weight: 600;
}
.table tbody tr
{
    cursor: default;
}
.table tbody tr:hover
{
    background: var(--hover);
}
.table tbody tr.off td
{
    color: var(--muted);
}
.table tbody tr:last-child td
{
    border-bottom: 0;
}
.status
{
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
}
.status .dot
{
    width: 7px;
    height: 7px;
}
.home-side
{
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.side-card
{
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 14px;
}
.side-card .muted
{
    margin: 0;
}
.mini-list
{
    display: flex;
    flex-direction: column;
}
.mini-row
{
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    border: 0;
    border-bottom: 1px solid var(--row);
    background: none;
    font-size: 12.5px;
    text-align: left;
}
.mini-row:last-child
{
    border-bottom: 0;
}
.mini-row:hover .mini-name
{
    color: var(--accent);
}
.mini-name
{
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}
.mini-row .faint
{
    font-size: 11px;
}
.live-dot
{
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--ok);
    box-shadow: 0 0 0 3px rgba(31, 157, 99, .18);
}
.feed
{
    max-height: calc(100vh - 470px);
    min-height: 160px;
    margin: 0;
    padding: 0;
    overflow: auto;
    list-style: none;
}
.feed li
{
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 8px;
    padding: 5px 0;
    border-bottom: 1px solid var(--row);
    font-size: 12px;
    line-height: 1.4;
}
.feed li:last-child
{
    border-bottom: 0;
}
.feed time
{
    color: var(--faint);
    font-family: var(--mono);
    font-size: 11px;
}
.feed em
{
    color: var(--faint);
    font-style: normal;
}
.note
{
    font-size: 12px;
}
/* ---------- session tab ---------- */
.tab
{
    font-size: 12.5px;
}
.session-title strong
{
    font-size: 14px;
}
.toolbar .btn, .segmented button
{
    height: 28px;
    font-size: 12px;
}
.statusbar
{
    font-size: 11.5px;
}
@media (max-width: 1200px)
{
    .home-main
    {
        grid-template-columns: minmax(0, 1fr);
    }
    .table-wrap, .feed
    {
        max-height: none;
    }
}
@media (max-width: 900px)
{
    .home-grid
    {
        grid-template-columns: minmax(0, 1fr);
    }
    .page-head .connect-card, .page-head .partner-input
    {
        width: 100%;
    }
    .page-head .connect-row
    {
        width: 100%;
    }
    .table.devices th:nth-child(6), .table.devices td:nth-child(6), .table.devices th:nth-child(8), .table.devices td:nth-child(8)
    {
        display: none;
    }
}
@media (pointer: coarse)
{
    .page-head .partner-input, .search .input
    {
        font-size: 16px;
    }
}
/* The old stat-card number style must not reach text inside the new cards. */
.home-card b, .side-card b, .table-card b
{
    display: inline;
    margin: 0;
    font-size: inherit;
    font-weight: 600;
}
.check b
{
    min-width: 22px;
    font-family: var(--mono);
    font-size: 13px;
}
.table th, .table td
{
    padding-left: 10px;
    padding-right: 10px;
}
@media (max-width: 1440px)
{
    /* IP and "connected" move into the tooltip on narrower screens. */
    .table.devices th:nth-child(6), .table.devices td:nth-child(6), .table.devices th:nth-child(8), .table.devices td:nth-child(8)
    {
        display: none;
    }
}
.feed li
{
    grid-template-columns: 56px minmax(0, 1fr);
}
/* ---------- PiqRemote colors: logo navy for actions, brand pink/orange for highlights; green only means "online" ---------- */
:root
{
    --accent: #2b2459;
    --accent-2: #463c86;
    --accent-grad: linear-gradient(135deg, #2b2459, #463c86);
    --accent-soft: rgba(43, 36, 89, .07);
    --pink: #e04f86;
    --bg: #f5f5f8;
    --side: #f9f9fb;
    --hover: #f5f5f9;
    --row: #efeff3;
    --line: #e4e4ea;
    --line-2: #d4d4dd;
    --panel-2: #f2f2f6;
}
.input:focus
{
    box-shadow: 0 0 0 3px rgba(43, 36, 89, .14);
}
.group.drop, .chip.active
{
    background: var(--accent-soft);
}
.device.active
{
    border-color: rgba(43, 36, 89, .35);
    background: #ecebf4;
}
.market-on
{
    color: var(--pink);
}
.notice.ok
{
    background: var(--panel-2);
    color: var(--accent);
}
.table th.sorted, .check:hover span, .mini-row:hover .mini-name
{
    color: var(--pink);
}
.h1, .page-hello strong
{
    color: var(--accent);
}
/* ---------- home head: small greeting left, connect in the middle ---------- */
.page-head
{
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    margin-bottom: 14px;
}
.page-hello
{
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.page-hello strong
{
    font-size: 16px;
    font-weight: 700;
}
.page-head .connect-card
{
    flex-direction: row;
    align-items: center;
    gap: 10px;
}
.table-tools
{
    padding: 8px 12px;
}
.chip svg
{
    width: 12px;
    height: 12px;
}
.home-main
{
    grid-template-columns: minmax(0, 1fr) 340px;
}
.table-wrap
{
    max-height: calc(100vh - 330px);
}
/* ---------- session: title and toolbar share one thin row, the screen gets the rest ---------- */
.session-page:has(> .toolbar)
{
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
}
.session-page:has(> .toolbar) > .session-head
{
    grid-column: 1;
    gap: 8px;
    max-width: 340px;
    padding: 4px 10px 4px 12px;
    border-right: 1px solid var(--line);
}
.session-page:has(> .toolbar) > .toolbar
{
    grid-column: 2;
    gap: 4px;
    padding: 4px 10px;
}
.session-page:has(> .toolbar) > .work, .session-page:has(> .toolbar) > .statusbar
{
    grid-column: 1 / -1;
}
.session-head .device-icon
{
    display: none;
}
.session-title strong
{
    font-size: 13px;
}
.session-title small
{
    font-size: 11px;
}
.session-head .pill
{
    height: 22px;
    padding: 0 7px;
    font-size: 0;
    gap: 0;
}
.session-head .pill svg
{
    width: 14px;
    height: 14px;
}
.session-head .btn.icon
{
    width: 26px;
    height: 26px;
}
.toolbar .btn, .segmented button
{
    height: 26px;
    padding: 0 9px;
}
.toolbar .btn svg
{
    width: 15px;
    height: 15px;
}
.statusbar
{
    height: 22px;
    font-size: 11px;
}
@media (max-width: 900px)
{
    .page-head
    {
        grid-template-columns: minmax(0, 1fr);
    }
    .page-head .connect-card
    {
        flex-direction: column;
        align-items: stretch;
    }
    .session-page:has(> .toolbar)
    {
        grid-template-columns: minmax(0, 1fr);
    }
    .session-page:has(> .toolbar) > .session-head, .session-page:has(> .toolbar) > .toolbar
    {
        grid-column: 1;
        max-width: none;
        border-right: 0;
    }
}
/* ---------- home: one thin status line ---------- */
.strip
{
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 18px;
    margin-bottom: 12px;
    padding: 7px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    color: var(--muted);
    font-size: 12.5px;
}
.strip-item
{
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.strip-item b
{
    color: var(--text);
    font-weight: 600;
}
.strip-spacer
{
    flex: 1;
}
.strip-warn
{
    height: 22px;
    padding: 0 8px;
    border: 0;
    border-radius: 5px;
    background: var(--warn-bg);
    color: var(--warn-text);
    font-size: 12px;
}
.strip-warn b
{
    font-family: var(--mono);
}
.strip-warn:hover
{
    filter: brightness(.97);
}
/* ---------- remaining green surfaces in PiqRemote tones ---------- */
.login
{
    background:
        radial-gradient(900px 500px at 15% 10%, rgba(43, 36, 89, .08), transparent 60%),
        radial-gradient(800px 500px at 90% 90%, rgba(236, 76, 138, .07), transparent 60%),
        var(--bg);
}
.btn:hover:not(:disabled)
{
    background: var(--hover);
}
.btn.on
{
    border-color: rgba(43, 36, 89, .35);
    background: var(--accent-soft);
    color: var(--accent);
}
.stage
{
    padding: 6px;
    background: radial-gradient(circle at 50% 40%, #f3f3f7, #e6e6ee 70%);
}
.stage img
{
    box-shadow: 0 10px 40px rgba(30, 24, 70, .22);
}
.stage.control img
{
    outline: 2px solid rgba(224, 79, 134, .55);
}
/* ---------- details dialog: analytics, sign-ins, versions ---------- */
.btn.ghost
{
    border-color: transparent;
    background: none;
    color: var(--muted);
}
.btn.ghost:hover:not(:disabled)
{
    border-color: var(--line);
    background: var(--panel);
    color: var(--accent);
}
a.btn
{
    display: inline-flex;
    align-items: center;
    gap: 7px;
    text-decoration: none;
}
.dialog.wide
{
    width: min(1100px, calc(100vw - 32px));
    max-width: none;
}
.dialog.wide .dialog-body
{
    max-height: calc(100vh - 190px);
    overflow: auto;
}
.details
{
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.details > .segmented
{
    align-self: flex-start;
}
.details-tools
{
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}
.details-section
{
    margin-top: 14px;
}
.details-section .table-wrap
{
    border: 1px solid var(--line);
    border-radius: 8px;
}
.table-wrap.short
{
    max-height: 300px;
    min-height: 0;
}
.table th.num, .table td.num
{
    text-align: right;
}
.kpis
{
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 8px;
}
.kpi
{
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--side);
}
.kpi b
{
    color: var(--accent);
    font-size: 16px;
    font-weight: 600;
}
.facts dd.break
{
    word-break: break-all;
}
.kpis
{
    grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
}

/* Home: unassigned registers on the side, scrolling; table shows the last 10 */
.mini-list.scroll
{
    max-height: 340px;
    overflow-y: auto;
    padding-right: 4px;
}
.mini-list.scroll.tall
{
    max-height: 55vh;
    margin-top: 8px;
}
.mini-row.off
{
    opacity: 0.6;
}
.mini-row .dot
{
    display: inline-block;
    vertical-align: middle;
}
.side-card .card-title
{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.link-btn
{
    border: 0;
    background: none;
    padding: 0;
    color: var(--accent);
    font-size: 12px;
    cursor: pointer;
}
.link-btn:hover
{
    text-decoration: underline;
}
.table-more
{
    display: block;
    width: 100%;
    padding: 8px;
    border: 0;
    border-top: 1px solid var(--row);
    background: none;
    color: var(--accent);
    font-size: 12.5px;
    cursor: pointer;
}
.table-more:hover
{
    background: var(--row);
}

/* Small action button inside tables (Piqoff keys) */
.btn.small
{
    height: auto;
    min-height: 0;
    padding: 3px 10px;
    font-size: 12px;
}
