:root {
    color-scheme: light;
    --bg: #eef2f5;
    --bg-raised: #f7f9fb;
    --surface: #ffffff;
    --surface-soft: #f5f7fa;
    --surface-strong: #e8edf2;
    --text: #151b24;
    --text-strong: #0b1118;
    --muted: #647183;
    --line: #d7dee7;
    --line-strong: #b9c4d1;
    --primary: #176b7c;
    --primary-strong: #0f5362;
    --accent: #c66b28;
    --success: #1f7a4f;
    --warning: #a76100;
    --danger: #b42318;
    --focus: #74b8c7;
    --sidebar: #10161d;
    --sidebar-raised: #19222c;
    --sidebar-hover: #24313d;
    --shadow: 0 14px 32px rgba(16, 22, 29, 0.10);
    --shadow-soft: 0 8px 18px rgba(16, 22, 29, 0.07);
}

@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
        --bg: #101418;
        --bg-raised: #151b21;
        --surface: #171d24;
        --surface-soft: #1d252d;
        --surface-strong: #26313b;
        --text: #eef3f7;
        --text-strong: #ffffff;
        --muted: #a6b1bd;
        --line: #2c3742;
        --line-strong: #40505f;
        --primary: #69b6c4;
        --primary-strong: #8fc9d3;
        --accent: #e19a57;
        --success: #72c695;
        --warning: #e3b45d;
        --danger: #ed7b73;
        --focus: #5796a4;
        --sidebar: #0d1116;
        --sidebar-raised: #151c24;
        --sidebar-hover: #22303c;
        --shadow: 0 18px 36px rgba(0, 0, 0, 0.34);
        --shadow-soft: 0 10px 22px rgba(0, 0, 0, 0.24);
    }
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.64), rgba(255, 255, 255, 0) 260px),
        var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    line-height: 1.5;
    letter-spacing: 0;
}

@media (prefers-color-scheme: dark) {
    body {
        background:
            linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0) 260px),
            var(--bg);
    }
}

a {
    color: inherit;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 18px;
    color: var(--text-strong);
    font-size: 30px;
    line-height: 1.16;
    letter-spacing: 0;
}

h2 {
    margin-bottom: 14px;
    color: var(--text-strong);
    font-size: 17px;
    line-height: 1.25;
    letter-spacing: 0;
}

pre {
    overflow-x: auto;
    margin: 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #0e141b;
    color: #dce6ef;
}

.guest-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px;
}

.welcome-panel,
.form-panel {
    width: min(960px, 100%);
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.welcome-panel {
    display: grid;
    gap: 24px;
    padding: 36px;
}

.form-panel {
    width: min(540px, 100%);
    padding: 30px;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--primary);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.lead {
    max-width: 740px;
    margin-bottom: 0;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.72;
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.status-grid article,
.metric-card,
.section-band {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow-soft);
}

.status-grid article {
    min-height: 86px;
    padding: 16px;
}

.status-grid span,
.metric-card span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.status-grid strong {
    display: block;
    margin-top: 6px;
    color: var(--text-strong);
    font-size: 20px;
}

.panel-body {
    display: grid;
    grid-template-columns: 258px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    padding: 16px 12px;
    background: var(--sidebar);
    color: #eef4f7;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar a {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 38px;
    padding: 9px 11px 9px 14px;
    margin: 3px 0;
    color: #bdc9d4;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: 8px;
    font-weight: 750;
}

.sidebar a::before {
    content: "";
    width: 7px;
    height: 7px;
    margin-right: 10px;
    border-radius: 999px;
    background: #526170;
}

.sidebar a:hover,
.sidebar a:focus-visible {
    background: var(--sidebar-hover);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.08);
    outline: none;
}

.sidebar a:hover::before,
.sidebar a:focus-visible::before {
    background: var(--accent);
}

.sidebar .brand {
    min-height: 48px;
    margin-bottom: 14px;
    padding-left: 12px;
    background: var(--sidebar-raised);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.10);
    font-size: 20px;
    font-weight: 900;
}

