:root {
    --bg: #f3f2ee;
    --bg-elevated: #fffcf7;
    --surface: #ffffff;
    --surface-2: #eceae4;
    --text: #141414;
    --muted: #6d6a64;
    --border: rgba(20, 20, 20, 0.1);
    --glass: rgba(255, 252, 247, 0.72);
    --glass-border: rgba(20, 20, 20, 0.12);
    --accent: #0f6e6b;
    --accent-fg: #ffffff;
    --accent-soft: rgba(15, 110, 107, 0.12);
    --win: #1f9d6a;
    --win-bg: rgba(31, 157, 106, 0.12);
    --loss: #d64545;
    --loss-bg: rgba(214, 69, 69, 0.12);
    --timeout: #b8860b;
    --timeout-bg: rgba(184, 134, 11, 0.14);
    --neutral: #6d6a64;
    --shadow: 0 10px 40px rgba(20, 20, 20, 0.08);
    --header-shadow: 0 8px 30px rgba(20, 20, 20, 0.1);
    --chart-fill: rgba(15, 110, 107, 0.16);
    --zebra: rgba(20, 20, 20, 0.03);
    --row-hover: rgba(15, 110, 107, 0.06);
    color-scheme: light;
}

html[data-theme="dark"] {
    --bg: #0b100f;
    --bg-elevated: #121917;
    --surface: #161e1c;
    --surface-2: #1c2623;
    --text: #e8eee9;
    --muted: #8b968f;
    --border: rgba(232, 238, 233, 0.1);
    --glass: rgba(14, 22, 20, 0.62);
    --glass-border: rgba(232, 238, 233, 0.14);
    --accent: #5eead4;
    --accent-fg: #0b100f;
    --accent-soft: rgba(94, 234, 212, 0.14);
    --win: #6ee7a8;
    --win-bg: rgba(110, 231, 168, 0.12);
    --loss: #ff8a8a;
    --loss-bg: rgba(255, 138, 138, 0.12);
    --timeout: #ffd37a;
    --timeout-bg: rgba(255, 211, 122, 0.12);
    --neutral: #8b968f;
    --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
    --header-shadow: 0 10px 36px rgba(0, 0, 0, 0.28);
    --chart-fill: rgba(94, 234, 212, 0.16);
    --zebra: rgba(255, 255, 255, 0.025);
    --row-hover: rgba(94, 234, 212, 0.08);
    color-scheme: dark;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    min-height: 100%;
    font-family: "Instrument Sans", "Segoe UI", system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-feature-settings: "ss01" 1;
    transition: background-color 0.2s ease, color 0.2s ease;
}

body {
    background-image:
        radial-gradient(1200px 500px at 10% -10%, var(--accent-soft), transparent 60%),
        radial-gradient(900px 400px at 100% 0%, rgba(184, 134, 11, 0.06), transparent 55%);
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

h1, h2, h3 {
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.15;
}

h1 {
    font-size: 2rem;
    margin: 0 0 0.35rem;
}

h2 {
    font-size: 1.15rem;
    margin: 0 0 0.75rem;
}

h3 {
    font-size: 0.92rem;
    color: var(--muted);
    font-weight: 600;
    letter-spacing: 0.01em;
    margin: 1.5rem 0 0.6rem;
}

.num,
td.num,
th.num {
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1;
    text-align: right;
    white-space: nowrap;
}

.app {
    min-height: 100vh;
}

.header-pill {
    position: fixed;
    z-index: 40;
    top: 0.85rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0.2rem;
    width: max-content;
    max-width: calc(100vw - 1.5rem);
    padding: 0.32rem 0.4rem;
    border-radius: 999px;
    background: var(--glass);
    backdrop-filter: blur(16px) saturate(1.4);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    border: 1px solid var(--glass-border);
    box-shadow: var(--header-shadow);
    animation: header-in 0.45s ease both;
}

.nav-menu {
    display: none;
    width: 2.25rem;
    height: 2.25rem;
    border: 0;
    background: transparent;
    color: var(--text);
    border-radius: 999px;
    cursor: pointer;
}

.nav-primary {
    display: flex;
    align-items: center;
    gap: 0.1rem;
}

.nav-primary a,
.brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
}

