:root {
    color-scheme: dark;
    --bg: #080b10;
    --surface: #10161f;
    --surface-2: #151d28;
    --line: #253040;
    --text: #f2f5f7;
    --muted: #8e9bad;
    --accent: #c8ff39;
    --accent-2: #95d700;
    --danger: #ff5f6d;
    --warning: #ffbf47;
    --radius: 18px;
    --shadow: 0 18px 55px rgb(0 0 0 / 28%);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: radial-gradient(circle at 75% -10%, #1d2b26 0, transparent 30rem), var(--bg); color: var(--text); font: 15px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
svg { width: 1.25rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(1.4rem, 3vw, 2rem); letter-spacing: -.04em; }
h2 { margin-bottom: 0; font-size: 1.2rem; letter-spacing: -.025em; }
h3 { margin-bottom: .25rem; font-size: 1.15rem; }
small { color: var(--muted); }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 250px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 28px 18px; border-right: 1px solid var(--line); background: rgb(8 11 16 / 88%); backdrop-filter: blur(18px); display: flex; flex-direction: column; z-index: 20; }
.brand { display: flex; gap: 12px; align-items: center; padding: 0 10px 32px; }
.brand-mark { width: 43px; height: 43px; border-radius: 13px; display: grid; place-items: center; color: #111; background: var(--accent); font-weight: 900; letter-spacing: -.08em; box-shadow: 0 0 35px rgb(200 255 57 / 20%); }
.brand strong, .brand small { display: block; }
.brand small { margin-top: 1px; font-size: .72rem; }
.sidebar nav { display: grid; gap: 6px; }
.nav-link { color: var(--muted); padding: 11px 13px; border-radius: 11px; transition: .2s ease; }
.nav-link span { color: var(--accent); display: inline-block; width: 24px; }
.nav-link:hover { color: var(--text); background: var(--surface-2); transform: translateX(2px); }
.sidebar-note { margin-top: auto; color: var(--muted); font-size: .8rem; padding: 12px; border: 1px solid var(--line); border-radius: 11px; }
.pulse { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.main { min-width: 0; padding: 0 34px 50px; }
.topbar { min-height: 112px; display: flex; align-items: center; gap: 18px; }
.top-action { margin-left: auto; }
.menu-button { display: none; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; width: 42px; height: 42px; }
.eyebrow, .section-kicker { margin-bottom: 2px; color: var(--accent); text-transform: uppercase; font-weight: 800; letter-spacing: .13em; font-size: .67rem; }

.panel, .metric, .detail-hero { border: 1px solid var(--line); background: linear-gradient(145deg, rgb(21 29 40 / 92%), rgb(14 20 28 / 92%)); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel { padding: 22px; margin-bottom: 22px; }
.panel-head, .toolbar, .detail-hero { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.panel-head { margin-bottom: 20px; }
.toolbar { margin-bottom: 20px; }
.badge, .status { display: inline-flex; align-items: center; width: fit-content; white-space: nowrap; border: 1px solid var(--line); border-radius: 999px; padding: 4px 9px; color: var(--muted); font-size: .73rem; font-weight: 700; }
.status-active { color: var(--accent); border-color: rgb(200 255 57 / 30%); background: rgb(200 255 57 / 7%); }
.status-inactive { color: var(--muted); }
.positive { color: var(--accent) !important; }
.negative { color: var(--danger) !important; }

.button, .icon-button { cursor: pointer; border: 1px solid var(--line); color: var(--text); background: var(--surface-2); transition: .18s ease; }
.button { min-height: 40px; padding: 9px 14px; display: inline-flex; justify-content: center; align-items: center; border-radius: 10px; font-weight: 750; }
.button:hover, .icon-button:hover { border-color: #4b5b70; transform: translateY(-1px); }
.button-primary { color: #101508; border-color: var(--accent); background: var(--accent); }
.button-primary:hover { border-color: #ddff83; background: #d4ff63; }
.button-danger { color: #ff8993; background: rgb(255 95 109 / 8%); border-color: rgb(255 95 109 / 22%); }
.icon-button { width: 36px; height: 36px; border-radius: 9px; }
.icon-button.danger { color: var(--danger); }

input, select { width: 100%; color: var(--text); background: #0b1017; border: 1px solid var(--line); border-radius: 10px; padding: 10px 11px; outline: none; font-size: 16px; }
input:focus, select:focus { border-color: var(--accent-2); box-shadow: 0 0 0 3px rgb(200 255 57 / 8%); }
label { display: grid; gap: 6px; color: var(--muted); font-size: .77rem; font-weight: 700; }
.item-form { display: grid; grid-template-columns: 1.1fr 2fr 1fr .8fr auto; align-items: end; gap: 12px; }
.add-form-feedback { grid-column: 1 / -1; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; font-size: .78rem; font-weight: 750; }
.add-form-feedback.is-success { color: var(--accent); border-color: rgb(200 255 57 / 25%); background: rgb(200 255 57 / 6%); }
.add-form-feedback.is-error { color: #ff9ba4; border-color: rgb(255 95 109 / 30%); background: rgb(255 95 109 / 8%); }
.collapsible-create summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.collapsible-create summary::-webkit-details-marker { display: none; }
.collapsible-create summary strong, .collapsible-create summary span { display: block; }
.collapsible-create[open] summary { margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.summary-action { color: var(--accent); font-size: .78rem; font-weight: 800; }
.collapsible-create[open] .summary-action { font-size: 0; }
.collapsible-create[open] .summary-action::after { content: '− Schließen'; font-size: .78rem; }
.inline-form, .filter-form, .period-form, .edit-form, .version-form { display: flex; align-items: end; gap: 10px; }
.filter-form input { min-width: 210px; }
.list-overview { margin: -4px 0 16px; display: flex; align-items: center; gap: 9px; }
.list-overview > span { min-width: 125px; padding: 9px 12px; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; border: 1px solid var(--line); border-radius: 10px; background: rgb(8 13 19 / 45%); }
.list-overview > span.restock { border-color: rgb(255 191 71 / 25%); }
.list-overview > span.stock-count { border-color: rgb(77 167 255 / 25%); }
.list-overview > span.stock-value { border-color: rgb(200 255 57 / 25%); }
.list-overview small { font-size: .7rem; }
.list-overview strong { color: var(--text); font-size: 1rem; }
.list-overview .restock strong { color: var(--warning); }
.list-overview .stock-count strong { color: #91cfff; }
.list-overview .stock-value strong { color: var(--accent); }
.list-overview .visible-count { margin-left: auto; }
.list-filter-error { margin: 0 0 14px; padding: 10px 12px; color: #ff9ba4; border: 1px solid rgb(255 95 109 / 30%); border-radius: 9px; background: rgb(255 95 109 / 8%); }
.custom-period { display: flex; gap: 6px; }
.custom-period.is-hidden { display: none; }

.metric-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.metric { padding: 20px; min-height: 144px; display: flex; flex-direction: column; justify-content: center; overflow: hidden; position: relative; }
.metric::after { content: ""; position: absolute; width: 100px; height: 100px; right: -55px; top: -55px; background: var(--accent); border-radius: 50%; filter: blur(35px); opacity: .12; }
.metric-featured { border-color: rgb(200 255 57 / 34%); }
.metric-label { color: var(--muted); font-size: .78rem; }
.metric strong { display: block; margin: 8px 0 4px; font-size: clamp(1.05rem, 1.6vw, 1.55rem); letter-spacing: -.045em; }
.split-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, .7fr); gap: 22px; }
.split-grid .panel { margin-bottom: 0; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { color: var(--muted); text-align: left; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; }
th, td { padding: 13px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
.item-link { display: flex; gap: 10px; align-items: center; }
.item-link strong, .item-link small { display: block; }
.category-icon { flex: 0 0 auto; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; color: var(--accent); background: rgb(200 255 57 / 7%); border: 1px solid rgb(200 255 57 / 15%); }
.category-icon.large { width: 44px; height: 44px; }
.category-icon.hero-icon { width: 62px; height: 62px; border-radius: 16px; }
.category-icon.hero-icon svg { width: 30px; }
.category-stats { display: grid; gap: 8px; }
.category-stat { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--line); }
.category-stat:last-child { border: 0; }
.category-stat strong, .category-stat small { display: block; }

.item-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.item-card { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 15px; background: rgb(8 13 19 / 54%); display: grid; gap: 18px; }
.item-card.is-inactive { opacity: .68; }
.item-card-head, .card-actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.item-card p { margin-bottom: 0; color: var(--muted); }
.item-numbers { display: grid; grid-template-columns: .55fr 1.15fr 1fr; gap: 7px; }
.item-numbers span { min-width: 0; padding: 9px; border-radius: 9px; background: var(--surface); }
.item-numbers small, .item-numbers strong { display: block; overflow: hidden; text-overflow: ellipsis; }
.item-numbers strong { margin-top: 2px; font-size: .84rem; }
.card-actions .button, .card-actions form { flex: 1; }
.card-actions form .button { width: 100%; }

.compact-item-list { display: grid; gap: 7px; transition: opacity .15s ease; }
.compact-item-list.is-loading { opacity: .48; pointer-events: none; }
.compact-item-row { min-width: 0; min-height: 68px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 13px; background: rgb(8 13 19 / 52%); display: grid; grid-template-columns: auto minmax(140px, 1fr) minmax(150px, .65fr) minmax(100px, auto) minmax(70px, auto) 58px auto; align-items: center; gap: 12px; transition: border-color .16s ease, background .16s ease, transform .16s ease; }
.compact-item-row.is-actionable { cursor: pointer; }
.compact-item-row.is-actionable:hover, .compact-item-row.is-actionable:focus-visible { border-color: #4b5b70; background: var(--surface); outline: none; transform: translateY(-1px); }
.compact-item-row.is-inactive { opacity: .68; }
.compact-item-row.is-newly-added { animation: newly-added 1.8s ease-out; }
@keyframes newly-added {
    0%, 35% { border-color: var(--accent); background: rgb(200 255 57 / 13%); box-shadow: 0 0 0 3px rgb(200 255 57 / 8%); }
    100% { border-color: var(--line); background: rgb(8 13 19 / 52%); box-shadow: none; }
}
.compact-icon { width: 40px; height: 40px; }
.compact-item-main { min-width: 0; }
.compact-item-main strong, .compact-item-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compact-item-main strong { font-size: .94rem; }
.compact-item-main small { margin-top: 1px; }
.turnover { min-width: 0; display: flex; align-items: center; gap: 9px; }
.turnover > span:last-child { min-width: 0; }
.turnover strong, .turnover small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.turnover strong { font-size: .78rem; }
.turnover small { font-size: .68rem; }
.turnover-dot { flex: 0 0 auto; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); box-shadow: 0 0 12px currentColor; }
.turnover-running { color: var(--accent); }
.turnover-running .turnover-dot { background: var(--accent); }
.turnover-watch { color: var(--warning); }
.turnover-watch .turnover-dot { background: var(--warning); }
.turnover-slow { color: var(--danger); }
.turnover-slow .turnover-dot { background: var(--danger); }
.turnover-quiet { color: var(--muted); }
.turnover small { color: var(--muted); }
.last-purchase { min-width: 0; padding-left: 10px; border-left: 1px solid var(--line); }
.last-purchase small, .last-purchase strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.last-purchase small { font-size: .67rem; }
.last-purchase strong { margin-top: 1px; font-size: .78rem; }
.open-stock { text-align: center; padding: 4px 9px; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.open-stock small, .open-stock strong { display: block; }
.open-stock strong { font-size: 1rem; }
.compact-actions { display: flex; align-items: center; justify-content: flex-end; gap: 5px; }
.compact-actions form { display: flex; }
.compact-action { min-height: 34px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: var(--surface-2); cursor: pointer; font-size: .76rem; font-weight: 750; display: inline-flex; align-items: center; justify-content: center; }
.compact-action:hover { color: var(--text); border-color: #4b5b70; }
.compact-action.icon-only { width: 34px; padding-inline: 0; font-size: 1rem; }
.compact-action.danger { color: var(--danger); }
.compact-buy { color: #111; border-color: var(--accent); background: var(--accent); }
.compact-buy:hover { color: #111; background: #d4ff63; }
.reactivate-action { color: #111; border-color: var(--accent); background: var(--accent); }
.is-hidden { display: none !important; }

.open-chem-styles { min-width: 64px; display: flex; align-items: center; gap: 3px; }
.chem-style { --chem-color: #a7b0bc; min-width: 30px; height: 30px; padding: 2px 5px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid #475364; border: 1px solid color-mix(in srgb, var(--chem-color) 42%, transparent); border-radius: 8px 8px 11px 11px; color: var(--chem-color); background: #111821; background: linear-gradient(145deg, color-mix(in srgb, var(--chem-color) 16%, #111821), #0b1017); box-shadow: inset 0 0 12px rgb(255 255 255 / 3%); }
.chem-style b { font-size: .59rem; letter-spacing: -.02em; }
.chem-style > span { min-width: 90px; color: var(--text); font-size: .8rem; font-weight: 750; }
.chem-style-basic { --chem-color: #b9c0c9; }
.chem-style-attack { --chem-color: #ff7984; }
.chem-style-midfield { --chem-color: #62b7ff; }
.chem-style-defense { --chem-color: #79e08b; }
.chem-style-goalkeeper { --chem-color: #f4c95d; }
.chem-overflow { color: var(--muted); font-size: .68rem; font-weight: 800; }
.purchase-chem-style { margin: 5px 0 8px; }
.purchase-chem-style .chem-style { width: fit-content; }
.settings-list-head { margin: -7px 0 18px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.settings-hint { color: var(--muted); margin: 0; }
.sort-save-status { flex: 0 0 auto; color: var(--muted); font-size: .74rem; font-weight: 750; }
.sort-save-status.is-saving { color: var(--warning); }
.sort-save-status.is-saved { color: var(--accent); }
.sort-save-status.is-error { color: var(--danger); }
.chem-settings-list { display: grid; gap: 7px; }
.chem-settings-list.is-saving { pointer-events: none; }
.chem-settings-row { display: grid; grid-template-columns: 36px minmax(155px, 1fr) 75px auto; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: rgb(8 13 19 / 96%); transition: border-color .15s ease, opacity .15s ease; }
.chem-settings-row.is-inactive { opacity: .58; }
.chem-settings-row > .chem-style { align-self: center; width: fit-content; }
.system-default { align-self: center; justify-self: center; color: var(--muted); font-size: .74rem; font-weight: 750; }
.drag-handle { width: 34px; height: 38px; padding: 0; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: var(--surface-2); cursor: grab; touch-action: none; user-select: none; font-size: 1.2rem; line-height: 1; }
.drag-handle:hover, .drag-handle:focus-visible { color: var(--accent); border-color: var(--accent-2); outline: none; }
.drag-handle:active { cursor: grabbing; }
.chem-settings-row.is-dragging { opacity: .94; border-color: var(--accent); box-shadow: 0 18px 45px rgb(0 0 0 / 55%); }
.chem-drop-placeholder { border: 1px dashed var(--accent-2); border-radius: 12px; background: rgb(200 255 57 / 6%); }
.chem-is-sorting { user-select: none; cursor: grabbing; }

.quick-dialog { width: min(440px, calc(100vw - 28px)); padding: 0; color: var(--text); border: 1px solid #39475a; border-radius: 20px; background: linear-gradient(145deg, #17212d, #0e141c); box-shadow: 0 28px 90px rgb(0 0 0 / 65%); }
.quick-dialog::backdrop { background: rgb(2 5 8 / 76%); backdrop-filter: blur(5px); }
.quick-dialog-form { padding: 22px; display: grid; gap: 17px; }
.quick-dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 15px; }
.quick-dialog-head p:last-child { margin: 3px 0 0; color: var(--muted); }
.dialog-close { width: 36px; height: 36px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: var(--surface); cursor: pointer; font-size: 1.25rem; }
.quick-sale-preview { min-height: 22px; color: var(--muted); font-size: .78rem; }
.dialog-error { margin: 0; padding: 10px 12px; color: #ff9ba4; border: 1px solid rgb(255 95 109 / 30%); border-radius: 9px; background: rgb(255 95 109 / 8%); }
.quick-dialog-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 9px; }
.toast-region { position: fixed; right: 22px; bottom: 22px; z-index: 100; display: grid; gap: 8px; pointer-events: none; }
.quick-toast { padding: 12px 16px; color: #111; background: var(--accent); border-radius: 11px; box-shadow: var(--shadow); font-weight: 800; opacity: 0; transform: translateY(12px); transition: .2s ease; }
.quick-toast.is-visible { opacity: 1; transform: translateY(0); }
.settings-form { display: grid; gap: 20px; }
.settings-form > label { max-width: 600px; }
.settings-divider { padding-top: 18px; border-top: 1px solid var(--line); }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.settings-grid label { padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: rgb(8 13 19 / 45%); }
.settings-grid small { font-weight: 400; }
.settings-form > .button { justify-self: start; }

.finder-intro { max-width: 720px; margin: 6px 0 0; color: var(--muted); }
.finder-warning { padding: 11px 13px; color: var(--warning); border: 1px solid rgb(255 191 71 / 28%); border-radius: 10px; background: rgb(255 191 71 / 7%); }
.finder-warning code { color: var(--text); }
.finder-form { display: grid; grid-template-columns: minmax(180px, .7fr) minmax(150px, .5fr) auto; gap: 12px; align-items: end; }
.finder-source { display: block; margin-top: 12px; }
.finder-source a { color: var(--accent); }
.suggestion-list { display: grid; gap: 8px; }
.suggestion-row { padding: 11px 12px; display: grid; grid-template-columns: 68px minmax(150px, 1fr) 115px 90px minmax(190px, 1.2fr) auto; gap: 13px; align-items: center; border: 1px solid var(--line); border-radius: 13px; background: rgb(8 13 19 / 52%); }
.suggestion-score { width: 58px; height: 52px; display: grid; place-content: center; text-align: center; color: var(--accent); border: 1px solid rgb(200 255 57 / 25%); border-radius: 11px; background: rgb(200 255 57 / 7%); }
.suggestion-score strong { font-size: 1.2rem; line-height: 1; }
.suggestion-score small { margin-top: 3px; font-size: .58rem; }
.suggestion-player, .suggestion-number { min-width: 0; }
.suggestion-player strong, .suggestion-player small, .suggestion-number strong, .suggestion-number small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggestion-player small, .suggestion-number small { margin-top: 2px; }
.suggestion-number strong { font-size: .8rem; }
.suggestion-reasons { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.suggestion-reasons .badge { padding-block: 3px; font-size: .65rem; }
.suggestion-reasons > small { width: 100%; }
.suggestion-actions { display: flex; align-items: center; gap: 6px; }

.detail-hero { margin-bottom: 22px; padding: 24px; }
.detail-title { display: flex; align-items: center; gap: 16px; }
.detail-title p:last-child { color: var(--muted); margin: 3px 0 0; }
.quick-entry { display: flex; justify-content: space-between; align-items: end; gap: 20px; }
.quick-entry p:last-child { margin-bottom: 0; color: var(--muted); }
.trade-list { display: grid; gap: 10px; }
.trade-row { display: grid; grid-template-columns: 80px minmax(150px, .7fr) 28px minmax(250px, 1.1fr) auto auto; gap: 12px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: rgb(8 13 19 / 45%); }
.trade-status { color: var(--warning); text-transform: uppercase; font-size: .68rem; letter-spacing: .08em; font-weight: 850; }
.trade-status span { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--warning); }
.trade-row.is-sold .trade-status { color: var(--accent); }
.trade-row.is-sold .trade-status span { background: var(--accent); }
.trade-block small { display: block; margin-bottom: 5px; }
.edit-form input { max-width: 150px; }
.sale-form { display: grid; grid-template-columns: minmax(120px, .7fr) minmax(180px, 1fr) auto; gap: 10px; align-items: end; }
.sale-preview { align-self: center; color: var(--muted); font-size: .75rem; }
.trade-arrow { color: var(--muted); font-size: 1.25rem; }
.trade-meta { color: var(--muted); font-size: .73rem; }
.trade-profit { white-space: nowrap; }

.version-list { display: grid; gap: 9px; }
.version-row { display: grid; grid-template-columns: 80px 1fr auto; gap: 14px; align-items: end; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: rgb(8 13 19 / 45%); }
.version-row.is-inactive { opacity: .62; }
.version-form { display: grid; grid-template-columns: 1fr 130px auto; }
.empty-state, .error-page { padding: 45px 20px; text-align: center; color: var(--muted); }
.empty-state strong, .error-page h2 { color: var(--text); }
.empty-state p { margin: 5px auto 18px; }
.empty-state.compact { padding: 22px 10px; }
.error-page { padding-block: 90px; }
.error-page > span { color: var(--accent); font-size: 4rem; font-weight: 900; }
.error-page pre { text-align: left; white-space: pre-wrap; color: #ffb0b7; background: #090d12; padding: 15px; border-radius: 10px; }
.debug-panel { max-width: 900px; margin: 20px auto; text-align: left; }
.debug-panel > strong { display: block; margin-bottom: 8px; color: var(--warning); }
.flash-stack { display: grid; gap: 8px; margin-bottom: 18px; }
.flash { padding: 12px 15px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.flash-success { border-color: rgb(200 255 57 / 25%); color: var(--accent); }
.flash-error { border-color: rgb(255 95 109 / 30%); color: #ff9ba4; }
.flash-info { color: #91cfff; border-color: rgb(77 167 255 / 28%); }

@media (max-width: 1180px) {
    .metric-grid { grid-template-columns: repeat(3, 1fr); }
    .item-grid { grid-template-columns: repeat(2, 1fr); }
    .item-form { grid-template-columns: repeat(2, 1fr); }
    .trade-row { grid-template-columns: 70px 1fr 25px 1.5fr auto; }
    .trade-row > .delete-form { grid-column: 5; }
    .trade-profit { grid-column: 5; grid-row: 1; }
    .suggestion-row { grid-template-columns: 58px minmax(140px, 1fr) 105px 80px auto; }
    .suggestion-reasons { grid-column: 2 / 5; grid-row: 2; }
    .suggestion-actions { grid-column: 5; grid-row: 1 / 3; }
}

@media (max-width: 900px) {
    .app-shell { display: block; }
    .sidebar { position: fixed; left: 0; transform: translateX(-105%); width: 260px; transition: transform .2s ease; box-shadow: var(--shadow); }
    .menu-open .sidebar { transform: translateX(0); }
    .main { padding-inline: 20px; }
    .menu-button { display: block; }
    .split-grid { grid-template-columns: 1fr; }
    .quick-entry { align-items: stretch; flex-direction: column; }
    .compact-item-row { grid-template-columns: auto minmax(130px, 1fr) minmax(100px, auto) minmax(70px, auto) 50px auto; }
    .turnover { grid-column: 2; grid-row: 2; }
    .compact-item-row { row-gap: 3px; }
    .compact-icon { grid-row: 1 / 3; }
    .last-purchase { grid-column: 3; grid-row: 1 / 3; }
    .open-chem-styles { grid-column: 4; grid-row: 1 / 3; }
    .open-stock { grid-column: 5; grid-row: 1 / 3; }
    .compact-actions { grid-column: 6; grid-row: 1 / 3; }
    .suggestion-row { grid-template-columns: 58px minmax(130px, 1fr) 105px auto; }
    .suggestion-popularity { display: none; }
    .suggestion-reasons { grid-column: 2 / 4; }
    .suggestion-actions { grid-column: 4; }
}

@media (max-width: 680px) {
    .main { padding-inline: 14px; }
    .topbar { min-height: 92px; }
    .top-action { display: none; }
    .metric-grid { grid-template-columns: repeat(2, 1fr); }
    .metric:first-child { grid-column: 1 / -1; }
    .item-grid { grid-template-columns: 1fr; }
    .item-form, .version-form { grid-template-columns: 1fr; }
    .stack-mobile, .toolbar { align-items: stretch; flex-direction: column; }
    .filter-form, .period-form, .inline-form { align-items: stretch; flex-direction: column; }
    .filter-form input { min-width: 0; }
    .list-overview { flex-wrap: wrap; }
    .list-overview > span { flex: 1; min-width: 135px; }
    .list-overview .visible-count { width: 100%; margin-left: 0; }
    .custom-period { display: grid; grid-template-columns: 1fr 1fr; }
    .trade-row { grid-template-columns: 1fr auto; }
    .trade-status, .trade-block, .sale-form { grid-column: 1 / -1; }
    .trade-arrow { display: none; }
    .sale-form { grid-template-columns: 1fr; }
    .trade-profit { grid-column: 1; grid-row: auto; }
    .trade-row > .delete-form { grid-column: 2; grid-row: auto; }
    .version-row { grid-template-columns: 1fr; align-items: stretch; }
    .detail-hero { align-items: flex-start; }
    .compact-item-row { min-height: 88px; padding: 9px; grid-template-columns: auto minmax(90px, 1fr) minmax(32px, auto) 40px auto; gap: 4px 6px; }
    .compact-icon { width: 36px; height: 36px; }
    .compact-icon { grid-row: 1 / 4; }
    .turnover { grid-column: 2; grid-row: 2; }
    .last-purchase { grid-column: 2; grid-row: 3; padding-left: 0; border-left: 0; display: flex; gap: 5px; }
    .last-purchase small::after { content: ':'; }
    .last-purchase strong { margin-top: 0; }
    .open-chem-styles { grid-column: 3; grid-row: 1 / 4; }
    .open-stock { grid-column: 4; grid-row: 1 / 4; }
    .compact-actions { grid-column: 5; grid-row: 1 / 4; }
    .compact-actions { gap: 3px; }
    .compact-action { min-height: 32px; padding: 5px 7px; }
    .compact-action.icon-only { width: 32px; }
    .compact-buy { font-size: 0; width: 32px; padding: 0; }
    .compact-buy::after { content: '+'; font-size: 1.15rem; }
    .open-stock { padding-inline: 5px; }
    .open-chem-styles { min-width: 30px; max-width: 66px; flex-wrap: wrap; }
    .chem-style { min-width: 28px; height: 28px; padding-inline: 4px; }
    .settings-list-head { align-items: flex-start; flex-direction: column; }
    .chem-settings-row { grid-template-columns: 34px minmax(105px, 1fr) auto; gap: 8px; }
    .chem-settings-row > .status { display: none; }
    .chem-settings-row > form { grid-column: 3; grid-row: 1; }
    .chem-settings-row > .system-default { grid-column: 3; grid-row: 1; }
    .settings-grid { grid-template-columns: 1fr; }
    .finder-form { grid-template-columns: 1fr; }
    .suggestion-row { grid-template-columns: 52px minmax(110px, 1fr) auto; gap: 8px; }
    .suggestion-score { width: 48px; }
    .suggestion-number { grid-column: 2; grid-row: 2; }
    .suggestion-reasons { grid-column: 2 / 4; grid-row: 3; }
    .suggestion-actions { grid-column: 3; grid-row: 1 / 3; align-items: flex-end; flex-direction: column; }
    .suggestion-actions .button { padding-inline: 9px; }
    .toast-region { right: 14px; left: 14px; bottom: 14px; }
    .quick-toast { text-align: center; }
}