.sidebar .brand::before {
    width: 13px;
    height: 13px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 4px;
}

.panel-main {
    min-width: 0;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 2;
    min-height: 66px;
    padding: 14px 26px;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px);
}

.topbar div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.topbar strong {
    color: var(--text-strong);
    font-size: 19px;
    font-weight: 900;
}

.topbar span {
    color: var(--muted);
    font-weight: 800;
}

.content {
    width: min(1500px, 100%);
    margin: 0 auto;
    padding: 26px;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(176px, 1fr));
    gap: 12px;
}

.metric-card {
    min-height: 98px;
    padding: 17px;
}

.metric-card::after {
    content: "";
    display: block;
    width: 34px;
    height: 3px;
    margin-top: 14px;
    border-radius: 999px;
    background: var(--accent);
}

.metric-card strong {
    display: block;
    margin-top: 8px;
    color: var(--text-strong);
    font-size: 28px;
    line-height: 1;
}

.section-band {
    margin-top: 16px;
    padding: 18px;
}

.split {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.search-form,
.actions,
.inline-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-form {
    flex-wrap: wrap;
    flex: 1 1 auto;
}

.toolbar .search-form input,
.toolbar .search-form select {
    width: auto;
    min-width: 180px;
    flex: 0 1 220px;
}

.toolbar .search-form .button,
.toolbar .search-form button {
    flex: 0 0 auto;
}

.stack-form,
.edit-form {
    display: grid;
    gap: 14px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
}

.checkline {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    color: var(--text);
}

label.wide {
    grid-column: 1 / -1;
}

input,
select,
textarea {
    width: 100%;
    min-height: 40px;
    padding: 9px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
}

input:hover,
select:hover,
textarea:hover {
    border-color: var(--line-strong);
}

input:focus,
select:focus,
textarea:focus,
.button:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--focus) 36%, transparent);
    border-color: var(--focus);
}

textarea {
    resize: vertical;
}

input[type="checkbox"] {
    width: 16px;
    min-height: 16px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 13px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font-weight: 850;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 1px 0 rgba(16, 22, 29, 0.04);
}

.button:hover {
    background: var(--surface-strong);
}

.button.primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
}

.button.primary:hover {
    background: var(--primary-strong);
}

.button.danger,
.alert.danger {
    background: var(--danger);
    border-color: var(--danger);
    color: #ffffff;
}

.alert.info {
    border: 1px solid color-mix(in srgb, var(--primary) 36%, var(--line));
    background: color-mix(in srgb, var(--primary) 9%, var(--surface));
    color: var(--text);
}

.alert.warning {
    border: 1px solid color-mix(in srgb, var(--warning) 44%, var(--line));
    background: color-mix(in srgb, var(--warning) 11%, var(--surface));
    color: var(--text);
}

.button.small {
    min-height: 30px;
    padding: 5px 9px;
    font-size: 12px;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow-soft);
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

th,
td {
    padding: 12px 13px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

tr:last-child th,
tr:last-child td {
    border-bottom: 0;
}

th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}

tbody tr:hover td {
    background: color-mix(in srgb, var(--primary) 5%, transparent);
}

td {
    color: var(--text);
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 8px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--text);
    font-size: 12px;
    font-weight: 850;
}

.badge.ok {
    border-color: color-mix(in srgb, var(--success) 54%, var(--line));
    color: var(--success);
}

.badge.warn {
    border-color: color-mix(in srgb, var(--warning) 54%, var(--line));
    color: var(--warning);
}

.badge.bad {
    border-color: color-mix(in srgb, var(--danger) 54%, var(--line));
    color: var(--danger);
}

.badge.neutral {
    color: var(--muted);
}

.alert {
    margin-bottom: 14px;
    padding: 12px 13px;
    border-radius: 8px;
}

.check-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 14px 0;
}

.empty {
    color: var(--muted);
    text-align: center;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.detail-grid section {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow-soft);
}