.nav-primary a:hover,
.brand:hover {
    color: var(--text);
    text-decoration: none;
    background: var(--accent-soft);
}

.nav-primary a.active {
    color: var(--text);
    background: var(--surface);
}

.brand {
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.04em;
    font-size: 0.95rem;
    padding-inline: 1rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding-left: 0.25rem;
}

.shell {
    max-width: 1180px;
    margin: 0 auto;
    padding: 5.25rem 1.25rem 3rem;
}

.app-version {
    margin: 1rem 0 0;
    font-size: 0.72rem;
    color: var(--muted);
    text-align: center;
}

.nav-drawer .app-version {
    margin: 0.5rem 0 0;
    padding-top: 0.5rem;
}

.page-head {
    margin-bottom: 1.35rem;
    animation: rise 0.4s ease both;
}

.eyebrow {
    margin: 0 0 0.2rem;
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 600;
}

.crumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
    margin: 0 0 1.1rem;
    font-size: 0.82rem;
    color: var(--muted);
}

.crumbs a {
    color: var(--muted);
}

.crumbs a:hover {
    color: var(--text);
}

.crumbs .sep {
    opacity: 0.45;
}

.crumbs .current {
    color: var(--text);
    font-weight: 550;
}

.meta {
    color: var(--muted);
    margin: 0.25rem 0 0;
    font-size: 0.9rem;
}

.muted {
    color: var(--muted);
}

.error {
    color: var(--loss);
}

.win { color: var(--win); }
.loss { color: var(--loss); }
.timeout { color: var(--timeout); }
.nofill, .notrade { color: var(--muted); }
.ok, .done { color: var(--win); }
.failed { color: var(--loss); }
.running, .pending { color: var(--timeout); }

.content {
    animation: rise 0.45s ease both;
}

.kpi-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 0.95rem 1.05rem 0.85rem;
    min-height: 5.1rem;
}

