.header {
    background: var(--bg-header);
    padding: 12px 16px;
    border-bottom: 2px solid var(--border-main);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.header-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.header-link:hover .title h1 {
    color: var(--accent-green);
}

.title h1 {
    font-size: 16px;
    line-height: 1.15;
    font-weight: 900;
}

.title span {
    color: var(--accent-green);
}

@media (min-width: 480px) {
    .title h1 {
        font-size: 18px;
    }
}

@media (min-width: 768px) {
    .title h1 {
        font-size: 20px;
    }
}

.subtitle {
    font-size: 9px;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.controls-right {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-end;
}

.toggle-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.toggle-label {
    font-size: 9px;
    font-weight: 800;
    color: var(--text-mid);
}

.toggle-label.green {
    color: var(--accent-green);
}

.toggle-label.blue {
    color: #1d4ed8;
}

.toggle-label.navy {
    color: #1e3a5f;
}

.toggle-label.orange {
    color: #ea580c;
}

.toggle-label.teal {
    color: #059669;
}

.toggle {
    width: 32px;
    height: 16px;
    background: #9ca3af;
    border-radius: 8px;
    cursor: pointer;
    position: relative;
    transition: background 0.2s;
}

.toggle.active {
    background: var(--accent-green);
}

.toggle-knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s;
}

.toggle.active .toggle-knob {
    transform: translateX(16px);
}

.quality-row,
.tab-row {
    display: flex;
    gap: 4px;
    margin-bottom: 10px;
}

.quality-btn,
.tab-btn {
    flex: 1;
    padding: 8px 4px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    border: 2px solid var(--border-main);
    border-radius: 6px;
    background: white;
    color: var(--text-mid);
    cursor: pointer;
    transition: all 0.15s;
}

.quality-btn.active {
    background: var(--text-dark);
    color: white;
    border-color: var(--text-dark);
}

.tab-btn {
    font-size: 9px;
    color: var(--text-light);
}

.tab-btn.active {
    color: var(--accent-green);
    border-color: var(--accent-green);
    background: var(--accent-green-light);
}

.filter-group {
    margin-bottom: 12px;
}

.filter-label {
    font-size: 10px;
    font-weight: 800;
    color: var(--text-mid);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.filter-summary {
    color: var(--accent-green);
}

.search-input {
    width: 100%;
    padding: 8px 12px;
    font-size: 13px;
    border: 2px solid var(--border-main);
    border-radius: 6px;
    background: white;
    outline: none;
}

.search-input:focus {
    border-color: var(--accent-green);
}

.table-wrap {
    overflow: auto;
    border-top: 2px solid var(--border-main);
    max-height: calc(100vh - 280px);
    max-height: calc(100dvh - 280px);
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 600px;
}

thead {
    position: sticky;
    top: 0;
    z-index: 20;
}

thead th {
    background: var(--bg-header);
    padding: 10px 8px;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-mid);
    border-bottom: 2px solid var(--border-main);
    text-align: left;
    white-space: nowrap;
}

thead th.center {
    text-align: center;
}

.sticky-name {
    position: sticky;
    left: 0;
    z-index: 10;
    min-width: 120px;
    max-width: 140px;
    background: inherit;
}

.sticky-best {
    position: sticky;
    left: 120px;
    z-index: 10;
    min-width: 80px;
    max-width: 95px;
    background: inherit;
    border-right: 2px solid var(--border-main);
}

td {
    padding: 8px;
    font-size: 12px;
    border-bottom: 1px solid var(--border-light);
    white-space: nowrap;
}

tr:nth-child(even) td,
tr:nth-child(even) .sticky-name,
tr:nth-child(even) .sticky-best {
    background: var(--bg-row-alt);
}

tr:nth-child(odd) td,
tr:nth-child(odd) .sticky-name,
tr:nth-child(odd) .sticky-best {
    background: var(--bg-row);
}

.season-row td,
.season-row .sticky-name,
.season-row .sticky-best {
    background: #ddd8c8 !important;
    font-weight: 800;
    font-size: 11px;
    color: var(--text-dark);
    padding: 6px 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border-main);
}