@media (max-width: 940px) {
    .panel-body {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
    }

    .sidebar a {
        display: inline-flex;
    }

    .sidebar .brand {
        width: 100%;
    }

    .content {
        padding: 16px;
    }

    .split,
    .form-grid,
    .detail-grid {
        grid-template-columns: 1fr;
    }

    .toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .search-form,
    .actions,
    .inline-controls {
        align-items: stretch;
        flex-direction: column;
    }

    .toolbar .search-form input,
    .toolbar .search-form select {
        width: 100%;
        min-width: 0;
        flex: 1 1 auto;
    }
}

@media (max-width: 720px) {
    .guest-shell {
        padding: 16px;
        place-items: stretch;
    }

    .welcome-panel,
    .form-panel {
        padding: 22px;
    }

    .status-grid {
        grid-template-columns: 1fr;
    }

    table,
    thead,
    tbody,
    tr,
    th,
    td {
        display: block;
    }

    thead {
        display: none;
    }

    tr {
        padding: 8px 0;
        border-bottom: 1px solid var(--line);
    }

    tr:last-child {
        border-bottom: 0;
    }

    td {
        border: 0;
        display: flex;
        justify-content: space-between;
        gap: 12px;
    }

    td::before {
        content: attr(data-label);
        color: var(--muted);
        font-weight: 850;
    }
}

/* AblePanel UI3: cache-busted console redesign */
.admin-shell,
.user-shell {
    background: #e9edf1;
}

.admin-shell .sidebar,
.user-shell .sidebar {
    padding: 18px 14px;
    background: linear-gradient(180deg, #111822 0%, #121923 48%, #17202b 100%);
}

.brand {
    gap: 12px;
}

.brand span:last-child {
    display: grid;
    gap: 1px;
}

.brand strong {
    display: block;
    color: #ffffff;
    font-size: 18px;
    line-height: 1.1;
}

.brand small {
    color: #91a2b5;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: linear-gradient(135deg, #2d8fa3, #d47933);
    color: #ffffff;
    font-size: 12px;
    font-weight: 950;
}

.sidebar .brand::before,
.sidebar a::before {
    display: none;
}

.side-nav {
    display: grid;
    gap: 3px;
}

.nav-label {
    display: block;
    margin: 16px 8px 6px;
    color: #728397;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.side-nav a {
    min-height: 40px;
    padding: 10px 12px;
    border-radius: 8px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 76px;
    padding: 16px 30px;
    background: rgba(255, 255, 255, 0.96);
}

.topbar > div {
    display: grid;
    gap: 2px;
}

.topbar p {
    margin: 0;
    color: var(--accent);
    font-size: 11px;
    font-weight: 950;
    letter-spacing: 0.08em;
}

.account-chip {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 7px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--text);
    font-size: 13px;
    font-weight: 900;
}

.dashboard-hero {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 20px;
    min-height: 156px;
    margin-bottom: 16px;
    padding: 24px;
    border: 1px solid #cfd8e2;
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(23, 107, 124, 0.12), transparent 46%),
        linear-gradient(180deg, #ffffff, #f7fafc);
    box-shadow: var(--shadow);
}

.dashboard-hero h1 {
    margin: 0;
    font-size: 34px;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(128px, 1fr));
    gap: 10px;
    min-width: min(520px, 100%);
}

.compact-hero .hero-stats {
    grid-template-columns: repeat(4, minmax(118px, 1fr));
    min-width: min(640px, 100%);
}

.hero-stat {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #101820;
    color: #ffffff;
}

.hero-stat span {
    display: block;
    color: #aab7c4;
    font-size: 12px;
    font-weight: 850;
}

.hero-stat strong {
    display: block;
    margin-top: 6px;
    font-size: 22px;
    line-height: 1.12;
    overflow-wrap: anywhere;
}

.metric-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.metric-card.featured {
    min-height: 124px;
    border-top: 4px solid var(--primary);
}

