/* decklab.ink - Deck Builder Styles v0.6.4 */

body.in-deckbuilder {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    background: var(--bg-dark, #0e1015);
    color: var(--text-main, #e2e8f0);
}

.db-workspace {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(420px, 1fr);
    overflow: hidden;
}

.db-catalog-pane {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    border-right: 1px solid var(--card-border, #222630);
}

.db-filter-header {
    padding: 10px 14px;
    background: #13161c;
    border-bottom: 1px solid var(--card-border, #222630);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
}

.db-search-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.db-search-wrap {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    padding: 5px 32px 5px 34px;
    min-height: 38px;
    background: #181b23;
    border: 1px solid #222630;
    border-radius: 999px;
    cursor: text;
}

.db-search-wrap:focus-within {
    border-color: #3b82f6;
}

.db-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-dim, #94a3b8);
    pointer-events: none;
}

.db-active-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
}

.db-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #1e293b;
    border: 1px solid #334155;
    color: #e2e8f0;
    font-size: 0.74rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 6px;
}

.db-chip button {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 0;
    font-size: 0.75rem;
    line-height: 1;
}

.db-chip button:hover {
    color: #f8fafc;
}

.db-search-input {
    flex: 1;
    min-width: 110px;
    background: transparent;
    border: none;
    color: #f8fafc;
    font-size: 0.86rem;
    outline: none;
    padding: 2px 0;
}

.db-search-clear {
    position: absolute;
    right: 11px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    display: none;
    font-size: 0.85rem;
}

.db-filters-trigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #2563eb;
    border: 1px solid #3b82f6;
    color: #ffffff;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
}

.db-filters-trigger:hover {
    background: #1d4ed8;
}

.db-filter-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #dc2626;
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #13161c;
}

.db-quick-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.db-quick-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.db-results-count {
    font-size: 0.8rem;
    color: #94a3b8;
    font-style: italic;
    white-space: nowrap;
}

.db-btn-subtle {
    background: #181b23;
    border: 1px solid #222630;
    color: #cbd5e1;
    padding: 6px 11px;
    border-radius: 7px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
}

.db-filter-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.db-quick-sep {
    width: 1px;
    height: 24px;
    background: #334155;
    margin: 0 3px;
}

.db-hex-icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 7px;
    border: none;
    background: transparent;
    padding: 3px;
    cursor: pointer;
    opacity: 0.65;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.db-hex-icon-btn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.db-hex-icon-btn:hover {
    opacity: 1;
}

.db-hex-icon-btn.active {
    opacity: 1;
    background: #2563eb;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.5);
}

.db-ink-btn {
    width: 38px;
    height: 38px;
    border-radius: 7px;
    border: none;
    background: transparent;
    padding: 3px;
    cursor: pointer;
    opacity: 0.55;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.db-ink-btn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.db-ink-btn:hover {
    opacity: 0.95;
}

.db-ink-btn.active {
    opacity: 1;
    background: #2563eb;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.5);
}

.db-rarity-btn {
    width: 34px;
    height: 34px;
    border-radius: 7px;
    border: none;
    background: transparent;
    padding: 4px;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.db-rarity-btn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.db-rarity-btn:hover {
    opacity: 1;
}

.db-rarity-btn.active {
    opacity: 1;
    background: #2563eb;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.5);
}

.db-pill-btn {
    background: #181b23;
    border: 1px solid #222630;
    color: #cbd5e1;
    border-radius: 6px;
    padding: 5px 9px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

.db-cost-btn {
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 7px;
    background: url('../assets/inks/inkcost.svg') center/33px 33px no-repeat;
    color: #f8fafc;
    font-size: 0.88rem;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0.78;
    transition: all 0.15s ease;
}

.db-pill-btn:hover {
    color: #ffffff;
    border-color: #64748b;
}

.db-cost-btn:hover {
    opacity: 1;
}

.db-pill-btn.active {
    background: #2563eb;
    border-color: #3b82f6;
    color: #ffffff;
}

.db-cost-btn.active {
    opacity: 1;
    background-color: #2563eb;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.5);
}

.db-inline-ink-icon {
    width: 17px;
    height: 17px;
    vertical-align: -3px;
}

.db-catalog-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    scrollbar-width: thin;
    scrollbar-color: #334155 transparent;
}

.db-catalog-scroll::-webkit-scrollbar,
.db-deck-body::-webkit-scrollbar {
    width: 6px;
}

.db-catalog-scroll::-webkit-scrollbar-track,
.db-deck-body::-webkit-scrollbar-track {
    background: transparent;
}

.db-catalog-scroll::-webkit-scrollbar-thumb,
.db-deck-body::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 999px;
}

.db-card-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}

