/* =============================================================================
    NEW FEATURES CSS - Streaks, Heatmap, Skill Calc, Boss Log,
   Collection Log, Smart Suggestions, Achievements
   ============================================================================= */

/* =============================================================================
   TOOL MODAL THEME (all Tools dropdown modals ? respects Star Shop themes)
   ============================================================================= */

.tool-modal-content,
.mqc-tracker-content,
.skill-calc-content,
.drop-calc-content,
.suggestions-modal-content,
.heatmap-modal-content,
.achievements-content,
.boss-log-content,
.clog-content {
    background: var(--tool-surface);
    border: 1px solid var(--tool-border);
    color: var(--tool-text);
}

.tool-modal-content .modal-close,
.mqc-tracker-content .modal-close,
.drop-calc-content .modal-close,
.skill-calc-content .modal-close,
.heatmap-modal-content .modal-close,
.suggestions-modal-content .modal-close,
.achievements-content .modal-close {
    color: var(--tool-text-muted);
}

.tool-modal-content .modal-close:hover,
.mqc-tracker-content .modal-close:hover,
.drop-calc-content .modal-close:hover,
.skill-calc-content .modal-close:hover,
.heatmap-modal-content .modal-close:hover,
.suggestions-modal-content .modal-close:hover,
.achievements-content .modal-close:hover {
    color: var(--tool-text);
}

/* =============================================================================
   ACCOUNT TABS (Shared across all tool modals)
   ============================================================================= */

.account-tabs {
    display: flex;
    gap: 4px;
    padding: 8px 16px;
    border-bottom: 1px solid var(--tool-border-subtle);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.account-tabs::-webkit-scrollbar { display: none; }

.account-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: 1px solid var(--tool-border-subtle);
    border-radius: 20px;
    background: var(--tool-accent-soft);
    color: var(--tool-text-muted);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.account-tab:hover {
    background: var(--tool-accent-medium);
    border-color: var(--tool-accent-strong);
    color: var(--tool-text);
}

.account-tab.active {
    background: var(--tool-accent-medium);
    border-color: var(--tool-accent);
    color: var(--tool-text);
    font-weight: 600;
}

.account-tab img {
    border-radius: 50%;
    object-fit: cover;
}

/* =============================================================================
   STREAK BADGE (Header)
   ============================================================================= */

.streak-badge {
    display: none;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--radius-full, 50px);
    background: rgba(255, 152, 0, 0.1);
    border: 1px solid rgba(255, 152, 0, 0.2);
    cursor: default;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary, #fff);
    transition: all 0.2s;
}

.streak-badge.streak-active {
    background: rgba(255, 69, 0, 0.15);
    border-color: rgba(255, 69, 0, 0.4);
    animation: streak-glow 2s ease-in-out infinite alternate;
}

@keyframes streak-glow {
    from { box-shadow: 0 0 4px rgba(255, 69, 0, 0.2); }
    to   { box-shadow: 0 0 12px rgba(255, 69, 0, 0.4); }
}

.streak-fire { font-size: 1rem; }
.streak-count { font-family: 'Rajdhani', sans-serif; font-size: 1rem; }

/* =============================================================================
   HEATMAP CALENDAR (Modal)
   ============================================================================= */

.heatmap-modal-content {
    max-width: 650px;
    max-height: 80vh;
}

.heatmap-modal-content .modal-body {
    overflow-x: auto;
    padding: 16px;
}

/* Shared modal header for new feature modals */
.heatmap-modal-content .modal-header,
.suggestions-modal-content .modal-header,
.skill-calc-content .modal-header,
.boss-log-content .modal-header,
.clog-content .modal-header,
.achievements-content .modal-header,
.drop-calc-content .modal-header,
.mqc-tracker-content .mqc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--tool-border-subtle);
}

.heatmap-modal-content .modal-header h3,
.suggestions-modal-content .modal-header h3,
.skill-calc-content .modal-header h3,
.boss-log-content .modal-header h3,
.clog-content .modal-header h3,
.achievements-content .modal-header h3,
.drop-calc-content .modal-header h3 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.05rem;
    color: var(--tool-text);
    font-weight: 600;
}

.heatmap-modal-content .modal-header svg,
.suggestions-modal-content .modal-header svg,
.skill-calc-content .modal-header svg,
.boss-log-content .modal-header svg,
.clog-content .modal-header svg,
.achievements-content .modal-header svg,
.drop-calc-content .modal-header svg {
    color: var(--tool-accent);
}