.compact-grid {
    margin-top: 12px;
}

.capacity-grid,
.usage-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.server-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
}

.server-summary-card {
    min-width: 0;
    min-height: 122px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: linear-gradient(180deg, var(--surface), var(--surface-soft));
}

.server-summary-card span,
.server-summary-card small {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
}

.server-summary-card strong {
    display: block;
    margin: 8px 0;
    color: var(--text-strong);
    font-size: 23px;
    line-height: 1.14;
    overflow-wrap: anywhere;
}

.server-summary-card.ok {
    border-color: color-mix(in srgb, var(--success) 34%, var(--line));
}

.server-summary-card.warn {
    border-color: color-mix(in srgb, var(--warning) 38%, var(--line));
}

.server-summary-card.bad {
    border-color: color-mix(in srgb, var(--danger) 44%, var(--line));
}

.capacity-item,
.usage-item {
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
}

.capacity-head,
.usage-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.capacity-head strong,
.usage-head strong {
    color: var(--text-strong);
    font-size: 13px;
}

.capacity-head span,
.usage-head span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}

.usage-bar {
    overflow: hidden;
    width: 100%;
    height: 9px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--line) 74%, transparent);
}

.usage-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary), var(--accent));
}

.usage-fill.ok {
    background: linear-gradient(90deg, var(--success), var(--primary));
}

.usage-fill.warn {
    background: linear-gradient(90deg, var(--warning), var(--accent));
}

.usage-fill.bad {
    background: linear-gradient(90deg, var(--danger), var(--accent));
}

.capacity-item p,
.usage-item p {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.capacity-item.ok {
    border-color: color-mix(in srgb, var(--success) 28%, var(--line));
}

.capacity-item.warn {
    border-color: color-mix(in srgb, var(--warning) 34%, var(--line));
}

.capacity-item.bad {
    border-color: color-mix(in srgb, var(--danger) 42%, var(--line));
}

.capacity-foot {
    color: var(--text) !important;
}

.dashboard-status-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.9fr);
    gap: 14px;
    margin-top: 16px;
}

.dashboard-status-grid > section {
    min-width: 0;
}

.dashboard-status-grid h3 {
    margin: 0 0 10px;
    color: var(--text-strong);
    font-size: 15px;
}

.service-list {
    display: grid;
    gap: 8px;
}

.service-list > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 42px;
    padding: 9px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
}

.service-list span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
}

.compact-table {
    margin-top: 14px;
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.section-head h2 {
    margin: 0;
}

@media (max-width: 940px) {
    .metric-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .capacity-grid,
    .usage-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-status-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-hero {
        align-items: stretch;
        flex-direction: column;
    }
}

@media (max-width: 720px) {
    .metric-strip {
        grid-template-columns: 1fr;
    }

    .capacity-grid,
    .usage-grid {
        grid-template-columns: 1fr;
    }

    .hero-stats {
        grid-template-columns: 1fr;
        min-width: 0;
    }

    .dashboard-hero h1 {
        font-size: 28px;
    }
}

.user-profile-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 16px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: linear-gradient(135deg, #ffffff, #f4f7f9);
    box-shadow: var(--shadow);
}

.user-profile-hero h1 {
    margin-bottom: 8px;
    font-size: 34px;
}

.profile-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.subtext {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
}

.queue-filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
}

.queue-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 18px 0 14px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow-soft);
}

.queue-toolbar form {
    flex: 0 0 auto;
}

.queue-filter-tabs .button {
    min-width: 72px;
    justify-content: center;
}

.queue-state-band {
    margin-bottom: 14px;
    padding: 14px;
}

.queue-state-band .status-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.job-table-wrap {
    overflow-x: auto;
}

.job-table {
    width: 100%;
    min-width: 1220px;
    table-layout: fixed;
}

.job-table th,
.job-table td {
    vertical-align: middle;
    overflow: hidden;
}

.job-table th:nth-child(1),
.job-table td:nth-child(1) {
    width: 56px;
}