.db-card-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: #101520;
    border: 1px solid #1e2638;
    border-radius: 10px;
    padding: 6px;
    transition: border-color 0.15s ease;
}

.db-card-tile.in-deck {
    border-color: #eab308;
    box-shadow: 0 0 12px rgba(234, 179, 8, 0.22);
}

.db-card-thumb-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 5/7;
    border-radius: 8px;
    overflow: hidden;
    background: #07090e;
    cursor: pointer;
}

.db-card-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.db-card-price-tag {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(34, 197, 94, 0.55);
    color: #4ade80;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 5px;
    font-family: 'Fira Code', monospace;
}

.db-card-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
}

.db-qty-btn {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid #334155;
    background: #182032;
    color: #f8fafc;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.db-qty-btn:hover:not(:disabled) {
    border-color: #eab308;
    color: #fde047;
}

.db-qty-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.db-qty-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: #cbd5e1;
    min-width: 34px;
    text-align: center;
    font-family: 'Fira Code', monospace;
}

.db-filters-modal-box {
    max-width: 520px;
    width: 94%;
    max-height: 86vh;
    display: flex;
    flex-direction: column;
    padding: 18px 20px;
}

.db-filters-modal-body {
    flex: 1;
    overflow-y: auto;
    margin: 10px 0 14px;
    padding-right: 6px;
    display: flex;
    flex-direction: column;
    scrollbar-width: thin;
    scrollbar-color: #334155 transparent;
}

.db-filters-modal-body::-webkit-scrollbar {
    width: 6px;
}

.db-filters-modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.db-filters-modal-body::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 999px;
}

.db-acc-item {
    border-bottom: 1px solid #1e293b;
}

.db-acc-header {
    width: 100%;
    background: transparent;
    border: none;
    color: #f8fafc;
    padding: 12px 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
}

.db-acc-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.db-acc-count {
    background: #2563eb;
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 1px 7px;
    border-radius: 999px;
}

.db-acc-body {
    display: none;
    padding: 4px 4px 14px;
    flex-wrap: wrap;
    gap: 6px;
}

.db-acc-item.open .db-acc-body {
    display: flex;
}

.db-acc-item.open .db-acc-body.two-cols {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.db-acc-body.two-cols .db-pill-btn {
    width: 100%;
    text-align: center;
    padding: 7px 10px;
    border-radius: 8px;
    background: rgba(30, 41, 59, 0.45);
    border: 1px solid rgba(148, 163, 184, 0.14);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.db-acc-body.two-cols .db-pill-btn:hover {
    background: rgba(51, 65, 85, 0.65);
    border-color: rgba(148, 163, 184, 0.35);
}

.db-acc-body.two-cols .db-pill-btn.active {
    background: #2563eb;
    border-color: #3b82f6;
    box-shadow: 0 2px 10px rgba(37, 99, 235, 0.35);
}

.db-filters-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 8px;
    border-top: 1px solid #1e293b;
}

.db-btn-reset-red {
    background: #dc2626;
    border-color: #ef4444;
    color: #ffffff;
    padding: 8px 16px;
}

.db-btn-done {
    background: #2563eb;
    border-color: #3b82f6;
    color: #ffffff;
    padding: 8px 18px;
}

.db-deck-pane {
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: #13161c;
}

.db-deck-header {
    padding: 10px 16px;
    border-bottom: 1px solid var(--card-border, #222630);
    background: #13161c;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
}

@media (min-width: 961px) {

    .db-filter-header,
    .db-deck-header {
        min-height: 116px;
        box-sizing: border-box;
        justify-content: space-between;
        padding-top: 12px;
        padding-bottom: 12px;
    }

    .db-quick-bar,
    .db-actions-bar {
        min-height: 38px;
        align-items: center;
    }
}

.db-deck-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.db-deck-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #f8fafc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.db-deck-counters {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.db-counter-pill {
    background: #181b23;
    border: 1px solid #222630;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 0.76rem;
    color: #cbd5e1;
}

.db-counter-pill.is-valid {
    border-color: rgba(34, 197, 94, 0.5);
    color: #86efac;
}

.db-price-pill {
    color: #4ade80;
}

.db-deck-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.db-deck-inks {
    display: flex;
    align-items: center;
    gap: 5px;
}

.db-deck-ink-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 999px;
    background: #181b23;
    border: 1px solid #222630;
    text-transform: capitalize;
}

