:root {
    color-scheme: light;
    --canvas: #f2f3f5;
    --surface: #ffffff;
    --surface-subtle: #f7f8f9;
    --surface-strong: #eceff2;
    --ink: #17191f;
    --ink-soft: #3f4550;
    --muted: #6c7380;
    --muted-light: #9aa1ac;
    --line: #d9dde3;
    --line-strong: #bcc2cb;
    --sidebar: #17191f;
    --sidebar-soft: #24272f;
    --sidebar-text: #f6f7f8;
    --sidebar-muted: #aeb4be;
    --phoenix: #d53b32;
    --phoenix-dark: #ad2d27;
    --signal: #087f8c;
    --success: #177a4a;
    --success-bg: #edf8f2;
    --success-line: #a8d8bf;
    --warning: #9a6314;
    --warning-bg: #fff7e8;
    --warning-line: #e9ca8f;
    --danger: #c42d32;
    --danger-dark: #9f2227;
    --danger-bg: #fff1f1;
    --danger-line: #efb5b8;
    --radius: 6px;
    --radius-control: 5px;
    --sidebar-width: 232px;
    --font-ui: "Segoe UI Variable Text", "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
    --font-display: Bahnschrift, "Arial Narrow", "Segoe UI", "PingFang SC", sans-serif;
    --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    overflow-x: hidden;
    background: var(--canvas);
    color: var(--ink);
    font-family: var(--font-ui);
    font-size: 14px;
    line-height: 1.5;
    letter-spacing: 0;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    background: var(--canvas);
    color: var(--ink);
}

::selection {
    background: rgb(213 59 50 / 0.18);
}

button,
input,
select,
textarea {
    margin: 0;
    color: inherit;
    font: inherit;
    letter-spacing: 0;
}

button,
select {
    cursor: pointer;
}

button:disabled {
    cursor: not-allowed;
}

a {
    color: inherit;
    text-decoration: none;
}

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

h1,
h2,
h3 {
    margin-bottom: 0;
    color: var(--ink);
    font-weight: 650;
    line-height: 1.25;
    letter-spacing: 0;
}

h1 {
    font-size: 1.35rem;
}

h2 {
    font-size: 1rem;
}

p {
    color: var(--muted);
}

svg {
    display: block;
    flex: 0 0 auto;
    stroke-width: 1.85;
}

[hidden] {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

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

.mono,
.countdown,
code {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}

.eyebrow,
.section-kicker {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 4px;
    color: var(--muted);
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0;
}

.topbar .eyebrow::before {
    width: 18px;
    height: 2px;
    background: var(--phoenix);
    content: "";
}

.app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    flex-direction: column;
    height: 100vh;
    min-height: 520px;
    padding: 18px 14px 14px;
    border-right: 1px solid #0e1014;
    background: var(--sidebar);
    color: var(--sidebar-text);
}

.sidebar::before {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 3px;
    background: var(--phoenix);
    content: "";
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
    min-height: 40px;
    padding: 2px 6px;
    color: inherit;
    font-family: var(--font-display);
    font-weight: 700;
    white-space: nowrap;
}

.brand-large {
    padding: 0;
    font-size: 1rem;
}

.brand-icon {
    position: relative;
    display: inline-grid;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    place-items: center;
    overflow: hidden;
    border: 1px solid rgb(255 255 255 / 0.14);
    border-radius: var(--radius-control);
    background: var(--phoenix);
    color: #ffffff;
}

.brand-icon::after {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 9px;
    height: 9px;
    border-top: 2px solid var(--sidebar);
    border-left: 2px solid var(--sidebar);
    background: #ffffff;
    content: "";
}

.brand-icon svg {
    width: 17px;
    height: 17px;
}

.side-nav {
    display: grid;
    gap: 4px;
    margin-top: 30px;
}

.nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 42px;
    padding: 9px 11px;
    overflow: hidden;
    border: 1px solid transparent;
    border-radius: var(--radius-control);
    color: var(--sidebar-muted);
    font-size: 0.84rem;
    font-weight: 520;
    transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
}

.nav-link svg {
    width: 17px;
    height: 17px;
}

.nav-link:hover {
    border-color: rgb(255 255 255 / 0.08);
    background: rgb(255 255 255 / 0.045);
    color: #ffffff;
}

.nav-link.active {
    border-color: rgb(255 255 255 / 0.07);
    background: var(--sidebar-soft);
    color: #ffffff;
    font-weight: 650;
}

.nav-link.active::before {
    position: absolute;
    top: 8px;
    bottom: 8px;
    left: 0;
    width: 3px;
    border-radius: 0 2px 2px 0;
    background: var(--phoenix);
    content: "";
}

.sidebar-account {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) 34px;
    align-items: center;
    gap: 9px;
    margin-top: auto;
    padding: 14px 4px 2px;
    border-top: 1px solid rgb(255 255 255 / 0.1);
}

.sidebar-account form {
    margin: 0;
}

.account-mark {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border: 1px solid rgb(255 255 255 / 0.12);
    border-radius: var(--radius-control);
    background: rgb(255 255 255 / 0.04);
    color: var(--sidebar-muted);
}

