:root {
    color-scheme: dark;
    --bg: #0c0e0f;
    --bg-soft: #101315;
    --panel: #15191b;
    --panel-raised: #191e20;
    --panel-hover: #1d2325;
    --border: #293034;
    --border-strong: #394246;
    --text: #f3f0e8;
    --text-soft: #b9b8b2;
    --muted: #7f8788;
    --gold: #d6b85f;
    --gold-bright: #efd57e;
    --gold-deep: #9b7e31;
    --gold-wash: rgba(214, 184, 95, .1);
    --green: #72c795;
    --green-wash: rgba(114, 199, 149, .1);
    --red: #ec7b75;
    --red-wash: rgba(236, 123, 117, .1);
    --orange: #e6a85d;
    --blue: #79aeda;
    --shadow: 0 18px 48px rgba(0, 0, 0, .22);
    --radius: 14px;
    --radius-sm: 9px;
    --sidebar: 238px;
    --font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html { min-width: 320px; scroll-behavior: smooth; }

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 75% -10%, rgba(214, 184, 95, .055), transparent 32rem),
        var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { color: inherit; }

:focus-visible {
    outline: 2px solid var(--gold-bright);
    outline-offset: 2px;
}

::selection { background: rgba(214, 184, 95, .25); color: #fff; }

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

.skip-link {
    position: fixed; z-index: 1000; top: 10px; left: 10px;
    padding: 9px 13px; border-radius: 7px;
    background: var(--gold); color: #15130d; font-weight: 800;
    transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

.sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 30;
    display: flex; flex-direction: column;
    width: var(--sidebar); padding: 20px 14px 16px;
    border-right: 1px solid var(--border);
    background: rgba(16, 19, 21, .97);
    box-shadow: 12px 0 42px rgba(0, 0, 0, .12);
}

.brand {
    display: flex; align-items: center; gap: 11px;
    min-height: 50px; margin: 0 6px 24px;
}
.brand-mark {
    position: relative; display: grid; place-items: center;
    width: 39px; height: 39px;
    border: 1px solid rgba(214, 184, 95, .52);
    border-radius: 10px; background: linear-gradient(145deg, #24251e, #171915);
    box-shadow: inset 0 0 20px rgba(214, 184, 95, .07);
}
.brand-mark::before, .brand-mark span {
    content: ""; width: 14px; height: 14px;
    border: 2px solid var(--gold); transform: rotate(45deg);
}
.brand-mark span { position: absolute; width: 6px; height: 6px; border-color: var(--gold-bright); }
.brand-copy { display: flex; flex-direction: column; line-height: 1.18; }
.brand-copy strong { font-size: 15px; letter-spacing: .12em; }
.brand-copy small { margin-top: 4px; color: var(--muted); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }

.primary-nav { display: flex; flex: 1; flex-direction: column; gap: 3px; }
.nav-label {
    margin: 0 10px 8px; color: #646c6e;
    font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
}
.nav-link {
    position: relative; display: flex; align-items: center; gap: 11px;
    min-height: 42px; padding: 8px 10px;
    border: 1px solid transparent; border-radius: 9px;
    color: #aeb2af; font-size: 13px; font-weight: 650;
    transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.nav-link:hover { background: #191d1f; color: var(--text); }
.nav-link.is-active {
    border-color: rgba(214, 184, 95, .18);
    background: linear-gradient(90deg, rgba(214, 184, 95, .13), rgba(214, 184, 95, .035));
    color: var(--gold-bright);
}
.nav-link.is-active::before {
    position: absolute; content: ""; left: -15px; top: 10px; bottom: 10px;
    width: 3px; border-radius: 0 3px 3px 0; background: var(--gold);
}
.nav-icon {
    display: grid; place-items: center; flex: 0 0 24px;
    width: 24px; height: 24px; border-radius: 6px;
    background: rgba(255, 255, 255, .035); color: #929a99;
    font-family: var(--mono); font-size: 12px; font-weight: 800;
}
.is-active .nav-icon { background: var(--gold-wash); color: var(--gold-bright); }
.nav-count {
    margin-left: auto; min-width: 20px; padding: 1px 6px;
    border-radius: 999px; background: #242a2c; color: var(--text-soft);
    font-size: 10px; text-align: center;
}
.sidebar-foot { display: grid; gap: 13px; padding-top: 14px; border-top: 1px solid var(--border); }
.source-note { display: flex; align-items: flex-start; gap: 9px; padding: 4px 10px; color: var(--text-soft); font-size: 11px; line-height: 1.4; }
.source-note small { color: var(--muted); }
.live-dot { width: 7px; height: 7px; margin-top: 4px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(114, 199, 149, .09); }

.app-shell { min-height: 100vh; margin-left: var(--sidebar); }
.topbar {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; gap: 16px;
    height: 70px; padding: 0 clamp(20px, 3vw, 42px);
    border-bottom: 1px solid rgba(41, 48, 52, .82);
    background: rgba(12, 14, 15, .86); backdrop-filter: blur(18px);
}
.menu-button { display: none !important; }
.global-search { position: relative; display: flex; align-items: center; width: min(540px, 50vw); }
.global-search > span { position: absolute; left: 14px; color: var(--muted); font-size: 18px; }
.global-search input {
    width: 100%; height: 40px; padding: 0 50px 0 42px;
    border: 1px solid var(--border); border-radius: 10px;
    background: #121618; color: var(--text); outline: none;
    transition: border-color .18s, box-shadow .18s;
}
.global-search input::placeholder { color: #6f7677; }
.global-search input:focus { border-color: rgba(214, 184, 95, .55); box-shadow: 0 0 0 3px var(--gold-wash); }
.global-search kbd { position: absolute; right: 11px; padding: 1px 7px; border: 1px solid var(--border); border-bottom-color: #465054; border-radius: 5px; color: var(--muted); background: #181c1e; font: 11px var(--mono); }
.search-results, .compare-suggestions {
    position: absolute; z-index: 50; top: calc(100% + 8px); left: 0; right: 0;
    max-height: 390px; overflow: auto; padding: 7px;
    border: 1px solid var(--border-strong); border-radius: 12px;
    background: #171b1d; box-shadow: var(--shadow);
}
.search-result {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 9px 10px; border: 0; border-radius: 8px;
    background: transparent; color: var(--text); text-align: left; cursor: pointer;
}
.search-result:hover, .search-result:focus-visible { background: var(--panel-hover); }
.search-result img, .item-avatar { width: 31px; height: 31px; object-fit: contain; image-rendering: pixelated; }
.search-result div { min-width: 0; }
.search-result strong, .search-result small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-result small { color: var(--muted); font: 10px var(--mono); }
.topbar-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.api-pill {
    display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 11px;
    border: 1px solid var(--border); border-radius: 999px; color: var(--text-soft); font-size: 11px; font-weight: 700;
}
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.status-dot.is-online { background: var(--green); box-shadow: 0 0 0 4px var(--green-wash); }
.status-dot.is-degraded { background: var(--orange); box-shadow: 0 0 0 4px rgba(230, 168, 93, .1); }
.status-dot.is-offline { background: var(--red); box-shadow: 0 0 0 4px var(--red-wash); }
.status-dot.is-loading { animation: pulse 1.2s ease-in-out infinite; }

.main-content { width: min(1500px, 100%); min-height: calc(100vh - 160px); margin: 0 auto; padding: 32px clamp(20px, 3vw, 42px) 48px; }
.page-heading, .item-heading {
    display: flex; align-items: flex-end; justify-content: space-between; gap: 24px;
    margin-bottom: 24px;
}
.compact-heading { margin-bottom: 20px; }
.page-heading h1, .item-heading h1 { margin: 1px 0 5px; font-size: clamp(26px, 3vw, 38px); line-height: 1.13; letter-spacing: -.035em; }
.page-heading p:not(.eyebrow), .item-heading p:not(.eyebrow) { max-width: 680px; margin: 0; color: var(--muted); }
.eyebrow { margin: 0 0 3px; color: var(--gold); font-size: 10px; font-weight: 850; letter-spacing: .16em; text-transform: uppercase; }
.heading-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.freshness {
    display: flex; align-items: center; gap: 9px; flex: 0 0 auto;
    padding: 8px 11px; border: 1px solid var(--border); border-radius: 8px;
    color: var(--muted); font-size: 11px;
}

.button, .icon-button {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    min-height: 38px; padding: 0 14px;
    border: 1px solid transparent; border-radius: 8px;
    cursor: pointer; font-size: 12px; font-weight: 750;
    transition: transform .15s ease, background .15s ease, border-color .15s ease, color .15s ease;
}
.button:hover:not(:disabled), .icon-button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { opacity: .45; cursor: not-allowed; }
.button-primary { background: var(--gold); color: #17140d; box-shadow: 0 7px 20px rgba(214, 184, 95, .13); }
.button-primary:hover { background: var(--gold-bright); }
.button-secondary { border-color: rgba(214, 184, 95, .3); background: var(--gold-wash); color: var(--gold-bright); }
.button-secondary:hover { border-color: rgba(214, 184, 95, .55); background: rgba(214, 184, 95, .16); }
.button-ghost { border-color: var(--border); background: #141819; color: var(--text-soft); }
.button-ghost:hover { border-color: var(--border-strong); background: var(--panel-hover); color: var(--text); }
.button-compact { min-height: 34px; padding: 0 11px; font-size: 11px; }
.icon-button { width: 38px; padding: 0; background: transparent; border-color: var(--border); }
.text-link { padding: 0; border: 0; background: none; color: var(--gold); font-size: 11px; font-weight: 750; cursor: pointer; }
.text-link:hover { color: var(--gold-bright); }

.panel {
    border: 1px solid var(--border); border-radius: var(--radius);
    background: linear-gradient(155deg, rgba(25, 30, 32, .93), rgba(19, 23, 25, .98));
    box-shadow: 0 8px 28px rgba(0, 0, 0, .09);
}
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 18px 20px 14px; }
.panel-head h2 { margin: 0; font-size: 16px; letter-spacing: -.015em; }
.panel-head p:not(.eyebrow) { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.help { display: grid; place-items: center; width: 20px; height: 20px; border: 1px solid var(--border); border-radius: 50%; color: var(--muted); font-size: 10px; cursor: help; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.metric-card {
    position: relative; min-height: 116px; padding: 17px 18px;
    overflow: hidden; border: 1px solid var(--border); border-radius: 12px;
    background: linear-gradient(145deg, var(--panel-raised), #141718);
}
.metric-card::after { position: absolute; content: ""; right: -25px; bottom: -40px; width: 100px; height: 100px; border-radius: 50%; background: rgba(214, 184, 95, .03); }
.metric-card > span { display: block; color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; }
.metric-card strong { display: block; margin: 11px 0 2px; font-size: 25px; line-height: 1; letter-spacing: -.035em; }
.metric-card small { color: var(--text-soft); font-size: 10px; }
.metric-card .metric-icon { position: absolute; right: 16px; top: 15px; color: rgba(214, 184, 95, .55); font: 14px var(--mono); }
.metric-card .positive { color: var(--green); }
.metric-card .negative { color: var(--red); }

.dashboard-grid, .detail-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; }
.span-12 { grid-column: span 12; }
.span-8 { grid-column: span 8; }
.span-7 { grid-column: span 7; }
.span-5 { grid-column: span 5; }
.span-4 { grid-column: span 4; }
.trend-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; padding: 0 14px 14px; }
.trend-card {
    position: relative; display: grid; grid-template-columns: auto 1fr auto; gap: 11px; align-items: center;
    min-height: 80px; padding: 12px;
    border: 1px solid #262d30; border-radius: 10px; background: rgba(10, 13, 14, .34);
    transition: border-color .18s, background .18s;
}
a.trend-card:hover { border-color: rgba(214, 184, 95, .3); background: rgba(214, 184, 95, .04); }
.trend-card img { width: 40px; height: 40px; object-fit: contain; image-rendering: pixelated; }
.trend-card strong { display: block; font-size: 12px; }
.trend-card small { display: block; margin-top: 2px; color: var(--muted); font: 9px var(--mono); }
.trend-price { text-align: right; }
.trend-price b { display: block; font-size: 13px; }
.change { display: inline-flex; align-items: center; gap: 3px; font-size: 10px; font-weight: 800; }
.change.positive { color: var(--green); }
.change.negative { color: var(--red); }
.change.neutral { color: var(--muted); }

.rate-compact-list, .auction-compact-list { display: grid; gap: 0; padding: 0 14px 14px; }
.compact-row { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 5px; border-top: 1px solid rgba(41, 48, 52, .7); }
.compact-row:first-child { border-top: 0; }
.compact-row img { width: 30px; height: 30px; object-fit: contain; image-rendering: pixelated; }
.compact-row-copy { min-width: 0; flex: 1; }
.compact-row-copy strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.compact-row-copy small { display: block; color: var(--muted); font-size: 9px; }
.compact-value { text-align: right; }
.compact-value strong { display: block; font-size: 11px; }
.compact-value small { display: block; color: var(--gold); font-size: 9px; }

.truth-panel {
    display: flex; gap: 13px; align-items: flex-start;
    margin-top: 14px; padding: 15px 17px;
    border: 1px solid rgba(121, 174, 218, .18); border-radius: 11px;
    background: rgba(121, 174, 218, .045); color: var(--text-soft);
}
.truth-panel strong { display: block; color: var(--text); font-size: 11px; }
.truth-panel p { margin: 3px 0 0; font-size: 10px; line-height: 1.55; }
.truth-mark { display: grid; place-items: center; flex: 0 0 22px; width: 22px; height: 22px; border: 1px solid rgba(121, 174, 218, .35); border-radius: 50%; color: var(--blue); font: 700 11px var(--mono); }
.warning-panel { margin: -8px 0 16px; border-color: rgba(230, 168, 93, .22); background: rgba(230, 168, 93, .055); }
.warning-panel .truth-mark { border-color: rgba(230, 168, 93, .4); color: var(--orange); }

.toolbar {
    display: flex; align-items: flex-end; gap: 9px; flex-wrap: wrap;
    margin-bottom: 13px; padding: 12px;
    border: 1px solid var(--border); border-radius: 12px; background: #121517;
}
.search-field { position: relative; display: flex; align-items: center; flex: 1 1 240px; }
.search-field > span:not(.sr-only) { position: absolute; left: 12px; color: var(--muted); font-size: 17px; }
.search-field input, .select-field select, .calculator-form input, .calculator-form select, .login-form input {
    height: 39px; border: 1px solid var(--border); border-radius: 8px; background: #0f1213; color: var(--text); outline: none;
}
.search-field input { width: 100%; padding: 0 12px 0 38px; }
.search-field input:focus, .select-field select:focus, .calculator-form input:focus, .calculator-form select:focus, .login-form input:focus { border-color: rgba(214, 184, 95, .55); box-shadow: 0 0 0 3px var(--gold-wash); }
.select-field { display: grid; gap: 4px; flex: 0 1 175px; }
.select-field > span, .calculator-form label > span, .login-form label > span { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.select-field select { min-width: 145px; padding: 0 30px 0 11px; }

.table-panel { overflow: hidden; }
.table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.data-table th {
    height: 38px; padding: 0 13px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
    background: rgba(9, 11, 12, .36); color: #808889;
    font-size: 9px; font-weight: 850; letter-spacing: .065em; text-align: left; text-transform: uppercase; white-space: nowrap;
}
.data-table td { height: 57px; padding: 8px 13px; border-bottom: 1px solid rgba(41, 48, 52, .68); color: var(--text-soft); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background .15s; }
.data-table tbody tr:hover { background: rgba(255, 255, 255, .018); }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table .price-buy { color: var(--green); font-weight: 760; }
.data-table .price-sell { color: var(--gold-bright); font-weight: 760; }
.order-note { display: block; margin-top: 2px; color: var(--muted); font-size: 8px; font-weight: 500; }
.data-table code { color: var(--muted); font: 9px var(--mono); }
.table-item { display: flex; align-items: center; gap: 10px; min-width: 190px; }
.table-item img { width: 33px; height: 33px; object-fit: contain; image-rendering: pixelated; }
.table-item strong { display: block; color: var(--text); font-size: 11px; }
.table-item small { display: block; color: var(--muted); font: 9px var(--mono); }
.category-tag, .status-tag {
    display: inline-flex; align-items: center; min-height: 23px; padding: 2px 8px;
    border: 1px solid var(--border); border-radius: 999px; color: var(--text-soft); background: rgba(255, 255, 255, .02); font-size: 9px;
}
.status-tag.success { border-color: rgba(114, 199, 149, .25); background: var(--green-wash); color: var(--green); }
.status-tag.failed { border-color: rgba(236, 123, 117, .25); background: var(--red-wash); color: var(--red); }
.status-tag.running { border-color: rgba(230, 168, 93, .25); color: var(--orange); }
.row-action { width: 31px; height: 31px; padding: 0; border: 1px solid var(--border); border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer; }
.row-action:hover { border-color: rgba(214, 184, 95, .35); color: var(--gold); }
.compact-table td { height: 48px; }
.market-summary-head { align-items: center; }
.legend { display: flex; align-items: center; gap: 13px; color: var(--muted); font-size: 9px; }
.legend > span, .chart-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.legend-swatch { display: inline-block; width: 8px; height: 8px; border-radius: 2px; }
.legend-swatch.buy { background: var(--green); }
.legend-swatch.sell, .legend-swatch.gold { background: var(--gold); }
.legend-swatch.moving { background: var(--green); }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 15px; min-height: 58px; padding: 8px 14px; border-top: 1px solid var(--border); }
.pagination p { margin: 0; color: var(--muted); font-size: 10px; }
.pagination > div { display: flex; gap: 5px; }
.page-button { min-width: 31px; height: 31px; border: 1px solid var(--border); border-radius: 7px; background: #121617; color: var(--text-soft); cursor: pointer; font-size: 10px; }
.page-button.is-active { border-color: rgba(214, 184, 95, .4); background: var(--gold-wash); color: var(--gold-bright); }

.breadcrumbs { display: flex; gap: 8px; margin-bottom: 17px; color: var(--muted); font-size: 10px; }
.breadcrumbs a { color: var(--gold); }
.item-title { display: flex; align-items: center; gap: 15px; }
.item-icon-shell { display: grid; place-items: center; width: 67px; height: 67px; border: 1px solid var(--border); border-radius: 13px; background: var(--panel); }
.item-icon-shell img { width: 50px; height: 50px; object-fit: contain; image-rendering: pixelated; }
.material-id { font: 9px var(--mono) !important; letter-spacing: .04em; }
.detail-kpis { margin-top: 2px; }
.chart-panel { min-width: 0; }
.chart-wrap { position: relative; height: 330px; margin: 0 14px; }
.chart-wrap.large { height: 390px; }
.chart-wrap canvas { display: block; width: 100%; height: 100%; }
.chart-tooltip {
    position: absolute; z-index: 3; pointer-events: none;
    min-width: 150px; padding: 9px 10px;
    border: 1px solid var(--border-strong); border-radius: 8px;
    background: rgba(17, 20, 21, .96); box-shadow: var(--shadow); color: var(--text-soft); font-size: 9px;
}
.chart-tooltip strong { display: block; margin-bottom: 3px; color: var(--text); font-size: 10px; }
.chart-legend { display: flex; justify-content: space-between; padding: 10px 19px 16px; color: var(--text-soft); font-size: 9px; }
.muted { color: var(--muted) !important; }
.segmented-control { display: inline-flex; padding: 3px; border: 1px solid var(--border); border-radius: 8px; background: #0f1213; }
.segmented-control button { min-width: 48px; height: 27px; padding: 0 8px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 9px; font-weight: 750; cursor: pointer; }
.segmented-control button.is-active { background: var(--panel-hover); color: var(--gold-bright); box-shadow: 0 2px 7px rgba(0, 0, 0, .18); }
.stat-periods { display: grid; gap: 0; padding: 0 18px; }
.period-row { display: grid; grid-template-columns: 43px 1fr auto; align-items: center; gap: 11px; min-height: 63px; border-top: 1px solid var(--border); }
.period-row:first-child { border-top: 0; }
.period-row > span { color: var(--gold); font-size: 10px; font-weight: 800; }
.period-row div strong { display: block; font-size: 13px; }
.period-row div small { display: block; color: var(--muted); font-size: 9px; }
.period-row > small { text-align: right; }
.definition-note { margin: 15px 17px 17px; padding: 12px; border: 1px solid var(--border); border-radius: 9px; background: rgba(8, 10, 11, .28); }
.definition-note strong { font-size: 10px; }
.definition-note p { margin: 3px 0 0; color: var(--muted); font-size: 9px; }

.result-strip { display: flex; align-items: center; justify-content: space-between; min-height: 43px; margin-bottom: 8px; }
.result-strip p { margin: 0; color: var(--muted); font-size: 10px; }
.view-toggle { display: flex; padding: 3px; border: 1px solid var(--border); border-radius: 8px; }
.view-toggle button { width: 31px; height: 26px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); cursor: pointer; }
.view-toggle button.is-active { background: var(--panel-hover); color: var(--gold); }
.auction-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; }
.auction-card {
    position: relative; display: flex; flex-direction: column; min-height: 238px; padding: 15px;
    border: 1px solid var(--border); border-radius: 12px; background: linear-gradient(155deg, var(--panel-raised), #121516);
    color: var(--text); text-align: left; cursor: pointer; transition: transform .16s, border-color .16s, background .16s;
}
.auction-card:hover { transform: translateY(-2px); border-color: rgba(214, 184, 95, .3); background: var(--panel-hover); }
.auction-card-head { display: flex; justify-content: space-between; gap: 10px; }
.auction-card img { width: 53px; height: 53px; object-fit: contain; image-rendering: pixelated; }
.amount-badge { position: absolute; top: 46px; left: 49px; min-width: 20px; padding: 1px 4px; border-radius: 5px; background: #090b0c; color: #fff; font: 9px var(--mono); text-align: center; }
.ending-badge { display: inline-flex; height: 23px; align-items: center; padding: 0 7px; border: 1px solid var(--border); border-radius: 6px; color: var(--muted); font: 9px var(--mono); }
.ending-badge.is-urgent { border-color: rgba(236, 123, 117, .28); background: var(--red-wash); color: var(--red); }
.auction-card h3 { margin: 13px 0 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.auction-material { margin: 0; color: var(--muted); font: 9px var(--mono); }
.auction-card-footer { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: auto; padding-top: 14px; }
.auction-price { padding: 8px; border: 1px solid #252c2f; border-radius: 8px; background: rgba(9, 11, 12, .27); }
.auction-price span { display: block; color: var(--muted); font-size: 8px; text-transform: uppercase; }
.auction-price strong { display: block; margin-top: 2px; color: var(--gold-bright); font-size: 11px; }
.auction-meta { display: flex; justify-content: space-between; gap: 8px; margin-top: 10px; color: var(--muted); font-size: 8px; }
.auction-grid.is-list { display: grid; grid-template-columns: 1fr; }
.auction-grid.is-list .auction-card { display: grid; grid-template-columns: 64px minmax(160px, 1fr) 190px 190px; align-items: center; min-height: 92px; }
.auction-grid.is-list .auction-card h3 { margin: 0; }
.auction-grid.is-list .auction-card-footer { margin: 0; padding: 0; }
.auction-grid.is-list .auction-meta { justify-content: flex-end; }
.load-more-wrap { display: flex; justify-content: center; padding: 18px; }
.auction-dialog { width: min(650px, calc(100vw - 24px)); max-height: calc(100vh - 30px); padding: 0; border: 1px solid var(--border-strong); border-radius: 15px; background: #15191b; color: var(--text); box-shadow: 0 28px 90px rgba(0, 0, 0, .55); }
.auction-dialog::backdrop { background: rgba(4, 5, 6, .76); backdrop-filter: blur(5px); }
.dialog-shell { position: relative; padding: 25px; }
.dialog-close { position: absolute; top: 12px; right: 12px; width: 33px; height: 33px; border: 1px solid var(--border); border-radius: 8px; background: #111416; color: var(--muted); cursor: pointer; font-size: 20px; }
.auction-detail-head { display: flex; gap: 15px; padding-right: 40px; }
.auction-detail-head img { width: 65px; height: 65px; object-fit: contain; image-rendering: pixelated; }
.auction-detail-head h2 { margin: 2px 0 2px; font-size: 21px; }
.auction-detail-section { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.auction-detail-section h3 { margin: 0 0 9px; font-size: 11px; }
.detail-facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.detail-fact { padding: 10px; border: 1px solid var(--border); border-radius: 8px; background: #111416; }
.detail-fact span { display: block; color: var(--muted); font-size: 8px; text-transform: uppercase; }
.detail-fact strong { display: block; margin-top: 3px; font-size: 11px; overflow-wrap: anywhere; }
.lore-list { margin: 0; padding-left: 17px; color: var(--text-soft); font-size: 10px; }

.op-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.op-card { min-height: 260px; padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: linear-gradient(145deg, var(--panel-raised), #121516); }
.op-card-head { display: flex; gap: 13px; align-items: center; }
.op-card-head img { width: 51px; height: 51px; object-fit: contain; image-rendering: pixelated; }
.op-card h2 { margin: 0; font-size: 14px; }
.op-card .material-id { margin: 3px 0 0; color: var(--muted); }
.op-tags { display: flex; flex-wrap: wrap; gap: 5px; min-height: 26px; margin: 13px 0; }
.op-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.op-metric { padding: 9px; border: 1px solid var(--border); border-radius: 8px; background: rgba(8, 10, 11, .25); }
.op-metric span { display: block; color: var(--muted); font-size: 8px; }
.op-metric strong { display: block; margin-top: 3px; font-size: 11px; }
.op-card-foot { display: flex; justify-content: space-between; margin-top: 13px; padding-top: 11px; border-top: 1px solid var(--border); color: var(--muted); font-size: 9px; }

.rates-layout { display: grid; grid-template-columns: 1.4fr .6fr; gap: 13px; margin-bottom: 13px; }
.calculator-form { display: grid; grid-template-columns: 1.5fr .7fr 1.2fr; gap: 12px; align-items: end; padding: 0 20px 20px; }
.calculator-form label, .login-form label { display: grid; gap: 5px; }
.calculator-form select, .calculator-form input { width: 100%; padding: 0 11px; }
.calculator-result { min-height: 70px; padding: 10px 13px; border: 1px solid rgba(214, 184, 95, .24); border-radius: 10px; background: var(--gold-wash); }
.calculator-result span { display: block; color: var(--gold); font-size: 8px; font-weight: 800; text-transform: uppercase; }
.calculator-result strong { display: block; margin: 2px 0; font-size: 19px; }
.calculator-result small { color: var(--text-soft); font-size: 8px; }
.definition-list { margin: 0; padding: 0 18px 16px; }
.definition-list > div { padding: 9px 0; border-top: 1px solid var(--border); }
.definition-list > div:first-child { border-top: 0; }
.definition-list dt { color: var(--text); font-size: 10px; font-weight: 750; }
.definition-list dd { margin: 2px 0 0; color: var(--muted); font-size: 9px; }

.compare-builder { position: relative; margin-bottom: 13px; }
.compare-controls { position: relative; padding: 0 20px 18px; }
.compare-controls .search-field { max-width: 470px; }
.compare-suggestions { top: 45px; width: min(470px, 100%); }
.compare-chips { display: flex; flex-wrap: wrap; gap: 7px; min-height: 1px; margin-top: 10px; }
.compare-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 3px 7px 3px 9px; border: 1px solid var(--border); border-radius: 999px; color: var(--text-soft); font-size: 10px; }
.compare-chip i { width: 7px; height: 7px; border-radius: 50%; }
.compare-chip button { width: 21px; height: 21px; padding: 0; border: 0; border-radius: 50%; background: #252b2d; color: var(--muted); cursor: pointer; }
.compare-chart-panel { position: relative; margin-bottom: 13px; overflow: hidden; }
.compare-legend { display: flex; gap: 15px; flex-wrap: wrap; min-height: 38px; padding: 8px 20px 14px; color: var(--text-soft); font-size: 9px; }
.compare-legend span { display: inline-flex; align-items: center; gap: 6px; }
.compare-legend i { width: 8px; height: 8px; border-radius: 50%; }
.color-0 { color: #d6b85f; background-color: #d6b85f; }
.color-1 { color: #72c795; background-color: #72c795; }
.color-2 { color: #79aeda; background-color: #79aeda; }
.color-3 { color: #c98ad6; background-color: #c98ad6; }
.chart-dot { background: transparent; }
.icon-missing { position: relative; }
.icon-missing::after { content: "◇"; display: grid; place-items: center; min-width: 30px; min-height: 30px; color: var(--gold-deep); font: 18px var(--mono); }
[data-watch-toggle].is-watching { border-color: rgba(214, 184, 95, .45); color: var(--gold-bright); }
.empty-overlay { position: absolute; inset: 70px 0 0; display: grid; place-content: center; text-align: center; background: rgba(21, 25, 27, .8); }
.empty-overlay strong { font-size: 14px; }
.empty-overlay p { margin: 4px 0; color: var(--muted); font-size: 10px; }
.empty-overlay[hidden] { display: none; }

.watchlist-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.watch-card { display: grid; grid-template-columns: auto 1fr; gap: 14px; padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); }
.watch-card img { width: 47px; height: 47px; object-fit: contain; image-rendering: pixelated; }
.watch-card h2 { margin: 0; font-size: 13px; }
.watch-card .material-id { margin: 2px 0 10px; color: var(--muted); }
.watch-prices { display: flex; gap: 17px; }
.watch-prices span { display: block; color: var(--muted); font-size: 8px; }
.watch-prices strong { display: block; color: var(--text); font-size: 11px; }
.watch-actions { display: flex; gap: 7px; grid-column: 1 / -1; }

.status-overview { margin-bottom: 13px; }
.status-hero { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); }
.status-hero.is-online { border-color: rgba(114, 199, 149, .22); background: linear-gradient(90deg, var(--green-wash), var(--panel)); }
.status-hero.is-degraded { border-color: rgba(230, 168, 93, .25); background: linear-gradient(90deg, rgba(230, 168, 93, .09), var(--panel)); }
.status-hero.is-offline { border-color: rgba(236, 123, 117, .25); background: linear-gradient(90deg, var(--red-wash), var(--panel)); }
.status-orb { width: 34px; height: 34px; border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 8px rgba(127, 135, 136, .08); }
.is-online .status-orb { background: var(--green); box-shadow: 0 0 0 8px var(--green-wash); }
.is-degraded .status-orb { background: var(--orange); box-shadow: 0 0 0 8px rgba(230, 168, 93, .1); }
.is-offline .status-orb { background: var(--red); box-shadow: 0 0 0 8px var(--red-wash); }
.status-hero strong { font-size: 14px; }
.status-hero p { margin: 2px 0 0; color: var(--muted); font-size: 10px; }
.status-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 13px; }
.status-card { min-height: 175px; padding: 17px; }
.status-card-head { display: flex; justify-content: space-between; align-items: center; }
.status-card h2 { margin: 0; font-size: 14px; }
.status-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 17px; }
.status-fact, .system-fact { padding: 9px; border: 1px solid var(--border); border-radius: 8px; }
.status-fact span, .system-fact span { display: block; color: var(--muted); font-size: 8px; text-transform: uppercase; }
.status-fact strong, .system-fact strong { display: block; margin-top: 3px; font-size: 10px; }
.system-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; padding: 0 18px 18px; }

.login-panel { max-width: 520px; }
.login-form { display: grid; gap: 12px; padding: 0 20px 20px; }
.login-form input { width: 100%; padding: 0 11px; }
.login-form .button { margin-top: 4px; }
.inline-alert { margin: 0 20px 17px; padding: 11px 12px; border: 1px solid var(--border); border-radius: 9px; }
.inline-alert strong { font-size: 10px; }
.inline-alert p { margin: 3px 0 0; color: var(--muted); font-size: 9px; }
.inline-alert.warning { border-color: rgba(230, 168, 93, .24); background: rgba(230, 168, 93, .05); }
.inline-alert code { color: var(--gold-bright); }
.admin-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 13px; }
.admin-summary .panel { display: flex; flex-direction: column; min-height: 105px; padding: 16px; }
.admin-summary strong { margin-top: 8px; font-size: 15px; }
.admin-summary small { color: var(--muted); font-size: 9px; }
.fact-label { color: var(--gold); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.logout-card .text-link { align-self: flex-start; margin-top: auto; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 9px; padding: 0 20px 18px; }

.empty-state { padding: 26px 15px; color: var(--muted); text-align: center; font-size: 10px; }
.empty-state.large { grid-column: 1 / -1; padding: 70px 20px; border: 1px dashed var(--border); border-radius: 12px; }
.empty-state strong { display: block; margin-bottom: 4px; color: var(--text-soft); font-size: 13px; }
.empty-state p { margin: 0; }
.empty-state.is-loading::before { display: inline-block; content: ""; width: 12px; height: 12px; margin: 0 8px -2px 0; border: 2px solid var(--border); border-top-color: var(--gold); border-radius: 50%; animation: spin .8s linear infinite; }
.skeleton-block, .skeleton-line { position: relative; overflow: hidden; background: #202527 !important; color: transparent !important; }
.skeleton-block::after, .skeleton-line::after { position: absolute; content: ""; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .04), transparent); animation: shimmer 1.5s infinite; }
.skeleton-line { width: 58%; height: 19px; border-radius: 5px; }
.skeleton-line.short { width: 38%; height: 8px; }
.skeleton-block { min-height: 80px; }

.toast-stack { position: fixed; z-index: 100; right: 18px; bottom: 18px; display: grid; gap: 8px; width: min(350px, calc(100vw - 36px)); }
.toast { padding: 11px 13px; border: 1px solid var(--border-strong); border-radius: 9px; background: #1a1f21; box-shadow: var(--shadow); color: var(--text-soft); font-size: 10px; animation: toast-in .2s ease-out; }
.toast.is-static { margin: -12px 0 18px; }
.toast.is-success { border-color: rgba(114, 199, 149, .35); }
.toast.is-error { border-color: rgba(236, 123, 117, .38); }
.toast.is-warning { border-color: rgba(230, 168, 93, .38); }
.footer { display: flex; justify-content: space-between; gap: 24px; padding: 22px clamp(20px, 3vw, 42px); border-top: 1px solid var(--border); color: #656d6e; font-size: 8px; }
.footer p { margin: 0; }
.footer p:last-child { display: flex; align-items: center; gap: 7px; text-align: right; }
.footer .truth-mark { flex-basis: 16px; width: 16px; height: 16px; font-size: 8px; }
.not-found { display: grid; justify-items: start; max-width: 520px; padding: 8vh 0; }
.not-found-code { color: rgba(214, 184, 95, .14); font-size: clamp(90px, 18vw, 170px); font-weight: 900; line-height: .82; letter-spacing: -.09em; }
.not-found h1 { margin: 7px 0; font-size: 30px; }
.not-found > p:not(.eyebrow) { margin: 0 0 20px; color: var(--muted); }
.mobile-scrim { display: none; }

@keyframes pulse { 50% { opacity: .35; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { to { transform: translateX(100%); } }
@keyframes toast-in { from { transform: translateY(7px); opacity: 0; } }

@media (max-width: 1180px) {
    .auction-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .watchlist-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .op-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .auction-grid.is-list .auction-card { grid-template-columns: 64px minmax(150px, 1fr) 180px; }
    .auction-grid.is-list .auction-meta { display: none; }
}

@media (max-width: 960px) {
    :root { --sidebar: 218px; }
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .span-8, .span-7, .span-5, .span-4 { grid-column: span 12; }
    .dashboard-grid .span-8, .dashboard-grid .span-4 { grid-column: span 12; }
    .dashboard-grid .span-7, .dashboard-grid .span-5 { grid-column: span 12; }
    .rates-layout { grid-template-columns: 1fr; }
    .status-grid { grid-template-columns: 1fr; }
    .status-card { min-height: auto; }
    .auction-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .legend { display: none; }
}

@media (max-width: 760px) {
    .sidebar {
        width: min(280px, 84vw); transform: translateX(-105%);
        transition: transform .22s ease; box-shadow: 20px 0 60px rgba(0, 0, 0, .45);
    }
    body.menu-open { overflow: hidden; }
    body.menu-open .sidebar { transform: translateX(0); }
    .mobile-scrim { position: fixed; inset: 0; z-index: 25; background: rgba(3, 4, 5, .68); }
    body.menu-open .mobile-scrim { display: block; }
    .app-shell { margin-left: 0; }
    .topbar { height: 62px; padding: 0 14px; gap: 9px; }
    .menu-button { display: inline-flex !important; flex: 0 0 38px; }
    .global-search { width: auto; flex: 1; }
    .global-search input { padding-right: 12px; }
    .global-search kbd, .api-pill span:last-child, .topbar-actions .button span { display: none; }
    .api-pill { width: 34px; padding: 0; justify-content: center; }
    .topbar-actions { gap: 6px; }
    .main-content { padding: 23px 14px 38px; }
    .page-heading, .item-heading { align-items: flex-start; flex-direction: column; gap: 13px; }
    .page-heading h1, .item-heading h1 { font-size: 29px; }
    .freshness { align-self: flex-start; }
    .trend-grid { grid-template-columns: 1fr; }
    .panel-head { padding: 16px 15px 12px; }
    .toolbar { align-items: stretch; }
    .search-field, .select-field { flex-basis: 100%; }
    .select-field select { width: 100%; }
    .auction-toolbar .select-field { flex-basis: calc(50% - 5px); }
    .auction-grid.is-list .auction-card { display: flex; min-height: 238px; }
    .auction-grid.is-list .auction-meta { display: flex; }
    .auction-grid.is-list .auction-card-footer { margin-top: auto; padding-top: 14px; }
    .op-grid, .watchlist-grid { grid-template-columns: 1fr; }
    .calculator-form { grid-template-columns: 1fr; padding: 0 15px 16px; }
    .system-facts, .admin-summary { grid-template-columns: 1fr; }
    .chart-wrap { height: 285px; margin: 0 6px; }
    .chart-wrap.large { height: 320px; }
    .chart-panel .panel-head { flex-direction: column; }
    .footer { flex-direction: column; padding: 18px 14px; }
    .footer p:last-child { text-align: left; }
}

@media (max-width: 520px) {
    .kpi-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .metric-card { min-height: 105px; padding: 14px; }
    .metric-card strong { font-size: 21px; }
    .auction-grid { grid-template-columns: 1fr; }
    .auction-toolbar .select-field { flex-basis: 100%; }
    .trend-card { grid-template-columns: auto 1fr; }
    .trend-price { grid-column: 2; text-align: left; }
    .item-icon-shell { width: 56px; height: 56px; }
    .item-icon-shell img { width: 43px; height: 43px; }
    .segmented-control { width: 100%; }
    .segmented-control button { flex: 1; min-width: 0; }
    .detail-facts { grid-template-columns: 1fr; }
    .pagination { align-items: flex-start; flex-direction: column; }
    .market-summary-head { align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
