:root {
    color-scheme: dark;
    --bg-base: #05080a;
    --bg-card: rgba(14, 22, 29, 0.92);
    --line: rgba(117, 231, 210, 0.16);
    --text: #eff7f5;
    --muted: #94a8aa;
    --accent: #75e7d2;
    --accent-soft: #8dd4ff;
    --accent-warm: #f0b24e;
    --danger: #ff7a67;
    --success: #91f2b4;
    --warning: #ffd279;
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.42);
    --radius-xl: 30px;
    --radius-lg: 22px;
    --radius-md: 16px;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    font-family: "Segoe UI Variable Text", "Trebuchet MS", sans-serif;
    background:
        radial-gradient(circle at 10% 20%, rgba(117, 231, 210, 0.16), transparent 30%),
        radial-gradient(circle at 86% 8%, rgba(240, 178, 78, 0.14), transparent 24%),
        linear-gradient(160deg, #040608 0%, #091116 45%, #0f171d 100%);
    color: var(--text);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
    background-size: 52px 52px;
    mask-image: radial-gradient(circle at center, black 42%, transparent 92%);
    opacity: 0.35;
}

button,
input,
select {
    font: inherit;
}

.app-shell {
    position: relative;
    max-width: 1600px;
    margin: 0 auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.hero,
.summary-strip,
.tab-bar,
.panel {
    position: relative;
    z-index: 1;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) minmax(320px, 1fr);
    gap: 18px;
    padding: 28px;
    border-radius: var(--radius-xl);
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(15, 23, 29, 0.95), rgba(9, 15, 20, 0.86));
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.eyebrow,
.panel__kicker,
.metric-card__label,
.mini-stat__label,
.socket-control__label,
.ticker__label {
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.74rem;
    color: var(--muted);
}

.hero h1,
.panel h2 {
    margin: 0;
    font-family: "Bahnschrift", "Segoe UI Variable Display", sans-serif;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.hero h1 {
    margin-top: 10px;
    font-size: clamp(2.4rem, 4vw, 4.1rem);
    line-height: 0.96;
}

.hero__summary {
    margin: 16px 0 0;
    max-width: 42rem;
    color: #c6d3d3;
    font-size: 1.03rem;
}

.hero__controls {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 14px;
    padding: 18px;
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, rgba(17, 26, 33, 0.96), rgba(10, 16, 20, 0.9));
    border: 1px solid rgba(141, 212, 255, 0.14);
}

.socket-control,
.recipe-control {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.socket-control input,
.recipe-control select {
    width: 100%;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid rgba(141, 212, 255, 0.18);
    background: rgba(4, 10, 14, 0.9);
    color: var(--text);
}

.socket-control input:focus,
.recipe-control select:focus {
    outline: 2px solid rgba(141, 212, 255, 0.45);
    outline-offset: 2px;
}

.hero__actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.action-button,
.tab-button {
    border: 0;
    cursor: pointer;
    color: var(--text);
    transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
}

.action-button {
    border-radius: 999px;
    padding: 12px 18px;
    background: linear-gradient(135deg, rgba(117, 231, 210, 0.18), rgba(141, 212, 255, 0.22));
}

.action-button:hover,
.tab-button:hover {
    transform: translateY(-1px);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    border-radius: 999px;
    font-weight: 600;
    border: 1px solid transparent;
    background: rgba(17, 24, 29, 0.86);
}

.status-pill__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.05);
}

.status-pill.is-online {
    color: var(--success);
    border-color: rgba(145, 242, 180, 0.28);
}

.status-pill.is-connecting {
    color: var(--accent-soft);
    border-color: rgba(141, 212, 255, 0.22);
}

.status-pill.is-offline {
    color: var(--danger);
    border-color: rgba(255, 122, 103, 0.24);
}

.connection-detail,
.panel__summary,
.recipe-status {
    margin: 0;
    color: var(--muted);
}

.summary-strip {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
}

.metric-card,
.mini-stat,
.tab-bar {
    background: var(--bg-card);
    box-shadow: var(--shadow);
}