.account-mark svg {
    width: 15px;
    height: 15px;
}

.account-copy {
    min-width: 0;
}

.account-copy strong,
.account-copy span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-copy strong {
    color: var(--sidebar-text);
    font-size: 0.8rem;
    font-weight: 650;
}

.account-copy span {
    color: var(--sidebar-muted);
    font-size: 0.68rem;
}

.account-copy .account-card-key,
.full-card-key {
    overflow: visible;
    overflow-wrap: anywhere;
    text-overflow: clip;
    white-space: normal;
}

.sidebar .icon-button {
    border-color: rgb(255 255 255 / 0.12);
    background: transparent;
    color: var(--sidebar-muted);
}

.sidebar .icon-button:hover {
    border-color: rgb(255 255 255 / 0.2);
    background: rgb(255 255 255 / 0.06);
    color: #ffffff;
}

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

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 70px;
    padding: 11px 30px;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
}

.topbar > div:first-child,
.title-with-back > div {
    min-width: 0;
}

.topbar h1 {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-meta,
.title-with-back {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
}

.topbar-meta {
    flex: 0 0 auto;
}

.time-meta {
    color: var(--muted);
    font-size: 0.76rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.page-content {
    width: 100%;
    margin: 0;
    padding: 28px clamp(24px, 2.2vw, 48px) 56px;
}

.metric-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    margin-bottom: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--line);
}

.metric {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 3px 16px;
    min-width: 0;
    min-height: 82px;
    padding: 17px 22px;
    background: var(--surface);
}

.metric:first-child::before {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 3px;
    background: var(--phoenix);
    content: "";
}

.metric > span {
    align-self: end;
    color: var(--ink-soft);
    font-size: 13px;
    font-weight: 620;
}

.metric strong {
    grid-row: 1 / span 2;
    grid-column: 2;
    align-self: center;
    color: var(--ink);
    font-family: var(--font-display);
    font-size: 1.65rem;
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.metric small {
    color: var(--muted);
    font-size: 0.69rem;
}

.workspace-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    margin-bottom: 18px;
}

.panel,
.table-section,
.event-section,
.detail-summary {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.panel {
    padding: 24px;
}

.submit-panel {
    position: relative;
    overflow: hidden;
    border-top: 3px solid var(--phoenix);
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-width: 0;
}

.section-heading > div {
    min-width: 0;
}

.section-heading h2 {
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-heading h2::before {
    width: 3px;
    height: 14px;
    border-radius: 2px;
    background: var(--phoenix);
    content: "";
}

.section-heading p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.76rem;
}

.section-heading.compact {
    align-items: flex-start;
}

.record-count {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 0.74rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.task-form,
.stack-form {
    display: grid;
    gap: 18px;
    margin-top: 22px;
}

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

.field {
    display: grid;
    gap: 7px;
    min-width: 0;
    color: var(--ink-soft);
    font-size: 12px;
    font-weight: 620;
}

.field small {
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 400;
    line-height: 1.45;
}

.field .field-error {
    color: var(--danger);
    font-weight: 550;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-control);
    outline: 0;
    background: var(--surface);
    color: var(--ink);
    font-size: 13px;
    font-weight: 430;
    transition: border-color 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
}

input,
select {
    height: 44px;
    padding: 0 12px;
}

select {
    padding-right: 32px;
}

textarea {
    min-height: 172px;
    padding: 10px 11px;
    line-height: 1.55;
    resize: vertical;
}

input::placeholder,
textarea::placeholder {
    color: var(--muted-light);
}

input:hover,
select:hover,
textarea:hover {
    border-color: #9098a4;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--phoenix);
    box-shadow: 0 0 0 3px rgb(213 59 50 / 0.11);
}

input:invalid:not(:placeholder-shown),
textarea:invalid:not(:placeholder-shown) {
    border-color: var(--danger-line);
}

.input-with-icon {
    position: relative;
    display: block;
}

.input-with-icon svg {
    position: absolute;
    top: 50%;
    left: 12px;
    z-index: 1;
    width: 16px;
    height: 16px;
    color: var(--muted);
    pointer-events: none;
    transform: translateY(-50%);
}

.input-with-icon input {
    padding-left: 38px;
}

.form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 9px;
    padding-top: 3px;
}

.button,
.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: var(--radius-control);
    outline: 0;
    font-weight: 620;
    line-height: 1;
    white-space: nowrap;
    transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.button {
    gap: 7px;
    min-height: 40px;
    padding: 0 15px;
    font-size: 13px;
}

.button svg {
    width: 15px;
    height: 15px;
}

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

.button-primary:hover {
    border-color: #2c3038;
    background: #2c3038;
}

.button-secondary,
.button-quiet,
.button:not(.button-primary):not(.button-danger) {
    border-color: var(--line-strong);
    background: var(--surface);
    color: var(--ink);
}

.button-secondary:hover,
.button-quiet:hover,
.button:not(.button-primary):not(.button-danger):hover,
.icon-button:hover {
    border-color: #a7aeb8;
    background: var(--surface-subtle);
}

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

