/* ============================================================================
   Human Journey Control Center — premium dark dashboard theme
   All class/ID hooks used by index.html and app.js are preserved.
   ============================================================================ */

:root {
    --bg: #0a0e14;
    --bg-2: #0d131c;
    --surface: #121a25;
    --surface-soft: #16202d;
    --surface-2: #1b2836;
    --ink: #eaf1f8;
    --ink-soft: #c6d3e0;
    --muted: #8a98a8;
    --faint: #5f6d7d;
    --line: rgba(150, 178, 208, 0.14);
    --line-strong: rgba(150, 178, 208, 0.28);
    --accent: #2dd4bf;
    --accent-dark: #16b8a6;
    --accent-ink: #04211d;
    --accent-glow: rgba(45, 212, 191, 0.30);
    --blue: #60a5fa;
    --blue-soft: rgba(96, 165, 250, 0.15);
    --warning: #fbbf24;
    --warning-soft: rgba(251, 191, 36, 0.14);
    --danger: #f87171;
    --danger-soft: rgba(248, 113, 113, 0.15);
    --ok: #34d399;
    --ok-soft: rgba(52, 211, 153, 0.15);
    --shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
    --shadow-sm: 0 12px 30px rgba(0, 0, 0, 0.38);
    --radius: 16px;
    --radius-sm: 11px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    font-family: "Be Vietnam Pro", system-ui, -apple-system, sans-serif;
    background:
        radial-gradient(1200px 640px at 8% -10%, rgba(45, 212, 191, 0.14), transparent 55%),
        radial-gradient(1100px 620px at 108% -6%, rgba(96, 165, 250, 0.12), transparent 52%),
        linear-gradient(180deg, var(--bg-2), var(--bg) 42%);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
}

::selection {
    background: var(--accent-glow);
    color: #fff;
}

/* Elegant thin scrollbars */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--line-strong) transparent;
}

*::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

*::-webkit-scrollbar-thumb {
    background: rgba(150, 178, 208, 0.20);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
    background: rgba(150, 178, 208, 0.34);
    background-clip: padding-box;
}

body.locked .shell {
    filter: blur(10px) saturate(0.8);
    pointer-events: none;
    user-select: none;
}

/* License gate: keep admin panel usable; block automation controls only. */
body.license-locked .left-column,
body.license-locked .status-panel,
body.license-locked .log-panel,
body.license-locked #startRun,
body.license-locked #refreshProfiles {
    opacity: 0.4;
    pointer-events: none;
    filter: grayscale(0.2);
}

.admin-app-body .admin-shell {
    display: block;
}

.admin-only-grid {
    grid-template-columns: 1fr;
}

.admin-full {
    width: min(1100px, 100%);
    margin: 0 auto;
}

body.license-locked #licenseView.auth-shell {
    place-items: center;
    padding-top: 24px;
    background: rgba(8, 12, 18, 0.82);
    backdrop-filter: blur(12px);
    pointer-events: auto;
    z-index: 200;
}

body.license-locked #licenseView .auth-card {
    pointer-events: auto;
}

.license-pill {
    appearance: none;
    border: 1px solid var(--line-strong);
    background: var(--surface-soft);
    color: inherit;
    font: inherit;
    font-size: 12.5px;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: 999px;
    cursor: pointer;
}

.license-pill-warn {
    border-color: rgba(251, 191, 36, 0.55);
    background: var(--warning-soft);
    color: #fde68a;
}

.license-pill-ok {
    border-color: rgba(52, 211, 153, 0.45);
    background: var(--ok-soft);
    color: #a7f3d0;
}

[hidden] {
    display: none !important;
}

/* ---------------------------------------------------------------- Auth ---- */
.auth-shell {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 24px;
    background: radial-gradient(900px 520px at 50% -10%, rgba(45, 212, 191, 0.16), transparent 60%), rgba(8, 12, 18, 0.72);
    backdrop-filter: blur(14px);
}

.auth-card {
    position: relative;
    width: min(430px, 100%);
    padding: 34px 30px 30px;
    border: 1px solid var(--line-strong);
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(24, 34, 47, 0.96), rgba(16, 24, 34, 0.96));
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    overflow: hidden;
}