.metric-card {
    padding: 18px 20px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.metric-card__value,
.mini-stat__value,
.ticker__value {
    margin: 10px 0 0;
    font-family: "Consolas", "Cascadia Code", monospace;
}

.metric-card__value {
    font-size: clamp(1.15rem, 2.2vw, 1.85rem);
}

.metric-card--accent {
    border-color: rgba(117, 231, 210, 0.2);
}

.metric-card--warning {
    border-color: rgba(240, 178, 78, 0.22);
}

.tab-bar {
    display: flex;
    gap: 10px;
    padding: 10px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.tab-button {
    flex: 1;
    padding: 14px 18px;
    border-radius: 14px;
    background: rgba(8, 13, 18, 0.5);
    border: 1px solid transparent;
    font-weight: 600;
}

.tab-button.is-active {
    background: linear-gradient(135deg, rgba(117, 231, 210, 0.18), rgba(141, 212, 255, 0.22));
    border-color: rgba(117, 231, 210, 0.24);
}

.tab-panels {
    display: block;
}

.tab-panel {
    display: block;
}

.tab-panel[hidden] {
    display: none;
}

.dashboard-grid {
    display: grid;
    gap: 18px;
}

.dashboard-grid--overview {
    grid-template-columns: minmax(360px, 1.25fr) minmax(320px, 0.95fr);
}

.dashboard-grid--single {
    grid-template-columns: minmax(0, 1fr);
}

.panel {
    display: flex;
    flex-direction: column;
    min-height: 560px;
    border-radius: var(--radius-xl);
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(13, 20, 26, 0.94), rgba(9, 15, 19, 0.92));
    box-shadow: var(--shadow);
    overflow: hidden;
}

.panel--recipe,
.panel--snapshot {
    min-height: 520px;
}

.panel__header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-end;
    padding: 22px 22px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.panel__body {
    padding: 18px;
}

.panel__body--stack {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.recipe-toolbar {
    display: grid;
    grid-template-columns: minmax(280px, 420px) minmax(220px, 1fr);
    gap: 18px;
    align-items: end;
}

.recipe-status {
    justify-self: end;
    text-align: right;
}

.recipe-list,
.mini-stat-grid {
    display: grid;
    gap: 14px;
}

.recipe-list {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.mini-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mini-stat {
    padding: 18px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.mini-stat__value {
    font-size: clamp(1.2rem, 2vw, 1.8rem);
}

.latest-panel,
.recipe-card,
.recipe-empty-state,
.alert-banner,
.table-shell {
    border-radius: 20px;
    background: rgba(10, 16, 21, 0.92);
}

.latest-panel,
.alert-banner,
.table-shell {
    padding: 18px;
}

.recipe-card {
    position: relative;
    overflow: hidden;
    padding: 16px;
    border: 1px solid rgba(117, 231, 210, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.recipe-card::before,
.resource-table tbody tr::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.recipe-card::before {
    background: linear-gradient(90deg, rgba(117, 231, 210, 0.12) 0, rgba(117, 231, 210, 0.06) var(--recipe-progress, 0%), transparent var(--recipe-progress, 0%));
}

.recipe-card > * {
    position: relative;
    z-index: 1;
}

.recipe-card__header,
.recipe-card__footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.recipe-card__heading {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.recipe-card__title,
.recipe-card__progress,
.recipe-card__status,
.recipe-card__footer,
.ticker__value {
    margin: 0;
}

.recipe-card__title {
    font-family: "Bahnschrift", "Segoe UI Variable Display", sans-serif;
    font-size: 1.08rem;
}

.recipe-card__progress,
.recipe-card__footer,
.analytics-table,
.resource-table {
    font-family: "Consolas", "Cascadia Code", monospace;
}

.recipe-card__progress,
.recipe-card__footer,
.analytics-table,
.resource-table,
.ticker__value {
    color: var(--muted);
}

.recipe-card__status {
    align-self: flex-start;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border: 1px solid transparent;
}

.recipe-card__status[data-state="remaining"] {
    color: var(--warning);
    background: rgba(240, 178, 78, 0.12);
    border-color: rgba(240, 178, 78, 0.18);
}

.recipe-card__status[data-state="surplus"] {
    color: var(--success);
    background: rgba(145, 242, 180, 0.1);
    border-color: rgba(145, 242, 180, 0.18);
}

.recipe-card__track {
    margin: 14px 0 12px;
    height: 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

.recipe-card__fill {
    height: 100%;
    width: var(--recipe-progress, 0%);
    border-radius: inherit;
    background: linear-gradient(90deg, rgba(117, 231, 210, 0.9), rgba(141, 212, 255, 0.95));
}

.recipe-empty-state {
    min-height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: var(--muted);
    border: 1px dashed rgba(255, 255, 255, 0.08);
}

.alert-banner {
    border: 1px solid rgba(145, 242, 180, 0.12);
    color: var(--text);
}

.alert-banner[data-state="warning"] {
    background: linear-gradient(135deg, rgba(255, 122, 103, 0.22), rgba(240, 178, 78, 0.16));
    border-color: rgba(255, 122, 103, 0.32);
    color: #fff3ec;
}

.table-shell {
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.analytics-table,
.resource-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px;
}

.analytics-table thead th,
.resource-table thead th {
    padding: 0 14px 6px;
    text-align: left;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
}

.analytics-table tbody tr,
.resource-table tbody tr {
    position: relative;
}

.resource-table tbody tr::before {
    border-radius: 14px;
    background: linear-gradient(90deg, rgba(117, 231, 210, 0.16) 0, rgba(117, 231, 210, 0.08) var(--fill, 0%), rgba(11, 18, 23, 0.88) var(--fill, 0%));
    border: 1px solid rgba(117, 231, 210, 0.08);
}

.analytics-table tbody td,
.resource-table tbody td {
    position: relative;
    z-index: 1;
    padding: 14px;
}

.analytics-table tbody tr,
.resource-table tbody tr {
    background: rgba(11, 18, 23, 0.84);
}

.analytics-table tbody td:first-child,
.resource-table tbody td:first-child {
    color: var(--text);
    font-family: "Segoe UI Variable Text", "Trebuchet MS", sans-serif;
    font-weight: 600;
}

.empty-row td {
    color: var(--muted);
}

.ticker__value {
    color: var(--text);
    line-height: 1.5;
}

::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
}

::-webkit-scrollbar-thumb {
    background: rgba(141, 212, 255, 0.24);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

@media (max-width: 1200px) {
    .hero,
    .dashboard-grid--overview,
    .summary-strip,
    .mini-stat-grid {
        grid-template-columns: 1fr;
    }

    .recipe-toolbar {
        grid-template-columns: 1fr;
    }

    .recipe-status {
        justify-self: start;
        text-align: left;
    }

    .panel {
        min-height: auto;
    }

    .panel__header {
        flex-direction: column;
        align-items: flex-start;
    }

    .panel__summary {
        text-align: left;
    }
}

@media (max-width: 780px) {
    .app-shell {
        padding: 14px;
    }

    .hero,
    .metric-card,
    .panel,
    .tab-bar {
        border-radius: 20px;
    }

    .hero,
    .hero__controls,
    .panel__header,
    .panel__body,
    .tab-bar {
        padding-left: 16px;
        padding-right: 16px;
    }

    .hero h1 {
        font-size: 2.25rem;
    }

    .hero__actions,
    .recipe-card__header,
    .recipe-card__footer,
    .tab-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .tab-button {
        width: 100%;
    }
}

/* --------------------------------------------------------------------- */
/* Goal planner                                                          */
/* --------------------------------------------------------------------- */
.recipe-control--qty {
    max-width: 140px;
}

.recipe-control--qty input {
    width: 100%;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid rgba(141, 212, 255, 0.18);
    background: rgba(4, 10, 14, 0.9);
    color: var(--text);
}

.planner-results {
    display: grid;
    gap: 18px;
}

.planner-group {
    display: grid;
    gap: 10px;
    padding: 14px;
    border-radius: 16px;
    border: 1px solid rgba(141, 212, 255, 0.14);
    background: rgba(6, 14, 20, 0.55);
    border-left: 4px solid var(--planner-accent, rgba(141, 212, 255, 0.5));
}

.planner-group[data-source="mined"]   { --planner-accent: #d9a441; }
.planner-group[data-source="rift"]    { --planner-accent: #b070e0; }
.planner-group[data-source="found"]   { --planner-accent: #4fb0d8; }
.planner-group[data-source="craft"]   { --planner-accent: #5fd38d; }
.planner-group[data-source="unknown"] { --planner-accent: #ff6b6b; }
.planner-group[data-source="leftover"]{ --planner-accent: #8a93a6; }
.planner-group[data-source="totals"] { --planner-accent: #ffd166; }
.planner-group[data-source="flow"]   { --planner-accent: #ff9f6e; }
.planner-group[data-source="stockpile"]{ --planner-accent: #7ee0a6; }

.planner-stock {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    font-size: 0.85rem;
    color: var(--muted, #9aa3b2);
}

.planner-stock__input {
    width: 96px;
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid rgba(141, 212, 255, 0.18);
    background: rgba(4, 10, 14, 0.9);
    color: var(--text);
    font-size: 0.85rem;
}

.planner-stock__note {
    font-size: 0.78rem;
    opacity: 0.85;
}

.planner-stock__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.planner-total__use--danger {
    border-color: rgba(255, 107, 107, 0.4);
    background: rgba(255, 107, 107, 0.12);
}

.planner-total__use--danger:hover {
    background: rgba(255, 107, 107, 0.25);
}

.planner-total__value {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.planner-total__rate {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    font-size: 0.85rem;
    color: var(--muted, #9aa3b2);
}

.planner-total__rate input {
    width: 92px;
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid rgba(141, 212, 255, 0.18);
    background: rgba(4, 10, 14, 0.9);
    color: var(--text);
    font-size: 0.85rem;
}

.planner-total__hours {
    color: var(--text);
    font-weight: 600;
}

.planner-total__use {
    padding: 2px 8px;
    border-radius: 8px;
    border: 1px solid rgba(255, 209, 102, 0.4);
    background: rgba(255, 209, 102, 0.12);
    color: var(--text);
    font-size: 0.75rem;
    cursor: pointer;
}

.planner-total__use:hover {
    background: rgba(255, 209, 102, 0.25);
}

.prices-anchors {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.prices-anchors input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(141, 212, 255, 0.18);
    background: rgba(4, 10, 14, 0.9);
    color: var(--text);
}

.prices-anchors input:focus {
    outline: 2px solid rgba(141, 212, 255, 0.45);
    outline-offset: 2px;
}

.planner-group__title {
    margin: 0;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    color: var(--text);
}

.planner-card {
    display: grid;
    gap: 2px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(4, 10, 14, 0.6);
    border: 1px solid rgba(141, 212, 255, 0.1);
}

.planner-card[data-done="true"] {
    opacity: 0.5;
}

.planner-card__title {
    margin: 0;
    font-weight: 600;
}

.planner-card__detail {
    margin: 0;
    font-size: 0.85rem;
    color: var(--muted, #9aa3b2);
}

.planner-card__select {
    margin-top: 4px;
    width: 100%;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid rgba(141, 212, 255, 0.18);
    background: rgba(4, 10, 14, 0.9);
    color: var(--text);
    font-size: 0.82rem;
}

.planner-card__recipe {
    margin: 2px 0 0;
    font-size: 0.78rem;
    color: var(--muted, #9aa3b2);
}

.sound-toolbar {
    display: flex;
    align-items: flex-end;
    gap: 14px;
    flex-wrap: wrap;
}

.sound-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 13px 16px;
    border-radius: 14px;
    border: 1px solid rgba(141, 212, 255, 0.18);
    background: rgba(4, 10, 14, 0.9);
    cursor: pointer;
    font-weight: 600;
}

.sound-toggle input {
    accent-color: #75e7d2;
    width: 16px;
    height: 16px;
}

.sound-hint {
    flex-basis: 100%;
    font-size: 0.82rem;
}

.audio-blocked-hint {
    color: var(--warning);
}

/* Packer tab: the standalone packer.html brings its own dark theme, the
   iframe just needs to fill the viewport below the tab bar. */
.packer-frame {
    width: 100%;
    height: calc(100vh - 190px);
    min-height: 540px;
    border: 1px solid #2a2f3a;
    border-radius: 12px;
    background: #0f1115;
}

/* ------------------------------------------------------------------------- */
/* Item icons                                                                 */
/* ------------------------------------------------------------------------- */
.res-icon {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    vertical-align: -3px;
    margin-right: 7px;
    background: rgba(255, 255, 255, 0.04);
    flex: none;
}

.resource-cell {
    white-space: nowrap;
}

.planner-card__title .res-icon,
.recipe-card__title .res-icon {
    width: 20px;
    height: 20px;
}

/* ------------------------------------------------------------------------- */
/* Operations history                                                         */
/* ------------------------------------------------------------------------- */
.mini-stat-grid--history {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.history-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
}

.range-toggle {
    display: inline-flex;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
}

.range-toggle button {
    border: none;
    background: transparent;
    color: var(--muted);
    padding: 7px 14px;
    cursor: pointer;
    font-size: 0.84rem;
}

.range-toggle button + button {
    border-left: 1px solid var(--line);
}

.range-toggle button.is-active {
    background: rgba(117, 231, 210, 0.14);
    color: var(--text);
}

.history-chart {
    position: relative;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: rgba(10, 16, 21, 0.92);
    padding: 12px 14px 8px;
}

.history-chart svg {
    display: block;
    width: 100%;
    height: auto;
}

.chart-grid {
    stroke: rgba(255, 255, 255, 0.07);
    stroke-width: 1;
}

.chart-baseline {
    stroke: rgba(255, 255, 255, 0.22);
    stroke-width: 1;
}

.chart-axis-label {
    fill: var(--muted);
    font-size: 11px;
}

.chart-bar-label {
    fill: var(--text);
    font-size: 11.5px;
}

.chart-bar.is-selected {
    stroke: rgba(255, 255, 255, 0.65);
    stroke-width: 1.5;
}

.chart-hit {
    cursor: pointer;
}

.chart-hit:hover {
    fill: rgba(255, 255, 255, 0.05);
}

.chart-tooltip {
    position: absolute;
    top: 10px;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: rgba(7, 12, 16, 0.96);
    color: var(--text);
    font-size: 0.82rem;
    pointer-events: none;
    white-space: nowrap;
    z-index: 5;
}

.chart-tooltip span {
    color: var(--muted);
}

.history-detail {
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: rgba(10, 16, 21, 0.92);
    padding: 16px 18px;
}

.history-detail__heading {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 12px;
}

.history-detail__heading h3 {
    margin: 0;
    font-size: 1.05rem;
}

.history-detail__facts {
    margin: 0;
    color: var(--muted);
    font-size: 0.88rem;
}

.history-resources {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.history-resource-chip {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.03);
    font-size: 0.82rem;
}

.history-resource-chip--muted {
    color: var(--muted);
}

.history-row {
    cursor: pointer;
}

.history-row:hover {
    background: rgba(117, 231, 210, 0.06);
}

.history-row.is-selected {
    background: rgba(117, 231, 210, 0.12);
}

.prices-section-row td {
    padding-top: 18px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.74rem;
    color: var(--muted);
}

/* ------------------------------------------------------------------------- */
/* Loot tracker                                                               */
/* ------------------------------------------------------------------------- */
.mini-stat-grid--loot {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.loot-paste-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 14px;
}

.recipe-control input[type="text"],
.loot-paste-control textarea {
    width: 100%;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid rgba(141, 212, 255, 0.18);
    background: rgba(4, 10, 14, 0.9);
    color: var(--text);
}

.recipe-control input[type="text"]:focus,
.loot-paste-control textarea:focus {
    outline: 2px solid rgba(141, 212, 255, 0.45);
    outline-offset: 2px;
}

.loot-paste-control textarea {
    min-height: 132px;
    resize: vertical;
    font-family: "Consolas", "Cascadia Code", monospace;
    font-size: 0.86rem;
    line-height: 1.5;
}

.loot-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.action-button--ghost {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(141, 212, 255, 0.18);
}

.loot-delete {
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: transparent;
    color: var(--muted);
    border-radius: 10px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 0.8rem;
}

.loot-delete:hover {
    color: #fff3ec;
    background: rgba(255, 122, 103, 0.16);
    border-color: rgba(255, 122, 103, 0.32);
}

/* expanded per-event breakdown reuses the history chip look */
.loot-detail-row td {
    padding-top: 0;
}

.loot-detail-row h4 {
    margin: 0 0 8px;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
}

.loot-detail-row .history-resources + h4 {
    margin-top: 12px;
}

.loot-value--pos {
    color: var(--success);
}

.loot-value--neg {
    color: var(--danger);
}