.button-danger:hover {
    border-color: var(--danger-dark);
    background: var(--danger-dark);
}

.button-block {
    width: 100%;
}

.button-small {
    min-height: 31px;
    padding: 0 10px;
    font-size: 0.72rem;
}

.button:disabled {
    opacity: 0.48;
}

.button:focus-visible,
.icon-button:focus-visible,
.nav-link:focus-visible,
.task-link:focus-visible,
.table-primary-link:focus-visible {
    box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--phoenix);
}

.icon-button {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    padding: 0;
    border-color: var(--line);
    background: var(--surface);
    color: var(--ink-soft);
}

.icon-button svg {
    width: 16px;
    height: 16px;
}

.table-section,
.event-section {
    overflow: hidden;
    margin-top: 18px;
}

.workspace-grid + .table-section,
.history-table-section,
.admin-table-section {
    margin-top: 0;
}

.table-heading {
    min-height: 68px;
    padding: 15px 20px;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
}

.history-filter-bar,
.admin-filter-bar {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) 176px 34px;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-subtle);
}

.history-filter-search {
    position: relative;
    min-width: 0;
}

.history-filter-search svg {
    position: absolute;
    top: 50%;
    left: 11px;
    z-index: 1;
    width: 15px;
    height: 15px;
    color: var(--muted);
    pointer-events: none;
    transform: translateY(-50%);
}

.history-filter-search input {
    padding-left: 34px;
    background: var(--surface);
}

.history-status-filter {
    min-width: 0;
}

.history-filter-clear {
    align-self: center;
}

.history-heading-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    min-width: 0;
}

.selection-count {
    color: var(--ink-soft);
    font-size: 0.74rem;
    font-weight: 620;
    white-space: nowrap;
}

.batch-stop-form,
.row-stop-form {
    margin: 0;
}

.row-stop-form {
    display: flex;
    justify-content: flex-end;
}

.select-column {
    width: 42px;
    padding-right: 6px !important;
    padding-left: 14px !important;
    text-align: center !important;
}

.table-checkbox {
    width: 15px;
    height: 15px;
    padding: 0;
    border-radius: 3px;
    accent-color: var(--phoenix);
    vertical-align: middle;
}

.table-checkbox:focus-visible {
    outline: 2px solid var(--phoenix);
    outline-offset: 2px;
}

.table-checkbox:disabled {
    cursor: not-allowed;
    opacity: 0.32;
}

.table-placeholder {
    color: var(--muted-light);
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-color: #b8bec7 transparent;
    scrollbar-width: thin;
}

.table-wrap::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.table-wrap::-webkit-scrollbar-thumb {
    border: 2px solid var(--surface);
    border-radius: 8px;
    background: #b8bec7;
}

.table-wrap table {
    width: 100%;
    min-width: 820px;
    border-collapse: collapse;
    table-layout: auto;
}

.history-table-section table {
    min-width: 880px;
}

.table-wrap th,
.table-wrap td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}