.license-card {
    width: min(520px, 100%);
}

.machine-id-row {
    display: flex;
    gap: 8px;
}

.machine-id-row input {
    flex: 1;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    letter-spacing: 0.02em;
}

.license-status {
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
    text-align: center;
}

.update-banner {
    position: sticky;
    top: 0;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 10px 16px;
    background: var(--warning-soft);
    border-bottom: 1px solid rgba(251, 191, 36, 0.35);
    color: var(--ink);
    font-size: 13.5px;
    font-weight: 600;
}

.created-license-key {
    margin: 10px 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--ok-soft);
    color: var(--ok);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12.5px;
    word-break: break-all;
}

.admin-row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}

.license-box {
    margin-top: 12px;
}

.auth-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent), var(--blue), transparent);
}

.auth-card h1 {
    margin-bottom: 8px;
    font-size: 26px;
}

.auth-copy {
    margin-bottom: 22px;
    color: var(--muted);
    line-height: 1.6;
    font-size: 13.5px;
}

.auth-submit {
    width: 100%;
    margin-top: 6px;
}

.auth-error {
    min-height: 20px;
    margin: 14px 0 0;
    color: var(--danger);
    font-size: 13px;
    font-weight: 700;
    text-align: center;
}

/* ---------------------------------------------------- Base controls ------- */
button,
input,
textarea,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

h1,
h2,
p {
    margin-top: 0;
}

.shell {
    width: min(1520px, calc(100% - 40px));
    margin: 0 auto;
    padding: 22px 0 40px;
}

/* --------------------------------------------------------------- Topbar --- */
.topbar {
    position: sticky;
    top: 14px;
    z-index: 20;
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto auto;
    gap: 20px;
    align-items: center;
    padding: 16px 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(22, 32, 45, 0.88), rgba(16, 24, 34, 0.86));
    box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(20px);
}

.brand-block {
    position: relative;
    min-width: 0;
    padding-left: 58px;
}

.brand-block::before {
    content: "HJ";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 13px;
    background: linear-gradient(140deg, var(--accent), var(--accent-dark));
    color: var(--accent-ink);
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.5px;
    box-shadow: 0 8px 22px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.eyebrow {
    margin: 0 0 4px;
    color: var(--accent);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.4px;
    text-transform: uppercase;
}

h1 {
    margin: 0;
    font-size: clamp(20px, 2vw, 26px);
    line-height: 1.15;
    letter-spacing: -0.2px;
    color: var(--ink);
}

.run-summary {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    max-width: 560px;
}

.run-summary span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 30px;
    padding: 5px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(150, 178, 208, 0.06);
    color: var(--ink-soft);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

#runStatus {
    background: var(--blue-soft);
    border-color: rgba(96, 165, 250, 0.4);
    color: #bcd6ff;
}

#runStatus::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--blue);
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.22);
}

.topbar-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.button,
.small-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 11px;
    font-weight: 700;
    letter-spacing: 0.1px;
    transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease, border-color 150ms ease, filter 150ms ease;
}

.button {
    min-height: 42px;
    padding: 0 18px;
}

.small-button {
    min-height: 34px;
    padding: 0 12px;
    border-radius: 9px;
    background: rgba(150, 178, 208, 0.08);
    border-color: var(--line);
    color: var(--ink-soft);
    font-size: 12px;
}

.button:hover:not(:disabled),
.small-button:hover:not(:disabled) {
    transform: translateY(-1px);
}

.button:active:not(:disabled),
.small-button:active:not(:disabled) {
    transform: translateY(0);
}

.small-button:hover:not(:disabled) {
    border-color: var(--line-strong);
    background: rgba(150, 178, 208, 0.14);
    color: var(--ink);
}

.primary {
    background: linear-gradient(140deg, var(--accent), var(--accent-dark));
    color: var(--accent-ink);
    box-shadow: 0 10px 24px var(--accent-glow);
}

.primary:hover:not(:disabled) {
    filter: brightness(1.06);
    box-shadow: 0 14px 30px var(--accent-glow);
}

.secondary {
    background: rgba(150, 178, 208, 0.06);
    border-color: var(--line-strong);
    color: var(--ink-soft);
}