.heatmap-months {
    display: flex;
    gap: 0;
    padding-left: 30px;
    margin-bottom: 4px;
    font-size: 0.7rem;
    color: var(--text-secondary, #aaa);
}

.heatmap-month-label {
    min-width: 42px;
}

.heatmap-wrapper {
    display: flex;
    gap: 2px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.heatmap-days {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-right: 4px;
    padding-top: 0;
}

.heatmap-day-label {
    height: 11px;
    font-size: 0.6rem;
    color: var(--text-secondary, #aaa);
    line-height: 11px;
    width: 24px;
    text-align: right;
}

.heatmap-cells {
    display: flex;
    gap: 2px;
}

.heatmap-week {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.heatmap-cell {
    width: 11px;
    height: 11px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.05);
    transition: background 0.15s;
}

.heatmap-cell[data-level="0"] { background: rgba(255, 255, 255, 0.06); }
.heatmap-cell[data-level="1"] { background: rgba(255, 152, 0, 0.25); }
.heatmap-cell[data-level="2"] { background: rgba(255, 152, 0, 0.45); }
.heatmap-cell[data-level="3"] { background: rgba(255, 152, 0, 0.65); }
.heatmap-cell[data-level="4"] { background: rgba(255, 152, 0, 0.9); }
.heatmap-cell.heatmap-future  { background: transparent; }

.heatmap-cell:hover:not(.heatmap-future) {
    outline: 1px solid var(--accent, #ff9800);
    transform: scale(1.3);
    z-index: 1;
}

.heatmap-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    font-size: 0.7rem;
    color: var(--text-secondary, #aaa);
}

.heatmap-stats {
    display: flex;
    gap: 12px;
}

.heatmap-legend {
    display: flex;
    align-items: center;
    gap: 3px;
}

.heatmap-legend .heatmap-cell {
    cursor: default;
}

.heatmap-legend .heatmap-cell:hover {
    outline: none;
    transform: none;
}

/* =============================================================================
   SMART SUGGESTIONS MODAL ("What Should I Do Next?")
   ============================================================================= */

.suggestions-modal-content {
    max-width: 500px;
    max-height: 80vh;
}

.suggestions-modal-content .modal-body {
    padding: 0;
}

.suggest-empty {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary, #aaa);
}

.suggest-empty span { font-size: 2rem; display: block; margin-bottom: 8px; }

.suggest-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background 0.15s;
}

.suggest-item:last-child { border-bottom: none; }
.suggest-item:hover { background: var(--bg-hover); }

.suggest-top {
    background: var(--tool-accent-soft);
    border-left: 3px solid var(--tool-accent);
}

.suggest-rank {
    font-size: 0.85rem;
    font-weight: 700;
    min-width: 28px;
    text-align: center;
    color: var(--text-secondary, #aaa);
}

.suggest-top .suggest-rank { color: #ffd700; font-size: 1.1rem; }

.suggest-info { flex: 1; min-width: 0; }

.suggest-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary, #fff);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.suggest-desc {
    font-size: 0.72rem;
    color: var(--text-secondary, #aaa);
    margin-top: 2px;
}

.suggest-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    font-size: 0.72rem;
}

.suggest-type {
    font-weight: 600;
    text-transform: capitalize;
}

.suggest-time {
    color: var(--text-secondary, #aaa);
}

/* =============================================================================
   SKILL CALCULATOR MODAL
   ============================================================================= */

.skill-calc-content {
    max-width: 600px;
    max-height: 80vh;
}

.skill-calc-body {
    overflow-y: auto;
    max-height: 65vh;
}

.calc-skill-select {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 16px;
    justify-content: center;
}

.calc-skill-btn {
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.04);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    padding: 4px;
}

.calc-skill-btn:hover {
    background: var(--tool-accent-soft);
    border-color: var(--tool-accent-strong);
}

.calc-skill-btn.active {
    background: var(--tool-accent-medium);
    border-color: var(--tool-accent);
    box-shadow: 0 0 8px color-mix(in srgb, var(--tool-accent) 30%, transparent);
}

.calc-skill-btn img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.calc-inputs {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.calc-field {
    flex: 1;
}

.calc-field label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary, #aaa);
    margin-bottom: 4px;
}

.calc-field input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary, #fff);
    font-size: 1rem;
    font-family: 'Rajdhani', sans-serif;
    box-sizing: border-box;
}

.calc-field input:focus {
    outline: none;
    border-color: var(--accent, #ff9800);
}

.calc-xp-info {
    margin-bottom: 16px;
}

.calc-xp-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.85rem;
}

.calc-xp-row:last-child { border-bottom: none; }

.calc-xp-val {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
}

.calc-xp-needed {
    font-weight: 700;
    font-size: 0.95rem;
}

.calc-xp-val.highlight {
    color: var(--accent, #ff9800);
}

.calc-methods-header {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary, #aaa);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.calc-method-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 8px;
}

.calc-method-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary, #fff);
    margin-bottom: 4px;
}

.calc-method-name .calc-wiki-link {
    color: var(--accent, #ff9800);
    text-decoration: none;
    transition: opacity 0.15s;
}

.calc-method-name .calc-wiki-link:hover {
    text-decoration: underline;
    opacity: 0.85;
}

.calc-rank {
    font-size: 0.6rem;
    letter-spacing: -1px;
    color: #f5a623;
    margin-left: 4px;
    vertical-align: middle;
}

/* Ironman toggle */
.calc-mode-toggle {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 8px;
}

.calc-ironman-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    font-size: 0.82rem;
}

.calc-ironman-toggle input {
    display: none;
}

.calc-toggle-slider {
    position: relative;
    width: 36px;
    height: 20px;
    background: var(--bg-tertiary, #333);
    border-radius: 10px;
    transition: background 0.25s;
}

.calc-toggle-slider::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: #aaa;
    border-radius: 50%;
    transition: transform 0.25s, background 0.25s;
}

.calc-ironman-toggle input:checked + .calc-toggle-slider {
    background: #6e6e6e;
}

.calc-ironman-toggle input:checked + .calc-toggle-slider::after {
    transform: translateX(16px);
    background: #c0c0c0;
}

.calc-toggle-label {
    color: var(--text-secondary, #aaa);
    transition: color 0.25s;
}

.calc-ironman-toggle input:checked ~ .calc-toggle-label {
    color: #c0c0c0;
    font-weight: 600;
}

.calc-method-details {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    color: var(--text-secondary, #aaa);
    margin-bottom: 6px;
}

.calc-method-count {
    color: var(--accent, #ff9800);
    font-weight: 600;
}

.calc-method-items {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 6px;
}

.calc-item-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    padding: 2px 0;
    color: var(--text-secondary, #aaa);
}

.calc-item-qty {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    color: var(--text-primary, #fff);
}

.calc-no-methods, .calc-placeholder p {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary, #aaa);
    font-size: 0.85rem;
}

/* =============================================================================
   BOSS KILL LOG MODAL
   ============================================================================= */

.boss-log-content {
    max-width: 600px;
    max-height: 80vh;
}

.boss-log-body {
    overflow-y: auto;
    max-height: 65vh;
}

.boss-log-summary {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.boss-stat {
    text-align: center;
}

.boss-stat-val {
    display: block;
    font-size: 1.4rem;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    color: var(--accent, #ff9800);
}

.boss-stat-label {
    font-size: 0.72rem;
    color: var(--text-secondary, #aaa);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.boss-log-entry {
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    margin-bottom: 4px;
    overflow: hidden;
    transition: border-color 0.15s;
}

.boss-log-entry.has-data {
    border-color: rgba(255, 152, 0, 0.15);
}

.boss-log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.15s;
}

.boss-log-header:hover {
    background: rgba(255, 255, 255, 0.03);
}

.boss-log-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 500;
}

.boss-log-name img {
    border-radius: 4px;
    object-fit: contain;
}

.boss-log-kc {
    font-size: 0.8rem;
    color: var(--text-secondary, #aaa);
}

.boss-kc-value {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary, #fff);
}

.boss-log-details {
    padding: 8px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(0, 0, 0, 0.15);
}

.boss-log-controls {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-bottom: 8px;
}

.boss-btn {
    padding: 4px 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary, #fff);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.15s;
}

.boss-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.boss-btn-accent {
    background: rgba(255, 152, 0, 0.15);
    border-color: rgba(255, 152, 0, 0.3);
    color: var(--accent, #ff9800);
}

.boss-kc-input {
    width: 70px;
    padding: 4px 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary, #fff);
    font-size: 0.9rem;
    text-align: center;
    font-family: 'Rajdhani', sans-serif;
}

.boss-drops-list {
    margin-bottom: 8px;
}

.boss-drop-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 0.8rem;
}

.boss-drop-name { flex: 1; color: var(--text-primary, #fff); }
.boss-drop-date { color: var(--text-secondary, #aaa); font-size: 0.72rem; }

.boss-drop-remove {
    background: none;
    border: none;
    color: var(--text-secondary, #aaa);
    cursor: pointer;
    font-size: 1rem;
    padding: 0 4px;
    transition: color 0.15s;
}

.boss-drop-remove:hover { color: #ff3333; }

.boss-wiki-link {
    display: inline-block;
    font-size: 0.75rem;
    color: var(--accent-blue, #4fc3f7);
    text-decoration: none;
    margin-top: 4px;
}

.boss-wiki-link:hover { text-decoration: underline; }

/* =============================================================================
   ADVENTURE LOG SYNC BAR (Boss Log + Collection Log)
   ============================================================================= */

.boss-log-sync-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 16px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sync-advlog-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary, #bbb);
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.sync-advlog-btn:hover {
    background: rgba(255, 152, 0, 0.12);
    border-color: var(--accent, #ff9800);
    color: var(--accent, #ff9800);
}

.sync-advlog-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.sync-advlog-btn.syncing svg {
    animation: syncSpin 0.8s linear infinite;
}

@keyframes syncSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.sync-status {
    font-size: 0.75rem;
    transition: opacity 0.3s ease;
}

.sync-status.sync-loading { color: var(--text-secondary, #aaa); }
.sync-status.sync-success { color: #4caf50; }
.sync-status.sync-warn { color: var(--accent, #ff9800); }
.sync-status.sync-error { color: #f44336; }

/* =============================================================================
   COLLECTION LOG MODAL
   ============================================================================= */

.clog-content {
    max-width: 550px;
    max-height: 80vh;
}

.clog-body {
    overflow-y: auto;
    max-height: 65vh;
}

.clog-overall {
    margin-bottom: 16px;
}

.clog-overall-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 6px;
}

.clog-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent, #ff9800), #ffd700);
    border-radius: 4px;
    transition: width 0.3s;
}

.clog-overall-text {
    font-size: 0.8rem;
    color: var(--text-secondary, #aaa);
    text-align: center;
}

.clog-category {
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    margin-bottom: 6px;
    overflow: hidden;
}

.clog-cat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.15s;
}

.clog-cat-header:hover {
    background: rgba(255, 255, 255, 0.03);
}

.clog-cat-name {
    font-weight: 600;
    font-size: 0.85rem;
}

.clog-cat-progress {
    font-size: 0.78rem;
    color: var(--accent, #ff9800);
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
}

.clog-cat-items {
    display: none;
    padding: 6px 14px 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(0, 0, 0, 0.1);
}

.clog-category.clog-open .clog-cat-items {
    display: block;
}

.clog-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    font-size: 0.82rem;
    color: var(--text-secondary, #aaa);
    cursor: pointer;
    transition: color 0.15s;
}

.clog-item:hover { color: var(--text-primary, #fff); }

.clog-item.checked {
    color: var(--accent, #ff9800);
}

.clog-item.checked span {
    text-decoration: line-through;
    text-decoration-color: rgba(255, 152, 0, 0.4);
}

.clog-item input[type="checkbox"] {
    accent-color: var(--accent, #ff9800);
    width: 14px;
    height: 14px;
}

/* =============================================================================
   ACHIEVEMENTS MODAL
   ============================================================================= */

.achievements-content {
    max-width: 550px;
    max-height: 80vh;
}

.achievements-body {
    overflow-y: auto;
    max-height: 65vh;
}

.ach-summary {
    text-align: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* =============================================================================
   DROP RATE CALCULATOR
   ============================================================================= */

/* Modal shell */
.drop-calc-content {
    width: min(96vw, 1060px);
    max-width: min(96vw, 1060px);
    height: min(92vh, 720px);
    padding: 0;
    overflow: hidden;
    background: var(--tool-surface);
    border: 1px solid var(--tool-border);
    border-radius: var(--tool-radius);
    display: flex;
    flex-direction: column;
    box-shadow: var(--tool-shadow);
}

.drop-calc-content .modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    font-size: 1.4rem;
    color: var(--tool-text-muted);
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s;
    z-index: 1;
}
.drop-calc-content .modal-close:hover { color: var(--tool-text); }

/* Header */
.dc-header {
    position: relative;
    display: flex;
    align-items: center;
    padding: 14px 24px;
    border-bottom: 1px solid var(--tool-border-subtle);
    flex-shrink: 0;
}
.dc-header h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--tool-text);
}

/* Two-panel layout */
.dc-panels {
    display: flex;
    flex: 1;
    min-height: 0;
}

/* Left panel ? boss picker */
.dc-panel-left {
    width: 300px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-dark);
    background: #131313;
}

.dc-search-input {
    width: 100%;
    padding: 10px 14px;
    background: #0e0e0e;
    border: none;
    border-bottom: 1px solid var(--border-dark);
    color: #fff;
    font-size: 0.85rem;
    outline: none;
    box-sizing: border-box;
    flex-shrink: 0;
}
.dc-search-input::placeholder { color: #555; }
.dc-search-input:focus { background: var(--bg-input); }

.dc-boss-list {
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}
.dc-boss-list::-webkit-scrollbar { width: 4px; }
.dc-boss-list::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 99px; }
.dc-boss-list::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-thumb-hover); }

.dc-boss-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    background: none;
    border: none;
    color: #bbb;
    font-size: 0.82rem;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
}
.dc-boss-btn:hover { background: rgba(255,255,255,0.04); }
.dc-boss-btn.active {
    background: rgba(255,152,0,0.1);
    color: var(--accent, #ff9800);
}

.dc-boss-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 4px;
    flex-shrink: 0;
}
.dc-boss-emoji {
    font-size: 1rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.dc-boss-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dc-boss-empty {
    padding: 20px 14px;
    color: #555;
    font-size: 0.8rem;
    text-align: center;
}

/* Right panel ? config + results */
.dc-panel-right {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
    padding: 20px 24px;
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}
.dc-panel-right::-webkit-scrollbar { width: 4px; }
.dc-panel-right::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 99px; }
.dc-panel-right::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-thumb-hover); }

/* Placeholder when no boss selected */
.dc-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 10px;
    color: #444;
    font-size: 0.88rem;
}
.dc-placeholder-icon { font-size: 2rem; opacity: 0.6; }

/* Shared field / label / note */
.dc-field { margin-bottom: 14px; }
.dc-label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.dc-note {
    margin-top: 6px;
    font-size: 0.72rem;
    line-height: 1.4;
    color: #888;
}

/* Inputs */
.dc-input {
    width: 100%;
    padding: 9px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: #fff;
    font-size: 0.88rem;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
    appearance: textfield;
    -moz-appearance: textfield;
}
.dc-input::-webkit-outer-spin-button,
.dc-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.dc-input:focus { border-color: var(--accent, #ff9800); }

/* Item Chips */
.dc-item-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.dc-item-btn {
    padding: 6px 10px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-dark);
    border-radius: 6px;
    color: #bbb;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    gap: 1px;
    text-align: left;
}
.dc-item-btn:hover { background: rgba(255,255,255,0.06); border-color: var(--border-light); }
.dc-item-btn.active {
    background: rgba(255,152,0,0.1);
    border-color: rgba(255,152,0,0.35);
    color: #fff;
}
.dc-item-name { font-size: 0.78rem; font-weight: 600; }
.dc-item-rate { font-size: 0.68rem; color: #666; font-family: 'Rajdhani', sans-serif; }
.dc-item-btn.active .dc-item-rate { color: var(--accent, #ff9800); }

/* Divider */
.dc-divider { height: 1px; background: var(--bar-bg); margin: 16px 0; }

/* Probability Display */
.dc-prob-display { text-align: center; margin-bottom: 10px; }
.dc-prob-label {
    font-size: 0.7rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}
.dc-prob-value {
    font-size: 2.2rem;
    font-weight: 700;
    color: #fff;
    font-family: 'Rajdhani', sans-serif;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}

/* Progress Bar */
.dc-bar-wrap {
    height: 6px;
    background: var(--border-dark);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 14px;
}
.dc-prob-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s ease;
    min-width: 2px;
}
.dc-bar-low { background: #ef5350; }
.dc-bar-med { background: #ff9800; }
.dc-bar-good { background: #ffca28; }
.dc-bar-high { background: #66bb6a; }
.dc-bar-max { background: #26c6da; }

/* Stats Grid ? 4 columns */
.dc-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}
.dc-stat {
    padding: 8px 10px;
    background: var(--bg-input);
    border: 1px solid var(--border-dark);
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.dc-stat-label {
    font-size: 0.6rem;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.dc-stat-value {
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
    font-family: 'Rajdhani', sans-serif;
    font-variant-numeric: tabular-nums;
}

/* Verdict */
.dc-verdict {
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    line-height: 1.4;
    margin-bottom: 12px;
}
.dc-verdict-lucky { background: rgba(76,175,80,0.08); border: 1px solid rgba(76,175,80,0.2); color: #81c784; }
.dc-verdict-normal { background: rgba(255,235,59,0.05); border: 1px solid rgba(255,235,59,0.15); color: #fff59d; }
.dc-verdict-dry { background: rgba(255,152,0,0.08); border: 1px solid rgba(255,152,0,0.2); color: #ffb74d; }
.dc-verdict-extreme { background: rgba(244,67,54,0.08); border: 1px solid rgba(244,67,54,0.2); color: #ef9a9a; }

/* Milestones ? inline row */
.dc-milestones {
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-dark);
    border-radius: 6px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.dc-ms-title {
    font-size: 0.65rem;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
}
.dc-ms-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    white-space: nowrap;
}
.dc-ms-row span:first-child { color: #888; font-weight: 600; }
.dc-ms-row span:last-child {
    color: #fff;
    font-weight: 700;
    font-family: 'Rajdhani', sans-serif;
    font-variant-numeric: tabular-nums;
}

/* Source */
.dc-source { font-size: 0.68rem; color: #555; line-height: 1.4; }
.dc-source a { color: #4fc3f7; text-decoration: none; }
.dc-source a:hover { text-decoration: underline; }

/* Responsive */
@media (max-width: 768px) {
    .drop-calc-content {
        width: calc(100vw - 16px);
        height: auto;
        max-height: 92vh;
        margin: 0 8px;
    }
    .dc-panels { flex-direction: column; }
    .dc-panel-left {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-dark);
        max-height: 240px;
    }
    .dc-stats-grid { grid-template-columns: 1fr 1fr; }
    .dc-milestones { flex-direction: column; align-items: flex-start; gap: 4px; }
    .dc-ms-row { justify-content: space-between; width: 100%; }
    .dc-prob-value { font-size: 1.7rem; }
}

.ach-count {
    display: block;
    font-size: 1.6rem;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    color: var(--accent, #ff9800);
}

.ach-label {
    font-size: 0.75rem;
    color: var(--text-secondary, #aaa);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ach-category {
    margin-bottom: 16px;
}

.ach-cat-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary, #aaa);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.ach-grid {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ach-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    opacity: 0.4;
    filter: grayscale(1);
    transition: all 0.2s;
}

.ach-badge.unlocked {
    opacity: 1;
    filter: none;
    border-color: rgba(255, 152, 0, 0.2);
    background: rgba(255, 152, 0, 0.05);
}

.ach-icon {
    font-size: 1.3rem;
    min-width: 28px;
    text-align: center;
}

.ach-badge-name {
    font-weight: 600;
    font-size: 0.85rem;
}

.ach-badge-desc {
    font-size: 0.72rem;
    color: var(--text-secondary, #aaa);
}

/* Achievement Toast Notification */

.achievement-toast {
    position: fixed;
    bottom: 80px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: linear-gradient(135deg, rgba(30, 30, 30, 0.98), rgba(20, 20, 20, 0.98));
    border: 1px solid rgba(255, 152, 0, 0.4);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 152, 0, 0.15);
    z-index: 10000;
    transform: translateX(120%);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    color: var(--text-primary, #fff);
}

.achievement-toast.show {
    transform: translateX(0);
}

.achievement-toast-icon {
    font-size: 1.8rem;
}

.achievement-toast-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent, #ff9800);
    font-weight: 600;
}

.achievement-toast-name {
    font-weight: 700;
    font-size: 0.95rem;
}

/* =============================================================================
   TOOLS SECTION IN DROPDOWN (Skill Calc, Boss Log, Collection Log, Achievements)
   ============================================================================= */

.dropdown-section-header {
    font-size: 0.68rem;
    color: var(--text-secondary, #aaa);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 14px 4px;
    font-weight: 600;
}

/* =============================================================================
   RESPONSIVE
   ============================================================================= */

@media (max-width: 768px) {
    .skill-calc-content,
    .boss-log-content,
    .clog-content,
    .achievements-content,
    .heatmap-modal-content,
    .suggestions-modal-content {
        max-width: 95vw;
        max-height: 85vh;
        margin: 10px;
    }

    .calc-skill-select {
        gap: 3px;
    }

    .calc-skill-btn {
        width: 32px;
        height: 32px;
    }

    .calc-skill-btn img {
        width: 20px;
        height: 20px;
    }

    .calc-inputs {
        flex-direction: column;
        gap: 8px;
    }

    .heatmap-cell {
        width: 9px;
        height: 9px;
    }

    .suggest-item {
        padding: 6px 10px;
    }

    .achievement-toast {
        right: 10px;
        bottom: 70px;
        left: 10px;
    }
}


/* =============================================================================
   ARCHAEOLOGY RESTORATION CALCULATOR
   ============================================================================= */

.arch-calc-content {
    width: min(98vw, 1600px);
    max-width: min(98vw, 1600px);
    height: min(98vh, 1120px);
    max-height: calc(100vh - 12px);
    padding: 0;
    overflow: hidden;
    background: #101216;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.62), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.arch-calc-content .modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    line-height: 1;
    color: #b9c0c9;
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    z-index: 1;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.arch-calc-content .modal-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.18);
}

.ac-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 15px 22px;
    padding-right: 60px;
    background: linear-gradient(180deg, #181b20 0%, #111419 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}
.ac-title-wrap {
    min-width: 0;
    display: grid;
    gap: 3px;
    position: relative;
    padding-left: 12px;
}
.ac-title-wrap::before {
    content: '';
    position: absolute;
    left: 0;
    top: 3px;
    bottom: 3px;
    width: 3px;
    border-radius: 999px;
    background: linear-gradient(180deg, #f0b13c, #73b7d8);
}
.ac-kicker {
    color: #9cd8f4;
    font-size: 0.66rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.ac-header h3 {
    margin: 0;
    color: #f3f5f7;
    font-size: 1.2rem;
    font-weight: 850;
    line-height: 1.1;
}
.ac-header-stats {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.ac-pill {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 3px 10px;
    color: #dfe7ef;
    background: rgba(115, 183, 216, 0.1);
    border: 1px solid rgba(115, 183, 216, 0.25);
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 800;
    white-space: nowrap;
}
.ac-pill:last-child {
    color: #ffe0a0;
    background: rgba(240, 177, 60, 0.09);
    border-color: rgba(240, 177, 60, 0.26);
}

.ac-toolbar {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) auto auto auto;
    align-items: center;
    gap: 10px;
    padding: 11px 18px;
    background: #12161c;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    flex-shrink: 0;
}
.ac-filters-toggle {
    display: none;
}
.ac-toolbar-extras {
    display: contents;
}
.ac-details-toggle {
    display: none;
}
.ac-mobile-pane-bar,
.ac-mat-peek {
    display: none;
}
.ac-mobile-pane-bar {
    flex-shrink: 0;
    gap: 6px;
    padding: 6px 8px;
    background: #0d1117;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.ac-pane-btn {
    flex: 1;
    min-height: 38px;
    padding: 8px 10px;
    background: #161b22;
    color: #9eb4c8;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.ac-pane-btn.is-active {
    color: #101317;
    background: #f0b13c;
    border-color: #f0b13c;
}
.ac-pane-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    margin-left: 6px;
    padding: 0 6px;
    background: rgba(0, 0, 0, 0.22);
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 850;
    font-variant-numeric: tabular-nums;
}
.ac-pane-btn.is-active .ac-pane-badge {
    background: rgba(0, 0, 0, 0.18);
    color: #101317;
}
.ac-mat-peek {
    position: sticky;
    bottom: 0;
    z-index: 20;
    width: 100%;
    min-height: 44px;
    padding: 10px 14px;
    background: linear-gradient(180deg, rgba(17, 21, 27, 0.92) 0%, #11151b 100%);
    border: 0;
    border-top: 1px solid rgba(240, 177, 60, 0.35);
    color: #ffe0a0;
    font-size: 0.88rem;
    font-weight: 850;
    cursor: pointer;
    box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.45);
}
.ac-mat-peek:hover,
.ac-mat-peek:active {
    background: #1a2028;
    color: #fff;
}
.ac-search-wrap {
    display: flex;
    align-items: center;
    gap: 9px;
    flex: 1;
    min-width: 0;
    padding: 0 12px;
    background: #0b0f14;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #8aa1b8;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.ac-search-wrap:focus-within {
    border-color: rgba(115, 183, 216, 0.65);
    box-shadow: 0 0 0 3px rgba(115, 183, 216, 0.12);
    background: #0e1319;
}
.ac-search-icon { flex-shrink: 0; }
.ac-search {
    width: 100%;
    min-width: 0;
    padding: 9px 0;
    background: transparent;
    border: 0;
    color: #f1f4f8;
    font-size: 0.92rem;
    outline: none;
}
.ac-search::placeholder { color: #697481; }
.ac-btn {
    min-height: 38px;
    padding: 7px 13px;
    background: #1a2028;
    color: #d9dee5;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.84rem;
    font-weight: 800;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.15s;
}
.ac-btn:hover {
    background: #2a303a;
    border-color: rgba(255, 255, 255, 0.16);
    color: #fff;
    transform: translateY(-1px);
}
.ac-btn-filter.is-active {
    color: #101317;
    background: #73b7d8;
    border-color: #73b7d8;
}
.ac-btn-clear {
    color: #ffd1d1;
    background: rgba(150, 54, 54, 0.22);
    border-color: rgba(255, 126, 126, 0.18);
}
.ac-btn-clear:hover {
    color: #fff;
    background: rgba(188, 70, 70, 0.32);
}

.ac-group-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px;
    background: #0c1016;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}
.ac-group-toggle-label {
    color: #8a96a4;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0 6px 0 8px;
}
.ac-seg-btn {
    background: transparent;
    color: #c5cdd6;
    border: 0;
    padding: 7px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 800;
    transition: background 0.15s, color 0.15s, transform 0.15s;
}
.ac-seg-btn:hover { color: #fff; background: rgba(255, 255, 255, 0.07); transform: translateY(-1px); }
.ac-seg-btn.is-active {
    background: #f0b13c;
    color: #101317;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}
.ac-seg-btn.is-active:hover { background: #f6bc4d; color: #101317; }

.ac-meta-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 18px;
    background: #0c1015;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    color: #8d99a7;
    font-size: 0.76rem;
    font-weight: 700;
    flex-shrink: 0;
}
.ac-meta-divider {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #46515f;
}

.ac-top-stack {
    flex-shrink: 0;
    background: #12161c;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.ac-top-collapsible {
    overflow: hidden;
    max-height: 520px;
    opacity: 1;
    transform: translateY(0);
}
.ac-view-calc.is-top-collapsed .ac-top-collapsible {
    max-height: 0;
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
}
.ac-view-calc.is-top-collapsed-animate .ac-top-collapsible {
    transition: max-height 0.28s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.2s ease,
                transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.ac-compact-summary {
    display: none;
    overflow: hidden;
    padding: 5px 18px 8px;
    background: linear-gradient(180deg, #141920 0%, #12161c 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.ac-view-calc.is-top-collapsed .ac-compact-summary {
    display: block;
    cursor: pointer;
}
.ac-view-calc.is-top-collapsed-animate .ac-compact-summary {
    animation: acCompactSummaryIn 0.22s ease;
}
@keyframes acCompactSummaryIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}
.ac-view-calc.is-top-collapsed .ac-compact-summary:hover {
    background: linear-gradient(180deg, #181e28 0%, #141920 100%);
}
.ac-view-calc.is-top-collapsed .ac-compact-summary:hover .ac-compact-summary-stats {
    color: #e8edf3;
}
.ac-compact-summary-stats {
    color: #b8c4d0;
    font-size: 0.76rem;
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (prefers-reduced-motion: reduce) {
    .ac-view-calc.is-top-collapsed-animate .ac-top-collapsible,
    .ac-view-calc.is-top-collapsed-animate .ac-compact-summary {
        transition-duration: 0.01ms;
        animation: none;
    }
}

.ac-materials-focus-toggle.is-active {
    color: #101317;
    background: #f0b13c;
    border-color: #f0b13c;
}

.ac-chip-bar {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 5px 16px 6px;
    background: linear-gradient(180deg, #11161d 0%, #0c1016 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
    transition: padding 0.2s ease;
}
.ac-chip-bar.is-collapsed { padding: 6px 18px; }
.ac-chip-bar.is-collapsed .ac-chip-groups {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    margin: 0;
}
.ac-chip-groups {
    transition: max-height 0.25s ease, opacity 0.2s ease;
    max-height: 220px;
    opacity: 1;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0 0 2px 0;
}
.ac-chip-action.ac-chip-collapse {
    border-color: rgba(115, 183, 216, 0.3);
    color: #aedfff;
}
.ac-chip-action.ac-chip-collapse:hover {
    background: rgba(115, 183, 216, 0.18);
    color: #fff;
}
.ac-chip-bar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.ac-chip-bar-label {
    color: #c2cbd6;
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    flex-shrink: 0;
}
.ac-chip-bar-actions {
    display: inline-flex;
    gap: 6px;
    flex-shrink: 0;
}
.ac-chip-action {
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #c5cdd6;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.15s;
}
.ac-chip-action:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.22);
    transform: translateY(-1px);
}
.ac-chip-action.ac-chip-clear {
    border-color: rgba(255, 126, 126, 0.3);
    color: #ffb1b1;
}
.ac-chip-action.ac-chip-clear:hover {
    background: rgba(188, 70, 70, 0.25);
    color: #fff;
}
.ac-chip-groups {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
}
.ac-chip-group {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-width: 0;
    gap: 3px;
    padding: 4px 5px 5px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.055) 0%, rgba(255, 255, 255, 0.025) 100%);
    border: 1px solid rgba(255, 255, 255, 0.075);
    border-left: 2px solid var(--ac-faction, #5f6b7a);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}
.ac-chip-group[data-faction="Zarosian"] { --ac-faction: #8b5cf6; }
.ac-chip-group[data-faction="Zamorakian"] { --ac-faction: #dc2626; }
.ac-chip-group[data-faction="Saradominist"] { --ac-faction: #f4c542; }
.ac-chip-group[data-faction="Armadylean"] { --ac-faction: #2f8cff; }
.ac-chip-group[data-faction="Bandosian"] { --ac-faction: #9a6b34; }
.ac-chip-group[data-faction="Dragonkin"] { --ac-faction: #8f8f86; }
.ac-chip-group[data-faction="Guthixian"] { --ac-faction: #22c55e; }
.ac-chip-group[data-faction="Other"] { --ac-faction: #c0a278; }
.ac-chip-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 7px;
    min-width: 0;
}
.ac-chip-group-title {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
}
.ac-chip-group-icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(255, 255, 255, 0.07);
    overflow: hidden;
    flex: 0 0 18px;
}
.ac-chip-group-icon {
    display: block;
    width: 14px;
    height: 14px;
    max-width: 14px;
    max-height: 14px;
    object-fit: contain;
    image-rendering: auto;
}
.ac-chip-group-label {
    color: #e3e9f0;
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.035em;
    text-transform: uppercase;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ac-chip-group-toggle {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #8d98a7;
    min-height: 18px;
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 0.64rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}
.ac-chip-group-toggle:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.ac-chip-group-toggle.is-active {
    background: color-mix(in srgb, var(--ac-faction, #f0b13c) 22%, transparent);
    border-color: var(--ac-faction, #f0b13c);
    color: #fff;
}
.ac-chip-group-header + .ac-chip-row {
    padding-left: 0;
    border-left: 0;
}
.ac-chip-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2px;
    min-width: 0;
}
.ac-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 20px;
    padding: 3px 5px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    color: #c5cdd6;
    font-size: 0.68rem;
    font-weight: 700;
    cursor: pointer;
    min-width: 0;
    transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.15s;
}
.ac-chip:only-child { grid-column: 1 / -1; }
.ac-chip:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    transform: translateY(-1px);
}
.ac-chip-name {
    line-height: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ac-chip-count {
    background: rgba(255, 255, 255, 0.1);
    color: #aab4be;
    padding: 0 5px;
    border-radius: 999px;
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 1.4;
}
.ac-chip.is-active {
    background: rgba(240, 177, 60, 0.18);
    border-color: rgba(240, 177, 60, 0.7);
    color: #fce6a8;
    box-shadow: 0 0 0 1px rgba(240, 177, 60, 0.35);
}
.ac-chip.is-active .ac-chip-count {
    background: rgba(240, 177, 60, 0.35);
    color: #1a1410;
}
.ac-chip-clear {
    /* legacy hidden state class used by the JS G?? see above for visible style */
}

.ac-body {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(400px, 1fr);
    gap: 0;
    flex: 1;
    overflow: hidden;
    min-height: 0;
    background: #0b0f14;
}
.ac-body.is-materials-focus {
    grid-template-columns: minmax(0, 1.2fr) minmax(480px, 1.35fr);
}
.ac-body.is-materials-focus .ac-selected-card {
    display: none;
}
.ac-body.is-materials-focus .ac-materials-card {
    flex: 1 1 auto;
    min-height: 0;
}
.ac-body.is-materials-focus .ac-materials {
    flex: 1;
    min-height: 0;
    max-height: none;
}

.ac-panel-left {
    overflow-y: auto;
    min-height: 0;
    padding: 12px;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    background: #0d1117;
}
.ac-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.ac-panel-right {
    min-height: 0;
    overflow: hidden;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: linear-gradient(180deg, #11151b 0%, #0f1217 100%);
}

.ac-panel-left,
.ac-panel-right,
.ac-chip-groups,
.ac-selected-list,
.ac-materials {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}
.ac-panel-left::-webkit-scrollbar,
.ac-panel-right::-webkit-scrollbar,
.ac-chip-groups::-webkit-scrollbar,
.ac-selected-list::-webkit-scrollbar,
.ac-materials::-webkit-scrollbar { width: 8px; }
.ac-panel-left::-webkit-scrollbar-track,
.ac-panel-right::-webkit-scrollbar-track,
.ac-chip-groups::-webkit-scrollbar-track,
.ac-selected-list::-webkit-scrollbar-track,
.ac-materials::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.04); }
.ac-panel-left::-webkit-scrollbar-thumb,
.ac-panel-right::-webkit-scrollbar-thumb,
.ac-chip-groups::-webkit-scrollbar-thumb,
.ac-selected-list::-webkit-scrollbar-thumb,
.ac-materials::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 999px;
}
.ac-panel-left::-webkit-scrollbar-thumb:hover,
.ac-panel-right::-webkit-scrollbar-thumb:hover,
.ac-chip-groups::-webkit-scrollbar-thumb:hover,
.ac-selected-list::-webkit-scrollbar-thumb:hover,
.ac-materials::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-thumb-hover); }
.ac-chip-groups::-webkit-scrollbar { height: 5px; }
.ac-chip-groups::-webkit-scrollbar-track { background: transparent; }
.ac-chip-groups::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); }
.ac-chip-groups::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-thumb-hover); }
.ac-chip-groups { scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track); }

.ac-group { display: flex; flex-direction: column; gap: 8px; }
.ac-group-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #ffd782;
    padding: 9px 14px;
    border: 0;
    border-bottom: 1px solid rgba(240, 177, 60, 0.2);
    border-radius: 0;
    margin: 0 -12px 2px;
    position: sticky;
    top: 0;
    background: #0d1117;
    box-shadow: 0 10px 18px rgba(0, 0, 0, 0.62), inset 0 -1px 0 rgba(255, 255, 255, 0.045);
    isolation: isolate;
    z-index: 12;
}
.ac-group-title::before {
    content: '';
    position: absolute;
    inset: -12px 0 -6px;
    background: #0d1117;
    z-index: -1;
}
.ac-group-title span:first-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ac-group-title span:last-child {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(240, 177, 60, 0.12);
    border: 1px solid rgba(240, 177, 60, 0.22);
    color: #f6c76f;
    font-size: 0.68rem;
    letter-spacing: 0;
}

.ac-row {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr) 136px;
    align-items: center;
    gap: 11px;
    min-height: 74px;
    padding: 9px 10px;
    background: #141922;
    border: 1px solid rgba(255, 255, 255, 0.075);
    border-radius: 8px;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.ac-row-img-wrap {
    width: 58px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #20252d 0%, #151920 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 7px;
    overflow: hidden;
    flex-shrink: 0;
}
.ac-img {
    display: block;
    width: auto;
    height: auto;
    max-width: 42px;
    max-height: 42px;
    object-fit: contain;
    object-position: center center;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: pixelated;
    -ms-interpolation-mode: nearest-neighbor;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
}
.ac-row.is-selected .ac-row-img-wrap {
    border-color: rgba(240, 177, 60, 0.45);
    background: linear-gradient(180deg, #2a2418 0%, #1d1a14 100%);
}
.ac-row:hover {
    background: #19202a;
    border-color: rgba(255, 255, 255, 0.14);
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}
.ac-row.is-selected {
    background: rgba(240, 177, 60, 0.08);
    border-color: rgba(240, 177, 60, 0.46);
    box-shadow: inset 3px 0 0 #f0b13c;
}

.ac-row-info { flex: 1; min-width: 0; }
.ac-row-title {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}
.ac-row-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #f2f4f7;
    font-size: 0.93rem;
    font-weight: 750;
    white-space: nowrap;
    text-decoration: none;
    transition: color 0.15s;
}
.ac-row-name:hover { color: #f0b13c; text-decoration: underline; }
.ac-row-img-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    line-height: 0;
}
.ac-lvl {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    min-height: 23px;
    padding: 0 7px;
    background: rgba(115, 183, 216, 0.12);
    border: 1px solid rgba(115, 183, 216, 0.24);
    color: #9bd8f4;
    font-weight: 800;
    border-radius: 999px;
    font-size: 0.7rem;
    text-align: center;
    white-space: nowrap;
    cursor: help;
}
.ac-row-mats {
    color: #9da7b3;
    font-size: 0.74rem;
    line-height: 1.4;
    margin-top: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ac-stepper {
    display: grid;
    grid-template-columns: 34px minmax(48px, 1fr) 34px;
    align-items: stretch;
    height: 36px;
    overflow: hidden;
    background: #090d12;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 8px;
}
.ac-stepper-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: #1a2029;
    border: 0;
    color: #eee;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 800;
    transition: background 0.15s, color 0.15s;
}
.ac-stepper-btn:hover {
    background: #2a3340;
    color: #fff;
}
.ac-stepper-btn[data-action="increase"] { color: #ffe1a4; }
.ac-stepper-btn[data-action="decrease"] { color: #b7c3cf; }
.ac-stepper-btn:first-child { border-right: 1px solid rgba(255, 255, 255, 0.08); }
.ac-stepper-btn:last-child { border-left: 1px solid rgba(255, 255, 255, 0.08); }

.ac-qty {
    width: 100%;
    min-width: 0;
    padding: 0 6px;
    background: #0c0f14;
    border: 0;
    color: #fff;
    text-align: center;
    font-size: 0.92rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    outline: none;
}
.ac-qty:focus { box-shadow: inset 0 0 0 2px rgba(240, 177, 60, 0.55); }
.ac-qty::-webkit-outer-spin-button,
.ac-qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.ac-empty {
    text-align: center;
    color: #8e99a6;
    padding: 32px 12px;
    background: #141922;
    border: 1px dashed rgba(255, 255, 255, 0.12);
    border-radius: 8px;
}

.ac-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    flex-shrink: 0;
}
.ac-stat-card {
    min-height: 70px;
    padding: 10px 11px;
    background: linear-gradient(180deg, #171d25 0%, #131820 100%);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}
.ac-stat-card span {
    color: #8f9aa8;
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.ac-stat-card strong {
    color: #f0b13c;
    font-size: 1.18rem;
    font-weight: 850;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.ac-side-card {
    min-height: 0;
    overflow: hidden;
    background: #141922;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}
.ac-selected-card { max-height: 210px; flex-shrink: 0; }
.ac-materials-card { flex: 1; }

.ac-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 11px;
    color: #f3f5f7;
    background: rgba(255, 255, 255, 0.035);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    font-size: 0.78rem;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.ac-section-count {
    color: #8f9aa8;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: none;
    letter-spacing: 0;
    white-space: nowrap;
}
.ac-selected-list,
.ac-materials {
    flex: 1;
    overflow-y: auto;
    padding: 6px;
    min-height: 0;
}
.ac-placeholder {
    color: #7f8a96;
    padding: 24px 10px;
    text-align: center;
    font-size: 0.86rem;
}
.ac-selected-row {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto 28px;
    align-items: center;
    gap: 8px;
    padding: 7px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.055);
    border-radius: 7px;
    transition: background 0.15s;
}
.ac-selected-row:hover { background: rgba(255, 255, 255, 0.035); }
.ac-selected-img {
    display: block;
    width: auto;
    height: auto;
    max-width: 28px;
    max-height: 28px;
    object-fit: contain;
    object-position: center center;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: pixelated;
}
.ac-selected-img-link {
    width: 36px;
    height: 36px;
    background: linear-gradient(180deg, #1d2129 0%, #161a21 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
}
.ac-selected-row:last-child { border-bottom: none; }
.ac-selected-info { min-width: 0; }
.ac-selected-name {
    display: block;
    color: #f2f4f7;
    font-size: 0.86rem;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
    transition: color 0.15s;
}
.ac-selected-name:hover { color: #f0b13c; text-decoration: underline; }
.ac-selected-img-link {
    width: 36px;
    height: 36px;
    background: linear-gradient(180deg, #1d2129 0%, #161a21 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}
.ac-selected-site {
    display: block;
    margin-top: 2px;
    color: #8793a1;
    font-size: 0.72rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ac-selected-qty {
    min-width: 38px;
    padding: 3px 7px;
    color: #ffe0a0;
    background: rgba(240, 177, 60, 0.1);
    border: 1px solid rgba(240, 177, 60, 0.22);
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 850;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.ac-selected-remove {
    width: 28px;
    height: 28px;
    padding: 0;
    color: #aeb4bd;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 850;
}
.ac-selected-remove:hover {
    color: #fff;
    background: rgba(188, 70, 70, 0.28);
    border-color: rgba(255, 126, 126, 0.18);
}
.ac-mat-row {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: 38px;
    padding: 6px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.055);
    border-radius: 7px;
    font-size: 0.86rem;
    transition: background 0.15s;
}
.ac-mat-row:hover { background: rgba(255, 255, 255, 0.035); }
.ac-mat-row:last-child { border-bottom: none; }
.ac-mat-img-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 5px;
    background: linear-gradient(180deg, #1d2129 0%, #161a21 100%);
    border: 1px solid rgba(255, 255, 255, 0.07);
    overflow: hidden;
}
.ac-mat-img {
    display: block;
    width: auto;
    height: auto;
    max-width: 22px;
    max-height: 22px;
    object-fit: contain;
    object-position: center center;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: pixelated;
}
/* Subtle placeholder when an artefact or material image fails to load on the
   wiki. Adds a faint diagonal hatch + question mark so empty boxes look
   intentional rather than broken. */
.ac-row-img-wrap.is-img-missing::after,
.ac-selected-img-link.is-img-missing::after,
.ac-mat-img-link.is-img-missing::after {
    content: '?';
    color: rgba(255, 255, 255, 0.18);
    font-size: 1.1rem;
    font-weight: 800;
}
.ac-mat-name {
    min-width: 0;
    color: #dfe4eb;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 0.15s;
}
.ac-mat-name:hover { color: #f0b13c; text-decoration: underline; }
.ac-mat-qty {
    color: #f0b13c;
    font-weight: 850;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.ac-source {
    flex-shrink: 0;
    font-size: 0.72rem;
    color: #6f7a87;
    text-align: center;
    padding-top: 1px;
}
.ac-source a {
    color: #92c8e5;
    text-decoration: none;
}
.ac-source a:hover { text-decoration: underline; }

@media (max-width: 1100px) {
    .arch-calc-content {
        width: min(99vw, 1340px);
    }
    .ac-toolbar {
        grid-template-columns: minmax(260px, 1fr) auto auto;
    }
    .ac-group-toggle {
        grid-column: 1 / -1;
        justify-content: flex-start;
        width: fit-content;
    }
    .ac-body { grid-template-columns: minmax(0, 1.45fr) minmax(360px, 1fr); }
    .ac-chip-groups {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        max-height: min(320px, 38vh);
    }
}

@media (max-width: 900px) {
    .ac-toolbar { grid-template-columns: 1fr auto auto; }
    .ac-body { grid-template-columns: 1fr; }
    .ac-body.is-materials-focus .ac-panel-left {
        max-height: 34vh;
    }
    .ac-body.is-materials-focus .ac-panel-right {
        min-height: 52vh;
        flex: 1;
    }
    .ac-panel-left {
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        max-height: 48vh;
    }
    .ac-panel-right {
        min-height: 360px;
        overflow-y: auto;
    }
    .ac-summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    body.arch-calc-open {
        overflow: hidden;
    }
    body.arch-calc-open #arch-calc-modal.modal-overlay {
        align-items: stretch;
        justify-content: stretch;
        padding: 0;
    }
    .arch-calc-content {
        width: 100vw;
        max-width: 100vw;
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
        border: none;
    }
    .arch-calc-content .ac-tabs {
        padding: 2px 8px 0;
        flex-shrink: 0;
    }
    .ac-tab-label-full { display: none; }
    .ac-tab-label-short { display: inline; }
    .arch-calc-content .ac-tab {
        padding: 6px 10px 7px;
        font-size: 0.74rem;
    }
    .ac-header {
        flex-direction: row;
        align-items: center;
        gap: 8px;
        padding: 8px 46px 8px 12px;
        min-height: 0;
    }
    .ac-kicker,
    .ac-header-stats {
        display: none;
    }
    .ac-title-wrap {
        padding-left: 10px;
        flex: 1;
        min-width: 0;
    }
    .ac-title-wrap::before {
        top: 2px;
        bottom: 2px;
    }
    .ac-header h3 {
        font-size: 0.95rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .arch-calc-content .modal-close {
        top: 8px;
        right: 8px;
        width: 36px;
        height: 36px;
    }

    /* Collapsible top controls G?? search stays visible; filters tuck away */
    .ac-top-stack {
        flex-shrink: 0;
        background: #12161c;
        border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    }
    .ac-toolbar {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 6px;
        padding: 6px 8px;
        border-bottom: none;
        background: transparent;
    }
    .ac-search-wrap {
        grid-column: auto;
        padding: 0 10px;
        min-height: 36px;
    }
    .ac-search {
        padding: 7px 0;
        font-size: 0.88rem;
    }
    .ac-filters-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 36px;
        padding: 6px 11px;
        font-size: 0.76rem;
        flex-shrink: 0;
    }
    .ac-filters-toggle.is-active {
        color: #101317;
        background: #73b7d8;
        border-color: #73b7d8;
    }
    .ac-toolbar-extras {
        display: none;
        grid-column: 1 / -1;
        gap: 6px;
    }
    .ac-view-calc:not(.is-filters-collapsed) .ac-toolbar-extras {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
    .ac-view-calc.is-filters-collapsed .ac-meta-bar,
    .ac-view-calc.is-filters-collapsed .ac-chip-bar {
        display: none;
    }
    .ac-view-calc:has(.ac-pane-materials) .ac-meta-bar {
        display: none;
    }
    .ac-view-calc:not(.is-filters-collapsed) .ac-meta-bar {
        display: flex;
        align-items: flex-start;
        flex-direction: column;
        gap: 3px;
        padding: 4px 8px 6px;
        font-size: 0.68rem;
        border-bottom: none;
        background: transparent;
    }
    .ac-meta-divider { display: none; }
    .ac-view-calc:not(.is-filters-collapsed) .ac-chip-bar {
        display: flex;
        padding: 0 8px 6px;
        border-bottom: none;
        background: transparent;
    }
    .ac-group-toggle {
        grid-column: 1 / -1;
        width: 100%;
    }
    .ac-seg-btn {
        flex: 1;
        min-width: 0;
        padding: 8px 6px;
        font-size: 0.76rem;
    }
    .ac-toolbar-extras .ac-btn {
        width: 100%;
        min-height: 36px;
        font-size: 0.76rem;
    }
    .ac-view-calc.is-top-collapsed .ac-compact-summary {
        padding: 4px 8px 6px;
    }
    .ac-compact-summary-stats {
        font-size: 0.68rem;
    }

    .ac-mobile-pane-bar {
        display: flex;
    }
    .ac-mat-peek {
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    /* Two full-screen panes: pick artefacts OR scroll all material totals */
    .ac-body {
        display: flex;
        flex-direction: column;
        overflow: hidden;
        min-height: 0;
        flex: 1;
        position: relative;
    }
    .ac-body.ac-pane-artefacts .ac-panel-right {
        display: none;
    }
    .ac-body.ac-pane-materials .ac-panel-left,
    .ac-body.ac-pane-materials .ac-mat-peek {
        display: none;
    }
    .ac-panel-left {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        border-right: none;
        border-bottom: none;
        padding: 8px;
    }
    .ac-panel-right {
        flex: 1 1 auto;
        min-height: 0;
        max-height: none;
        overflow: hidden;
        padding: 8px;
        display: flex;
        flex-direction: column;
        gap: 8px;
        border-top: none;
        background: #11151b;
        box-shadow: none;
    }
    .ac-body.ac-pane-materials .ac-panel-right {
        display: flex;
    }
    .ac-details-toggle {
        display: none;
    }
    .ac-summary-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0;
        margin: 0;
        padding: 4px 2px 6px;
        flex-shrink: 0;
    }
    .ac-stat-card {
        padding: 4px 6px;
        background: transparent;
        border: none;
        border-radius: 0;
        text-align: center;
    }
    .ac-stat-card + .ac-stat-card {
        border-left: 1px solid rgba(255, 255, 255, 0.08);
    }
    .ac-stat-card span {
        font-size: 0.62rem;
    }
    .ac-stat-card strong {
        font-size: 0.92rem;
    }
    .ac-body.ac-pane-materials .ac-selected-card {
        display: none;
    }
    .ac-body.ac-pane-materials .ac-materials-card {
        flex: 1;
        min-height: 0;
        max-height: none;
    }
    .ac-body.ac-pane-materials .ac-materials {
        flex: 1;
        min-height: 0;
        max-height: none;
        padding: 4px 2px 8px;
    }
    .ac-body.is-materials-focus.ac-pane-artefacts .ac-panel-right {
        display: flex;
    }
    .ac-body.is-materials-focus.ac-pane-artefacts .ac-panel-left {
        display: block;
        max-height: 34vh;
    }
    .ac-body.ac-pane-materials .ac-mat-row {
        grid-template-columns: 36px minmax(0, 1fr) auto;
        min-height: 48px;
        padding: 8px 10px;
        font-size: 0.92rem;
    }
    .ac-body.ac-pane-materials .ac-mat-img-link {
        width: 36px;
        height: 36px;
    }
    .ac-body.ac-pane-materials .ac-mat-img {
        max-width: 30px;
        max-height: 30px;
    }
    .ac-body.ac-pane-materials .ac-mat-name {
        white-space: normal;
        line-height: 1.25;
    }
    .ac-body.ac-pane-materials .ac-mat-qty {
        font-size: 1.05rem;
        padding-left: 8px;
    }
    .ac-body.ac-pane-materials .ac-source {
        flex-shrink: 0;
        padding-bottom: 4px;
    }
    .ac-chip-bar-header {
        align-items: center;
        flex-direction: row;
        gap: 6px;
    }
    .ac-chip-bar-actions {
        width: auto;
        flex-wrap: nowrap;
        margin-left: auto;
    }
    .ac-chip-action {
        flex: 0 1 auto;
        padding: 3px 7px;
        font-size: 0.64rem;
    }
    .ac-chip-groups {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-height: min(42vh, 280px);
    }
    .ac-row {
        grid-template-columns: 44px minmax(0, 1fr);
        grid-template-areas:
            "img info"
            "stepper stepper";
        align-items: stretch;
        row-gap: 8px;
        min-height: 0;
        padding: 8px;
    }
    .ac-row-img-wrap { grid-area: img; width: 44px; height: 44px; }
    .ac-row-info { grid-area: info; min-width: 0; }
    .ac-row-title {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }
    .ac-row-name {
        width: 100%;
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
        line-height: 1.25;
        font-size: 0.86rem;
    }
    .ac-row-mats {
        white-space: normal;
        line-height: 1.35;
    }
    .ac-stepper {
        grid-area: stepper;
        grid-template-columns: 44px 1fr 44px;
        width: 100%;
    }
    .ac-qty {
        width: 100%;
        min-height: 40px;
        font-size: 1rem;
    }
    .ac-step-btn {
        min-width: 44px;
        min-height: 40px;
    }
    .ac-side-card .ac-section-heading { font-size: 0.78rem; }
}

/* ============================================================================
   Archaeology Calculator G?? Tab strip & Mysteries view
   ============================================================================ */

.arch-calc-content .ac-tabs {
    display: flex;
    gap: 4px;
    padding: 6px 14px 0;
    background: #0d1117;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.arch-calc-content .ac-tab {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 16px 10px;
    background: transparent;
    color: #8f9aa8;
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    position: relative;
    top: 1px;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.arch-calc-content .ac-tab:hover {
    color: #e2e6ec;
    background: rgba(255, 255, 255, 0.04);
}
.arch-calc-content .ac-tab.is-active {
    color: #f3f5f7;
    background: #141922;
    border-color: rgba(255, 255, 255, 0.09);
    border-bottom-color: #141922;
}
.arch-calc-content .ac-tab-icon {
    font-size: 0.95rem;
    line-height: 1;
}
.ac-tab-label-short { display: none; }
.arch-calc-content .ac-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    padding: 1px 6px;
    background: rgba(255, 255, 255, 0.08);
    color: #b9c2cc;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
}
.arch-calc-content .ac-tab.is-active .ac-tab-count {
    background: rgba(124, 200, 255, 0.18);
    color: #cfe6ff;
}

.arch-calc-content .ac-view {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1;
}
.arch-calc-content .ac-view[hidden] { display: none; }

/* --- Mysteries view --- */
.arch-calc-content .ac-view-mysteries {
    background: #0d1117;
}
.ac-mystery-toolbar {
    display: grid;
    grid-template-columns: minmax(320px, 440px) 1fr;
    gap: 14px;
    align-items: center;
    padding: 13px 18px 11px;
    background: #0f141b;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.ac-mystery-filters-toggle,
.ac-mystery-toolbar-extras {
    display: none;
}
.ac-mystery-faction-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    justify-content: flex-end;
}
.ac-mystery-faction-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 11px;
    background: #141922;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 999px;
    color: #c5cdd6;
    font-size: 0.74rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}
.ac-mystery-faction-chip:hover {
    background: #1a212c;
    color: #f3f5f7;
}
.ac-mystery-faction-chip.is-active {
    color: #f3f5f7;
    background: rgba(124, 200, 255, 0.14);
    border-color: rgba(124, 200, 255, 0.45);
}
.ac-mystery-faction-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #c0a278;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.05);
}
.ac-mystery-faction-dot[data-faction="Zarosian"]    { background: #8b5cf6; }
.ac-mystery-faction-dot[data-faction="Zamorakian"]  { background: #dc2626; }
.ac-mystery-faction-dot[data-faction="Saradominist"]{ background: #f4c542; }
.ac-mystery-faction-dot[data-faction="Armadylean"]  { background: #2f8cff; }
.ac-mystery-faction-dot[data-faction="Bandosian"]   { background: #9a6b34; }
.ac-mystery-faction-dot[data-faction="Dragonkin"]   { background: #8f8f86; }
.ac-mystery-faction-dot[data-faction="Guthixian"]   { background: #22c55e; }
.ac-mystery-faction-dot[data-faction="General"]     { background: #c0a278; }
.ac-mystery-faction-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    padding: 0 5px;
    background: rgba(255, 255, 255, 0.07);
    border-radius: 999px;
    color: #9aa3ad;
    font-size: 0.68rem;
    font-weight: 700;
}
.ac-mystery-faction-chip.is-active .ac-mystery-faction-count {
    background: rgba(124, 200, 255, 0.22);
    color: #cfe6ff;
}

.ac-mystery-intro {
    padding: 8px 18px;
    background: rgba(124, 200, 255, 0.04);
    border-top: 1px solid rgba(124, 200, 255, 0.08);
    border-bottom: 1px solid rgba(124, 200, 255, 0.12);
    color: #c5cdd6;
    font-size: 0.76rem;
    line-height: 1.35;
}
.ac-mystery-intro strong { color: #cfe6ff; }

.ac-mystery-meta-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    padding: 7px 18px;
    background: #0f141b;
    color: #8f9aa8;
    font-size: 0.74rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.ac-mystery-progress-filter {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
}
.ac-mystery-progress-btn {
    min-height: 28px;
    padding: 4px 10px;
    font-size: 0.68rem;
    text-transform: none;
    letter-spacing: normal;
}
.ac-mystery-progress-btn.is-active {
    color: #101317;
    background: #73b7d8;
    border-color: #73b7d8;
}

.ac-mystery-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px 22px 26px;
    background: #0d1117;
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.ac-mystery-list::-webkit-scrollbar { width: 10px; }
.ac-mystery-list::-webkit-scrollbar-track { background: transparent; }
.ac-mystery-list::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 6px;
}
.ac-mystery-list::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-thumb-hover); }

.ac-mystery-empty {
    text-align: center;
    color: #8f9aa8;
    padding: 30px;
    font-size: 0.85rem;
}

.ac-mystery-site {
    display: flex;
    flex-direction: column;
    gap: 13px;
}
.ac-mystery-site-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    min-height: 0;
    position: static;
    top: auto;
    z-index: auto;
    width: auto;
    padding: 0 0 8px;
    background: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: none;
}
.ac-mystery-site-name {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: #f3f5f7;
    font-size: 1.02rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}
.ac-mystery-site-name::before {
    content: '';
    width: 11px;
    height: 11px;
    border-radius: 3px;
    background: #c0a278;
    box-shadow: 0 0 0 3px rgba(192, 162, 120, 0.12);
}
.ac-mystery-site[data-faction="Zarosian"]    .ac-mystery-site-name::before { background: #8b5cf6; box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.14); }
.ac-mystery-site[data-faction="Zamorakian"]  .ac-mystery-site-name::before { background: #dc2626; box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.14); }
.ac-mystery-site[data-faction="Saradominist"] .ac-mystery-site-name::before { background: #f4c542; box-shadow: 0 0 0 3px rgba(244, 197, 66, 0.14); }
.ac-mystery-site[data-faction="Armadylean"]  .ac-mystery-site-name::before { background: #2f8cff; box-shadow: 0 0 0 3px rgba(47, 140, 255, 0.14); }
.ac-mystery-site[data-faction="Bandosian"]   .ac-mystery-site-name::before { background: #9a6b34; box-shadow: 0 0 0 3px rgba(154, 107, 52, 0.14); }
.ac-mystery-site[data-faction="Dragonkin"]   .ac-mystery-site-name::before { background: #8f8f86; box-shadow: 0 0 0 3px rgba(143, 143, 134, 0.14); }
.ac-mystery-site[data-faction="Guthixian"]   .ac-mystery-site-name::before { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.14); }
.ac-mystery-site-count {
    color: #8f9aa8;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
}

.ac-mystery-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    align-items: start;
}

.ac-mystery-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0)) #141a23;
    border: 1px solid rgba(255, 255, 255, 0.085);
    border-left: 4px solid #c0a278;
    border-radius: 10px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 6px 18px rgba(0, 0, 0, 0.12);
    transition: border-color 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}
.ac-mystery-card:hover {
    border-color: rgba(124, 200, 255, 0.35);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.ac-mystery-card[open] {
    border-color: rgba(124, 200, 255, 0.28);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.ac-mystery-card.is-done {
    opacity: 0.82;
    border-color: rgba(143, 214, 148, 0.28);
}
.ac-mystery-card.is-done .ac-mystery-card-name {
    text-decoration: line-through;
    text-decoration-color: rgba(143, 214, 148, 0.45);
    color: #b8c4d0;
}
.ac-mystery-done-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    cursor: pointer;
}
.ac-mystery-done-check {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: #8fd694;
    cursor: pointer;
}
.ac-mystery-card[data-faction="Zarosian"]    { border-left-color: #8b5cf6; }
.ac-mystery-card[data-faction="Zamorakian"]  { border-left-color: #dc2626; }
.ac-mystery-card[data-faction="Saradominist"] { border-left-color: #f4c542; }
.ac-mystery-card[data-faction="Armadylean"]  { border-left-color: #2f8cff; }
.ac-mystery-card[data-faction="Bandosian"]   { border-left-color: #9a6b34; }
.ac-mystery-card[data-faction="Dragonkin"]   { border-left-color: #8f8f86; }
.ac-mystery-card[data-faction="Guthixian"]   { border-left-color: #22c55e; }

.ac-mystery-card-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    cursor: pointer;
    list-style: none;
    user-select: none;
}
.ac-mystery-card-summary::-webkit-details-marker {
    display: none;
}
.ac-mystery-card-summary::after {
    content: '';
    width: 9px;
    height: 9px;
    flex: 0 0 9px;
    border-right: 2px solid rgba(207, 230, 255, 0.72);
    border-bottom: 2px solid rgba(207, 230, 255, 0.72);
    transform: rotate(45deg);
    transition: transform 0.15s ease, border-color 0.15s ease;
}
.ac-mystery-card[open] .ac-mystery-card-summary::after {
    transform: rotate(225deg);
}
.ac-mystery-card-summary:hover::after {
    border-color: #cfe6ff;
}
.ac-mystery-card-summary-main {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.ac-mystery-card-icons {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}
.ac-mystery-faction-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    image-rendering: auto;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.45));
}
.ac-mystery-card-summary-text {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}
.ac-mystery-card-name {
    margin: 0;
    color: #f3f5f7;
    font-size: 0.98rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    line-height: 1.22;
    overflow-wrap: anywhere;
}
.ac-mystery-card-quickmeta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    color: #8f9aa8;
    font-size: 0.71rem;
    font-weight: 700;
    line-height: 1.25;
}
.ac-mystery-card-quickmeta > span {
    display: inline-flex;
    align-items: center;
}
.ac-mystery-card-quickmeta > span + span::before {
    content: '\2022';
    margin-right: 10px;
    color: rgba(255, 255, 255, 0.2);
}
.ac-mystery-card-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 14px 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.ac-mystery-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-top: 12px;
}
.ac-mystery-badge {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.06);
    color: #c5cdd6;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.ac-mystery-badge-level {
    background: rgba(124, 200, 255, 0.16);
    color: #cfe6ff;
}
.ac-mystery-badge-xp {
    background: rgba(124, 217, 152, 0.16);
    color: #c8ecd4;
}
.ac-mystery-badge-site {
    background: rgba(255, 255, 255, 0.04);
    color: #d7dee6;
    overflow-wrap: anywhere;
}
.ac-mystery-badge-faction[data-faction="Zarosian"]    { background: rgba(139, 92, 246, 0.22); color: #d9c7ff; }
.ac-mystery-badge-faction[data-faction="Zamorakian"]  { background: rgba(220, 38, 38, 0.22);  color: #f7c4c4; }
.ac-mystery-badge-faction[data-faction="Saradominist"]{ background: rgba(244, 197, 66, 0.22); color: #f6e3a8; }
.ac-mystery-badge-faction[data-faction="Armadylean"]  { background: rgba(47, 140, 255, 0.22); color: #bcd9ff; }
.ac-mystery-badge-faction[data-faction="Bandosian"]   { background: rgba(154, 107, 52, 0.22); color: #e2c79e; }
.ac-mystery-badge-faction[data-faction="Dragonkin"]   { background: rgba(143, 143, 134, 0.22); color: #d6d6cf; }
.ac-mystery-badge-faction[data-faction="Guthixian"]   { background: rgba(34, 197, 94, 0.22); color: #bbf7d0; }
.ac-mystery-badge-faction[data-faction="General"]     { background: rgba(192, 162, 120, 0.22); color: #e6d2af; }

.ac-mystery-summary {
    margin: 0;
    padding: 9px 10px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    color: #b9c2cc;
    font-size: 0.82rem;
    line-height: 1.5;
}

.ac-mystery-card-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ac-mystery-card-body:empty {
    display: none;
}

.ac-mystery-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 11px;
    border: 1px solid rgba(255, 255, 255, 0.065);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.025);
}

.ac-mystery-row-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.ac-mystery-row-label {
    color: #8f9aa8;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.ac-mystery-row-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: #c5cdd6;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    line-height: 1.1;
}

.ac-mystery-pill-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    min-width: 0;
}
.ac-mystery-pill {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 5px 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 6px;
    color: #d2d8df;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.3;
    overflow-wrap: anywhere;
}
.ac-mystery-pill-req {
    background: rgba(247, 196, 196, 0.07);
    border-color: rgba(247, 196, 196, 0.18);
    color: #ecc6c6;
}
/* Mystery-link pill: a clickable prerequisite that jumps to another card */
button.ac-mystery-link {
    cursor: pointer;
    font: inherit;
    text-decoration: underline dotted;
    text-underline-offset: 2px;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
button.ac-mystery-link:hover,
button.ac-mystery-link:focus-visible {
    background: rgba(247, 196, 196, 0.18);
    border-color: rgba(247, 196, 196, 0.45);
    color: #f9d8d8;
    outline: none;
}
.ac-mystery-pill-item {
    background: rgba(100, 180, 255, 0.07);
    border-color: rgba(100, 180, 255, 0.22);
    color: #b8d9f7;
}
.ac-mystery-pill-reward {
    background: rgba(200, 236, 212, 0.07);
    border-color: rgba(200, 236, 212, 0.2);
    color: #c8ecd4;
}

/* Highlight pulse when navigating to a mystery card via a mystery-link pill */
@keyframes ac-mystery-highlight {
    0%   { box-shadow: 0 0 0 0 rgba(124, 200, 255, 0); }
    20%  { box-shadow: 0 0 0 4px rgba(124, 200, 255, 0.45); background: rgba(124, 200, 255, 0.1); }
    100% { box-shadow: 0 0 0 0 rgba(124, 200, 255, 0); }
}
.ac-mystery-card.is-highlighted {
    animation: ac-mystery-highlight 1.8s ease-out forwards;
}

.ac-mystery-tip {
    padding: 10px 11px;
    background: rgba(244, 197, 66, 0.08);
    border: 1px solid rgba(244, 197, 66, 0.14);
    border-left: 3px solid rgba(244, 197, 66, 0.55);
    border-radius: 9px;
    color: #f1e0b6;
    font-size: 0.75rem;
    line-height: 1.45;
}
.ac-mystery-tip strong { color: #f6e3a8; }

.ac-mystery-card-foot {
    display: flex;
    justify-content: flex-end;
    margin-top: auto;
    padding-top: 4px;
}
.ac-mystery-wiki-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 7px 12px;
    background: rgba(124, 200, 255, 0.12);
    color: #cfe6ff;
    border: 1px solid rgba(124, 200, 255, 0.32);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.ac-mystery-wiki-btn:hover {
    background: rgba(124, 200, 255, 0.22);
    border-color: rgba(124, 200, 255, 0.55);
    transform: translateY(-1px);
}

@media (max-width: 700px) {
    .arch-calc-content .ac-tabs { padding: 4px 10px 0; gap: 2px; }
    .arch-calc-content .ac-tab { padding: 8px 12px 9px; font-size: 0.78rem; }
    .ac-mystery-toolbar {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px;
        padding: 8px 10px;
    }
    .ac-mystery-filters-toggle { display: inline-flex; }
    .ac-mystery-toolbar-extras {
        display: none;
        grid-column: 1 / -1;
    }
    .ac-view-mysteries:not(.is-filters-collapsed) .ac-mystery-toolbar-extras {
        display: block;
    }
    .ac-mystery-faction-bar { justify-content: flex-start; }
    .ac-mystery-intro { display: none; }
    .ac-mystery-list { padding: 10px; gap: 14px; }
    .ac-mystery-grid { grid-template-columns: 1fr; }
    .ac-mystery-card-summary {
        padding: 11px 12px;
    }
    .ac-mystery-card-summary-main {
        gap: 10px;
    }
    .ac-mystery-card-meta {
        justify-content: flex-start;
    }
    .ac-mystery-card-panel {
        padding: 0 12px 12px;
    }
}

/* =============================================================================
   MASTER QUEST CAPE TRACKER
   ============================================================================= */

body.mqc-tracker-open,
body.comp-cape-tracker-open,
body.cape-tracker-open { overflow: hidden; }

.mqc-tracker-content {
    width: min(98vw, 1280px);
    max-width: min(98vw, 1280px);
    max-height: min(96vh, 900px);
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: var(--tool-surface);
    border: 1px solid var(--tool-border);
    border-radius: var(--tool-radius);
    box-shadow: var(--tool-shadow);
}

.mqc-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 56px 14px 18px;
    background: var(--tool-surface-raised);
    border-bottom: 1px solid var(--tool-border-subtle);
    flex-shrink: 0;
}
.mqc-title-wrap { min-width: 0; padding-left: 12px; position: relative; }
.mqc-title-wrap::before {
    content: '';
    position: absolute;
    left: 0;
    top: 3px;
    bottom: 3px;
    width: 3px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--tool-accent), var(--tool-gold));
}
.mqc-kicker {
    color: color-mix(in srgb, var(--tool-accent) 65%, var(--tool-text));
    font-size: 0.66rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.mqc-header h3 {
    margin: 0;
    color: var(--tool-text);
    font-size: 1.12rem;
    font-weight: 850;
}
.mqc-header-meta { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.mqc-pill {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 800;
    color: color-mix(in srgb, var(--tool-gold) 85%, var(--tool-text));
    background: var(--tool-accent-soft);
    border: 1px solid var(--tool-accent-strong);
    white-space: nowrap;
}
.mqc-pill-muted {
    color: var(--tool-text-muted);
    background: color-mix(in srgb, var(--tool-accent) 8%, transparent);
    border-color: var(--tool-border-subtle);
}

.mqc-progress-wrap {
    height: 4px;
    background: var(--tool-border-subtle);
    flex-shrink: 0;
}
.mqc-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--tool-accent), var(--tool-gold));
    transition: width 0.25s ease;
}

.mqc-toolbar {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 14px;
    background: var(--tool-surface-sunken);
    border-bottom: 1px solid var(--tool-border-subtle);
    flex-shrink: 0;
    overflow: visible;
}
.mqc-toolbar .account-tabs { margin-bottom: 2px; }
.mqc-sort-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: min(100%, 320px);
}
.mqc-search-wrap {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 0 12px;
    background: var(--tool-surface);
    border: 1px solid var(--tool-border-subtle);
    border-radius: 8px;
}
.mqc-search-wrap:focus-within {
    border-color: var(--tool-accent);
    box-shadow: 0 0 0 3px var(--tool-accent-soft);
}
.mqc-search {
    width: 100%;
    padding: 9px 0;
    background: transparent;
    border: 0;
    color: var(--tool-text);
    font-size: 0.9rem;
    outline: none;
}
.mqc-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-start;
    justify-content: space-between;
}
.mqc-sort-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.mqc-sort-label {
    color: var(--tool-text-muted);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.mqc-sort-info {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    padding: 0;
    border: 1px solid var(--tool-border-subtle);
    border-radius: 50%;
    background: var(--tool-accent-soft);
    color: var(--tool-accent);
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1;
    cursor: help;
    flex-shrink: 0;
    z-index: 5;
}
.mqc-sort-info::after {
    content: attr(data-tip);
    position: absolute;
    left: 50%;
    top: calc(100% + 8px);
    transform: translateX(-50%);
    width: max-content;
    max-width: min(280px, 70vw);
    padding: 8px 10px;
    border-radius: 8px;
    background: var(--tool-surface-raised);
    border: 1px solid var(--tool-border);
    color: var(--tool-text);
    font-size: 0.72rem;
    font-weight: 500;
    line-height: 1.35;
    text-transform: none;
    letter-spacing: normal;
    white-space: normal;
    box-shadow: var(--tool-shadow);
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    z-index: 100;
}
.mqc-sort-info:hover::after,
.mqc-sort-info:focus-visible::after {
    opacity: 1;
    visibility: visible;
}
.mqc-sort-select {
    min-height: 34px;
    padding: 6px 28px 6px 10px;
    background: var(--tool-surface);
    color: var(--tool-text);
    border: 1px solid var(--tool-border-subtle);
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    outline: none;
}
.mqc-sort-select:focus {
    border-color: var(--tool-accent);
    box-shadow: 0 0 0 3px var(--tool-accent-soft);
}
.mqc-sort-select option {
    background: var(--tool-surface);
    color: var(--tool-text);
}
.mqc-sort-hint {
    margin: 0;
    color: var(--tool-text-dim);
    font-size: 0.72rem;
    line-height: 1.35;
    font-weight: 500;
}
.mqc-filter-bar {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
}
.mqc-filter-btn,
.mqc-btn {
    min-height: 34px;
    padding: 6px 11px;
    background: var(--tool-surface);
    color: var(--tool-text);
    border: 1px solid var(--tool-border-subtle);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 800;
}
.mqc-filter-btn.is-active,
.mqc-btn:hover {
    color: var(--bg-body);
    background: var(--tool-accent);
    border-color: var(--tool-accent);
}

.mqc-meta-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px;
    color: var(--tool-text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    background: var(--tool-surface-sunken);
    border-bottom: 1px solid var(--tool-border-subtle);
    flex-shrink: 0;
}
.mqc-meta-divider {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--tool-text-dim);
}

.mqc-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 10px 12px 12px;
    background: var(--tool-surface-sunken);
}
.mqc-empty {
    padding: 32px 16px;
    text-align: center;
    color: var(--tool-text-muted);
}

.mqc-group {
    margin-bottom: 10px;
    border: 1px solid var(--tool-border-subtle);
    border-radius: 8px;
    overflow: hidden;
    background: color-mix(in srgb, var(--tool-surface) 92%, var(--tool-text) 8%);
}
.mqc-group-head {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 12px;
    background: var(--tool-accent-soft);
    border: 0;
    color: var(--tool-text);
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 850;
    text-align: left;
}
.mqc-group-count {
    color: var(--tool-accent);
    font-size: 0.72rem;
    font-weight: 800;
}
.mqc-group.is-collapsed .mqc-group-body { display: none; }

.mqc-status-section .mqc-status-head {
    cursor: default;
    background: color-mix(in srgb, var(--tool-accent) 10%, transparent);
}
.mqc-status-section[data-section="done"] .mqc-status-head {
    background: color-mix(in srgb, var(--green) 12%, transparent);
}
.mqc-status-section[data-section="todo"] .mqc-group-count {
    color: var(--tool-accent);
}
.mqc-status-section[data-section="done"] .mqc-group-count {
    color: var(--green);
}

.mqc-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
    align-items: start;
    padding: 9px 12px;
    border-top: 1px solid var(--tool-border-subtle);
}
.mqc-item:hover { background: var(--bg-hover); }
.mqc-item.is-done { opacity: 0.78; }
.mqc-item.is-done .mqc-item-name {
    text-decoration: line-through;
    text-decoration-color: color-mix(in srgb, var(--green) 45%, transparent);
    color: var(--tool-text-muted);
}
.mqc-item.is-done .mqc-item-desc { color: var(--tool-text-dim); }
.mqc-item.is-auto { background: var(--tool-accent-soft); }
.mqc-item-check {
    margin-top: 3px;
    width: 16px;
    height: 16px;
    accent-color: var(--tool-accent);
    cursor: pointer;
    flex-shrink: 0;
}
.mqc-item-main {
    min-width: 0;
    display: grid;
    gap: 4px;
    cursor: pointer;
}
.mqc-item-name {
    color: var(--tool-text);
    font-size: 0.86rem;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: 0.01em;
}
.mqc-item-desc {
    color: var(--tool-text-muted);
    font-size: 0.76rem;
    line-height: 1.4;
    font-weight: 500;
}
.mqc-auto-tag {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    border-radius: 999px;
    background: var(--tool-accent-medium);
    color: color-mix(in srgb, var(--tool-accent) 55%, var(--tool-text));
    font-size: 0.62rem;
    font-weight: 800;
    text-transform: uppercase;
    vertical-align: middle;
    text-decoration: none;
}
.mqc-ingame-tag {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    border-radius: 999px;
    background: var(--tool-accent-soft);
    color: var(--tool-gold);
    font-size: 0.62rem;
    font-weight: 800;
    text-transform: uppercase;
    vertical-align: middle;
}
.mqc-flat-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.mqc-wiki-link {
    position: relative;
    z-index: 2;
    flex-shrink: 0;
    align-self: start;
    margin-top: 1px;
    color: color-mix(in srgb, var(--tool-accent) 70%, var(--tool-text));
    font-size: 0.72rem;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
    padding: 5px 9px;
    border-radius: 6px;
    border: 1px solid var(--tool-accent-strong);
    background: var(--tool-accent-soft);
    cursor: pointer;
    pointer-events: auto;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.mqc-wiki-link:hover {
    color: var(--tool-text);
    text-decoration: none;
    background: var(--tool-accent-medium);
    border-color: var(--tool-accent);
}

.mqc-footer {
    flex-shrink: 0;
    padding: 8px 14px 10px;
    color: var(--tool-text-dim);
    font-size: 0.72rem;
    border-top: 1px solid var(--tool-border-subtle);
    background: var(--tool-surface);
}
.mqc-footer a { color: var(--tool-accent); }

/* Cape tracker tabs */
body.cape-tracker-open { overflow: hidden; }

.cc-tracker-content .cc-title-wrap::before {
    background: linear-gradient(180deg, var(--tool-gold), var(--tool-accent));
}

.cc-cape-tabs {
    display: flex;
    gap: 6px;
    padding: 8px 14px 0;
    background: var(--tool-surface-sunken);
    border-bottom: 1px solid var(--tool-border-subtle);
    flex-shrink: 0;
}

.cc-cape-tab-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45));
    opacity: 0.88;
    transition: opacity 0.15s, transform 0.15s;
}

.cc-cape-tab.is-active .cc-cape-tab-icon {
    opacity: 1;
    transform: scale(1.05);
}

.cc-cape-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid var(--tool-border-subtle);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    background: var(--tool-accent-soft);
    color: var(--tool-text-muted);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.cc-cape-tab:hover {
    background: var(--tool-accent-medium);
    color: var(--tool-text);
}

.cc-cape-tab.is-active {
    background: var(--tool-surface);
    color: var(--tool-gold);
    border-color: var(--tool-accent-strong);
    box-shadow: inset 0 2px 0 var(--tool-accent);
}

.cc-cape-tab-count {
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--tool-accent);
    background: var(--tool-accent-soft);
    border: 1px solid var(--tool-border-subtle);
    border-radius: 999px;
    padding: 2px 8px;
}

.cc-cape-tab.is-active .cc-cape-tab-count {
    color: var(--tool-gold);
    background: var(--tool-accent-soft);
    border-color: var(--tool-accent-strong);
}

.cc-pill-combined {
    color: #9cd8f4;
    background: rgba(115, 183, 216, 0.1);
    border-color: rgba(115, 183, 216, 0.26);
}

.cc-progress-bar {
    background: linear-gradient(90deg, #f0b13c, #e8c547);
}

.ct-progress-bar-mqc {
    background: linear-gradient(90deg, #73b7d8, #f0b13c);
}

@media (max-width: 640px) {
    .mqc-tracker-content {
        width: 100vw;
        max-height: 100dvh;
        border-radius: 0;
    }
    .cc-cape-tab-icon {
        width: 24px;
        height: 24px;
    }
    .cc-cape-tab {
        padding: 8px 6px;
        gap: 4px;
        font-size: 0.76rem;
    }
    .mqc-header { padding-right: 48px; }
    .mqc-toolbar-actions { flex-direction: column; align-items: stretch; }
    .mqc-sort-wrap { width: 100%; }
    .mqc-sort-select { flex: 1; width: 100%; }
    .mqc-filter-bar { width: 100%; }
    .mqc-filter-btn { flex: 1; text-align: center; }
    .mqc-btn { width: 100%; }
}

/* =============================================================================
   SITE-WIDE MOTION POLISH - NEW FEATURE AND TOOL SURFACES
   ============================================================================= */
.tool-modal-content,
.account-tab,
.dc-boss-btn,
.dc-item-btn,
.dc-panel-left,
.dc-panel-right,
.dc-input,
.ac-panel-left,
.ac-panel-right,
.ac-chip,
.ac-selected-item,
.mqc-btn,
.mqc-filter-btn,
.cc-cape-tab {
    transition: var(--transition-interactive);
}

.account-tab:hover,
.dc-boss-btn:hover,
.dc-item-btn:hover,
.dc-panel-left:hover,
.dc-panel-right:hover,
.ac-panel-left:hover,
.ac-panel-right:hover,
.ac-chip:hover,
.ac-selected-item:hover,
.mqc-btn:hover,
.mqc-filter-btn:hover,
.cc-cape-tab:hover {
    transform: translateY(var(--hover-lift-y));
    border-color: var(--accent);
    box-shadow: var(--shadow-glow-soft);
}

.tool-modal-content {
    animation: arcanePanelIn var(--duration-normal) var(--ease-emphasis);
}

.account-tab.active,
.dc-boss-btn.active,
.ac-chip.active,
.mqc-filter-btn.active,
.cc-cape-tab.active {
    animation: runeBorderPulse 3.4s ease-in-out infinite;
}

.account-tab,
.dc-boss-btn,
.dc-item-btn,
.ac-chip,
.mqc-filter-btn,
.cc-cape-tab {
    position: relative;
    overflow: hidden;
}

.account-tab::after,
.dc-boss-btn::after,
.dc-item-btn::after,
.ac-chip::after,
.mqc-filter-btn::after,
.cc-cape-tab::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, transparent, color-mix(in srgb, var(--accent) 13%, transparent), transparent);
    transform: translateX(-130%) skewX(-18deg);
    pointer-events: none;
}

.account-tab:hover::after,
.dc-boss-btn:hover::after,
.dc-item-btn:hover::after,
.ac-chip:hover::after,
.mqc-filter-btn:hover::after,
.cc-cape-tab:hover::after {
    animation: energySweep 760ms var(--ease-standard);
}

/* =============================================================================
   WIDE TOOL MODAL SIZING — override base .modal-content when critical CSS
   (dashboard bundle) loads after this stylesheet in production builds.
   ============================================================================= */
.modal-content.drop-calc-content {
    width: min(96vw, 1060px) !important;
    max-width: min(96vw, 1060px) !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

.modal-content.arch-calc-content {
    width: min(98vw, 1600px) !important;
    max-width: min(98vw, 1600px) !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

.modal-content.mqc-tracker-content,
.modal-content.cc-tracker-content {
    width: min(98vw, 1280px) !important;
    max-width: min(98vw, 1280px) !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

@media (max-width: 1100px) {
    .modal-content.arch-calc-content {
        width: min(99vw, 1340px) !important;
        max-width: min(99vw, 1340px) !important;
    }
}

@media (max-width: 768px) {
    .modal-content.drop-calc-content {
        width: calc(100vw - 16px) !important;
        max-width: calc(100vw - 16px) !important;
    }
}

@media (max-width: 640px) {
    .modal-content.mqc-tracker-content,
    .modal-content.cc-tracker-content {
        width: 100vw !important;
        max-width: 100vw !important;
    }

    .modal-content.arch-calc-content {
        width: 100vw !important;
        max-width: 100vw !important;
    }
}