.table-wrap th {
    height: 42px;
    background: var(--surface-subtle);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.table-wrap td {
    height: 54px;
    color: var(--ink-soft);
    font-size: 13px;
}

.table-wrap tbody tr {
    background: var(--surface);
    transition: background-color 100ms ease;
}

.table-wrap tbody tr:hover {
    background: #f8f9fa;
}

.table-wrap tbody tr:last-child td {
    border-bottom: 0;
}

.table-wrap td small {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 0.67rem;
    line-height: 1.35;
    white-space: nowrap;
}

.table-wrap td strong {
    color: var(--ink);
    font-weight: 650;
}

.task-link,
.table-primary-link {
    display: inline-block;
    max-width: 280px;
    overflow: hidden;
    color: var(--ink);
    font-weight: 700;
    text-overflow: ellipsis;
    vertical-align: middle;
    white-space: nowrap;
}

.task-link:hover,
.table-primary-link:hover {
    color: var(--phoenix-dark);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.align-right {
    text-align: right !important;
}

.empty-cell {
    height: 112px !important;
    color: var(--muted) !important;
    text-align: center !important;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 23px;
    padding: 2px 7px;
    border: 1px solid;
    border-radius: 4px;
    font-size: 0.67rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.status-running,
.status-success {
    border-color: var(--success-line);
    background: var(--success-bg);
    color: var(--success);
}

.status-warning,
.status-queued {
    border-color: var(--warning-line);
    background: var(--warning-bg);
    color: var(--warning);
}

.status-error,
.status-stopped {
    border-color: var(--danger-line);
    background: var(--danger-bg);
    color: var(--danger);
}

.countdown {
    display: inline-block;
    color: var(--ink);
    font-size: 0.79rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.countdown.large {
    font-size: 1.08rem;
}

.alert {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    min-height: 40px;
    margin-bottom: 12px;
    padding: 10px 12px;
    border: 1px solid;
    border-left-width: 3px;
    border-radius: var(--radius-control);
    font-size: 0.77rem;
    line-height: 1.45;
}

.alert svg {
    width: 16px;
    height: 16px;
    margin-top: 1px;
}

.alert-error {
    border-color: var(--danger-line);
    border-left-color: var(--danger);
    background: var(--danger-bg);
    color: var(--danger);
}

.alert-success {
    border-color: var(--success-line);
    border-left-color: var(--success);
    background: var(--success-bg);
    color: var(--success);
}

.alert-warning {
    border-color: var(--warning-line);
    border-left-color: var(--warning);
    background: var(--warning-bg);
    color: var(--warning);
}

.detail-summary {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    background: var(--line);
}

.detail-summary > div {
    display: grid;
    align-content: center;
    gap: 5px;
    min-width: 0;
    min-height: 82px;
    padding: 13px 16px;
    background: var(--surface);
}

.detail-summary > div:first-child {
    box-shadow: inset 3px 0 0 var(--phoenix);
}

.detail-summary > div > span {
    color: var(--muted);
    font-size: 0.69rem;
}

.detail-summary > div > small {
    overflow: hidden;
    color: var(--muted);
    font-size: 0.67rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.detail-summary strong {
    overflow: hidden;
    color: var(--ink);
    font-size: 0.84rem;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.failure-cell {
    max-width: 280px;
    overflow: hidden;
    color: var(--danger);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.event-section {
    margin-bottom: 0;
}

.event-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.event-list li {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) auto;
    align-items: center;
    gap: 11px;
    min-height: 56px;
    padding: 8px 18px;
    border-bottom: 1px solid var(--line);
}

.event-list li:last-child {
    border-bottom: 0;
}

.event-icon {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: var(--radius-control);
    background: var(--surface-subtle);
    color: var(--phoenix);
}

.event-icon svg {
    width: 14px;
    height: 14px;
}

.event-list strong,
.event-list span {
    display: block;
}

.event-list strong {
    font-size: 0.77rem;
    font-weight: 650;
}

.event-list div > span {
    margin-top: 2px;
    color: var(--muted);
    font-size: 0.67rem;
}

.event-list code {
    padding: 3px 6px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--surface-subtle);
    color: var(--muted);
    font-size: 0.65rem;
    white-space: nowrap;
}

.login-body {
    min-height: 100vh;
    background: var(--surface);
}

.login-shell {
    display: grid;
    grid-template-columns: minmax(360px, 0.82fr) minmax(440px, 1.18fr);
    min-height: 100vh;
    background: var(--surface);
}

.login-context,
.login-form-panel {
    padding: 48px 64px;
}

.login-context {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 0;
    background: var(--sidebar);
    color: #ffffff;
}

.login-context::before {
    position: absolute;
    top: 0;
    right: 0;
    width: 5px;
    height: 34%;
    background: var(--phoenix);
    content: "";
}

.login-context::after {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 72px;
    height: 72px;
    border-top: 1px solid rgb(255 255 255 / 0.12);
    border-left: 1px solid rgb(255 255 255 / 0.12);
    content: "";
}

.login-context .brand {
    position: relative;
    z-index: 1;
    color: #ffffff;
}

.login-heading-group {
    position: relative;
    z-index: 1;
    margin: auto 0;
}

.login-heading-group .eyebrow {
    margin-bottom: 14px;
    color: #c8cdd5;
}

.login-heading-group h1 {
    max-width: 520px;
    margin-bottom: 0;
    color: #ffffff;
    font-family: var(--font-display);
    font-size: 4.25rem;
    font-weight: 700;
    line-height: 0.94;
}

.login-heading-group::after {
    display: block;
    width: 76px;
    height: 3px;
    margin-top: 24px;
    background: var(--phoenix);
    content: "";
}

.login-form-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    background: var(--surface);
}

.login-form-panel > * {
    width: min(390px, 100%);
    margin-right: auto;
    margin-left: auto;
}

.login-form-panel h2 {
    margin-bottom: 23px;
    font-size: 1.35rem;
}

.login-form-panel .stack-form {
    margin-top: 0;
}

.login-help {
    margin-top: 17px;
    margin-bottom: 0;
    color: var(--muted);
    font-size: 0.7rem;
    text-align: center;
}

.login-help a:hover {
    color: var(--phoenix-dark);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.admin-shell {
    --sidebar-width: 240px;
}

.admin-role-mark {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--ink-soft);
    font-size: 0.76rem;
    font-weight: 650;
}

.admin-role-mark svg {
    width: 16px;
    height: 16px;
    color: var(--phoenix);
}

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

.admin-setting-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 24px;
    margin-bottom: 18px;
    padding: 17px 20px;
    border-left: 3px solid var(--phoenix-flare);
}

.admin-setting-copy {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.admin-setting-copy h2,
.admin-setting-copy p {
    margin: 0;
}

.admin-setting-copy h2 {
    color: var(--ink);
    font-size: 0.96rem;
}

.admin-setting-copy p {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.74rem;
    line-height: 1.5;
}

.admin-setting-mark {
    display: inline-flex;
    flex: 0 0 36px;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid #ffccc7;
    border-radius: var(--radius-control);
    background: #fff2f0;
    color: var(--phoenix-flare);
}

.admin-setting-mark svg {
    width: 17px;
    height: 17px;
}

.admin-setting-form {
    display: grid;
    grid-template-columns: 210px auto;
    align-items: end;
    gap: 10px;
}

.admin-setting-field input {
    font-variant-numeric: tabular-nums;
}

.admin-setting-toggle-form {
    grid-template-columns: minmax(180px, auto) auto;
    align-items: center;
}

.setting-toggle-control {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 36px;
    color: var(--ink-soft);
    font-size: 0.78rem;
    font-weight: 650;
    cursor: pointer;
    white-space: nowrap;
}

.setting-toggle-control input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.setting-toggle-track {
    position: relative;
    display: inline-flex;
    flex: 0 0 42px;
    width: 42px;
    height: 24px;
    padding: 3px;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: var(--surface-strong);
    transition: background-color 160ms ease, border-color 160ms ease;
}

.setting-toggle-track > span {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--surface);
    box-shadow: 0 1px 3px rgb(23 25 31 / 0.22);
    transition: transform 160ms ease;
}

.setting-toggle-control input:checked + .setting-toggle-track {
    border-color: var(--signal);
    background: var(--signal);
}

.setting-toggle-control input:checked + .setting-toggle-track > span {
    transform: translateX(18px);
}

.setting-toggle-control input:focus-visible + .setting-toggle-track {
    outline: 2px solid var(--signal);
    outline-offset: 2px;
}

.admin-overview-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.2fr);
    gap: 18px;
}

.admin-overview-grid .table-section {
    min-width: 0;
    margin-top: 0;
}

.admin-compact-table {
    min-width: 380px !important;
}

.admin-form-panel {
    margin-bottom: 18px;
}

.admin-form-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(120px, 1fr)) auto;
    align-items: end;
    gap: 12px;
    margin-top: 20px;
}