.db-deck-ink-badge img {
    width: 16px;
    height: 16px;
}

.db-deck-legality {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.db-legality-pill {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 5px;
}

.db-legality-pill.ok {
    background: rgba(34, 197, 94, 0.14);
    border: 1px solid rgba(34, 197, 94, 0.4);
    color: #4ade80;
}

.db-legality-pill.warn {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.45);
    color: #fca5a5;
}

.db-actions-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.db-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid #2d3a55;
    border-radius: 7px;
    padding: 6px 10px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    color: #e2e8f0;
    background: #182135;
    transition: all 0.15s ease;
}

.db-action-btn:hover {
    background: #222e48;
    border-color: #475569;
    color: #ffffff;
}

.db-btn-primary,
.db-btn-accent,
.db-btn-danger {
    background: #182135;
    border-color: #2d3a55;
    color: #e2e8f0;
}

.db-btn-danger:hover {
    background: #3b1720;
    border-color: #991b1b;
    color: #fecaca;
}

.db-btn-menu {
    background: #2563eb;
    border-color: #3b82f6;
    color: #ffffff;
}

.db-btn-menu:hover {
    background: #1d4ed8;
    border-color: #3b82f6;
}

.db-menu-wrap {
    position: relative;
}

.db-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 185px;
    background: #131a29;
    border: 1px solid #2e3b55;
    border-radius: 10px;
    padding: 6px;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.7);
    display: none;
    flex-direction: column;
    gap: 4px;
    z-index: 50;
}

.db-dropdown-menu.open {
    display: flex;
}

.db-dropdown-menu button {
    background: transparent;
    border: none;
    color: #e2e8f0;
    text-align: left;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}

.db-dropdown-menu button:hover {
    background: #1e293b;
}

.db-view-tabs {
    margin-left: auto;
    display: flex;
    background: #141a28;
    border: 1px solid #222630;
    border-radius: 999px;
    padding: 2px;
}

.db-tab-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    padding: 4px 11px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
}

.db-tab-btn.active {
    background: #2563eb;
    color: #ffffff;
}

.db-deck-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 14px;
    scrollbar-width: thin;
    scrollbar-color: #334155 transparent;
}

.db-deck-empty {
    text-align: center;
    padding: 42px 16px;
    color: #64748b;
    font-size: 0.86rem;
}

.db-deck-empty p {
    margin: 0 0 6px;
    font-size: 0.96rem;
    color: #94a3b8;
    font-weight: 600;
}

.db-deck-groups {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.db-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #cbd5e1;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.db-group-count {
    background: #1e293b;
    color: #94a3b8;
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 0.72rem;
}

.db-group-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
}

.db-card-owned-tag {
    position: absolute;
    bottom: 6px;
    left: 6px;
    background: rgba(16, 185, 129, 0.92);
    color: #052e16;
    font-family: 'Fira Code', monospace;
    font-size: 0.66rem;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 999px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.55);
    pointer-events: none;
}

.db-row-owned {
    font-family: 'Fira Code', monospace;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 999px;
    flex-shrink: 0;
}