.job-table th:nth-child(2),
.job-table td:nth-child(2) {
    width: 235px;
}

.job-table th:nth-child(3),
.job-table td:nth-child(3) {
    width: 160px;
}

.job-table th:nth-child(4),
.job-table td:nth-child(4) {
    width: 110px;
}

.job-table th:nth-child(5),
.job-table td:nth-child(5) {
    width: 82px;
}

.job-table th:nth-child(6),
.job-table td:nth-child(6) {
    width: 82px;
}

.job-table th:nth-child(7),
.job-table td:nth-child(7) {
    width: 360px;
}

.job-table th:nth-child(8),
.job-table td:nth-child(8) {
    width: 156px;
}

.job-table th:nth-child(9),
.job-table td:nth-child(9) {
    width: 128px;
}

.inline-code,
.target-chip {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    min-height: 26px;
    padding: 3px 7px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.job-name-cell {
    min-width: 0;
}

.job-name-cell strong,
.job-stage-content {
    display: block;
    min-width: 0;
    overflow-wrap: anywhere;
}

.job-stage {
    white-space: normal;
}

.job-stage-content .subtext {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.job-name-cell .inline-code {
    margin-top: 5px;
}

.job-actions-cell {
    min-width: 0;
}

.job-row-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.job-row-actions form {
    margin: 0;
}

.queue-protected {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
}

.job-list {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow-soft);
}

.job-list-row {
    display: grid;
    grid-template-columns:
        46px
        minmax(210px, 1.2fr)
        minmax(140px, 0.75fr)
        118px
        70px
        82px
        minmax(320px, 2fr)
        148px
        116px;
    gap: 14px;
    align-items: center;
    min-height: 68px;
    padding: 12px 14px;
    border-top: 1px solid var(--line);
}

.job-list-head {
    min-height: 38px;
    border-top: 0;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}

.job-list-row > * {
    min-width: 0;
}

.job-id,
.job-created {
    white-space: nowrap;
}

.job-stage strong {
    display: block;
    color: var(--text-strong);
    font-size: 13px;
}

.job-list-empty {
    padding: 22px;
    color: var(--muted);
    text-align: center;
}

@media (max-width: 1180px) {
    .compact-hero {
        flex-direction: column;
    }

    .compact-hero .hero-stats,
    .queue-state-band .status-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        min-width: 0;
    }

    .job-list-row {
        grid-template-columns:
            42px
            minmax(190px, 1.2fr)
            minmax(120px, 0.7fr)
            112px
            64px
            76px
            minmax(260px, 1.5fr)
            136px
            108px;
    }
}

@media (max-width: 860px) {
    .queue-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .queue-toolbar form,
    .queue-toolbar button {
        width: 100%;
    }

    .queue-filter-tabs {
        width: 100%;
    }

    .queue-filter-tabs .button {
        flex: 1 1 calc(50% - 8px);
    }

    .job-list-head {
        display: none;
    }

    .job-list-row {
        display: block;
        min-height: 0;
        padding: 14px;
    }

    .job-list-row > div {
        display: flex;
        justify-content: space-between;
        gap: 14px;
        padding: 7px 0;
    }

    .job-list-row > div::before {
        content: attr(data-label);
        flex: 0 0 86px;
        color: var(--muted);
        font-size: 12px;
        font-weight: 900;
    }

    .job-list-row .job-name-cell,
    .job-list-row .job-stage,
    .job-list-row .job-actions-cell {
        display: block;
    }

    .job-list-row .job-name-cell::before,
    .job-list-row .job-stage::before,
    .job-list-row .job-actions-cell::before {
        display: block;
        margin-bottom: 4px;
    }
}

.resource-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.resource-pills span {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    color: var(--text);
    font-size: 12px;
    font-weight: 850;
}

.user-create-form > .section-band:first-of-type {
    margin-top: 0;
}

.form-section {
    box-shadow: var(--shadow-soft);
}

.plan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
}

