:root {

    --bg: #0d1117;
    --bg2: #131923;
    --bg3: #181f2b;

    --border: rgba(255,255,255,0.06);
    --border2: rgba(255,255,255,0.08);

    --green: #00e18f;
    --green-soft: rgba(0,225,143,0.08);

    --text: #f5f7fa;
    --text-dim: #7f8898;
}

* {

    margin: 0;
    padding: 0;

    box-sizing: border-box;
}

body {

    background: var(--bg);

    color: var(--text);

    font-family: 'Inter', sans-serif;

    height: 100vh;

    overflow: hidden;
}

/* ====================================== */
/* TOPBAR */
/* ====================================== */

.topbar {

    height: 66px;

    background: #10151d;

    border-bottom: 1px solid var(--border2);

    display: flex;

    align-items: center;

    justify-content: space-between;

    padding: 0 22px;
}

.topbar-left {

    display: flex;

    align-items: center;

    gap: 18px;
}

.logo {

    font-size: 33px;

    font-weight: 700;

    color: white;

    text-decoration: none;

    line-height: 1;
}

.logo span {

    color: var(--green);
}

.topbar-sep {

    width: 1px;
    height: 24px;

    background: var(--border2);
}

.subtitle {

    color: var(--text-dim);

    font-size: 12px;

    letter-spacing: 1.8px;

    text-transform: uppercase;
}

/* ====================================== */
/* MAIN */
/* ====================================== */

.main {

    display: flex;

    height: calc(100vh - 66px);
}

/* ====================================== */
/* LEFT PANEL */
/* ====================================== */

.left-panel {

    width: 800px;

    min-width: 500px;

    max-width: 55vw;

    display: flex;

    flex-direction: column;

    border-right: 1px solid var(--border);
}

/* ====================================== */
/* SEARCH */
/* ====================================== */

.search-panel {

    height: 58px;

    background: #111722;

    border-bottom: 1px solid var(--border);

    padding: 10px 14px;
}

.search-box {

    position: relative;

    width: 100%;
}

.search-input {

    width: 100%;

    height: 38px;

    background: var(--bg3);

    border: 1px solid var(--border2);

    border-radius: 9px;

    padding: 0 14px;

    color: white;

    font-size: 14px;

    outline: none;
}

.search-input:focus {

    border-color: rgba(0,225,143,0.4);
}

.search-dropdown {

    position: absolute;

    top: 44px;
    left: 0;
    right: 0;

    background: #181f2b;

    border: 1px solid var(--border2);

    border-radius: 10px;

    overflow: hidden;

    display: none;

    z-index: 999;

    max-height: 420px;

    overflow-y: auto;
}

.search-item {

    display: flex;

    align-items: center;

    gap: 12px;

    padding: 10px 14px;

    cursor: pointer;

    transition: 0.12s;
}

.search-item:hover {

    background: rgba(255,255,255,0.03);
}

.search-item img {

    width: 30px;
    height: 30px;

    image-rendering: pixelated;
}

.search-info {

    display: flex;

    flex-direction: column;

    gap: 2px;
}

.search-name {

    font-size: 13px;

    color: white;
}

.search-cat {

    font-size: 11px;

    color: var(--text-dim);
}

/* ====================================== */
/* BROWSER */
/* ====================================== */

.browser {

    display: flex;

    flex: 1;

    min-height: 0;
}

/* ====================================== */
/* FILTER TREE */
/* ====================================== */

.sidebar {

    width: 400px;

    min-width: 240px;

    max-width: 50%;

    background: var(--bg2);

    border-right: 1px solid var(--border);

    overflow-y: auto;

    padding: 10px 0;
}

.tree-row {

    display: flex;

    align-items: center;

    gap: 10px;

    padding: 8px 14px;

    cursor: pointer;

    transition: 0.12s;

    user-select: none;

    position: relative;
}

.tree-row:hover {

    background: rgba(255,255,255,0.03);
}

.tree-row.active {

    background: var(--green-soft);

    border-left: 3px solid var(--green);
}

.tree-expand {

    width: 26px;

    min-width: 26px;

    height: 24px;

    display: flex;

    align-items: center;

    justify-content: center;

    cursor: pointer;

    color: var(--text-dim);

    font-size: 11px;

    flex-shrink: 0;

    border-radius: 4px;

    transition: 0.12s;
}

.tree-expand:hover {

    background: rgba(255,255,255,0.05);
}

.tree-checkbox {

    width: 15px;
    height: 15px;

    border: 1px solid var(--border2);

    border-radius: 4px;

    flex-shrink: 0;

    position: relative;
}

.tree-checkbox.checked {

    background: var(--green);

    border-color: var(--green);
}

.tree-checkbox.checked::after {

    content: "✓";

    position: absolute;

    top: 50%;
    left: 50%;

    transform: translate(-50%, -50%);

    font-size: 10px;

    font-weight: bold;

    color: black;
}

.tree-label {

    font-size: 13px;
}

.tree-children {

    padding-left: 18px;
}

.coming {

    color: var(--text-dim);

    font-size: 11px;

    margin-left: 6px;
}