.db-row-owned.is-full {
    background: rgba(16, 185, 129, 0.14);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.35);
}

.db-row-owned.is-partial {
    background: rgba(245, 158, 11, 0.14);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.35);
}

.db-row-owned.is-none {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.db-col-ready-pct {
    font-family: 'Fira Code', monospace;
    color: #34d399;
}

.db-col-bar-track {
    width: 100%;
    height: 7px;
    background: #161e2e;
    border-radius: 999px;
    overflow: hidden;
    margin: 6px 0 8px;
}

.db-col-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #34d399);
    border-radius: 999px;
}

.db-col-missing-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.76rem;
    color: #94a3b8;
    margin-bottom: 6px;
}

.db-col-copy-btn {
    background: #1e293b;
    border: 1px solid #334155;
    color: #e2e8f0;
    border-radius: 6px;
    padding: 3px 9px;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
}

.db-col-copy-btn:hover {
    background: #2563eb;
    border-color: #3b82f6;
}

.db-col-missing-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 10px;
    font-size: 0.75rem;
    color: #cbd5e1;
    font-family: 'Fira Code', monospace;
}

.db-col-all-owned {
    font-size: 0.8rem;
    font-weight: 600;
    color: #34d399;
}

.db-deck-row {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 3px 6px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #141a28;
    font-size: 0.76rem;
    min-width: 0;
}

.db-deck-row.ink-amber {
    background: #8a560b;
    border-color: #d97706;
}

.db-deck-row.ink-amethyst {
    background: #582173;
    border-color: #9333ea;
}

.db-deck-row.ink-emerald {
    background: #165e2d;
    border-color: #22c55e;
}

.db-deck-row.ink-ruby {
    background: #7f141b;
    border-color: #dc2626;
}

.db-deck-row.ink-sapphire {
    background: #14497a;
    border-color: #3b82f6;
}

.db-deck-row.ink-steel {
    background: #475569;
    border-color: #94a3b8;
}

.db-row-ink-icon {
    width: 21px;
    height: 21px;
    object-fit: contain;
    flex-shrink: 0;
}

.db-row-cost {
    width: 26px;
    height: 26px;
    background: url('../assets/inks/inkcost.svg') center/contain no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.75rem;
    color: #ffffff;
    flex-shrink: 0;
}

.db-row-cost.is-inkable {
    background-image: url('../assets/inks/inkwell.svg');
}

.db-row-name {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
    color: #f1f5f9;
}

.db-row-controls {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}

.db-row-btn {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(15, 23, 42, 0.75);
    color: #f8fafc;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.db-row-btn:hover:not(:disabled) {
    border-color: #eab308;
    color: #fde047;
}

.db-row-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.db-row-qty {
    font-family: 'Fira Code', monospace;
    font-size: 0.75rem;
    font-weight: 700;
    min-width: 28px;
    text-align: center;
}

.db-info-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.db-info-stats-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.db-info-stat-box {
    background: #181b23;
    border: 1px solid #1e293b;
    border-radius: 10px;
    padding: 9px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.78rem;
    color: #94a3b8;
}

.db-info-stat-box strong {
    color: #f8fafc;
    font-size: 0.92rem;
    font-family: 'Fira Code', monospace;
}

.db-info-panel {
    background: #181b23;
    border: 1px solid #1e293b;
    border-radius: 10px;
    padding: 12px 14px;
}

.db-info-panel-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    margin-bottom: 10px;
}

.db-curve-chart {
    display: grid;
    grid-template-columns: repeat(9, minmax(0, 1fr));
    gap: 6px;
    height: 135px;
    align-items: end;
}

.db-curve-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    gap: 4px;
}

.db-curve-count {
    font-size: 0.72rem;
    font-weight: 700;
    color: #cbd5e1;
    font-family: 'Fira Code', monospace;
    min-height: 14px;
}

.db-curve-track {
    flex: 1;
    width: 100%;
    max-width: 24px;
    background: #0b0f18;
    border-radius: 4px;
    display: flex;
    flex-direction: column-reverse;
    overflow: hidden;
}

