@font-face {
    font-family: "IBM Plex Sans";
    src: url("/assets/fonts/ibm-plex-sans-400.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "IBM Plex Sans";
    src: url("/assets/fonts/ibm-plex-sans-500.woff2") format("woff2");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "IBM Plex Sans";
    src: url("/assets/fonts/ibm-plex-sans-600.woff2") format("woff2");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "IBM Plex Mono";
    src: url("/assets/fonts/ibm-plex-mono-400.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "IBM Plex Mono";
    src: url("/assets/fonts/ibm-plex-mono-500.woff2") format("woff2");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

:root {
    --ink: #171717;
    --text: #525252;
    --muted: #737373;
    --paper: #fafafa;
    --card: #ffffff;
    --raised: #f4f4f5;
    --line: rgba(23, 23, 23, 0.08);
    --section-line: rgba(23, 23, 23, 0.14);
    --work: #efeff1;
    --rail: #121212;
    --rail-text: #ededed;
    --rail-muted: #a1a1a6;
    --rail-raised: #232325;
    --accent: #f81090;
    --danger: #dc2626;
    --ok: #16a34a;
    --sans: "IBM Plex Sans", "Segoe UI", sans-serif;
    --mono: "IBM Plex Mono", ui-monospace, monospace;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --rail-w: 240px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
    min-height: 100vh;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 15px;
    line-height: 22px;
    font-weight: 400;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 2px;
}
.skip {
    position: absolute;
    left: 16px;
    top: 8px;
    transform: translateY(-120%);
    background: var(--card);
    padding: 8px 12px;
    z-index: 5;
}
.skip:focus { transform: none; }

.login-body { background: var(--paper); }
.login-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(280px, 440px) minmax(320px, 1fr);
}
.login-brand {
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 32px;
}
.login-brand img { width: min(280px, 70%); height: auto; }
.login-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    justify-self: center;
    width: min(440px, 100%);
    padding: 48px 32px;
}
h1 {
    margin: 0;
    font-size: 32px;
    line-height: 1.15;
    font-weight: 500;
    letter-spacing: 0;
}
.lede {
    margin: 12px 0 0;
    color: var(--text);
    max-width: none;
}
.form-error {
    margin: 20px 0 0;
    color: var(--danger);
}
.login-panel form { margin-top: 32px; display: flex; flex-direction: column; gap: 8px; }
.pick-list { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.section-nav,
.section-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 16px;
    padding: 6px;
    background: var(--card);
    border: 1px solid var(--section-line);
    border-radius: 14px;
}
.section-nav a,
.section-tabs a {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 12px;
    border-radius: 9px;
    color: var(--text);
    background: transparent;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
}
.section-nav a:hover,
.section-tabs a:hover {
    color: var(--ink);
    background: var(--raised);
}
.section-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: thin;
}
.section-tabs a { flex: none; }
.section-tabs a.is-active {
    color: #fff;
    background: var(--ink);
    box-shadow: inset 3px 0 0 var(--accent);
}
.section-tabs a.is-active:hover {
    color: #fff;
    background: #000;
}
.section-tabs a.is-active:focus-visible { outline-color: var(--accent); }
.tab-panel {
    width: 100%;
    min-width: 0;
    background: var(--work);
    border: 1px solid var(--section-line);
    border-radius: 16px;
    padding: 16px;
}
.tab-panel > .table-wrap,
.tab-panel > .status-card,
.tab-panel > .catalog-group,
.tab-panel > ul,
.tab-panel > .action-form {
    width: 100%;
}
.action-form { margin-top: 24px; max-width: 32rem; display: flex; flex-direction: column; gap: 8px; }
.tab-panel > .action-form {
    max-width: none;
    margin-top: 16px;
    background: var(--card);
    border: 1px solid var(--section-line);
    border-radius: 14px;
    padding: 8px 18px 20px;
}
.tab-panel > .action-form button[type="submit"] { align-self: flex-start; min-width: 180px; }
.tab-panel > .action-form input,
.tab-panel > .action-form select,
.tab-panel > .action-form textarea { max-width: 36rem; width: 100%; }
.check { display: flex; gap: 8px; align-items: flex-start; margin-top: 8px; }
.check input { width: 16px; height: 16px; margin-top: 2px; padding: 0; flex: none; }
label { font-size: 13px; line-height: 20px; color: var(--text); margin-top: 8px; }
input, select, textarea {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--card);
    padding: 8px 12px;
}
input, select { height: 44px; }
textarea { min-height: 96px; resize: vertical; }
.num {
    font-family: var(--mono);
    text-align: right;
    font-variant-numeric: tabular-nums;
}
button, .text-link {
    border-radius: 8px;
}
button[type="submit"] {
    margin-top: 16px;
    height: 44px;
    border: 0;
    background: var(--ink);
    color: #fff;
    cursor: pointer;
    transition: background-color 160ms var(--ease), transform 120ms var(--ease);
}
button[type="submit"]:hover { background: #000; }
button[type="submit"]:active { transform: scale(0.98); }

.shell { min-height: 100vh; display: grid; grid-template-columns: var(--rail-w) 1fr; }
.rail {
    background: var(--rail);
    color: var(--rail-text);
    display: flex;
    flex-direction: column;
    padding: 16px 12px 16px;
    height: 100vh;
    position: sticky;
    top: 0;
    overflow: auto;
}
.brand { display: block; padding: 8px 8px 16px; }
.brand img { width: 80px; height: auto; }
.rail nav { display: flex; flex-direction: column; gap: 4px; }
.nav-label {
    margin: 16px 8px 4px;
    color: var(--rail-muted);
    font-size: 12px;
    line-height: 16px;
}
.nav-label:first-child { margin-top: 0; }
.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 0 8px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--rail-muted);
}
.nav-link .icon { flex: 0 0 16px; }
.nav-link.is-active {
    color: var(--rail-text);
    background: var(--rail-raised);
    box-shadow: inset 2px 0 0 var(--accent);
}
.nav-link:hover { color: var(--rail-text); }
.rail-foot { margin-top: auto; padding-top: 24px; }
.who, .who-role { margin: 0 8px; }
.who { font-size: 14px; line-height: 20px; }
.who-role { margin-top: 4px; color: var(--rail-muted); font-size: 12px; line-height: 16px; }
.rail-foot .nav-link { margin-top: 8px; }
.exit-form { margin: 0; }
.rail-foot button.nav-exit {
    width: 100%;
    margin-top: 8px;
    height: auto;
    min-height: 36px;
    padding: 0 8px;
    border: 0;
    background: transparent;
    color: var(--rail-muted);
    cursor: pointer;
    justify-content: flex-start;
}
.rail-foot button.nav-exit:hover { background: transparent; color: var(--rail-text); }
.rail-foot button.nav-exit:active { transform: none; }
.lang-switch, .login-lang {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
}
.lang-switch { margin: 0 8px 12px; }
.login-lang { margin: 0 0 24px; max-width: 280px; }
.lang-switch .lang-link, .login-lang .lang-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
}
.lang-switch .lang-link { color: var(--rail-muted); }
.lang-switch .lang-link:hover { color: var(--rail-text); }
.lang-switch .lang-link.is-active {
    color: #fff;
    background: var(--rail-raised);
    box-shadow: inset 0 -2px 0 var(--accent);
}
.login-lang .lang-link {
    min-height: 36px;
    color: var(--text);
    border: 1px solid var(--section-line);
    background: var(--card);
}
.login-lang .lang-link.is-active {
    color: #fff;
    background: var(--ink);
    border-color: var(--ink);
    box-shadow: inset 3px 0 0 var(--accent);
}
.rail-foot .nav-label { margin-top: 0; }