.location-row td,
.location-row .sticky-name,
.location-row .sticky-best {
    background: #ebe7da !important;
    font-weight: 700;
    font-size: 9px;
    color: var(--text-light);
    padding: 4px 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.item-cell {
    display: flex;
    align-items: center;
    gap: 5px;
}

.item-icon {
    width: 24px;
    height: 24px;
    image-rendering: pixelated;
    object-fit: contain;
    flex-shrink: 0;
}

.item-icon.hidden {
    opacity: 0;
    width: 0;
    margin: 0;
}

.item-name {
    font-weight: 700;
    color: var(--text-dark);
    font-size: 11px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 85px;
}

.bundle-mark {
    color: var(--accent-gold);
    font-weight: 900;
    font-size: 14px;
}

.best-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.method-badge {
    display: inline-block;
    font-size: 8px;
    font-weight: 800;
    padding: 2px 5px;
    border-radius: 4px;
    color: white;
}

.badge-keg {
    background: var(--badge-keg);
}

.badge-jar {
    background: var(--badge-jar);
}

.badge-dry {
    background: var(--badge-dry);
}

.badge-smoke {
    background: var(--badge-smoke);
}

.badge-sashimi {
    background: #059669;
}

.badge-raw {
    background: var(--badge-raw);
}

.best-price {
    font-weight: 800;
    color: var(--accent-green);
}

.price-cell {
    font-weight: 700;
    color: var(--text-dark);
}

.highlight-cell {
    background: var(--accent-green-light) !important;
    font-weight: 800;
    color: #166534;
}

.snack-cell {
    text-align: center;
}

.snack-tag {
    display: inline-block;
    font-size: 9px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    color: white;
}

.snack-eat {
    background: var(--accent-green);
}

.snack-sell {
    background: var(--accent-red);
}

.snack-ratio {
    display: block;
    font-size: 9px;
    font-weight: 700;
    margin-top: 2px;
}

.snack-ratio.good {
    color: var(--accent-green);
}

.snack-ratio.bad {
    color: var(--accent-red);
}

.poison {
    color: var(--accent-red);
    font-weight: 800;
}

.na {
    color: var(--text-light);
}

.cond-cell {
    font-size: 10px;
    color: var(--text-mid);
    font-weight: 600;
    white-space: normal;
    max-width: 100px;
    line-height: 1.2;
}

/* Help Section */
.help-section {
    margin-bottom: 10px;
}

.help-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: white;
    border: 2px solid var(--border-main);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-mid);
    cursor: pointer;
    transition: all 0.15s;
}

.help-toggle:hover {
    border-color: var(--accent-green);
    color: var(--accent-green);
}

.help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: var(--accent-green);
    color: white;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 800;
}

.help-arrow {
    margin-left: auto;
    font-size: 10px;
    transition: transform 0.2s;
}

.help-arrow.open {
    transform: rotate(180deg);
}

.help-content {
    display: none;
    margin-top: 8px;
    padding: 12px;
    background: white;
    border: 2px solid var(--border-main);
    border-radius: 6px;
}

.help-content.open {
    display: block;
}

.help-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

@media (min-width: 640px) {
    .help-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.help-card {
    padding: 12px;
    background: var(--bg-main);
    border-radius: 6px;
    border: 1px solid var(--border-light);
}

.help-card-title {
    font-size: 13px;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.help-card p,
.help-card ul {
    font-size: 11px;
    color: var(--text-mid);
    margin-bottom: 6px;
    line-height: 1.4;
}

.help-card ul {
    padding-left: 16px;
    line-height: 1.6;
}

.help-card li {
    margin-bottom: 4px;
}

.help-note {
    font-size: 10px !important;
    color: var(--text-light) !important;
    font-style: italic;
    margin-top: 8px !important;
}

.icon-list {
    list-style: none;
    padding-left: 0 !important;
}

.icon-list li {
    display: flex;
    align-items: center;
    gap: 8px;
}

.inline-tag {
    display: inline-block;
    font-size: 9px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    color: white;
}

.inline-tag.eat {
    background: var(--accent-green);
}

.inline-tag.sell {
    background: var(--accent-red);
}

.legend-star {
    font-size: 14px;
}

.tip-card {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-color: #f59e0b;
}

@media (min-width: 768px) {
    .item-icon {
        width: 32px;
        height: 32px;
    }

    .sticky-name {
        min-width: 190px;
    }

    .sticky-best {
        left: 190px;
        min-width: 110px;
    }
}

.tab-icon {
    width: 14px;
    height: 14px;
    image-rendering: pixelated;
    object-fit: contain;
    vertical-align: -2px;
}

.tab-icon.crabpot-icon {
    width: 18px;
    height: 18px;
}