:root {
    --ff-bg: #f3f6fb;
    --ff-card: #ffffff;
    --ff-border: #e3e9f3;
    --ff-text: #15223f;
    --ff-title: #0f2352;
    --ff-muted: #6b7a99;
    --ff-primary: #1677ff;
    --ff-primary-dark: #0f5fd6;
    --ff-green: #16a34a;
    --ff-green-soft: #e3f8e9;
    --ff-green-strong: #c8f2d4;
    --ff-red: #e5484d;
    --ff-nav: #0f1f3d;
    --ff-nav-2: #132a52;
    --ff-radius: 10px;
    --ff-shadow: 0 1px 2px rgba(16, 35, 82, .04), 0 2px 8px rgba(16, 35, 82, .04);
}

html, body {
    margin: 0;
    background: var(--ff-bg);
    color: var(--ff-text);
    font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
}

* { box-sizing: border-box; }

a { color: var(--ff-primary); text-decoration: none; }

code { background: #eef2f8; padding: 1px 5px; border-radius: 4px; font-size: 12px; }

.ff-muted { color: var(--ff-muted); }

/* ---- Shell ------------------------------------------------------------------------------ */

.ff-shell { display: flex; min-height: 100vh; }

.ff-sidebar {
    width: 210px;
    flex: 0 0 210px;
    background: linear-gradient(180deg, var(--ff-nav) 0%, var(--ff-nav-2) 100%);
    color: #dbe5f7;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 30;
}

.ff-main { flex: 1; min-width: 0; position: relative; }

.ff-burger, .ff-backdrop { display: none; }

.ff-nav { display: flex; flex-direction: column; min-height: 100%; padding: 14px 12px; gap: 4px; }

.ff-nav-brand { display: block; padding: 4px 6px 18px; }

.ff-nav-section { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }

.ff-nav-group {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: 8px;
    color: #fff; font-weight: 600; cursor: pointer; user-select: none;
    background: rgba(255, 255, 255, .06);
}

.ff-nav-group .ff-nav-chevron { margin-left: auto; transition: transform .15s; opacity: .8; }
.ff-nav-group.open .ff-nav-chevron { transform: rotate(180deg); }

.ff-nav-caption {
    font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase;
    color: #7f93b8; padding: 10px 14px 2px;
}

.ff-nav-link {
    display: block; padding: 8px 14px 8px 38px; border-radius: 8px;
    color: #c9d6ee; font-size: 13.5px;
}

.ff-nav-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.ff-nav-link.active { background: var(--ff-primary); color: #fff; font-weight: 500; }

.ff-nav-spacer { flex: 1; }

.ff-nav-user { border-top: 1px solid rgba(255, 255, 255, .1); padding: 12px 6px 4px; }
.ff-nav-user-name { color: #fff; font-weight: 500; margin-bottom: 6px; overflow: hidden; text-overflow: ellipsis; }
.ff-nav-logout {
    display: inline-flex; align-items: center; gap: 6px;
    background: none; border: 0; color: #9fb2d6; cursor: pointer; padding: 0; font: inherit;
}
.ff-nav-logout:hover { color: #fff; }

/* ---- Logo ------------------------------------------------------------------------------- */

.ff-logo { display: flex; align-items: center; gap: 10px; }
.ff-logo-text { display: flex; flex-direction: column; line-height: 1; }
.ff-logo-name { font-weight: 800; font-size: 19px; letter-spacing: .02em; color: #fff; }
.ff-logo-sub { font-size: 8.5px; letter-spacing: .22em; color: #9fb2d6; margin-top: 4px; }
.ff-logo-dark .ff-logo-name { color: var(--ff-title); }
.ff-logo-dark .ff-logo-sub { color: var(--ff-muted); }

/* ---- Page ------------------------------------------------------------------------------- */

.ff-page { padding: 18px 22px 28px; display: flex; flex-direction: column; gap: 14px; max-width: 1680px; }

.ff-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.ff-title { margin: 0; font-size: 26px; font-weight: 800; color: var(--ff-title); letter-spacing: -.01em; }
.ff-subtitle { color: var(--ff-muted); font-size: 14.5px; margin-top: 2px; }
.ff-header-right { display: flex; align-items: center; gap: 16px; }
.ff-clock { display: flex; gap: 12px; color: #3d4b69; font-size: 13.5px; white-space: nowrap; padding-top: 6px; }
.ff-clock-time { font-variant-numeric: tabular-nums; }

.ff-card {
    background: var(--ff-card);
    border: 1px solid var(--ff-border);
    border-radius: var(--ff-radius);
    box-shadow: var(--ff-shadow);
}

.ff-card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 6px; }
.ff-card-head h3 { margin: 0; font-size: 17px; font-weight: 700; color: var(--ff-title); }

.ff-empty { padding: 28px; text-align: center; color: var(--ff-muted); }

.ff-alert { margin: 0 !important; }
.ff-alert-link { margin-left: 8px; font-weight: 600; color: inherit; text-decoration: underline; white-space: nowrap; }
.ff-alert-action {
    font: inherit; font-weight: 600; color: inherit; text-decoration: underline; white-space: nowrap;
    margin-left: 8px; padding: 0; border: 0; background: none; cursor: pointer;
}
.ff-alert-action:disabled { cursor: default; text-decoration: none; opacity: .7; }
.ff-donut-negative { margin-top: 8px; font-size: 12px; color: #b42318; text-align: center; }
.ff-loading-bar { margin-top: -8px; }

/* ---- Buttons ---------------------------------------------------------------------------- */

.ff-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 38px; padding: 0 18px; border-radius: 7px;
    border: 1px solid var(--ff-border); background: #fff; color: var(--ff-text);
    font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.ff-btn:hover { border-color: #c9d4e6; background: #f8fafd; }
.ff-btn-primary { background: var(--ff-primary); border-color: var(--ff-primary); color: #fff; min-width: 96px; }
.ff-btn-primary:hover { background: var(--ff-primary-dark); border-color: var(--ff-primary-dark); }
.ff-btn-outline { height: 34px; padding: 0 12px; }
.ff-btn:disabled, .ff-btn:disabled:hover { opacity: .5; cursor: not-allowed; }
.ff-icon-btn:disabled { opacity: .35; cursor: default; }
.ff-icon-btn { border: 0; background: none; color: #4c6fb5; cursor: pointer; padding: 2px; border-radius: 4px; display: inline-flex; }
.ff-icon-btn:hover { background: #eef3ff; }

/* ---- Controls (period + filters) -------------------------------------------------------- */

.ff-controls { padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }

.ff-period { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }

.ff-segmented { display: inline-flex; border: 1px solid var(--ff-border); border-radius: 7px; overflow: hidden; flex-wrap: wrap; }
.ff-segmented button {
    border: 0; border-right: 1px solid var(--ff-border); background: #fff;
    padding: 9px 16px; font: inherit; color: var(--ff-text); cursor: pointer;
}
.ff-segmented button:last-child { border-right: 0; }
.ff-segmented button:hover { background: #f4f7fc; }
.ff-segmented button.active { background: var(--ff-primary); color: #fff; }

.ff-range { width: 300px; }
.ff-range .mud-input-control { margin: 0; }

.ff-compare { display: flex; align-items: center; gap: 4px; margin-left: auto; color: #33415f; }
.ff-compare .mud-switch { margin-right: 0; }

.ff-filters {
    display: grid;
    grid-template-columns: repeat(5, minmax(150px, 1fr)) auto;
    gap: 12px 16px;
    align-items: end;
}
.ff-field label { display: block; font-size: 13px; color: #33415f; margin-bottom: 4px; }
.ff-field .mud-input-control { margin: 0; }
.ff-filter-actions { display: flex; gap: 10px; }

/* ---- KPI cards -------------------------------------------------------------------------- */

.ff-kpis { display: grid; gap: 14px; }
.ff-kpis.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.ff-kpis.six { grid-template-columns: repeat(6, minmax(0, 1fr)); }

.ff-kpi {
    display: flex; gap: 12px; padding: 16px;
    border-radius: var(--ff-radius); border: 1px solid transparent;
    min-height: 118px;
}
.ff-kpi-icon {
    width: 42px; height: 42px; flex: 0 0 42px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; background: #fff;
}
.ff-kpi-title { font-size: 14px; color: #33415f; margin: 2px 0 6px; }
.ff-kpi-value { font-size: 23px; font-weight: 800; color: var(--ff-title); letter-spacing: -.01em; word-break: break-all; }
.ff-kpi-delta { display: flex; align-items: center; gap: 2px; margin-top: 6px; font-weight: 600; font-size: 13.5px; }
.ff-kpi-delta .mud-icon-root { font-size: 16px; }
.ff-kpi-delta.good { color: var(--ff-green); }
.ff-kpi-delta.bad { color: var(--ff-red); }
.ff-kpi-delta.flat { color: var(--ff-muted); }
.ff-kpi-note { font-size: 12.5px; color: var(--ff-muted); margin-top: 2px; }

.ff-kpi-bet { background: #eef4ff; }
.ff-kpi-bet .ff-kpi-icon { color: #1677ff; background: #dbe8ff; }
.ff-kpi-bet .ff-kpi-title { color: #1d4fb8; }
.ff-kpi-win { background: #fff1f1; }
.ff-kpi-win .ff-kpi-icon { color: #e5484d; background: #ffe0e0; }
.ff-kpi-ggr { background: #f0faf4; }
.ff-kpi-ggr .ff-kpi-icon { color: #16a34a; background: #dcf5e5; }
.ff-kpi-revenue { background: #dcf7e4; border-color: #86dfa3; box-shadow: 0 0 0 1px #b5ecc6 inset; }
.ff-kpi-revenue .ff-kpi-icon { color: #fff; background: #22c55e; }
.ff-kpi-revenue .ff-kpi-title { color: #0f7a3a; font-weight: 600; }
.ff-kpi-rtp { background: #fff8ec; }
.ff-kpi-rtp .ff-kpi-icon { color: #f59e0b; background: #ffedcc; }
.ff-kpi-users { background: #f3f0ff; }
.ff-kpi-users .ff-kpi-icon { color: #7c3aed; background: #e7e0ff; }

/* ---- Charts ----------------------------------------------------------------------------- */

.ff-charts { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: 14px; }
.ff-chart-card { padding: 14px 16px 6px; min-height: 300px; }
.ff-metric-select { max-width: 170px; }
.ff-metric-select .mud-input-control { margin: 0; }

.ff-donut { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(150px, 1fr); align-items: center; gap: 8px; }
.ff-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ff-legend li { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.ff-dot { width: 11px; height: 11px; border-radius: 50%; flex: 0 0 11px; }
.ff-legend-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ff-legend-value { color: #33415f; font-variant-numeric: tabular-nums; }

/* ---- Report table ----------------------------------------------------------------------- */

.ff-table-card { padding: 12px 14px; }
.ff-table-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.ff-toolbar-left { display: flex; gap: 10px; }
.ff-column-option { padding: 0 8px; }

.ff-search {
    display: flex; align-items: center; gap: 8px; width: 260px; max-width: 100%;
    border: 1px solid var(--ff-border); border-radius: 7px; padding: 0 10px; height: 36px; color: var(--ff-muted);
}
.ff-search input { border: 0; outline: 0; flex: 1; font: inherit; background: transparent; color: var(--ff-text); min-width: 0; }

.ff-table-wrap { overflow-x: auto; }

.ff-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.ff-table th, .ff-table td { padding: 8px 12px; text-align: right; white-space: nowrap; border-bottom: 1px solid #edf1f7; }
.ff-table th { background: #eef3fa; color: #33415f; font-weight: 600; font-size: 13px; position: relative; }
.ff-table th.sortable { cursor: pointer; padding-right: 22px; }
.ff-table th.sortable::after { content: "⇅"; position: absolute; right: 7px; color: #a8b5cc; font-size: 11px; }
.ff-table th.sorted.asc::after { content: "▲"; color: var(--ff-primary); }
.ff-table th.sorted.desc::after { content: "▼"; color: var(--ff-primary); }
.ff-table .text-col { text-align: left; }
.ff-table .num-col { text-align: left; color: #33415f; width: 36px; }
.ff-table .icon-col { width: 40px; text-align: center; }
.ff-table th.hl { background: var(--ff-green-strong); color: #0f5d2d; }
.ff-table td.hl { background: var(--ff-green-soft); color: #0f5d2d; font-weight: 500; }
.ff-table tbody tr:hover td { background: #f7faff; }
.ff-table tbody tr:hover td.hl { background: #d6f4de; }
.ff-table tfoot td { background: #e8eef8; font-weight: 700; color: var(--ff-title); border-bottom: 0; padding-top: 12px; padding-bottom: 12px; }
.ff-table tfoot td.hl { background: var(--ff-green-strong); }

.label-cell { display: flex; align-items: center; gap: 8px; }
.ff-link { color: var(--ff-primary); cursor: pointer; }
.ff-link:hover { text-decoration: underline; }
.ff-table td.ff-empty { text-align: center; }
.ff-sublabel { color: var(--ff-muted); font-size: 12.5px; }
.ff-game-icon { width: 24px; height: 24px; border-radius: 5px; object-fit: cover; flex: 0 0 24px; }
.ff-game-icon.placeholder {
    display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #3b9bff, #1668e3); color: #fff; font-weight: 700; font-size: 12px;
}

.ff-table-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.ff-pager { display: inline-flex; border: 1px solid var(--ff-border); border-radius: 7px; overflow: hidden; }
.ff-pager button, .ff-pager-gap {
    border: 0; border-right: 1px solid var(--ff-border); background: #fff; min-width: 36px;
    padding: 7px 11px; font: inherit; color: #33415f; cursor: pointer;
}
.ff-pager button:last-child { border-right: 0; }
.ff-pager button.active { background: var(--ff-primary); color: #fff; }
.ff-pager button:disabled { color: #b4bfd3; cursor: default; }
.ff-pager-gap { cursor: default; }

/* ---- Dialog extras ---------------------------------------------------------------------- */

.ff-dialog-title { font-size: 18px; font-weight: 700; color: var(--ff-title); }
.ff-mini-kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 10px; }
.ff-mini-kpis > div { background: #f4f7fc; border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.ff-mini-kpis span { color: var(--ff-muted); font-size: 12.5px; }
.ff-mini-kpis .hl { background: var(--ff-green-soft); }
.ff-mini-kpis .hl b { color: #0f5d2d; }

/* ---- Settings --------------------------------------------------------------------------- */

.ff-settings { padding: 16px; }
.ff-settings-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.ff-settings-toolbar p { margin: 0; color: var(--ff-muted); max-width: 900px; }
.ff-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 18px; }
.ff-form-grid .full { grid-column: 1 / -1; }
.ff-mono textarea, .ff-mono input { font-family: Consolas, "Cascadia Mono", monospace !important; font-size: 12.5px !important; }
.ff-pre { background: #0f1f3d; color: #d5e3ff; padding: 12px; border-radius: 8px; overflow: auto; max-height: 360px; font-size: 12px; margin: 0; }
.ff-badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; font-weight: 600; }
.ff-badge.ok { background: #dcf7e4; color: #0f7a3a; }
.ff-badge.warn { background: #fff3d6; color: #9a6400; }
.ff-badge.err { background: #ffe0e0; color: #b42318; }
.ff-badge.idle { background: #eef2f8; color: #52607d; }
.ff-help { color: var(--ff-muted); font-size: 12.5px; margin: 2px 0 10px; }
.ff-section-title { font-weight: 700; color: var(--ff-title); margin: 18px 0 6px; font-size: 15px; }

/* ---- Login ------------------------------------------------------------------------------ */

.ff-auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; background: radial-gradient(circle at 20% 10%, #e5eeff, var(--ff-bg) 55%); }
.ff-auth-card {
    width: 380px; max-width: 100%; background: #fff; border: 1px solid var(--ff-border); border-radius: 14px;
    box-shadow: 0 10px 40px rgba(16, 35, 82, .08); padding: 28px; display: flex; flex-direction: column; gap: 8px;
}
.ff-auth-card h1 { margin: 16px 0 0; font-size: 22px; color: var(--ff-title); }
.ff-auth-card p { margin: 0 0 10px; }
.ff-auth-card label { font-size: 13px; color: #33415f; margin-top: 6px; }
.ff-auth-card input {
    height: 40px; border: 1px solid var(--ff-border); border-radius: 7px; padding: 0 12px; font: inherit; outline: none;
}
.ff-auth-card input:focus { border-color: var(--ff-primary); box-shadow: 0 0 0 3px rgba(22, 119, 255, .15); }
.ff-auth-card .ff-btn { margin-top: 14px; height: 42px; }
.ff-auth-error { background: #ffe9e9; color: #b42318; padding: 8px 12px; border-radius: 7px; }

/* ---- Blazor ----------------------------------------------------------------------------- */

#blazor-error-ui {
    background: #fff4d6; bottom: 0; box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none; left: 0; padding: 0.6rem 1.25rem 0.7rem 1.25rem; position: fixed; width: 100%; z-index: 1000;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }

/* ---- Responsive ------------------------------------------------------------------------- */

@media (max-width: 1400px) {
    .ff-kpis.six { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .ff-kpis.five { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .ff-filters { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
}

@media (max-width: 1100px) {
    .ff-charts { grid-template-columns: 1fr; }
    .ff-compare { margin-left: 0; }
}

@media (max-width: 860px) {
    .ff-sidebar { position: fixed; left: -230px; transition: left .2s; }
    .ff-nav-open .ff-sidebar { left: 0; }
    .ff-nav-open .ff-backdrop { display: block; position: fixed; inset: 0; background: rgba(8, 18, 38, .4); z-index: 20; }
    .ff-burger {
        display: inline-flex; position: absolute; top: 16px; right: 16px; z-index: 10;
        border: 1px solid var(--ff-border); background: #fff; border-radius: 7px; padding: 6px; cursor: pointer;
    }
    .ff-page { padding: 16px; }
    .ff-header { flex-direction: column; padding-right: 48px; }
    .ff-kpis.six, .ff-kpis.five { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ff-filters { grid-template-columns: 1fr 1fr; }
    .ff-range { width: 100%; }
    .ff-donut { grid-template-columns: 1fr; }
    .ff-form-grid { grid-template-columns: 1fr; }
    .ff-mini-kpis { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 520px) {
    .ff-kpis.six, .ff-kpis.five, .ff-filters { grid-template-columns: 1fr; }
    .ff-clock { flex-direction: column; gap: 0; }
}

/* A file input behind a regular button: the native control shows the browser's language. */
.ff-file-btn { position: relative; overflow: hidden; cursor: pointer; }
.ff-file-btn input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }

.ff-details { margin-top: 4px; font-size: 12px; }
.ff-details summary { cursor: pointer; opacity: .8; }
.ff-details pre { white-space: pre-wrap; word-break: break-word; max-height: 220px; overflow: auto; margin: 4px 0 0; font-size: 11px; }

/* ---- Game servers: templates, schema form, bot runs --------------------------------------- */

.ff-form-grid.one { grid-template-columns: 1fr; }
.ff-env-line { margin: 8px 0; white-space: pre-wrap; word-break: break-all; }

.ff-server-strip {
    display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center;
    padding: 10px 14px; background: var(--ff-card); border: 1px solid var(--ff-border); border-radius: var(--ff-radius);
}
.ff-tabs .mud-tabs-tabbar { background: transparent; }
.ff-tab-panel { padding-top: 12px; }

.ff-editor-bar {
    position: sticky; top: 0; z-index: 5;
    display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px;
}
.ff-editor-status { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ff-editor-bar .ff-filter-actions, .ff-settings .ff-filter-actions { flex-wrap: wrap; }
.ff-editor-bar .ff-filter-actions { align-items: center; }
.ff-seed-switch { margin: 0 !important; white-space: nowrap; color: #33415f; }
.ff-tabs { max-width: 100%; min-width: 0; }
.ff-tabs .mud-tabs-tabbar { max-width: 100%; overflow: hidden; }
.ff-editor-issues { display: inline-flex; gap: 10px; }
.ff-editor { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 14px; align-items: start; }
.ff-editor-nav { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 72px; }
.ff-editor-nav-item {
    display: flex; justify-content: space-between; align-items: center; gap: 6px; width: 100%;
    padding: 9px 12px; border: 1px solid var(--ff-border); border-radius: 8px; background: #fff;
    font: inherit; color: var(--ff-text); text-align: left; cursor: pointer;
}
.ff-editor-nav-item:hover { border-color: #c9d4e6; }
.ff-editor-nav-item.active { border-color: var(--ff-primary); background: #eef5ff; font-weight: 600; }
.ff-editor-nav-badges { display: inline-flex; gap: 4px; }
.ff-editor-main { padding: 14px 16px; min-width: 0; }
.ff-editor-section-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.ff-editor-section-head h3 { margin: 0 0 2px; color: var(--ff-title); font-size: 16px; }
.ff-json textarea { min-height: 420px; }

.ff-schema-object { display: flex; flex-direction: column; gap: 6px; }
.ff-schema-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 18px; }
.ff-schema-cell.wide { grid-column: 1 / -1; }
.ff-schema-group { padding: 10px 0 12px; border-bottom: 1px dashed var(--ff-border); }
.ff-schema-cell:last-child .ff-schema-group { border-bottom: 0; }
.ff-schema-head { margin-bottom: 6px; }
.ff-schema-head .ff-help { margin: 0; }
.ff-schema-label { font-weight: 600; color: var(--ff-title); }
.ff-schema-error { color: #b42318; font-size: 12.5px; }
.ff-schema-warning { color: #9a6400; font-size: 12.5px; }
.ff-field-warning .mud-input-helper-text { color: #9a6400; }
.ff-schema-item { border: 1px solid var(--ff-border); border-radius: 8px; padding: 6px 10px 2px; margin-bottom: 8px; }
.ff-schema-item-head { display: flex; justify-content: space-between; align-items: center; color: var(--ff-muted); font-size: 12.5px; }
.ff-schema-item-actions { display: inline-flex; gap: 2px; }
.ff-schema-extra, .ff-schema-missing {
    display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
    padding: 8px 10px; border-radius: 8px; background: #fff8e6; color: #7a5200; font-size: 13px;
}

.ff-ladder { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ff-ladder-step {
    display: inline-flex; align-items: center; border: 1px solid var(--ff-border); border-radius: 7px; background: #fff; overflow: hidden;
}
.ff-ladder-step input {
    width: 64px; border: 0; padding: 6px 4px 6px 8px; font: inherit; font-variant-numeric: tabular-nums; background: transparent; color: var(--ff-text);
}
.ff-ladder-step input:focus { outline: none; }
.ff-ladder-step:focus-within { border-color: var(--ff-primary); box-shadow: 0 0 0 2px #d6e6ff; }
.ff-ladder-step.error { border-color: #e5484d; background: #fff5f5; }
.ff-ladder-remove { border: 0; background: none; color: #8a97b1; cursor: pointer; padding: 0 6px; font-size: 11px; }
.ff-ladder-remove:hover { color: #b42318; }
.ff-ladder-add {
    width: 32px; height: 32px; border: 1px dashed #b8c6de; border-radius: 7px; background: #fff; color: var(--ff-primary); cursor: pointer; font-size: 18px;
}
.ff-ladder-foot { display: flex; gap: 14px; margin-top: 6px; font-size: 12.5px; }
.ff-ladder-foot .ff-link, .ff-schema-extra .ff-link, .ff-settings .ff-link, .ff-card .ff-link { border: 0; background: none; padding: 0; font: inherit; }
.ff-ladder-text { display: flex; flex-direction: column; gap: 6px; }

.ff-weights { border-collapse: collapse; }
.ff-weights th, .ff-weights td { padding: 4px 10px 4px 0; text-align: left; font-weight: 400; vertical-align: middle; }
.ff-weights tbody th { color: var(--ff-text); min-width: 90px; }
.ff-weights tfoot th, .ff-weights tfoot td { color: var(--ff-muted); border-top: 1px solid var(--ff-border); }
.ff-weights-input { white-space: nowrap; }
.ff-weights-input input {
    width: 90px; padding: 6px 8px; border: 1px solid var(--ff-border); border-radius: 7px; font: inherit; font-variant-numeric: tabular-nums;
}
.ff-weights-input input:focus { outline: none; border-color: var(--ff-primary); box-shadow: 0 0 0 2px #d6e6ff; }
.ff-weights tr.error input { border-color: #e5484d; background: #fff5f5; }
.ff-weights-share { display: flex; align-items: center; gap: 8px; min-width: 170px; font-variant-numeric: tabular-nums; color: #33415f; }
.ff-weights-bar { display: inline-block; width: 100px; height: 8px; border-radius: 4px; background: #eef2f8; overflow: hidden; }
.ff-weights-bar span { display: block; height: 100%; background: var(--ff-primary); border-radius: 4px; }

.ff-map { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; }
.ff-map-entry { border: 1px solid var(--ff-border); border-radius: 8px; padding: 8px 12px; }
.ff-map-entry.error { border-color: #e5484d; }
.ff-map-entry .ff-schema-grid { grid-template-columns: 1fr; }
.ff-map-entry .mud-input-control { max-width: 220px; }
.ff-map-key { display: flex; align-items: center; gap: 8px; }
.ff-map-key input { width: 90px; padding: 5px 8px; border: 1px solid var(--ff-border); border-radius: 7px; font: inherit; font-weight: 600; }
.ff-map-key .ff-icon-btn { margin-left: auto; }
.ff-map-add { display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; max-width: 360px; }
.ff-map-add .ff-btn { margin-top: 6px; }

.ff-diff { width: 100%; border-collapse: collapse; font-size: 13px; }
.ff-diff th { text-align: left; color: var(--ff-muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--ff-border); }
.ff-diff td { padding: 6px 8px; border-bottom: 1px solid #f0f3f9; vertical-align: top; word-break: break-word; }
.ff-diff-before { color: #b42318; text-decoration: line-through; text-decoration-color: rgba(180, 35, 24, .35); }
.ff-diff-after { color: #0f7a3a; font-weight: 500; }

.ff-run-headline { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; padding: 2px 0; }
.ff-run-headline b { font-variant-numeric: tabular-nums; }
.ff-run-progress { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; font-size: 12px; }
.ff-run-config { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 32px; gap: 10px; align-items: center; max-width: 820px; }
.ff-run-profiles { display: grid; grid-template-columns: max-content minmax(0, 1fr); align-items: center; gap: 0 12px; }
.ff-run-profile-note { font-size: 12.5px; }
.ff-run-table th { white-space: normal; min-width: 180px; vertical-align: bottom; }
.ff-run-table th .ff-dot { display: inline-block; margin-right: 6px; vertical-align: -1px; }
.ff-run-table td:first-child, .ff-run-table th:first-child { color: var(--ff-muted); white-space: nowrap; text-align: left; }
.ff-run-table td, .ff-run-table th { text-align: right; }
.ff-run-table td { font-variant-numeric: tabular-nums; }
.ff-run-rtp td { font-size: 15px; }

@media (max-width: 1100px) {
    .ff-editor { grid-template-columns: 1fr; }
    .ff-editor-nav { position: static; flex-direction: row; flex-wrap: wrap; }
    .ff-editor-nav-item { width: auto; }
}

@media (max-width: 860px) {
    .ff-schema-grid { grid-template-columns: 1fr; }
    .ff-run-config { grid-template-columns: 1fr 32px; }
    .ff-run-profiles { grid-template-columns: 1fr; }
    .ff-editor-bar { position: static; }
}