.stat-card .label {
    display: block;
    color: var(--muted);
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.stat-card .value {
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    font-size: 1.45rem;
    letter-spacing: -0.04em;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.stat-card .hint {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.75rem;
    color: var(--muted);
}

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 1rem 1rem 0.4rem;
    margin-bottom: 1.25rem;
}

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.panel-head h2,
.panel-head h3 {
    margin: 0;
    color: var(--text);
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
    margin-bottom: 1rem;
    border-radius: 12px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

th, td {
    text-align: left;
    padding: 0.62rem 0.7rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--surface);
    color: var(--muted);
    font-weight: 600;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.th-abbr {
    display: none;
}

.table-legend {
    display: none;
    flex-wrap: wrap;
    gap: 0.35rem 0.85rem;
    margin: 0 0 0.65rem;
    padding: 0.55rem 0.7rem;
    border-radius: 10px;
    background: var(--surface-2);
    color: var(--muted);
    font-size: 0.75rem;
    line-height: 1.35;
}

.table-legend-item strong {
    color: var(--text);
    font-weight: 650;
    margin-right: 0.2rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

tbody tr:nth-child(even) {
    background: var(--zebra);
}

tbody tr:hover {
    background: var(--row-hover);
}

tr.row-link {
    cursor: pointer;
}

.filter-bar {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding: 0.85rem 1rem;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface);
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.55rem 0.85rem;
}

.filter-row-controls {
    align-items: center;
}

.filter-control {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
}

.filter-label {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 650;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding-top: 0.35rem;
}

.filter-chips {
    margin: 0;
    flex: 1;
}

.filter-chips .chip {
    cursor: pointer;
    font: inherit;
}

.filter-clear {
    margin-left: auto;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
    border-radius: 999px;
    padding: 0.32rem 0.75rem;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
}

.filter-clear:hover {
    color: var(--text);
    border-color: var(--accent);
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.12rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    background: var(--surface-2);
    color: var(--muted);
}

.badge.win { background: var(--win-bg); color: var(--win); }
.badge.loss { background: var(--loss-bg); color: var(--loss); }
.badge.timeout { background: var(--timeout-bg); color: var(--timeout); }
.badge.ok, .badge.done { background: var(--win-bg); color: var(--win); }
.badge.failed { background: var(--loss-bg); color: var(--loss); }
.badge.running, .badge.pending { background: var(--timeout-bg); color: var(--timeout); }

.dir-pill {
    display: inline-flex;
    min-width: 3.4rem;
    justify-content: center;
    padding: 0.12rem 0.45rem;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 650;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: var(--accent-soft);
    color: var(--accent);
}

.dir-pill.short {
    background: var(--loss-bg);
    color: var(--loss);
}

.dir-pill.long {
    background: var(--win-bg);
    color: var(--win);
}

.book-tabs,
.seg-toggle {
    display: inline-flex;
    gap: 0;
    padding: 0.18rem;
    background: var(--surface-2);
    border-radius: 999px;
    border: 1px solid var(--border);
}

.book-tabs button,
.seg-toggle button,
.theme-toggle,
button.analyze,
.cal-nav button,
.cal-week-btn,
.cal-day {
    font-family: inherit;
}

.book-tabs button,
.seg-toggle button {
    background: transparent;
    color: var(--muted);
    border: 0;
    padding: 0.32rem 0.75rem;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
}

.book-tabs button.active,
.seg-toggle button.active {
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 1px 0 var(--border);
}

.theme-toggle {
    width: 2.25rem;
    height: 2.25rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    display: grid;
    place-items: center;
}

.theme-toggle:hover,
.nav-menu:hover {
    background: var(--accent-soft);
}

.theme-toggle svg {
    width: 1.1rem;
    height: 1.1rem;
}

.book-block {
    margin-bottom: 2rem;
}

.charts-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 0.85rem;
    margin-bottom: 1.25rem;
}

.symbol-layout {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(280px, 1.1fr);
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.chart {
    width: 100%;
    height: 180px;
    display: block;
}

.chart-line {
    fill: none;
    stroke: var(--accent);
    stroke-width: 2.2;
    stroke-linejoin: round;
    stroke-linecap: round;
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    animation: draw 0.85s ease forwards;
}

.chart-area {
    fill: var(--chart-fill);
    opacity: 0;
    animation: fade 0.8s 0.15s ease forwards;
}

.chart-axis {
    stroke: var(--border);
    stroke-width: 1;
}

.chart-zero {
    stroke: var(--muted);
    stroke-dasharray: 3 4;
    stroke-width: 1;
    opacity: 0.5;
}

.chart-caption {
    margin: 0.35rem 0 0.7rem;
    font-size: 0.75rem;
    color: var(--muted);
}

.bar-chart {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding-bottom: 0.6rem;
}

.bar-row {
    display: grid;
    grid-template-columns: 4.5rem 1fr 4.2rem;
    gap: 0.55rem;
    align-items: center;
}

.bar-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
}

.bar-label:hover {
    color: var(--accent);
}

.bar-track {
    position: relative;
    height: 0.55rem;
    background: var(--surface-2);
    border-radius: 999px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: 999px;
    transform-origin: left center;
    animation: grow 0.55s ease both;
}

.bar-fill.win { background: var(--win); }
.bar-fill.loss { background: var(--loss); }

.bar-value {
    font-size: 0.78rem;
}

.outcome-stack {
    margin-bottom: 0.85rem;
}

.stack-bar {
    display: flex;
    height: 0.7rem;
    border-radius: 999px;
    overflow: hidden;
    background: var(--surface-2);
}

.stack-bar .seg {
    display: block;
    min-width: 0;
}

.stack-bar .seg.win { background: var(--win); }
.stack-bar .seg.loss { background: var(--loss); }
.stack-bar .seg.timeout { background: var(--timeout); }
.stack-bar .seg.muted { background: var(--border); }

.stack-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    margin-top: 0.55rem;
    font-size: 0.78rem;
    color: var(--muted);
}