.admin-form-action {
    display: flex;
    align-items: flex-end;
    min-height: 40px;
}

.admin-form-action .button {
    width: 100%;
}

.generated-keys-panel {
    margin-bottom: 18px;
    border-top: 3px solid var(--success);
}

.generated-key-list {
    display: grid;
    gap: 6px;
    max-height: 260px;
    margin-top: 15px;
    overflow-y: auto;
}

.generated-key-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 34px;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 7px 8px 7px 11px;
    border: 1px solid var(--line);
    border-radius: var(--radius-control);
    background: var(--surface-subtle);
}

.generated-key-row code {
    overflow: visible;
    overflow-wrap: anywhere;
    color: var(--ink);
    font-size: 0.78rem;
    white-space: normal;
}

.admin-wide-table {
    min-width: 1240px !important;
}

.admin-node-table {
    min-width: 1120px !important;
}

.admin-script-table {
    min-width: 780px !important;
}

.admin-execution-script-table {
    min-width: 960px !important;
}

.admin-execution-table {
    min-width: 1340px !important;
}

.table-heading-actions,
.table-sort-form,
.table-pagination {
    display: flex;
    align-items: center;
}

.table-heading-actions {
    gap: 10px;
}

.table-sort-form {
    gap: 6px;
}

.table-sort-form select {
    width: 190px;
    height: 34px;
    padding-block: 0;
    font-size: 0.73rem;
}

.table-sort-form .icon-button {
    width: 34px;
    height: 34px;
}

.table-pagination {
    justify-content: flex-end;
    gap: 8px;
    min-height: 52px;
    padding: 8px 14px;
    border-top: 1px solid var(--line);
    background: var(--surface-subtle);
}

.pagination-label {
    min-width: 94px;
    color: var(--ink-soft);
    font-size: 0.73rem;
    text-align: center;
    white-space: nowrap;
}

.pagination-disabled {
    opacity: 0.34;
    pointer-events: none;
}

.load-cell {
    min-width: 128px;
    white-space: nowrap;
}

.load-meter {
    width: 76px;
    height: 8px;
    margin-right: 7px;
    vertical-align: middle;
    accent-color: var(--warning);
}

.inline-control-form {
    display: inline-grid;
    grid-template-columns: 68px 30px;
    align-items: center;
    gap: 5px;
    margin: 0;
}

.inline-control-form input {
    height: 30px;
    padding: 0 7px;
    font-size: 0.73rem;
}

.inline-control-form .icon-button {
    width: 30px;
    height: 30px;
}