.main { min-width: 0; }
.top {
    height: 56px;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 32px;
    border-bottom: 1px solid var(--line);
    background: var(--paper);
}
.menu-btn {
    display: none;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--line);
    background: var(--card);
    border-radius: 8px;
    cursor: pointer;
}
.top-product { margin: 0; color: var(--muted); font-size: 13px; }
.env-mark, .env-line {
    margin: 0;
    font-family: var(--mono);
    font-size: 13px;
    line-height: 20px;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}
.env-mark { margin-left: auto; }
.env-line { margin-top: 12px; display: flex; flex-direction: column; gap: 4px; }
.content {
    padding: 28px 32px 48px;
    width: 100%;
    max-width: none;
}
.page-head {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--section-line);
}
.ledger {
    display: grid;
    grid-template-columns: 1fr 2px 1fr;
    background: var(--card);
    border: 1px solid var(--section-line);
    border-radius: 16px;
    overflow: hidden;
}
.ledger-side { padding: 24px; }
.ledger-label {
    margin: 0;
    color: var(--text);
    font-size: 14px;
}
.ledger-figure {
    margin: 12px 0 0;
    font-family: var(--mono);
    font-size: 32px;
    line-height: 1;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}
.ledger-figure.is-validated { color: var(--ok); }
.ledger-note {
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 20px;
}
.ledger-rule { background: var(--accent); }
.section-note {
    margin: 16px 0 0;
    color: var(--text);
    max-width: 40rem;
}
.content > .section-note,
.tab-panel > .section-note {
    width: 100%;
    max-width: none;
    padding: 12px 14px;
    background: var(--card);
    border: 1px solid var(--section-line);
    border-left: 3px solid var(--accent);
    border-radius: 12px;
}
.tab-panel > :first-child { margin-top: 0; }
.tab-panel > .section-note { margin-bottom: 16px; }
.tab-panel > .section-note + .section-note { margin-top: 8px; }
.tab-panel > ul {
    margin: 16px 0 0;
    padding: 12px 16px 12px 32px;
    background: var(--card);
    border: 1px solid var(--section-line);
    border-radius: 12px;
}
.tab-panel > h2,
.tab-panel > p { margin-left: 0; margin-right: 0; }
.tab-panel > h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 22px 0 12px;
    font-size: 18px;
    line-height: 28px;
    font-weight: 600;
}
.tab-panel > h2::before {
    content: "";
    width: 3px;
    height: 1em;
    border-radius: 2px;
    background: var(--accent);
    flex: none;
}
.status-card {
    margin-top: 32px;
    background: var(--card);
    border: 1px solid var(--section-line);
    border-radius: 16px;
    padding: 24px;
}
.tab-panel > .status-card,
.tab-panel .catalog-group { margin-top: 16px; }
.tab-panel > .catalog-group {
    background: var(--card);
    border: 1px solid var(--section-line);
    border-radius: 16px;
    padding: 18px 18px 16px;
}
.tab-panel .catalog-group > dl {
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
}
.tab-panel .catalog-group .status-card {
    background: var(--raised);
}
.status-card h2 {
    margin: 0 0 16px;
    font-size: 18px;
    line-height: 28px;
    font-weight: 500;
}
.status-card dl { margin: 0; }
.status-card dl > div {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 12px;
    min-height: 36px;
    align-items: center;
    border-top: 1px solid var(--line);
}
.status-card dt { margin: 0; color: var(--muted); font-size: 13px; }
.status-card dd {
    margin: 0;
    font-family: var(--mono);
    font-size: 13px;
    line-height: 20px;
    font-variant-numeric: tabular-nums;
}
.text-link { color: var(--ink); }
.catalog-group { margin-top: 32px; }
.catalog-group h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 12px;
    font-size: 18px;
    line-height: 28px;
    font-weight: 600;
}
.catalog-group h2::before {
    content: "";
    width: 3px;
    height: 1em;
    border-radius: 2px;
    background: var(--accent);
    flex: none;
}
.catalog-group > dl {
    margin: 0;
    background: var(--card);
    border: 1px solid var(--section-line);
    border-radius: 16px;
    padding: 4px 20px 8px;
}
.catalog-group > dl > div {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 12px;
    min-height: 40px;
    align-items: center;
    border-top: 1px solid var(--line);
}
.catalog-group > dl > div:first-child { border-top: 0; }
.catalog-group > dl dt { margin: 0; color: var(--muted); font-size: 13px; }
.catalog-group > dl dd {
    margin: 0;
    font-family: var(--mono);
    font-size: 13px;
    line-height: 20px;
    font-variant-numeric: tabular-nums;
}
.table-wrap {
    overflow-x: auto;
    width: 100%;
    background: var(--card);
    border: 1px solid var(--section-line);
    border-radius: 16px;
}
.api-table { width: 100%; border-collapse: collapse; }
.api-table:has(th:nth-child(6)) { min-width: 880px; }
.api-table th, .api-table td {
    padding: 12px 16px;
    text-align: left;
    vertical-align: top;
    border-top: 1px solid var(--line);
    font-size: 14px;
    line-height: 20px;
    overflow-wrap: break-word;
}
.api-table th {
    border-top: 0;
    background: var(--raised);
    color: var(--ink);
    font-weight: 600;
    font-size: 13px;
}
.api-table tbody tr:hover td { background: #f7f7f8; }
.api-table th.num { text-align: right; }
.api-table code, .method {
    font-family: var(--mono);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}
.api-note td { color: var(--text); padding-top: 0; border-top: 0; }

@media (max-width: 800px) {
    .login-shell { grid-template-columns: 1fr; }
    .login-brand { min-height: 180px; padding: 24px; }
    .login-panel { padding: 32px 20px 48px; }
    .shell { grid-template-columns: 1fr; }
    .rail {
        position: fixed;
        inset: 0 auto 0 0;
        width: var(--rail-w);
        z-index: 3;
        transform: translateX(-100%);
        transition: transform 180ms var(--ease);
    }
    body.nav-open .rail { transform: none; }
    .menu-btn { display: inline-flex; }
    .top {
        height: auto;
        min-height: 56px;
        flex-wrap: wrap;
        align-items: center;
        padding: 8px 16px;
        row-gap: 2px;
    }
    .top-product { flex: 1 1 auto; min-width: 0; }
    .content { padding-left: 16px; padding-right: 16px; }
    .env-mark {
        margin-left: auto;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .ledger { grid-template-columns: 1fr; }
    .ledger-rule { height: 2px; width: 100%; }
    .status-card dl > div,
    .catalog-group > dl > div { grid-template-columns: 1fr; gap: 0; padding: 8px 0; }
    .section-tabs {
        margin-right: 0;
        flex-wrap: wrap;
        overflow-x: visible;
    }
    .tab-panel { padding: 12px; }
    h1 { font-size: 28px; }
}

@media (prefers-reduced-motion: reduce) {
    .rail, button[type="submit"] { transition: none; }
}

.page-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; }
.head-actions, .filter-row, .inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filter-row { margin: 0 0 16px; }
.filter-row input, .filter-row select { margin: 0; }
.text-button {
    display: inline-flex;
    align-items: center;
    height: 44px;
    padding: 0 14px;
    background: var(--ink);
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
}
.demo-banner, .live-banner {
    margin: 0;
    padding: 8px 32px;
    font-size: 13px;
}
.demo-banner { background: #fff4fb; color: #9d174d; border-bottom: 1px solid rgba(248, 16, 144, 0.25); }
.live-banner { background: #ecfdf3; color: #166534; border-bottom: 1px solid rgba(22, 163, 74, 0.25); }
.env-mark.is-demo { color: var(--accent); }
.badge {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    background: var(--raised);
    font-size: 12px;
    letter-spacing: 0;
}
.badge-live, .badge-demo { background: var(--accent); color: #fff; }
.badge-ended { background: var(--raised); }
.badge-cancelled { color: var(--danger); }
.kicker { margin: 0 0 8px; }
.split { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 16px; margin-top: 16px; }
.cover { width: 100%; max-height: 220px; object-fit: cover; border-radius: 12px; margin-bottom: 12px; }
.onair {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    background: var(--rail);
    color: var(--rail-text);
    border-radius: 16px;
    padding: 20px 24px;
    margin-bottom: 16px;
}
.onair h1 { margin: 4px 0 0; font-weight: 500; }
.onair-kicker, .onair-time, .onair-note { margin: 0; }
.onair-kicker { color: var(--accent); font-family: var(--mono); font-size: 13px; }
.onair-time { font-family: var(--mono); margin-top: 8px; }
.onair-note { max-width: 280px; color: var(--rail-muted); }
.metric-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}
.metric-grid > div { background: var(--card); border: 1px solid var(--section-line); border-radius: 12px; padding: 12px; }
.metric-grid .ledger-figure { font-size: 22px; }
.chart { width: 100%; height: 160px; background: var(--raised); border-radius: 12px; }
.comment-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.tip { padding: 12px 0; border-top: 1px solid var(--line); }
.tip h3 { margin: 0 0 8px; font-size: 18px; font-weight: 500; }
.table-wrap button[type="submit"], .inline-form button[type="submit"] { height: 32px; margin-top: 0; padding: 0 10px; }
@media (max-width: 900px) {
    .split, .metric-grid, .page-head, .onair { grid-template-columns: 1fr; display: grid; }
    .demo-banner, .live-banner { padding-left: 16px; padding-right: 16px; }
}