.stack-legend span strong {
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    font-weight: 500;
    color: var(--text);
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0 0 1rem;
}

.chip {
    display: inline-flex;
    padding: 0.28rem 0.65rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    background: var(--surface);
}

.chip:hover {
    text-decoration: none;
    color: var(--text);
    border-color: var(--accent);
}

.chip.active {
    background: var(--accent);
    color: var(--accent-fg);
    border-color: transparent;
}

.job-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 1.25rem;
}

button.analyze {
    background: var(--accent);
    color: var(--accent-fg);
    border: 0;
    padding: 0.55rem 1.05rem;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 650;
    font-size: 0.88rem;
}

button.analyze:disabled {
    opacity: 0.5;
    cursor: default;
}

.calendar {
    margin-bottom: 0.5rem;
}

.cal-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.cal-nav-title {
    flex: 1;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
}

.cal-nav-title h2,
.cal-nav h2 {
    margin: 0;
    font-size: 1.05rem;
    text-transform: capitalize;
}

.cal-agg {
    font-size: 0.72rem;
    font-weight: 650;
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    color: var(--muted);
}

.cal-agg.win { color: var(--win); }
.cal-agg.loss { color: var(--loss); }

.cal-week-stat,
.cal-week-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.1rem;
}

.cal-week-stat {
    background: var(--surface);
    color: var(--muted);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.68rem;
    padding: 0.15rem 0;
}

.cal-week-label {
    font-size: 0.65rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.calendar-readonly .cal-day {
    cursor: default;
}

.cal-nav button {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    cursor: pointer;
}

.cal-nav button.cal-month-btn {
    width: auto;
    padding: 0 0.65rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 650;
}

.cal-nav button:disabled {
    opacity: 0.4;
    cursor: default;
}

.cal-grid {
    display: grid;
    /* Dom · Lun–Vie · Sáb: weekends narrow */
    grid-template-columns: 2.75rem 0.55fr 1fr 1fr 1fr 1fr 1fr 0.55fr;
    gap: 0.35rem;
}

.cal-dow {
    text-align: center;
    font-size: 0.72rem;
    color: var(--muted);
    padding: 0.25rem 0;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.cal-dow:nth-child(2),
.cal-dow:nth-child(8) {
    color: color-mix(in srgb, var(--muted) 70%, transparent);
}

.cal-week-btn {
    background: var(--surface);
    color: var(--muted);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.68rem;
    cursor: pointer;
    padding: 0.15rem 0;
}

.cal-week-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

.cal-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.12rem;
    min-height: 3.35rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    cursor: pointer;
    padding: 0.25rem;
}

.cal-day:disabled {
    cursor: default;
}

.cal-day.outside {
    opacity: 0.35;
}

.cal-day.weekend,
.cal-day.future {
    background: color-mix(in srgb, var(--surface-2) 55%, transparent);
    color: var(--muted);
    border-color: transparent;
    min-height: 2.6rem;
}

.cal-day.selected {
    border-color: transparent;
    box-shadow: none;
    position: relative;
}

.cal-day.selected::after {
    content: "";
    position: absolute;
    left: 18%;
    right: 18%;
    bottom: 0.2rem;
    height: 3px;
    border-radius: 999px;
    background: var(--accent);
}

.cal-day.win { background: var(--win-bg); }
.cal-day.loss { background: var(--loss-bg); }
.cal-day.timeout { background: var(--timeout-bg); }
.cal-day.notrade,
.cal-day.nofill { background: var(--surface); }

.cal-day-num {
    font-size: 0.82rem;
}

.cal-day-r {
    font-size: 0.68rem;
    font-weight: 600;
    font-family: "IBM Plex Mono", ui-monospace, monospace;
}

.skeleton {
    display: grid;
    gap: 0.65rem;
}

.skeleton-line,
.skeleton-card {
    background: linear-gradient(90deg, var(--surface-2), var(--surface), var(--surface-2));
    background-size: 200% 100%;
    animation: shimmer 1.2s ease infinite;
    border-radius: 10px;
}

.skeleton-line {
    height: 0.85rem;
}

.skeleton-card {
    height: 5.1rem;
}

.empty {
    padding: 1.5rem 0.25rem;
    color: var(--muted);
}

.log-level {
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    font-size: 0.75rem;
    text-transform: uppercase;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--win);
}