.table-action-group {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.type-badge {
    display: inline-block;
    min-width: 50px;
    padding: 3px 6px;
    border: 1px solid var(--line-strong);
    border-radius: 4px;
    background: var(--surface-strong);
    color: var(--ink-soft);
    font-family: var(--font-mono);
    font-size: 0.66rem;
    font-weight: 700;
    text-align: center;
}

.truncate-cell {
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.result-count {
    display: inline-block;
    margin-right: 7px;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 700;
    white-space: nowrap;
}

.result-success {
    color: var(--success);
}

.result-failed {
    color: var(--danger);
}

@media (max-width: 1240px) {
    .admin-form-grid {
        grid-template-columns: repeat(3, minmax(140px, 1fr));
    }

    .admin-form-action .button {
        width: auto;
    }
}

@media (max-width: 1100px) {
    .detail-summary {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .admin-overview-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .login-context,
    .login-form-panel {
        padding: 42px;
    }
}

@media (max-width: 780px) {
    .app-shell {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto minmax(0, 1fr);
    }

    .sidebar {
        position: sticky;
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        align-items: center;
        gap: 10px;
        width: 100%;
        height: auto;
        min-height: 0;
        padding: 9px 13px;
        border-right: 0;
        border-bottom: 1px solid #0e1014;
    }

    .sidebar::before {
        top: auto;
        right: auto;
        bottom: 0;
        width: 76px;
        height: 3px;
    }

    .brand {
        min-height: 36px;
        padding: 0;
    }

    .brand-icon {
        flex-basis: 32px;
        width: 32px;
        height: 32px;
    }

    .side-nav {
        display: flex;
        justify-content: center;
        gap: 4px;
        margin: 0;
    }

    .nav-link {
        min-height: 36px;
        padding: 7px 9px;
    }

    .nav-link.active::before {
        top: auto;
        right: 9px;
        bottom: 0;
        left: 9px;
        width: auto;
        height: 2px;
    }

    .sidebar-account {
        display: block;
        margin: 0;
        padding: 0;
        border: 0;
    }

    .account-mark,
    .account-copy {
        display: none;
    }

    .topbar {
        position: relative;
        min-height: 62px;
        padding: 10px 16px;
    }

    .page-content {
        padding: 18px 15px 38px;
    }

    .metric {
        display: block;
        min-height: 68px;
        padding: 12px;
        text-align: center;
    }

    .metric > span,
    .metric strong,
    .metric small {
        display: block;
    }

    .metric strong {
        margin: 5px 0 3px;
        font-size: 1.4rem;
    }

    .field-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .history-filter-bar,
    .admin-filter-bar {
        grid-template-columns: minmax(0, 1fr) minmax(136px, 0.48fr) 34px;
    }

    .login-shell {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: 230px minmax(0, 1fr);
    }

    .login-context,
    .login-form-panel {
        padding: 28px 24px;
    }

    .login-context::before {
        top: auto;
        right: auto;
        bottom: 0;
        left: 24px;
        width: 86px;
        height: 4px;
    }

    .login-context::after {
        display: none;
    }

    .login-heading-group {
        margin: auto 0 0;
    }

    .login-heading-group .eyebrow {
        display: none;
    }

    .login-heading-group h1 {
        font-size: 3rem;
    }

    .login-heading-group::after {
        display: none;
    }

    .login-form-panel {
        justify-content: flex-start;
    }

    .event-list li {
        grid-template-columns: 30px minmax(0, 1fr);
        padding: 9px 14px;
    }

    .event-list code {
        grid-column: 2;
        justify-self: start;
        white-space: normal;
    }

    .admin-metric-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-setting-panel {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
    }

    .admin-setting-form {
        grid-template-columns: minmax(0, 1fr) auto;
    }

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

    .server-script-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .table-heading-actions {
        justify-content: space-between;
        width: 100%;
    }

    .table-sort-form select {
        width: min(190px, 48vw);
    }
}

@media (max-width: 560px) {
    .brand > span:last-child {
        display: none;
    }

    .admin-side-nav .nav-link span {
        display: none;
    }

    .admin-side-nav .nav-link {
        width: 36px;
        justify-content: center;
        padding-inline: 0;
    }

    .topbar {
        gap: 10px;
    }

    .topbar .eyebrow,
    .time-meta,
    .admin-role-mark {
        display: none;
    }

    .metric small {
        display: none;
    }

    .panel {
        padding: 16px;
    }

    .section-heading {
        align-items: flex-start;
    }

    .table-heading {
        min-height: 58px;
        padding: 12px 14px;
    }

    .table-heading > .button {
        width: 34px;
        padding: 0;
    }

    .table-heading > .button span {
        display: none;
    }

    .history-table-section .table-heading {
        align-items: stretch;
        flex-direction: column;
        gap: 10px;
    }

    .history-heading-actions {
        justify-content: space-between;
        width: 100%;
    }

    .history-heading-actions .button {
        width: auto;
        padding: 0 10px;
    }

    .history-heading-actions .button span {
        display: inline;
    }

    .history-filter-bar,
    .admin-filter-bar {
        grid-template-columns: minmax(0, 1fr) 34px;
        padding: 9px 10px;
    }

    .history-status-filter,
    .admin-filter-bar .history-status-filter {
        grid-row: 2;
        grid-column: 1 / -1;
    }

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

    .detail-summary > div {
        min-height: 72px;
        padding: 11px 12px;
    }

    .detail-summary > div:last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }

    .form-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .form-actions .button-primary {
        width: 100%;
    }

    .admin-form-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .admin-setting-form {
        grid-template-columns: minmax(0, 1fr);
    }

    .admin-setting-form .button {
        width: 100%;
    }

    .admin-form-action .button {
        width: 100%;
    }

    .generated-keys-panel .section-heading {
        flex-direction: column;
        gap: 10px;
    }

    .generated-keys-panel .section-heading .button {
        align-self: flex-start;
    }
}

@media (max-width: 390px) {
    .sidebar {
        padding-inline: 10px;
    }

    .nav-link {
        gap: 6px;
        padding-inline: 8px;
        font-size: 0.76rem;
    }

    .nav-link svg {
        width: 15px;
        height: 15px;
    }

    .topbar h1 {
        font-size: 1.08rem;
    }

    .topbar .button {
        min-height: 34px;
        padding-inline: 10px;
    }

    .title-with-back {
        gap: 7px;
    }

    .metric {
        padding: 11px 6px;
    }

    .metric > span {
        font-size: 0.69rem;
        white-space: nowrap;
    }

    .metric strong {
        font-size: 1.22rem;
    }

    .login-heading-group h1 {
        font-size: 2.6rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}

/* Ant Design-inspired visual system with a SHENLONG brand accent. */
:root {
    --ant-primary: #1677ff;
    --ant-primary-hover: #4096ff;
    --ant-primary-active: #0958d9;
    --ant-primary-soft: #e6f4ff;
    --phoenix-flare: #e7473e;
    --canvas: #f5f5f5;
    --surface: #ffffff;
    --surface-subtle: #fafafa;
    --surface-strong: #f0f0f0;
    --ink: #1f1f1f;
    --ink-soft: #434343;
    --muted: #737373;
    --muted-light: #bfbfbf;
    --line: #f0f0f0;
    --line-strong: #d9d9d9;
    --sidebar: #ffffff;
    --sidebar-soft: #e6f4ff;
    --sidebar-text: #262626;
    --sidebar-muted: #595959;
    --phoenix: #1677ff;
    --phoenix-dark: #0958d9;
    --success: #389e0d;
    --success-bg: #f6ffed;
    --success-line: #b7eb8f;
    --warning: #d48806;
    --warning-bg: #fffbe6;
    --warning-line: #ffe58f;
    --danger: #ff4d4f;
    --danger-dark: #cf1322;
    --danger-bg: #fff2f0;
    --danger-line: #ffccc7;
    --radius: 8px;
    --radius-control: 6px;
}

::selection {
    background: rgb(22 119 255 / 0.18);
}

.sidebar {
    border-right-color: var(--line);
    background: var(--sidebar);
    box-shadow: 2px 0 8px rgb(0 0 0 / 0.025);
    color: var(--sidebar-text);
}

.sidebar::before {
    background: var(--ant-primary);
}

.sidebar .brand {
    color: var(--ink);
}

.brand-icon {
    border-color: #91caff;
    background: var(--ant-primary);
    box-shadow: 0 2px 5px rgb(22 119 255 / 0.18);
}

.brand-icon::after {
    border-color: #ffffff;
    background: var(--phoenix-flare);
}

.nav-link {
    color: var(--sidebar-muted);
}

.nav-link:hover {
    border-color: transparent;
    background: #f5f5f5;
    color: var(--ink);
}

.nav-link.active {
    border-color: transparent;
    background: var(--ant-primary-soft);
    color: var(--ant-primary);
}

.nav-link.active::before {
    background: var(--ant-primary);
}

.sidebar-account {
    border-top-color: var(--line);
}

.account-mark {
    border-color: var(--line-strong);
    background: var(--surface-subtle);
    color: var(--muted);
}

.sidebar .icon-button {
    border-color: var(--line-strong);
    background: var(--surface);
    color: var(--muted);
}

.sidebar .icon-button:hover {
    border-color: #91caff;
    background: var(--ant-primary-soft);
    color: var(--ant-primary);
}

.topbar {
    box-shadow: 0 2px 8px rgb(0 0 0 / 0.025);
}

.topbar .eyebrow::before,
.section-heading h2::before,
.metric:first-child::before {
    background: var(--ant-primary);
}

.panel,
.table-section,
.event-section,
.detail-summary {
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.02), 0 4px 12px rgb(0 0 0 / 0.025);
}

.submit-panel {
    border-top-color: var(--ant-primary);
}

.detail-summary > div:first-child {
    box-shadow: inset 3px 0 0 var(--ant-primary);
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--ant-primary);
    box-shadow: 0 0 0 2px rgb(5 145 255 / 0.1);
}

.button-primary {
    border-color: var(--ant-primary);
    background: var(--ant-primary);
    box-shadow: 0 2px 0 rgb(5 145 255 / 0.1);
}

.button-primary:hover {
    border-color: var(--ant-primary-hover);
    background: var(--ant-primary-hover);
}

.button-primary:active {
    border-color: var(--ant-primary-active);
    background: var(--ant-primary-active);
}

.button-danger {
    border-color: var(--danger);
    background: var(--danger);
}

.button-danger:hover {
    border-color: var(--danger-dark);
    background: var(--danger-dark);
}

.button:focus-visible,
.icon-button:focus-visible,
.nav-link:focus-visible,
.task-link:focus-visible,
.table-primary-link:focus-visible {
    box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ant-primary);
}