/* ====================================== */
/* ITEMS COLUMN */
/* ====================================== */

.items-column {

    flex: 1;

    background: #151b25;

    overflow-y: auto;
}

.items-group {

    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.items-group-title {

    padding: 12px 16px 8px;

    color: var(--green);

    font-size: 11px;

    text-transform: uppercase;

    letter-spacing: 1px;

    font-weight: 700;
}

.item-row {

    display: flex;

    align-items: center;

    gap: 10px;

    padding: 8px 16px;

    color: var(--text);

    text-decoration: none;

    transition: 0.12s;
}

.item-row:hover {

    background: rgba(255,255,255,0.03);
}

.item-row.active {

    background: var(--green-soft);

    border-left: 3px solid var(--green);
}

.item-row img {

    width: 28px;
    height: 28px;

    image-rendering: pixelated;
}

.item-name {

    font-size: 13px;
}

/* ====================================== */
/* CONTENT */
/* ====================================== */

.content {

    flex: 1;

    overflow: auto;

    padding: 18px;

    display: flex;

    flex-direction: column;

    gap: 16px;
}

.item-header {

    background: var(--bg2);

    border: 1px solid var(--border);

    border-radius: 10px;

    padding: 18px;

    display: flex;

    gap: 18px;

    align-items: center;

    flex-shrink: 0;
}

.item-header img {

    width: 64px;
    height: 64px;

    image-rendering: pixelated;
}

.item-title {

    font-size: 30px;

    font-weight: 700;

    margin-bottom: 10px;
}

.item-meta {

    display: flex;

    gap: 22px;

    flex-wrap: wrap;
}

.meta {

    color: var(--text-dim);

    font-size: 12px;
}

.meta strong {

    color: white;
}

.green {

    color: var(--green) !important;
}

/* ====================================== */
/* MARKET */
/* ====================================== */

.market-panel {

    background: var(--bg2);

    border: 1px solid var(--border);

    border-radius: 10px;

    overflow: hidden;

    flex: 1;

    min-height: 0;

    display: flex;

    flex-direction: column;
}

.market-title {

    padding: 12px 16px;

    color: var(--green);

    background: rgba(0,225,143,0.05);

    border-bottom: 1px solid rgba(0,225,143,0.1);

    font-size: 13px;

    font-weight: 600;

    letter-spacing: 0.5px;

    flex-shrink: 0;
}

.market-scroll {

    flex: 1;

    overflow-y: auto;
}

table {

    width: 100%;

    border-collapse: collapse;

    table-layout: fixed;
}

th {

    padding: 10px 12px;

    text-align: right;

    color: var(--text-dim);

    font-size: 10px;

    text-transform: uppercase;

    letter-spacing: 1px;

    border-bottom: 1px solid rgba(255,255,255,0.05);

    background: rgba(255,255,255,0.02);
}

th:first-child {

    text-align: right;
}

td {

    padding: 10px 12px;

    border-bottom: 1px solid rgba(255,255,255,0.03);

    font-size: 12px;

    text-align: right;

    /* Tabular nums — цифры одинаковой ширины, не скачут */
    font-variant-numeric: tabular-nums;
}

td:first-child {

    text-align: right;
}

tr:hover td {

    background: rgba(255,255,255,0.02);
}

.price {

    color: var(--green);

    font-weight: 600;

    font-variant-numeric: tabular-nums;
}

.age-fresh {

    color: var(--green);

    font-weight: 500;
}

.age-old {

    color: #f0c040;

    font-weight: 500;
}

.age-stale {

    color: #e05555;

    font-weight: 500;
}

/* ====================================== */
/* LANG SWITCHER */
/* ====================================== */

.lang-switcher {

    position: relative;
}

.lang-current {

    color: var(--text-dim);

    font-size: 12px;

    letter-spacing: 1px;

    cursor: pointer;

    padding: 6px 12px;

    border: 1px solid var(--border2);

    border-radius: 7px;

    transition: 0.12s;
}

.lang-current:hover {

    border-color: rgba(0,225,143,0.3);

    color: white;
}

.lang-dropdown {

    display: none;

    position: absolute;

    top: 36px;
    right: 0;

    background: #181f2b;

    border: 1px solid var(--border2);

    border-radius: 9px;

    overflow: hidden;

    min-width: 160px;

    z-index: 999;
}

.lang-item {

    padding: 10px 14px;

    font-size: 13px;

    cursor: pointer;

    transition: 0.12s;
}

.lang-item:hover {

    background: rgba(255,255,255,0.03);
}

.lang-item.active {

    color: var(--green);
}

.lang-item.coming {

    color: var(--text-dim);

    cursor: default;
}

.lang-item.coming span {

    font-size: 11px;
}

/* ====================================== */
/* RESPONSIVE */
/* ====================================== */

@media (max-width: 1400px) {

    .left-panel {

        width: 650px;
    }

    .sidebar {

        width: 320px;
    }
}

@media (max-width: 1100px) {

    .left-panel {

        width: 520px;
    }

    .sidebar {

        width: 260px;
    }

    .item-title {

        font-size: 22px;
    }
}