.invalid {
    outline: 1px solid var(--loss);
}

.validation-message {
    color: var(--loss);
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    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;
}

.blazor-error-boundary {
    background: var(--loss);
    padding: 1rem;
    color: white;
    border-radius: 12px;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto;
}

.loading-progress circle {
    fill: none;
    stroke: var(--border, #e0e0e0);
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: var(--accent, #1b6ec2);
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: 600;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
    color: var(--muted, #666);
}

.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "Loading");
}

.nav-drawer,
.nav-backdrop {
    display: none;
}

@keyframes header-in {
    from { opacity: 0; transform: translateX(-50%) translateY(-8px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes rise {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes draw {
    from { stroke-dashoffset: 1; }
    to { stroke-dashoffset: 0; }
}

@keyframes fade {
    to { opacity: 1; }
}

@keyframes grow {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

@keyframes shimmer {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

@media (max-width: 860px) {
    .kpi-strip,
    .charts-grid,
    .symbol-layout {
        grid-template-columns: 1fr;
    }

    .header-pill {
        width: calc(100vw - 1.25rem);
        justify-content: space-between;
        padding-inline: 0.35rem 0.4rem;
    }

    .nav-menu {
        display: grid;
        place-items: center;
    }

    .nav-primary {
        display: none;
    }

    .brand {
        padding-inline: 0.4rem;
    }

    .header-actions .book-tabs {
        display: none;
    }

    .nav-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 38;
    }

    .nav-drawer {
        display: flex;
        flex-direction: column;
        gap: 0.35rem;
        position: fixed;
        z-index: 39;
        top: 4.4rem;
        left: 50%;
        transform: translateX(-50%);
        width: calc(100vw - 1.25rem);
        padding: 0.75rem;
        border-radius: 18px;
        background: var(--glass);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border: 1px solid var(--glass-border);
        box-shadow: var(--header-shadow);
    }

    .nav-drawer a {
        padding: 0.7rem 0.85rem;
        border-radius: 12px;
        color: var(--text);
        text-decoration: none;
        font-weight: 550;
    }

    .nav-drawer a.active {
        background: var(--accent-soft);
    }

    .nav-drawer .book-tabs {
        width: 100%;
        justify-content: center;
        margin-top: 0.25rem;
    }

    .table-legend {
        display: flex;
    }

    .th-full {
        display: none;
    }

    .th-abbr {
        display: inline;
    }

    th, td {
        padding: 0.45rem 0.4rem;
    }

    table {
        font-size: 0.82rem;
    }

    thead th {
        font-size: 0.68rem;
        letter-spacing: 0.04em;
    }

    .filter-clear {
        margin-left: 0;
        width: 100%;
    }

    .filter-label {
        width: 100%;
        padding-top: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }

    .chart-line {
        stroke-dashoffset: 0;
    }

    .chart-area {
        opacity: 1;
    }

    .bar-fill {
        transform: none;
    }
}

.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    gap: 1rem 1.25rem;
}

.config-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.88rem;
}

.config-field span,
.config-check span {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 650;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.config-field input,
.config-field select,
.job-form input,
td input,
td select {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.45rem 0.65rem;
    font: inherit;
}

.config-check {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}