.table-checkbox {
    accent-color: var(--ant-primary);
}

.task-link:hover,
.table-primary-link:hover {
    color: var(--ant-primary-active);
}

.event-icon {
    color: var(--ant-primary);
}

.login-body {
    background: var(--surface);
}

.login-context {
    isolation: isolate;
    border-right: 1px solid #d6e4ff;
    background: #f4f8ff;
    color: var(--ink);
}

.login-context::before {
    top: 0;
    right: 0;
    bottom: 0;
    width: 4px;
    height: auto;
    background: var(--ant-primary);
}

.login-context::after {
    right: 46px;
    bottom: 42px;
    width: 112px;
    height: 112px;
    border-color: rgb(22 119 255 / 0.18);
}

.login-context .brand {
    color: var(--ink);
}

.login-heading-group {
    z-index: 3;
    margin: auto 0 10%;
}

.login-heading-group .eyebrow {
    color: var(--ant-primary);
}

.login-heading-group h1 {
    color: var(--ink);
    font-size: 4.35rem;
    font-weight: 760;
}

.login-heading-group::after {
    background: var(--phoenix-flare);
}

.login-form-panel {
    border-left: 1px solid var(--line);
    background: var(--surface);
}

.login-form-panel > * {
    width: min(404px, 100%);
}