.db-curve-seg {
    width: 100%;
}

.db-curve-lbl {
    font-size: 0.72rem;
    font-weight: 700;
    color: #94a3b8;
}

.db-pies-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.db-pie-card {
    background: #181b23;
    border: 1px solid #1e293b;
    border-radius: 10px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.db-pie-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #94a3b8;
}

.db-pie-donut {
    width: 78px;
    height: 78px;
    border-radius: 50%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.db-pie-donut::after {
    content: "";
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #181b23;
}

.db-pie-legend {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 0.7rem;
    color: #cbd5e1;
}

.db-pie-legend-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
}

.db-pie-legend-lbl {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    text-transform: capitalize;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.db-pie-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.db-roles-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.db-role-chip {
    background: #182135;
    border: 1px solid #2d3a55;
    color: #cbd5e1;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 0.73rem;
    font-weight: 600;
}

.db-share-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.db-qr-wrap {
    background: #ffffff;
    padding: 12px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.db-share-hint {
    margin: 0;
    font-size: 0.8rem;
    color: #94a3b8;
    text-align: center;
}

.db-share-link-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.db-share-link-row input {
    flex: 1;
    font-size: 0.78rem;
}

.db-modal-box {
    max-width: 460px;
    width: 92%;
}

.db-modal-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.db-import-textarea {
    width: 100%;
    background: #13161c;
    border: 1px solid #222630;
    border-radius: 8px;
    color: #f8fafc;
    padding: 10px;
    font-family: 'Fira Code', monospace;
    font-size: 0.82rem;
    resize: vertical;
}

.db-modal-msg {
    font-size: 0.8rem;
    color: #fca5a5;
    min-height: 16px;
}

.db-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.db-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #1e293b;
    border: 1px solid #eab308;
    color: #f8fafc;
    padding: 10px 18px;
    border-radius: 999px;
    font-size: 0.84rem;
    font-weight: 600;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
    z-index: 2000;
}

.db-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.db-mobile-switcher {
    display: none;
}

@media (max-width: 1200px) {
    .db-card-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media screen and (max-height: 600px),
screen and (hover: none) and (pointer: coarse) and (max-width: 1024px) {
    body.in-deckbuilder {
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
        overflow-y: auto;
    }

    .db-workspace {
        flex: none;
        height: auto;
        min-height: 420px;
        overflow: visible;
    }

    .db-catalog-scroll,
    .db-deck-body {
        max-height: 72vh;
    }
}

@media (max-width: 960px) {
    .db-workspace {
        grid-template-columns: 1fr;
    }

    .db-catalog-pane {
        border-right: none;
        min-height: 0;
    }

    .db-deck-pane {
        display: none;
        min-height: 0;
    }

    .db-workspace.mobile-show-deck .db-catalog-pane {
        display: none;
    }

    .db-workspace.mobile-show-deck .db-deck-pane {
        display: flex;
    }

    .db-mobile-switcher {
        position: sticky;
        bottom: 0;
        z-index: 40;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        padding: 8px 12px;
        background: #13161c;
        border-top: 1px solid var(--card-border, #222630);
        flex-shrink: 0;
    }

    .db-mob-tab {
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        padding: 8px 10px;
        border-radius: 10px;
        border: 1px solid #222630;
        background: #141a28;
        color: #cbd5e1;
        font-size: 0.8rem;
        font-weight: 700;
        cursor: pointer;
    }

    .db-mob-tab.active {
        background: #2563eb;
        border-color: #3b82f6;
        color: #ffffff;
    }

    .db-mob-badge {
        position: absolute;
        top: 6px;
        right: calc(50% - 26px);
        min-width: 18px;
        height: 18px;
        padding: 0 5px;
        border-radius: 999px;
        background: #dc2626;
        color: #ffffff;
        font-size: 0.7rem;
        font-weight: 800;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .db-card-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }
}

@media (max-width: 600px) {

    .db-cost-group,
    .db-cost-group+.db-quick-sep {
        display: none;
    }

    .db-group-list {
        grid-template-columns: 1fr;
    }
}