.secondary:hover:not(:disabled) {
    background: rgba(150, 178, 208, 0.12);
    color: var(--ink);
}

.button.danger {
    background: linear-gradient(140deg, #fb7185, #ef4444);
    color: #fff;
    box-shadow: 0 10px 24px rgba(239, 68, 68, 0.28);
}

.button.danger:hover:not(:disabled) {
    filter: brightness(1.05);
}

.small-button.danger {
    color: #fecaca;
    border-color: rgba(248, 113, 113, 0.45);
    background: var(--danger-soft);
}

.small-button.danger:hover:not(:disabled) {
    background: rgba(248, 113, 113, 0.24);
    color: #fff;
}

/* ------------------------------------------------------------ Workspace --- */
.workspace-grid {
    display: grid;
    grid-template-columns: minmax(500px, 0.94fr) minmax(480px, 1.06fr);
    gap: 18px;
    margin-top: 18px;
    align-items: start;
}

.left-column,
.right-column {
    display: grid;
    gap: 18px;
    min-width: 0;
}

.right-column {
    position: sticky;
    top: 108px;
}

/* --------------------------------------------------------------- Panels --- */
.panel {
    position: relative;
    min-width: 0;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(20, 30, 42, 0.72), rgba(15, 22, 32, 0.72));
    box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.03);
    overflow: hidden;
}

.panel::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(45, 212, 191, 0.5), transparent);
    opacity: 0.5;
}

.panel-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
}

.compact-head {
    align-items: center;
}

h2 {
    margin-bottom: 4px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.1px;
    color: var(--ink);
}

.panel-head p {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

#profileCount {
    color: var(--muted);
    font-size: 12px;
    margin: 0;
}

.profile-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.secondary-action {
    color: var(--muted);
}

.profiles-panel {
    padding-bottom: 16px;
}

.profile-list {
    display: grid;
    gap: 9px;
    max-height: 380px;
    overflow: auto;
    padding-right: 6px;
}

.profile-card {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 12px 13px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: rgba(150, 178, 208, 0.04);
    transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.profile-card:hover {
    border-color: var(--line-strong);
    background: rgba(150, 178, 208, 0.09);
    transform: translateY(-1px);
}

.profile-card.with-editor {
    grid-template-columns: 22px minmax(0, 1fr) auto;
}

.profile-card input[type="checkbox"] {
    width: 17px;
    height: 17px;
    accent-color: var(--accent);
    cursor: pointer;
}

.profile-card strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13.5px;
    color: var(--ink);
}

.profile-card small {
    display: block;
    overflow-wrap: anywhere;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.4;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 24px;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(150, 178, 208, 0.1);
    border: 1px solid var(--line);
    color: var(--muted);
    font-size: 11px;
    font-style: normal;
    font-weight: 700;
}

.badge.started {
    background: var(--ok-soft);
    border-color: rgba(52, 211, 153, 0.4);
    color: #6ee7b7;
}

.badge.started::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ok);
    box-shadow: 0 0 8px var(--ok);
}

.profile-task-editor {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding-top: 12px;
    margin-top: 2px;
    border-top: 1px dashed var(--line-strong);
}

.profile-task-editor label {
    display: grid;
    gap: 6px;
}

.profile-task-editor span,
.mode-toggle span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.profile-task-editor textarea {
    min-height: 82px;
    font-size: 12px;
}

/* ---------------------------------------------------------------- Forms --- */
.form-grid {
    display: grid;
    gap: 14px;
}

.two-columns {
    grid-template-columns: 1fr 1fr;
}

.textareas {
    align-items: stretch;
}

.field {
    display: grid;
    gap: 8px;
    margin-bottom: 14px;
}

.field span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

input,
textarea,
select {
    width: 100%;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: rgba(9, 14, 20, 0.6);
    color: var(--ink);
    padding: 11px 13px;
    outline: none;
    transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

input::placeholder,
textarea::placeholder {
    color: var(--faint);
}

input:hover,
textarea:hover,
select:hover {
    border-color: var(--line-strong);
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--accent);
    background: rgba(9, 14, 20, 0.85);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

select {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    padding-right: 34px;
}

select option {
    background: var(--surface-2);
    color: var(--ink);
}

textarea {
    min-height: 150px;
    resize: vertical;
    line-height: 1.55;
}

.mode-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 2px 0 14px;
    padding: 12px 13px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: rgba(150, 178, 208, 0.05);
    cursor: pointer;
}