.login-form-panel h2 {
    font-size: 1.55rem;
    font-weight: 650;
}

.login-form-panel input,
.login-form-panel .button {
    min-height: 42px;
}

.login-visual {
    position: absolute;
    inset: 12% 5% 24% 5%;
    z-index: 1;
    overflow: hidden;
    pointer-events: none;
}

.phoenix-ring {
    position: absolute;
    display: block;
    border: 1px solid rgb(22 119 255 / 0.18);
    border-radius: 50%;
}

.ring-one {
    top: 8%;
    left: 3%;
    width: 82%;
    height: 46%;
    transform: rotate(-12deg);
}

.ring-two {
    top: 26%;
    left: 22%;
    width: 62%;
    height: 36%;
    border-color: rgb(231 71 62 / 0.16);
    transform: rotate(22deg);
}

.phoenix-feather {
    position: absolute;
    left: 33%;
    display: block;
    width: 49%;
    height: 10%;
    border: 1px solid rgb(22 119 255 / 0.2);
    background: rgb(22 119 255 / 0.075);
    clip-path: polygon(0 50%, 86% 0, 100% 50%, 86% 100%);
    transform-origin: left center;
}

.feather-one {
    top: 29%;
    transform: rotate(-34deg);
}

.feather-two {
    top: 39%;
    transform: rotate(-18deg);
}

.feather-three {
    top: 49%;
    transform: rotate(0deg);
}

.feather-four {
    top: 59%;
    background: rgb(9 88 217 / 0.08);
    transform: rotate(19deg);
}

.feather-five {
    top: 69%;
    border-color: rgb(231 71 62 / 0.22);
    background: rgb(231 71 62 / 0.07);
    transform: rotate(38deg);
}

.visual-flame {
    position: absolute;
    top: 42%;
    left: 23%;
    display: grid;
    width: 58px;
    height: 58px;
    padding: 14px;
    border: 1px solid #91caff;
    border-radius: 50%;
    background: #ffffff;
    color: var(--phoenix-flare);
    box-shadow: 0 8px 24px rgb(22 119 255 / 0.12);
}

.flight-node {
    position: absolute;
    display: block;
    width: 8px;
    height: 8px;
    border: 2px solid #ffffff;
    border-radius: 2px;
    background: var(--ant-primary);
    box-shadow: 0 0 0 1px #91caff;
}

.node-one {
    top: 19%;
    right: 12%;
}

.node-two {
    right: 23%;
    bottom: 16%;
    background: var(--phoenix-flare);
    box-shadow: 0 0 0 1px #ffaaa5;
}

@media (max-width: 780px) {
    .sidebar {
        border-bottom-color: var(--line);
    }

    .login-shell {
        grid-template-rows: 270px minmax(0, 1fr);
    }

    .login-context {
        border-right: 0;
        border-bottom: 1px solid #d6e4ff;
    }

    .login-context::before {
        top: auto;
        right: auto;
        bottom: 0;
        left: 24px;
        width: 96px;
        height: 4px;
    }

    .login-context::after {
        display: block;
        right: 22px;
        bottom: 20px;
        width: 60px;
        height: 60px;
    }

    .login-heading-group {
        margin: auto 0 0;
    }

    .login-heading-group h1 {
        font-size: 3rem;
    }

    .login-heading-group::after {
        display: block;
        width: 58px;
        height: 3px;
        margin-top: 14px;
    }

    .login-visual {
        inset: 18px 18px 42px 36%;
        opacity: 0.8;
    }

    .phoenix-feather {
        left: 22%;
        width: 65%;
        height: 9%;
    }

    .visual-flame {
        top: 38%;
        left: 8%;
        width: 42px;
        height: 42px;
        padding: 10px;
    }

    .login-form-panel {
        border-left: 0;
    }
}

@media (max-width: 560px) {
    .login-context,
    .login-form-panel {
        padding-right: 22px;
        padding-left: 22px;
    }

    .login-heading-group h1 {
        font-size: 2.75rem;
    }

    .login-visual {
        right: 10px;
    }

    .login-context .brand > span:last-child {
        display: inline;
    }
}