.plan-card {
    display: grid;
    gap: 14px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow-soft);
}

.plan-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.plan-card h2 {
    margin: 0;
}

.price {
    color: var(--text-strong);
    font-size: 26px;
    line-height: 1.05;
}

.limit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.limit-grid.compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.limit-grid article,
.limit-grid div {
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
}

.limit-grid span,
.limit-grid small {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
}

.limit-grid strong {
    display: block;
    margin-top: 4px;
    color: var(--text-strong);
    font-size: 18px;
}

.limit-editor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.limit-editor {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
}

.checkline.mini {
    margin-top: 6px;
    font-size: 12px;
}

.actions.end {
    justify-content: flex-end;
}

.file-actions {
    flex-wrap: wrap;
    align-items: center;
}

.file-actions form {
    margin: 0;
}

.file-actions select {
    width: auto;
    min-width: 130px;
    max-width: 220px;
}

.file-restore-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(260px, 1fr));
    gap: 14px;
}

.file-restore-card {
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
}

.modal[hidden] {
    display: none;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: grid;
    align-content: start;
    justify-items: center;
    overflow-y: auto;
    padding: 52px 18px;
    background: rgba(10, 15, 21, 0.58);
}

.modal > .section-head,
.modal > .alert,
.modal > form {
    width: min(720px, 100%);
    margin: 0;
    background: var(--surface);
}

.modal > .section-head {
    padding: 18px 18px 10px;
    border: 1px solid var(--line);
    border-bottom: 0;
    border-radius: 8px 8px 0 0;
}

.modal > .alert {
    border-radius: 0;
}

.modal > form {
    padding: 14px 18px;
    border-right: 1px solid var(--line);
    border-left: 1px solid var(--line);
}

.modal > form:last-of-type {
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
    border-radius: 0 0 8px 8px;
    box-shadow: var(--shadow);
}

.modal-close {
    position: absolute;
    top: 18px;
    right: 18px;
    min-height: 32px;
    padding: 5px 10px;
    border: 1px solid rgba(255, 255, 255, 0.34);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    font: inherit;
    font-weight: 900;
    cursor: pointer;
}

/* AblePanel UI4: user-centric layout and non-wrapping search controls */
.panel-main {
    min-width: 0;
    align-items: center;
}

.topbar {
    width: 100%;
}

.content {
    width: min(1600px, calc(100% - 48px));
    max-width: 1600px;
    margin-right: auto;
    margin-left: auto;
}

.side-nav a.active {
    background: #ffffff;
    color: var(--primary);
    box-shadow: inset 3px 0 0 var(--primary);
}

.toolbar {
    width: 100%;
    align-items: center;
}

.toolbar .search-form {
    display: flex;
    flex: 1 1 auto;
    flex-wrap: nowrap;
    align-items: center;
    width: min(860px, 100%);
    max-width: 100%;
    gap: 8px;
}

.toolbar .search-form input {
    flex: 0 1 340px;
    width: 340px;
    min-width: 220px;
    max-width: 340px;
}

.toolbar .search-form select {
    flex: 0 0 170px;
    width: 170px;
    min-width: 150px;
    max-width: 190px;
}

.toolbar .search-form button,
.toolbar .search-form .button {
    flex: 0 0 auto;
    width: auto;
    min-width: 72px;
    white-space: nowrap;
}

@media (max-width: 940px) {
    .content {
        width: 100%;
        padding: 16px;
    }
}

@media (max-width: 720px) {
    .toolbar {
        align-items: stretch;
    }

    .file-restore-grid {
        grid-template-columns: 1fr;
    }

    .toolbar .search-form {
        flex-wrap: wrap;
        width: 100%;
    }

    .toolbar .search-form input,
    .toolbar .search-form select {
        flex: 1 1 100%;
        width: 100%;
        min-width: 0;
        max-width: none;
    }

    .toolbar .search-form button,
    .toolbar .search-form .button {
        width: 100%;
    }
}