.mode-toggle:hover {
    border-color: var(--line-strong);
}

.mode-toggle input {
    width: 17px;
    height: 17px;
    accent-color: var(--accent);
}

/* ---------------------------------------------------------- AI settings --- */
.ai-settings-panel {
    padding-top: 10px;
    padding-bottom: 10px;
}

.ai-settings-details > summary {
    list-style: none;
    cursor: pointer;
    display: block;
}

.ai-settings-details > summary::-webkit-details-marker {
    display: none;
}

.ai-settings-details > summary .panel-head,
.ai-settings-details > summary > div {
    display: grid;
    gap: 4px;
}

.ai-settings-details > summary h2 {
    margin: 0;
    font-size: 17px;
}

.ai-settings-details > summary p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.ai-settings-details[open] > summary {
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}

.ai-settings-body {
    display: grid;
    gap: 4px;
}

.ai-settings-body textarea {
    min-height: 88px;
}

.ai-settings-hint {
    margin: 0 0 10px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.ai-settings-hint a {
    color: var(--accent);
}

.ai-settings-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.ai-settings-status {
    color: var(--muted);
    font-size: 13px;
}

.ai-settings-status.is-ready {
    color: var(--ok);
}

.ai-settings-status.is-empty {
    color: var(--muted);
}

/* -------------------------------------------------------------- Metrics --- */
.metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.metrics div {
    padding: 14px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: linear-gradient(180deg, rgba(150, 178, 208, 0.07), rgba(150, 178, 208, 0.02));
    text-align: center;
}

.metrics strong {
    display: block;
    font-size: 26px;
    font-weight: 800;
    line-height: 1;
    color: var(--ink);
}

.metrics div:nth-child(3) strong {
    color: var(--ok);
}

.metrics div:nth-child(4) strong {
    color: var(--danger);
}

.metrics span {
    display: block;
    margin-top: 7px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

/* ---------------------------------------------------------------- Admin --- */
.admin-panel {
    display: grid;
    gap: 14px;
}

.admin-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.admin-box {
    min-width: 0;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: rgba(150, 178, 208, 0.04);
}

.admin-box h3 {
    margin: 0 0 10px;
    font-size: 13px;
    color: var(--ink-soft);
}

.admin-form {
    display: grid;
    grid-template-columns: 1fr 1fr auto auto;
    gap: 8px;
    margin-bottom: 10px;
    align-items: center;
}

.admin-form input,
.admin-form select {
    min-height: 36px;
    padding: 8px 10px;
    font-size: 12px;
}

.admin-list {
    display: grid;
    gap: 8px;
    max-height: 220px;
    overflow: auto;
    padding-right: 4px;
}

.admin-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 10px 11px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: rgba(9, 14, 20, 0.4);
}

.admin-row strong {
    display: block;
    overflow-wrap: anywhere;
    font-size: 12px;
    color: var(--ink);
}

.admin-row small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.muted-row {
    opacity: 0.55;
}

.release-form {
    grid-template-columns: 0.75fr 1fr 1fr auto auto;
}

.release-notes {
    min-height: 66px;
    margin-bottom: 10px;
    font-size: 12px;
}

.release-list {
    max-height: 160px;
}

.mini-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.mini-check input {
    width: 15px;
    height: 15px;
    accent-color: var(--accent);
}

.admin-message {
    min-height: 18px;
    margin: 0;
    color: var(--ok);
    font-size: 12px;
    font-weight: 700;
}

.admin-message.error {
    color: var(--danger);
}

/* --------------------------------------------------------- Run monitor --- */
.profile-progress {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
    max-height: 160px;
    overflow: auto;
    padding-right: 6px;
}

.profile-progress-item {
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: rgba(9, 14, 20, 0.4);
    font-size: 12px;
}

.profile-progress-item strong {
    display: block;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12.5px;
    color: var(--ink);
}

.profile-progress-item span {
    color: var(--muted);
}

.jobs,
.events {
    display: grid;
    gap: 10px;
    overflow: auto;
    padding-right: 6px;
}

.jobs {
    max-height: 500px;
}

.events {
    max-height: 300px;
}

.job,
.event {
    padding: 12px 13px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: rgba(9, 14, 20, 0.42);
    font-size: 12px;
}

.event {
    display: grid;
    grid-template-columns: 76px 1fr;
    gap: 12px;
    align-items: start;
}

.event time {
    color: var(--faint);
    font-size: 11px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.job {
    border-left: 3px solid var(--line-strong);
}

.job strong {
    display: block;
    margin-bottom: 5px;
    overflow-wrap: anywhere;
    font-size: 13px;
    color: var(--ink);
}

.job>span,
.job small {
    display: block;
    color: var(--muted);
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.job.done {
    border-left-color: var(--ok);
    background: linear-gradient(90deg, rgba(52, 211, 153, 0.10), rgba(9, 14, 20, 0.42) 34%);
}

.job.failed {
    border-left-color: var(--danger);
    background: linear-gradient(90deg, rgba(248, 113, 113, 0.12), rgba(9, 14, 20, 0.42) 34%);
}

.job.running {
    border-left-color: var(--warning);
    background: linear-gradient(90deg, rgba(251, 191, 36, 0.12), rgba(9, 14, 20, 0.42) 34%);
}

.job.running::after {
    content: "";
    position: absolute;
    width: 8px;
    height: 8px;
}

.job.running strong::after {
    content: "";
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-left: 8px;
    border-radius: 50%;
    background: var(--warning);
    box-shadow: 0 0 8px var(--warning);
    animation: pulse 1.3s ease-in-out infinite;
}

.job.cancelled {
    border-left-color: var(--faint);
    opacity: 0.75;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.35;
        transform: scale(0.75);
    }
}

.job-details {
    margin-top: 10px;
    border-top: 1px solid var(--line);
    padding-top: 10px;
}

.job-details summary {
    cursor: pointer;
    color: var(--accent);
    font-weight: 700;
    font-size: 12px;
}

.job-details summary:hover {
    color: var(--ink);
}

.job-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    margin-top: 10px;
}

.detail-block {
    display: grid;
    gap: 4px;
    min-width: 0;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: rgba(150, 178, 208, 0.04);
}

.detail-block strong {
    margin-bottom: 2px;
    font-size: 11px;
    color: var(--ink-soft);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.detail-block span,
.related-list div {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.related-list {
    display: grid;
    gap: 6px;
    margin-top: 8px;
}

/* --------------------------------------------------------- Responsive ----- */
@media (max-width: 1180px) {
    .topbar {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .run-summary {
        justify-content: flex-start;
        max-width: none;
    }

    .topbar-actions {
        justify-content: flex-start;
    }

    .workspace-grid {
        grid-template-columns: 1fr;
    }

    .right-column {
        position: static;
    }
}

@media (max-width: 720px) {
    .shell {
        width: min(100% - 24px, 680px);
        padding-top: 14px;
    }

    .topbar {
        position: static;
        padding: 14px;
        gap: 12px;
    }

    .brand-block {
        padding-left: 52px;
    }

    .brand-block::before {
        width: 38px;
        height: 38px;
    }

    h1 {
        font-size: 20px;
    }

    .run-summary {
        gap: 6px;
    }

    .run-summary span {
        min-height: 28px;
        padding: 4px 10px;
        font-size: 11px;
    }

    .topbar-actions {
        display: grid;
        grid-template-columns: 1fr 1fr 0.8fr;
        gap: 8px;
        width: 100%;
    }

    .button {
        min-height: 38px;
        padding: 0 10px;
        font-size: 12px;
    }

    .two-columns,
    .profile-task-editor,
    .job-detail-grid,
    .admin-grid,
    .admin-form,
    .release-form {
        grid-template-columns: 1fr;
    }

    .metrics {
        grid-template-columns: repeat(2, 1fr);
    }

    .event {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .profile-list {
        max-height: 340px;
    }

    .jobs {
        max-height: 440px;
    }
}