* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Color variables for different themes */
:root {
    /* Light mode (default) */
    --primary-color: #667eea;
    --primary-dark: #764ba2;
    --bg-gradient-1: #667eea;
    --bg-gradient-2: #764ba2;
    --bg-main: white;
    --bg-secondary: #f9f9f9;
    --bg-tertiary: #f0f0f0;
    --text-primary: #333;
    --text-secondary: #666;
    --text-tertiary: #999;
    --border-color: #ddd;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --info-box-bg: #f0f7ff;
    --skills-bg: #f9f5f0;
    --skills-border: #e8a76e;
    --capabilities-bg: #f0f7ff;
    --capabilities-border: #667eea;
    --error-bg: #f8d7da;
    --error-text: #721c24;
    --error-border: #dc3545;
    --success-bg: #e8f5e9;
    --success-border: #4caf50;
    --success-text: #2e7d32;
    --header-link-color: #333;
    --header-link-border: rgba(0, 0, 0, 0.3);
    --header-link-hover: rgba(0, 0, 0, 0.1);
}

/* Dark mode - applies only when explicitly set on body */
body.dark-mode {
    --primary-color: #8899ff;
    --primary-dark: #9966ee;
    --bg-gradient-1: #1a1f3a;
    --bg-gradient-2: #2d1b4e;
    --bg-main: #1e1e2e;
    --bg-secondary: #2a2a3e;
    --bg-tertiary: #3a3a4e;
    --text-primary: #e0e0e0;
    --text-secondary: #b0b0b0;
    --text-tertiary: #808080;
    --border-color: #444;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --info-box-bg: #1a2a3a;
    --skills-bg: #2a2620;
    --skills-border: #8b6f47;
    --capabilities-bg: #1a2a3a;
    --capabilities-border: #8899ff;
    --error-bg: #3a2420;
    --error-text: #ff9999;
    --error-border: #dd6666;
    --success-bg: #1a3a1a;
    --success-border: #66dd66;
    --success-text: #88ff88;
    --header-link-color: #e0e0e0;
    --header-link-border: rgba(255, 255, 255, 0.3);
    --header-link-hover: rgba(255, 255, 255, 0.15);
}

/* Solarized dark mode */
body.solarized-dark {
    --primary-color: #268bd2;
    --primary-dark: #2aa198;
    --bg-gradient-1: #002b36;
    --bg-gradient-2: #073642;
    --bg-main: #002b36;
    --bg-secondary: #073642;
    --bg-tertiary: #303e42;
    --text-primary: #93a1a1;
    --text-secondary: #839496; 
    --text-tertiary: #021317;
    --border-color: #073642;
    --shadow-color: rgba(0, 0, 0, 0.4);
    --info-box-bg: #073642;
    --skills-bg: #073642;
    --skills-border: #268bd2;
    --capabilities-bg: #073642;
    --capabilities-border: #268bd2;
    --error-bg: #932f2f;
    --error-text: #ffc8c8;
    --error-border: #dc322f;
    --success-bg: #2a5f3d;
    --success-border: #859900;
    --success-text: #b5e55f;
    --header-link-color: #93a1a1;
    --header-link-border: rgba(147, 161, 161, 0.3);
    --header-link-hover: rgba(147, 161, 161, 0.15);
}

/* Solarized light mode */
body.solarized-light {
    --primary-color: #268bd2;
    --primary-dark: #2aa198;
    --bg-gradient-1: #fdf6e3;
    --bg-gradient-2: #eee8d5;
    --bg-main: #fdf6e3;
    --bg-secondary: #eee8d5;
    --bg-tertiary: #e8dfc8;
    --text-primary: #657b83;
    --text-secondary: #839496;
    --text-tertiary: #93a1a1;
    --border-color: #d6d0c8;
    --shadow-color: rgba(0, 0, 0, 0.08);
    --info-box-bg: #eee8d5;
    --skills-bg: #eee8d5;
    --skills-border: #d33682;
    --capabilities-bg: #eee8d5;
    --capabilities-border: #268bd2;
    --error-bg: #eee8d5;
    --error-text: #d30102;
    --error-border: #dc322f;
    --success-bg: #eee8d5;
    --success-border: #859900;
    --success-text: #556e11;
    --header-link-color: #657b83;
    --header-link-border: rgba(101, 123, 131, 0.3);
    --header-link-hover: rgba(101, 123, 131, 0.1);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-1) 0%, var(--bg-gradient-2) 100%);
    min-height: 100vh;
    padding: 20px;
    color: var(--text-primary);
    transition: background 0.3s ease, color 0.3s ease;
    scrollbar-gutter: stable;
}

button,
input,
select,
textarea {
    font-family: inherit;
}

/* Compact presentation used inside the Owlbear Rodeo extension shell. */
body.owlbear-embedded {
    min-height: 100%;
    padding: 0;
    background: var(--bg-main);
}

body.owlbear-embedded .container {
    max-width: none;
    min-height: 100vh;
    padding: 12px;
    border-radius: 10px;
}

body.owlbear-embedded .header {
    display: none;
}

body.details-page.owlbear-embedded .header {
    display: none;
}

body.details-page.owlbear-embedded .pokemon-display {
    padding: 12px;
    border-radius: 10px;
    box-shadow: none;
}

@media (max-width: 700px) {
    body.owlbear-embedded .content,
    body.owlbear-embedded .content.with-sidebar {
        grid-template-columns: 1fr;
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: var(--bg-main);
    border-radius: 10px;
}

/* Header Styles */
.header {
    text-align: center;
    color: var(--text-primary);
    margin: -20px -20px 12px -20px;
    padding: 10px 14px;
    border-radius: 8px 8px 0 0;
    border-bottom: 1px solid var(--border-color);
}

.header-top {
    text-align: left;
    margin-bottom: 3px;
}

.header-back {
    color: white;
    text-decoration: none;
    font-weight: 500;
    background: var(--primary-color);
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    display: inline-block;
    transition: all 0.3s ease;
    font-size: 0.82em;
}

.header-back:hover {
    background: var(--primary-dark);
}

.header-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 1.45em;
    margin: 2px 0 0;
    color: var(--text-primary);
}

.header-logo {
    height: 28px;
    width: 28px;
    object-fit: contain;
}

.header-subtitle {
    font-size: 0.95em;
    opacity: 0.85;
    margin: 5px 0 15px 0;
    color: var(--text-primary);
}

.header-links {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.header-link {
    color: white;
    text-decoration: none;
    font-weight: 500;
    background: var(--primary-color);
    border: none;
    padding: 8px 14px;
    border-radius: 4px;
    display: inline-block;
    transition: all 0.3s ease;
    font-size: 0.9em;
}

.header-link:hover {
    background: var(--primary-dark);
}

.content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 12px;
}

.content.with-sidebar {
    grid-template-columns: 1fr 1fr;
}

.panel {
    background: var(--bg-secondary);
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 4px 6px var(--shadow-color);
}

.panel h2 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 1.4em;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 8px;
}

.form-group {
    margin-bottom: 10px;
}

label {
    display: block;
    margin-bottom: 3px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9em;
}

input, select {
    width: 100%;
    padding: 7px 9px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 0.9em;
    transition: border-color 0.3s;
    background: var(--bg-main);
    color: var(--text-primary);
}

/* Disable browser autocomplete suggestions */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px var(--bg-main) inset !important;
    -webkit-text-fill-color: var(--text-primary) !important;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.pref-changed-control {
    border-color: #f59e0b !important;
    /* box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.22); */
}

.pref-changed-group {
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.08), transparent 65%);
    border-left: 3px solid #f59e0b;
    padding-left: 8px;
    border-radius: 4px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.button-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 12px;
}

button {
    padding: 10px 16px;
    border: none;
    border-radius: 5px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-generate {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
}

.btn-generate:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-generate:active {
    transform: translateY(0);
}

.btn-reset {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-reset:hover {
    background: var(--border-color);
}

.pokemon-display {
    background: var(--bg-secondary);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 6px var(--shadow-color);
}

.pokemon-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 6px;
    gap: 10px;
}

.pokemon-header-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.pokemon-header-image {
    width: 74px;
    height: 74px;
    object-fit: contain;
    flex-shrink: 0;
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 3px;
}

.pokemon-header-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.pokemon-title {
    font-size: 1.25em;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 3px;
}

.pokemon-meta {
    font-size: 0.85em;
    color: var(--text-secondary);
    text-transform: capitalize;
}

.shiny-badge {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: bold;
}

.pokemon-info {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.info-box {
    background: var(--bg-tertiary);
    padding: 15px;
    border-radius: 5px;
    border-left: 4px solid var(--primary-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* Horizontal information rows */
.pokemon-info-row {
    display: grid;
    grid-template-columns: minmax(105px, .3fr) minmax(0, 1fr);
    align-items: center;
    gap: 5px 12px;
    padding: 9px 12px;
    text-align: left;
}

.pokemon-info-row > .info-label {
    grid-column: 1;
    margin: 0;
}

.pokemon-types-row > .pokemon-types-content,
.level-hp-info-row > :not(.info-label) {
    grid-column: 2;
    min-width: 0;
}

.pokemon-types-content {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.level-hp-info-row > .info-label {
    grid-row: 1 / span 4;
}

.level-hp-info-row .level-hp-wrapper {
    justify-content: flex-start;
    margin: 0;
}

.level-hp-info-row .margin-top-8,
.level-hp-info-row .hp-damage-controls {
    margin-top: 0;
}

.level-hp-info-row .hp-damage-controls {
    width: 100%;
    min-width: 0;
    grid-template-columns: minmax(76px, 82px) minmax(0, 1fr) minmax(0, 1fr) minmax(48px, auto);
    justify-content: start;
}

.nature-info-row {
    grid-template-columns: minmax(105px, .3fr) minmax(0, 1fr);
}

.nature-info-row .nature-control {
    grid-column: 2;
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 8px;
}

/* Collapsible information panels */
.capture-rate-panel,
.other-info-panel {
    display: block;
    padding: 0;
    overflow: hidden;
    text-align: left;
}

.capture-rate-panel-summary.advanced-toggle,
.collapsible-info-summary.advanced-toggle {
    position: relative;
    gap: 12px;
    margin-top: 0;
    border-radius: 0;
    list-style: none;
}

.capture-rate-panel-summary::-webkit-details-marker,
.collapsible-info-summary::-webkit-details-marker {
    display: none;
}

.capture-rate-panel-summary .info-label,
.collapsible-info-summary .info-label {
    margin: 0;
    white-space: nowrap;
}

.capture-rate-heading {
    display: flex;
    flex: 0 1 auto;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
}

.capture-rate-display {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-left: auto;
}

.capture-rate-value {
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--bg-main);
    font-size: .8em;
    color: var(--text-primary);
}

.capture-rate-value strong {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.15em;
}

.capture-rate-value strong.capture-rate-warning {
    display: inline-block;
    padding: 1px 5px;
    border-radius: 4px;
    background: var(--error-bg);
    color: var(--error-text);
    font-size: 0.82em;
    line-height: 1.2;
    white-space: nowrap;
}

.capture-rate-chevron {
    color: var(--text-secondary);
    text-align: center;
    flex: 0 0 auto;
}

.capture-rate-panel[open] .capture-rate-chevron {
    transform: rotate(180deg);
}

.collapsible-info-chevron {
    color: var(--text-secondary);
    flex: 0 0 auto;
}

.other-info-panel[open] .collapsible-info-chevron {
    transform: rotate(180deg);
}

.other-info-panel .other-info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px 12px;
    padding: 8px 12px 10px;
    border-top: 1px solid var(--border-color);
    text-align: left;
}

.other-info-panel .other-info-grid > :last-child {
    grid-column: 1 / -1;
}

.other-info-gender {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0;
}

.gender-select {
    min-width: 0;
    padding: 4px 24px 4px 7px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background: var(--bg-main);
    color: var(--text-primary);
    font: inherit;
}

.gender-select:focus {
    border-color: var(--primary-color);
    outline: 2px solid color-mix(in srgb, var(--primary-color) 22%, transparent);
    outline-offset: 1px;
}

.capture-rate-panel-body {
    padding: 8px 12px 10px;
    border-top: 1px solid var(--border-color);
}

.capture-rate-mode-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    margin: 0 0 8px;
    padding: 5px 8px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-main);
    font-size: .8em;
    cursor: pointer;
    transition: background-color .2s, border-color .2s;
}

.capture-rate-mode-toggle:hover {
    border-color: var(--primary-color);
    background: var(--bg-tertiary);
}

.capture-rate-mode-toggle:has(input:checked),
.modifier-item:has(input:checked),
.errata-row:has(input:checked) {
    border-color: var(--primary-color);
    background: color-mix(in srgb, var(--primary-color) 10%, var(--bg-main));
}

.capture-rate-mode-toggle-header,
.capture-rate-mode-toggle-header:hover,
.capture-rate-mode-toggle-header:has(input:checked) {
    min-height: 0;
    margin: 2px 0 0;
    padding: 0;
    border: 0;
    background: transparent;
    font-size: .68em;
    line-height: 1.2;
    white-space: nowrap;
}

.capture-rate-mode-toggle input,
.modifier-item input[type="checkbox"],
.errata-checkbox {
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
    margin: 0;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.capture-rate-modifiers {
    text-align: left;
    width: 100%;
}

.modifiers-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 3px 8px;
    border-radius: 4px;
    width: 100%;
    max-width: 100%;
}

/* Errata 2015 Styles */
.errata-container {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 8px;
    width: 100%;
    max-width: 100%;
}

.errata-info {
    font-size: 0.8em;
    color: var(--text-secondary);
    padding: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    border-left: 3px solid var(--primary-color);
}

.errata-row {
    display: grid;
    grid-template-columns: 30px 1fr;
    gap: 8px;
    align-items: center;
    min-height: 34px;
    padding: 5px 8px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-main);
    margin: 0;
    cursor: pointer;
    transition: background-color .2s, border-color .2s;
}

.errata-row:hover {
    border-color: var(--primary-color);
    background: var(--bg-tertiary);
}

@media (max-width: 520px) {
    .pokemon-info-row,
    .nature-info-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .pokemon-info-row > .info-label,
    .pokemon-types-row > .pokemon-types-content,
    .level-hp-info-row > :not(.info-label),
    .nature-info-row .nature-control {
        grid-column: 1;
        grid-row: auto;
    }

    .other-info-panel .other-info-grid,
    .errata-container {
        grid-template-columns: minmax(0, 1fr);
    }

    .other-info-panel .other-info-grid > :last-child {
        grid-column: auto;
    }

    .level-hp-info-row .hp-damage-controls {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .level-hp-info-row .hp-damage-btn {
        grid-column: 1 / -1;
    }
}

.errata-checkbox {
    justify-self: center;
}

.errata-checkbox-group {
    display: flex;
    gap: 6px;
    align-items: center;
}

.errata-checkbox-group input[disabled] {
    opacity: 0.5;
}

.errata-row-text {
    font-size: 0.8em;
    color: var(--text-primary);
}

.errata-hint {
    color: var(--text-secondary);
    font-size: 0.75em;
}

.errata-rarity-input {
    width: 50px;
    min-height: 24px;
    padding: 3px 5px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-main);
    color: var(--text-primary);
    font-size: 0.8em;
}

.errata-rarity-input:focus,
.status-count-input-standard:focus,
.status-count-input:focus {
    border-color: var(--primary-color);
    outline: 2px solid color-mix(in srgb, var(--primary-color) 22%, transparent);
    outline-offset: 1px;
}

.errata-rarity-symbol {
    justify-self: center;
    font-weight: 700;
    color: var(--primary-color);
}

.errata-rarity-control {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 0;
    cursor: pointer;
}

/* Modifier grid item inputs */
.modifier-item label {
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-count-input-standard,
.status-count-input {
    width: 40px;
    min-height: 24px;
    padding: 3px 5px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-main);
    color: var(--text-primary);
    font-size: 0.8em;
}

.status-multiplier-text {
    font-size: 0.75em;
}

.modifier-item {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 5px 8px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-main);
    font-size: 0.8em;
    cursor: help;
    transition: background-color .2s, border-color .2s;
}

.modifier-item:hover {
    border-color: var(--primary-color);
    background: var(--bg-tertiary);
}

.modifier-label {
    font-weight: 600;
    color: var(--text-primary);
    min-width: 55px;
}

.modifier-value {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 0.95em;
}

.modifier-item label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    width: 100%;
    margin: 0;
}

.modifier-item input[type="checkbox"] {
    width: 15px;
    height: 15px;
}

.status-count-input {
    padding: 4px !important;
    border: 1px solid var(--primary-color) !important;
    border-radius: 3px !important;
    background: var(--bg-primary) !important;
    color: var(--text-primary) !important;
}

.modifier-section {
    background: var(--bg-secondary);
    padding: 12px;
    border-radius: 4px;
    border-left: 3px solid var(--primary-color);
}

.modifier-title {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 8px;
    font-size: 0.9em;
    text-transform: uppercase;
}

.modifier-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.modifier-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9em;
    color: var(--text-primary);
}

.modifier-group input[type="radio"],
.modifier-group input[type="checkbox"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
}

.modifier-info {
    font-size: 0.85em;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-style: italic;
}

.info-label {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.85em;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.info-value {
    font-size: 1.1em;
    color: var(--text-primary);
}

.types {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.type-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
    color: white;
}

.type-normal { background: #A8A878; }
.type-fire { background: #F08030; }
.type-water { background: #6890F0; }
.type-electric { background: #F8D030; color: #333; }
.type-grass { background: #78C850; }
.type-ice { background: #98D8D8; color: #333; }
.type-fighting { background: #C03028; }
.type-poison { background: #A040A0; }
.type-ground { background: #E0C068; color: #333; }
.type-flying { background: #A890F0; }
.type-psychic { background: #F85888; }
.type-bug { background: #A8B820; }
.type-rock { background: #B8A038; }
.type-ghost { background: #705898; }
.type-dragon { background: #7038F8; }
.type-dark { background: #705848; }
.type-steel { background: #B8B8D0; color: #333; }
.type-fairy { background: #EE99AC; }
.type-nuclear { background: #2F9E44; }

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 20px 0;
}

.stats-breakdown {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 15px 0;
    min-width: 0;
    container-type: inline-size;
    padding: 8px 10px;
    background: var(--bg-tertiary);
    border-left: 4px solid var(--primary-color);
    border-radius: 5px;
}

.stat-breakdown-row {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 8px;
    display: grid;
    grid-template-columns: minmax(82px, 1.25fr) minmax(66px, .8fr) minmax(52px, .7fr) minmax(46px, .6fr) minmax(54px, .7fr);
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.stat-breakdown-label {
    font-weight: 600;
    color: var(--primary-color);
    min-width: 0;
    font-size: 0.85em;
}

.stat-breakdown-component {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.stat-breakdown-component label {
    font-size: 0.7em;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
}

.base-stat-wrapper {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    flex-wrap: wrap;
}

.base-stat-value {
    display: inline-block;
    width: 40px;
    padding: 4px;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    font-size: 0.85em;
    font-weight: 600;
    text-align: center;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.nature-modifier-tag {
    font-size: 0.75em;
    font-weight: 700;
    padding: 2px 4px;
    border-radius: 3px;
    line-height: 1;
    white-space: nowrap;
}

.nature-modifier-tag.nature-raise {
    color: #2ecc71;
    background: rgba(46, 204, 113, 0.12);
    border: 1px solid rgba(46, 204, 113, 0.3);
}

.nature-modifier-tag.nature-lower {
    color: #dc3545;
    background: rgba(220, 53, 69, 0.12);
    border: 1px solid rgba(220, 53, 69, 0.3);
}

.stat-breakdown-component input {
    width: 100%;
    max-width: 60px;
    min-width: 0;
    box-sizing: border-box;
    padding: 4px;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    font-size: 0.85em;
    font-weight: 500;
    text-align: center;
}

.stat-breakdown-component input:disabled {
    background: var(--bg-tertiary);
    color: var(--text-tertiary);
    cursor: not-allowed;
}

.stat-breakdown-component input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 3px rgba(102, 126, 234, 0.3);
}

.stat-breakdown-component.total {
    grid-column: 5;
    margin-left: 0;
    background: var(--bg-tertiary);
    padding: 4px 10px;
    border-radius: 3px;
    border: 1px solid var(--primary-color);
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

@container (max-width: 430px) {
    .stat-breakdown-row {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .stat-breakdown-label {
        grid-column: 1 / -1;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
    }

    .stat-breakdown-component.total {
        grid-column: 4;
    }
}

.stat-breakdown-component.total label {
    color: var(--primary-color);
}

.stat-total {
    font-size: 0.95em;
    font-weight: bold;
    color: var(--primary-color);
}

.capability-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 0;
}

.capability-value-input {
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 4px 6px;
    font-size: 0.9em;
    font-family: monospace;
}

.capability-value-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 4px rgba(102, 126, 234, 0.3);
}

.stat-number {
    font-weight: bold;
    font-size: 1.2em;
    min-width: 40px;
    color: var(--text-primary);
}

.stat-progress {
    flex: 1;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.stat-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: 4px;
}

/* ===== UNIFIED SECTION SYSTEM ===== */
.section {
    margin: 12px 0;
}

.section-title {
    font-weight: 600;
    color: var(--primary-color);
    margin: 0;
    font-size: 1.12em;
    color: var(--text-primary);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 5px;
    margin-top: 4px;
    margin-bottom: 7px;
}

.section-header .section-title,
.stats-section-header .section-title,
.flex-between-center-15 .section-title {
    margin: 0;
}

.section-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.section-card {
    background: var(--bg-tertiary);
    padding: 12px 15px;
    border-radius: 5px;
    border-left: 4px solid var(--primary-dark);
    color: var(--text-primary);
    font-size: 0.9em;
}

.section-card-name {
    font-weight: bold;
    font-size: 1.1em;
    margin-bottom: 8px;
    color: var(--primary-dark);
}

.section-card-field {
    font-size: 0.9em;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.section-card-field strong {
    font-weight: 600;
}

.section-card-field.main-text {
    font-size: 0.85em;
    color: var(--text-primary);
    margin-top: 5px;
    line-height: 1.4;
    font-style: italic;
}

.section-card-field.note {
    font-size: 0.8em;
    color: var(--text-tertiary);
    margin-top: 5px;
    font-style: italic;
}

.ability-table-wrap {
    overflow-x: auto;
    margin: 8px 0 10px;
}

.ability-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
    color: var(--text-primary);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
}

.ability-table th,
.ability-table td {
    padding: 6px 8px;
    border: 1px solid var(--border-color);
    text-align: left;
    vertical-align: top;
}

.ability-table th {
    background: var(--bg-tertiary);
    color: var(--primary-dark);
    font-weight: 600;
}

/* Move type-specific border colors */
.section-card.move {
    border-left-color: var(--primary-color);
}

.section-card.move.type-normal { border-left-color: #A8A878; }
.section-card.move.type-fire { border-left-color: #F08030; }
.section-card.move.type-water { border-left-color: #6890F0; }
.section-card.move.type-electric { border-left-color: #F8D030; }
.section-card.move.type-grass { border-left-color: #78C850; }
.section-card.move.type-ice { border-left-color: #98D8D8; }
.section-card.move.type-fighting { border-left-color: #C03028; }
.section-card.move.type-poison { border-left-color: #A040A0; }
.section-card.move.type-ground { border-left-color: #E0C068; }
.section-card.move.type-flying { border-left-color: #A890F0; }
.section-card.move.type-psychic { border-left-color: #F85888; }
.section-card.move.type-bug { border-left-color: #A8B820; }
.section-card.move.type-rock { border-left-color: #B8A038; }
.section-card.move.type-ghost { border-left-color: #705898; }
.section-card.move.type-dragon { border-left-color: #7038F8; }
.section-card.move.type-dark { border-left-color: #705848; }
.section-card.move.type-steel { border-left-color: #B8B8D0; }
.section-card.move.type-fairy { border-left-color: #EE99AC; }

.section-card.poke-edge {
    border-left-color: var(--primary-color);
}

.poke-edges-toolbar {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.tutor-points-control {
    display: flex;
    gap: 6px;
    align-items: center;
    color: var(--text-secondary);
    font-size: 0.8em;
    font-weight: 600;
}

.tutor-points-counter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-primary);
}

#tutorPointsCurrentDisplay {
    min-width: 22px;
    text-align: right;
}

.tutor-points-control input {
    width: 56px;
    padding: 4px 6px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-main);
    color: var(--text-primary);
    text-align: center;
    font-weight: 600;
}

.custom-poke-edge-name-input,
.custom-poke-edge-field-input {
    width: 100%;
    min-width: 0;
    padding: 4px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-main);
    color: var(--text-primary);
}

.custom-poke-edge-field-input.short {
    max-width: 120px;
}

/* Move class indicators */
.move-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 0.75em;
    font-weight: 600;
    text-transform: uppercase;
    margin-left: 10px;
    vertical-align: middle;
    color: white;
}

.move-class-toggle,
.struggle-type-toggle {
    border: 0;
    cursor: pointer;
    font-family: inherit;
}

.struggle-type-modifiable {
    position: relative;
}

.struggle-type-modifiable::after {
    content: '';
    position: absolute;
    top: -3px;
    right: -3px;
    width: 7px;
    height: 7px;
    border: 1px solid var(--bg-tertiary);
    border-radius: 50%;
    background: #f59e0b;
}

.move-class-physical {
    background-color: #d4a574;
}

.move-class-special {
    background-color: #7777dd;
}

.move-class-status {
    background-color: #A8A878;
}

.move-class-versatile {
    background-color: #b366cc;
}

.struggle-ac-input {
    width: 34px;
    padding: 0 2px;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    background: var(--bg-main);
    color: inherit;
    font: inherit;
    text-align: center;
}

/* Move usage tracker */
.usage-tracker {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    margin-left: 12px;
}

.usage-boxes {
    display: flex;
    gap: 4px;
    align-items: center;
}

.usage-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    background: var(--bg-main);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 0.9em;
    position: relative;
}

.usage-checkbox:hover {
    border-color: var(--primary-color);
    background-color: var(--bg-secondary);
}

.usage-checkbox.checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    font-weight: bold;
}

.usage-checkbox.checked::after {
    content: '✓';
    font-size: 0.85em;
    font-weight: bold;
}

.usage-label {
    font-size: 0.85em;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

.skill-input {
    font-family: monospace;
    font-size: 0.85em;
    color: var(--text-secondary);
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    padding: 4px;
    box-sizing: border-box;
    transition: border-color 0.2s ease, background-color 0.2s ease;
    background: var(--bg-main);
}

.skill-input:hover {
    border-color: var(--primary-color);
    background-color: var(--bg-secondary);
}

.skill-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: var(--bg-main);
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

/* Capabilities without value input */
.capability-no-value-input {
    font-family: monospace;
    font-size: 0.9em;
    color: var(--text-secondary);
    width: 100%;
    padding: 6px;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    box-sizing: border-box;
    transition: border-color 0.2s ease, background-color 0.2s ease;
    background: var(--bg-main);
    min-height: 40px;
    line-height: 1.3;
    resize: vertical;
    overflow-y: hidden;
}

.capability-no-value-input:hover {
    border-color: var(--primary-color);
    background-color: var(--bg-secondary);
}

.capability-no-value-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: var(--bg-main);
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

/* Section containers with grid layouts */
.section-container {
    padding: 15px;
    background: var(--bg-tertiary);
    border-radius: 5px;
    border-left: 4px solid;
}

.section-container.skills {
    border-left-color: var(--skills-border);
}

.section-container.capabilities {
    border-left-color: var(--capabilities-border);
}

.section-container.skills,
.section-container.capabilities {
    padding: 8px 10px;
}

.section-grid {
    display: grid;
    gap: 12px;
    margin-bottom: 12px;
}

.section-grid.skills {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 4px;
    margin: 0;
}

.section-grid.capabilities {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 4px;
    margin: 0 0 6px;
}

.grid-item {
    background: var(--bg-main);
    padding: 10px;
    border-radius: 4px;
    border: 1px solid;
}

.grid-item.skill {
    border-color: var(--skills-border);
}

.grid-item.capability {
    border-color: var(--capabilities-border);
}

.grid-item.capability-full {
    grid-column: 1 / -1;
}

.grid-item.skill,
.grid-item.capability {
    display: grid;
    align-items: center;
    gap: 6px;
    padding: 5px 7px;
}

.grid-item.skill {
    grid-template-columns: minmax(0, 1fr) minmax(72px, 0.85fr);
}

.grid-item.capability {
    grid-template-columns: minmax(0, 1fr) 44px;
}

.grid-item.capability-full {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
}

.grid-item-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9em;
    margin-bottom: 4px;
}

.grid-item.capability .grid-item-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.grid-item.skill .grid-item-title,
.grid-item.capability .grid-item-title {
    margin-bottom: 0;
    font-size: 0.82em;
}

.grid-item.skill .skill-input,
.grid-item.capability .capability-value-input,
.grid-item.capability .capability-no-value-input {
    min-width: 0;
    padding: 3px 4px;
    font-size: 0.8em;
}

.section-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.section-container.capabilities .section-buttons {
    gap: 3px;
}

.section-container.capabilities .section-btn {
    padding: 3px 6px;
    font-size: 0.7em;
}

.section-btn {
    padding: 4px 8px;
    color: white;
    background: var(--primary-color);
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.75em;
    font-weight: 600;
    transition: all 0.2s ease;
}

/* Legacy aliases for header and name */
.move-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    gap: 10px;
}

.move-name {
    font-weight: bold;
    font-size: 1.1em;
    color: var(--primary-color);
    flex: 1;
}

.remove-move-btn {
    flex-shrink: 0;
}

.ability-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    gap: 10px;
}

.ability-name {
    font-weight: bold;
    font-size: 1.1em;
    color: var(--primary-color);
    flex: 1;
}

.remove-ability-btn,
.remove-poke-edge-btn {
    flex-shrink: 0;
}

/* Legacy aliases for move fields */
.move-field {
    font-size: 0.9em;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.move-field strong {
    font-weight: 600;
}

.move-field.main-text {
    font-size: 0.85em;
    color: var(--text-primary);
    margin-top: 5px;
    line-height: 1.4;
    font-style: italic;
}

.move-field.note {
    font-size: 0.8em;
    color: var(--text-tertiary);
    margin-top: 5px;
    font-style: italic;
}

.nature-box {
    background: var(--bg-secondary);
    padding: 15px;
    border-radius: 5px;
    border-left: 4px solid var(--primary-dark);
    margin: 15px 0;
}

.nature-name {
    font-weight: 600;
    font-size: 1.1em;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.nature-mods {
    display: flex;
    gap: 15px;
    font-size: 0.9em;
}

.nature-raise {
    color: #2ecc71;
    font-weight: 600;
}

.nature-lower {
    color: #dc3545;
    font-weight: 600;
}

.error {
    background: var(--error-bg);
    color: var(--error-text);
    padding: 12px 15px;
    border-radius: 5px;
    margin-bottom: 15px;
    border-left: 4px solid var(--error-border);
}

.loading {
    text-align: center;
    padding: 40px;
    font-size: 1.2em;
    color: var(--text-secondary);
}

.spinner {
    border: 4px solid var(--bg-tertiary);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.advanced-toggle {
    background: var(--bg-tertiary);
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* margin-bottom: 5px; */
    margin-top: 10px;
    user-select: none;
    font-size: 0.9em;
}

.advanced-toggle.has-hidden-changes {
    border: 1px solid #f59e0b;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.18);
}

.advanced-toggle:hover {
    background: var(--border-color);
}

.advanced-section {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.advanced-section.open {
    max-height: 800px;
}

.owlbear-option-label {
    display: block;
    margin-bottom: 6px;
    font-size: .85em;
}

.owlbear-embed-only {
    display: none;
}

body.owlbear-embedded .owlbear-embed-only {
    display: block;
}

.owlbear-radio-group {
    display: flex;
    gap: 8px;
}

.owlbear-radio-option {
    display: flex;
    flex: 1 1 0;
    align-items: center;
    gap: 7px;
    margin: 0;
    padding: 7px 9px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background: var(--bg-main);
    cursor: pointer;
    font-size: .85em;
    transition: border-color .2s, background-color .2s;
}

.owlbear-radio-option:hover,
.owlbear-radio-option:has(input:checked) {
    border-color: var(--primary-color);
    background: color-mix(in srgb, var(--primary-color) 10%, var(--bg-main));
}

.owlbear-radio-option input {
    width: 15px;
    height: 15px;
    margin: 0;
    accent-color: var(--primary-color);
}

/* Styles pour les cartes Pokémon */
.pokemon-history-section {
    margin-bottom: 24px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-main);
}

.import-drop-zone {
    background: linear-gradient(135deg, var(--info-box-bg) 0%, var(--bg-main) 100%);
}

.import-drop-zone:hover,
.import-drop-zone.is-dragover {
    border-color: var(--success-border) !important;
    background: linear-gradient(
        135deg,
        color-mix(in srgb, var(--success-border) 16%, var(--bg-main)) 0%,
        var(--bg-main) 100%
    );
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--success-border) 30%, transparent);
}

.pokemon-history-section[hidden] {
    display: none;
}

.pokemon-history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.pokemon-history-header h3 {
    color: var(--primary-color);
    font-size: 1em;
}

.pokemon-history-header p {
    margin-top: 2px;
    color: var(--text-secondary);
    font-size: .75em;
}

.history-clear-btn {
    flex: 0 0 auto;
    padding: 6px 9px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: .72em;
}

.pokemon-history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 7px;
}

.pokemon-history-card {
    display: flex;
    min-width: 0;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 7px;
    background: var(--bg-secondary);
}

.pokemon-history-open {
    display: flex;
    min-width: 0;
    flex: 1;
    align-items: center;
    gap: 7px;
    padding: 6px 8px;
    background: transparent;
    color: var(--text-primary);
    text-align: left;
}

.pokemon-history-open:hover {
    background: var(--bg-tertiary);
}

.pokemon-history-icon {
    width: 32px;
    height: 32px;
    flex: 0 0 auto;
    object-fit: none;
}

.pokemon-history-text {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.pokemon-history-text strong {
    overflow: hidden;
    font-size: .78em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pokemon-history-text small {
    color: var(--text-secondary);
    font-size: .67em;
}

.pokemon-history-remove {
    flex: 0 0 auto;
    padding: 5px 8px;
    background: transparent;
    color: var(--text-tertiary);
    font-size: 1.1em;
}

.pokemon-history-remove:hover {
    color: var(--error-border);
}

.pokemon-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
    gap: 7px;
    padding: 7px;
}

.pokemon-card {
    background: var(--bg-main);
    border-radius: 6px;
    padding: 6px;
    box-shadow: 0 2px 6px var(--shadow-color);
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.pokemon-card-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-bottom: 4px;
    width: 100%;
}

.pokemon-card-icon {
    width: 28px;
    height: 28px;
    object-fit: none;
    flex-shrink: 0;
}

.pokemon-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    border-color: var(--primary-color);
}

.pokemon-card-number {
    font-size: 0.68em;
    color: var(--text-tertiary);
    font-weight: 500;
}

.pokemon-card-name {
    font-size: 0.8em;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 3px;
    line-height: 1.2;
}

.pokemon-card-info {
    display: flex;
    gap: 4px;
    align-items: center;
    justify-content: center;
    margin-bottom: 3px;
    font-size: 0.68em;
}

.pokemon-card-level {
    color: var(--primary-color);
    font-weight: 500;
}

.pokemon-card-types {
    display: flex;
    gap: 2px;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
}

.pokemon-card-type {
    font-size: 0.58em;
    padding: 2px 5px;
    border-radius: 10px;
    color: white;
    font-weight: 600;
}

.pokemon-card-shiny {
    color: #FFD700;
    font-size: 0.9em;
}

.toggle-icon {
    position: relative;
    font-size: 1.2em;
    transition: transform 0.3s;
}

.toggle-icon.has-hidden-changes::after {
    content: '';
    position: absolute;
    top: -3px;
    right: -7px;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #f59e0b;
    box-shadow: 0 0 0 2px var(--bg-secondary);
}

.toggle-icon.open {
    transform: rotate(180deg);
}

.form-group-autocomplete {
    position: relative;
    margin-bottom: 15px;
}

.autocomplete-suggestions {
    position: absolute;
    top: calc(100% + 3px);
    left: 0;
    right: 0;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 0 0 5px 5px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1001;
    display: none;
    box-shadow: 0 4px 6px var(--shadow-color);
}

.autocomplete-suggestions.open {
    display: block;
}

.autocomplete-item {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s;
    color: var(--text-primary);
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover {
    background-color: var(--bg-secondary);
}

.autocomplete-item.selected {
    background-color: var(--bg-tertiary);
    color: var(--primary-color);
}

.no-pokemon {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-tertiary);
    font-size: 1.1em;
}

.no-pokemon:has(.pokemon-cards-grid) {
    padding: 0;
    color: inherit;
    font-size: inherit;
    text-align: initial;
}

.details-content {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 30px;
}

.details-left {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.details-right {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

@media (max-width: 768px) {
    .details-content {
        grid-template-columns: 1fr;
    }
    .content {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .pokemon-info {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

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

    .header h1 {
        font-size: 1.3em;
    }
}

.combat-stage-input {
    width: 50px;
    padding: 4px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.8em;
    text-align: center;
    margin-left: 5px;
    background: var(--bg-main);
    color: var(--text-primary);
}

.combat-stage-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 4px rgba(102, 126, 234, 0.3);
}

/* Type button styles for modal */
.type-btn {
    transition: all 0.2s ease;
}

.type-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.type-btn:active {
    transform: translateY(0);
}

/* Modal move button styles */
.modal-move-btn {
    padding: 10px 12px !important;
    border-radius: 5px !important;
    cursor: pointer !important;
    text-align: left !important;
    font-size: 0.9em !important;
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    box-sizing: border-box !important;
    width: 100% !important;
    min-height: 44px !important;
    border: 1px solid var(--border-color) !important;
    background: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
}

.modal-move-btn.exists {
    background: var(--success-bg) !important;
    border-color: var(--success-border) !important;
    color: var(--success-text) !important;
    font-weight: 600 !important;
    box-shadow: inset 0 0 0 1px var(--success-border) !important;
}

.modal-move-btn:hover {
    background: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    box-shadow: inset 0 0 0 1px var(--primary-color) !important;
}

.modal-move-btn:hover .move-btn-text {
    color: white !important;
}

.modal-move-btn:hover .move-btn-checkmark {
    color: white !important;
}

.modal-move-btn .move-btn-text {
    color: var(--text-primary) !important;
}

.modal-move-btn.exists .move-btn-text {
    color: var(--success-text) !important;
}

.modal-move-btn .move-btn-checkmark {
    color: var(--success-border) !important;
    margin-left: 8px !important;
    font-weight: bold !important;
}

/* Modal ability button styles */
.modal-ability-btn {
    padding: 10px 12px !important;
    border-radius: 5px !important;
    cursor: pointer !important;
    text-align: left !important;
    font-size: 0.9em !important;
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
    box-sizing: border-box !important;
    width: 100% !important;
    min-height: 50px !important;
    border: 1px solid var(--border-color) !important;
    background: var(--bg-tertiary) !important;
}

.modal-ability-btn.exists {
    background: var(--success-bg) !important;
    border-color: var(--success-border) !important;
    box-shadow: inset 0 0 0 1px var(--success-border) !important;
}

.modal-ability-btn:hover {
    background: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    box-shadow: inset 0 0 0 1px var(--primary-color) !important;
}

.modal-ability-btn:hover .ability-btn-name {
    color: white !important;
}

.modal-ability-btn:hover .ability-btn-details {
    color: #f0f0f0 !important;
}

.modal-ability-btn:hover .ability-btn-checkmark {
    color: white !important;
}

.ability-btn-title {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}

.ability-btn-name {
    font-weight: 600 !important;
    color: var(--text-primary) !important;
}

.modal-ability-btn.exists .ability-btn-name {
    font-weight: bold !important;
    color: var(--success-text) !important;
}

.ability-btn-details {
    font-size: 0.85em !important;
    color: var(--text-secondary) !important;
}

.modal-ability-btn.exists .ability-btn-details {
    color: var(--success-text) !important;
}

.ability-btn-checkmark {
    color: var(--success-border) !important;
    font-weight: bold !important;
    margin-left: 8px !important;
}

/* Edit action buttons (small buttons for Add Move, Add Ability, Edit Types) */
/* .edit-action-btn {
    padding: 6px 12px !important;
    background: var(--primary-color) !important;
    color: white !important;
    border: none !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    font-size: 0.75em !important;
    font-weight: 600 !important;
    transition: all 0.2s ease !important;
    display: inline-block !important;
}

.edit-action-btn:hover {
    background: var(--primary-dark) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3) !important;
} */


.toc {
    background: transparent;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    border-left: 4px solid var(--primary-color);
}

.toc h2 {
    margin-top: 0;
    color: var(--text-primary);
}

.toc ul {
    list-style: none;
    padding: 0;
}

.toc li {
    margin: 8px 0;
}

.toc a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.toc a:hover {
    text-decoration: underline;
}

.endpoint {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.endpoint-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.method {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 4px;
    font-weight: bold;
    color: white;
    font-size: 0.9em;
}

.method-get {
    background-color: #61affe;
}

.endpoint-path {
    font-family: 'Courier New', monospace;
    background: var(--bg-secondary);
    padding: 8px 12px;
    border-radius: 4px;
    color: #d63384;
    font-weight: 500;
    flex: 1;
    min-width: 300px;
}

.endpoint h3 {
    margin-top: 0;
    color: var(--text-primary);
}

.description {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 15px;
}

.params-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
    font-size: 0.95em;
}

.params-table th {
    background-color: var(--bg-secondary);
    padding: 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-primary);
}

.params-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.param-name {
    font-family: 'Courier New', monospace;
    color: #d63384;
    font-weight: 500;
}

.param-type {
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: var(--primary-color);
}

.example {
    background: var(--bg-secondary);
    border-left: 3px solid var(--primary-color);
    padding: 15px;
    margin: 15px 0;
    border-radius: 4px;
    overflow-x: auto;
}

.example-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
    font-size: 0.95em;
}

.example-code {
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: var(--text-primary);
    background: var(--bg-main);
    padding: 10px;
    border-radius: 3px;
}

.note {
    background: var(--error-bg);
    border-left: 3px solid var(--error-border);
    padding: 12px;
    margin: 15px 0;
    border-radius: 4px;
    color: var(--error-text);
    font-size: 0.95em;
}

.response-example {
    background: var(--success-bg);
    border-left: 3px solid var(--success-border);
    padding: 15px;
    margin: 15px 0;
    border-radius: 4px;
    overflow-x: auto;
}

.response-title {
    font-weight: 600;
    color: var(--success-text);
    margin-bottom: 10px;
    font-size: 0.95em;
}

pre {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 0.85em;
    color: var(--text-primary);
}

.footer {
    text-align: center;
    margin-top: 50px;
    padding-top: 30px;
    border-top: 2px solid var(--border-color);
}

.footer-back {
    display: inline-block;
    margin-top: 10px;
    padding: 10px 20px;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    transition: background 0.2s ease;
}

.footer-back:hover {
    background: var(--primary-dark);
}

.stats-info {
    background: var(--bg-tertiary);
    border-left: 3px solid var(--primary-color);
    padding: 15px;
    margin: 15px 0;
    border-radius: 4px;
    font-size: 0.95em;
    color: var(--text-primary);
}

.edit-action-btn:active {
    transform: translateY(0) !important;
}

/* Hidden button class for filtering */
.btn-hidden {
    display: none !important;
}

/* Utility Classes for Inline Styles */
.text-secondary {
    color: var(--text-secondary);
}

.text-primary {
    color: var(--text-primary);
}

.text-muted {
    color: var(--text-tertiary);
}

.help-icon {
    cursor: help;
    color: var(--primary-color);
    font-weight: bold;
    font-size: 0.95em;
}

.small-text {
    font-size: 0.85em;
}

.small-block-text {
    display: block;
    margin-top: 3px;
    color: var(--text-secondary);
    font-size: 0.8em;
    line-height: 1.3;
}

.import-section-title {
    margin-top: 0;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.custom-status-text {
    font-size: 0.85em;
    color: var(--text-secondary);
}

.file-list-wrapper {
    margin-top: 12px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: 6px;
    display: none;
}

.file-list-header {
    font-size: 0.85em;
    font-weight: 600;
    color: var(--text-primary);
}

.file-list-content {
    font-size: 0.8em;
    color: var(--text-secondary);
    margin-bottom: 8px;
    max-height: 120px;
    overflow-y: auto;
}

.file-size-hint {
    color: var(--text-tertiary);
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.modal {
    background: var(--bg-main);
    border-radius: 8px;
    padding: 20px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.modal-header {
    margin-top: 0;
    color: var(--primary-color);
    margin-bottom: 12px;
    font-size: 1.3em;
}

.modal-section {
    margin-bottom: 12px;
    padding: 10px;
    background: var(--bg-tertiary);
    border-radius: 5px;
    color: var(--text-secondary);
    font-size: 0.9em;
}

.stats-info-box {
    background: var(--bg-tertiary);
    border-left: 3px solid var(--primary-color);
    padding: 15px;
    margin: 15px 0;
    border-radius: 4px;
    font-size: 0.95em;
    color: var(--text-primary);
}

.stat-level-wrapper {
    display: flex;
    gap: 20px;
    align-items: center;
}

.stat-label {
    font-size: 0.9em;
    color: var(--text-secondary);
    min-width: 30px;
}

.stat-input {
    padding: 6px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-weight: 600;
    text-align: center;
}

.stat-input-small {
    width: 50px;
}

.nickname-input {
    width: 200px;
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.9em;
    margin-top: 6px;
    font-style: italic;
}

.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 4px;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    min-width: 180px;
}

.dropdown-item {
    width: 100%;
    padding: 10px 16px;
    background: var(--bg-main);
    color: var(--text-primary);
    border: none;
    cursor: pointer;
    text-align: left;
    font-size: 0.85em;
    transition: background 0.2s;
}

.dropdown-item:not(:last-child) {
    border-bottom: 1px solid var(--border-color);
}

.dropdown-item:hover {
    background: var(--bg-secondary);
}

.dropdown-item:last-child {
    border-radius: 0 0 4px 4px;
}

.distribution-buttons {
    display: flex;
    gap: 8px;
}

.distribution-btn {
    padding: 4px 10px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75em;
    font-weight: 600;
    transition: all 0.2s ease;
}

.distribution-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.remaining-points {
    padding: 6px 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--primary-color);
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: 600;
    color: var(--primary-color);
    white-space: nowrap;
}

.abilities-container {
    color: var(--text-tertiary);
    font-size: 0.9em;
    margin-bottom: 12px;
}

.edit-btn {
    padding: 6px 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75em;
    font-weight: 600;
    transition: all 0.2s ease;
}

.edit-btn:hover {
    background: var(--primary-dark);
}

.remove-btn {
    padding: 4px 8px;
    background: var(--bg-secondary);
    color: #dc3545;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.7em;
    font-weight: 600;
    transition: all 0.2s ease;
}

.remove-btn:hover {
    background: #dc3545;
    color: white;
}

.adjust-btn {
    padding: 2px 6px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.7em;
    font-weight: 600;
    transition: all 0.2s ease;
}

.adjust-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.adjust-btn.increase {
    margin-left: 0;
}

.adjust-btn.decrease {
    margin-left: 8px;
}

.type-modal-header {
    margin-top: 0;
    color: var(--primary-color);
    margin-bottom: 12px;
}

.type-selection-box {
    margin-bottom: 12px;
    padding: 10px;
    background: var(--bg-tertiary);
    border-radius: 5px;
}

.type-selection-label {
    margin: 0 0 10px 0;
    font-size: 0.9em;
    color: var(--text-secondary);
}

.move-section-title {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 2px solid var(--primary-color);
}

.empty-state {
    padding: 20px;
    text-align: center;
    color: var(--text-tertiary);
}

.footer-text {
    color: var(--text-tertiary);
    font-size: 0.9em;
}

.method-post {
    background-color: #49cc90;
}

.method-delete {
    background-color: #f93e3e;
}

.doc-link {
    color: var(--primary-color);
    font-weight: bold;
}

.generation-logs {
    margin-top: 15px;
    font-size: 0.9em;
    color: var(--text-tertiary);
    line-height: 1.5;
    max-height: 200px;
    overflow-y: auto;
}

/* Details page styles */
.details-loading {
    text-align: center;
    color: var(--text-tertiary);
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8em;
    margin-bottom: 8px;
}

.stats-table-header {
    border-bottom: 1px solid var(--border-color);
    height: 36px;
}

.stats-table-row-alt {
    background: var(--bg-secondary);
    height: 30px;
}

.stats-table-cell {
    padding: 4px;
    text-align: center;
    border-right: 1px solid var(--border-color);
    vertical-align: middle;
}

.stats-table-header-cell {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.95em;
}

.forme-badge {
    display: inline-block;
    background: var(--bg-secondary);
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 0.85em;
    color: var(--text-secondary);
    font-weight: 500;
}

.variant-badge {
    display: inline-block;
    background: var(--error-bg);
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 0.85em;
    color: var(--error-text);
    font-weight: 500;
}

.export-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 4px;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    min-width: 180px;
}

.export-btn {
    padding: 8px 16px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: 600;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.export-btn:hover {
    background: var(--primary-dark);
}

.form-label-inline {
    font-size: 0.9em;
    color: var(--text-secondary);
}

.nature-select {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    margin-bottom: 8px;
}

.type-list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 6px;
}

.type-button {
    padding: 6px 12px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-main);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.85em;
    font-weight: 500;
    transition: all 0.2s ease;
}

.type-button:hover {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

.type-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 0.85em;
    font-weight: 600;
    color: white;
}

.section-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 8px;
    margin-top: 10px;
}

/* Utility styles for common inline patterns */
.text-center {
    text-align: center;
}

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

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.border-bottom-secondary {
    border-bottom: 2px solid var(--border-color);
}

/* Details page inline styles */
.flex-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.forme-badge-inline {
    display: inline-block;
    background: var(--bg-secondary);
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 0.85em;
    color: var(--text-secondary);
    font-weight: 500;
}

.variant-badge-inline {
    display: inline-block;
    background: var(--error-bg);
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 0.85em;
    color: var(--error-text);
    font-weight: 500;
}

.nickname-field {
    width: 200px;
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.9em;
    margin-top: 3px;
    font-style: italic;
}

.export-button-wrapper {
    position: relative;
    margin-left: auto;
    align-self: center;
    display: flex;
    align-items: center;
    gap: 8px;
}

.export-button-wrapper button {
    margin-top: 0;
}

.export-btn-main {
    min-height: 34px;
    padding: 6px 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8em;
    font-weight: 600;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    line-height: 1;
}

.export-btn-main:hover {
    background: var(--primary-dark);
}

.owlbear-export-group {
    display: inline-flex;
    align-items: stretch;
}

.owlbear-export-group .export-btn-main {
    margin-top: 0;
}

.details-page .skill-input,
.details-page .capability-value-input,
.details-page .capability-no-value-input {
    font-family: inherit;
}

.owlbear-copy-btn {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.owlbear-copy-btn img {
    display: block;
}

.owlbear-settings-btn {
    border-left: 1px solid rgba(255, 255, 255, 0.35);
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    padding-left: 10px;
    padding-right: 10px;
}

.owlbear-utilities-panel {
    display: flex;
    flex: 1 1 360px;
    min-width: 0;
    max-width: 440px;
    flex-direction: column;
    gap: 4px;
    padding: 6px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-main);
}

.owlbear-utilities-header {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.owlbear-utilities-header-actions {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.owlbear-header-export {
    position: relative;
    flex: 0 0 auto;
}

.export-button-wrapper .owlbear-header-export-btn {
    min-height: 23px;
    margin: 0;
    padding: 2px 6px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: .68em;
    font-weight: 700;
    cursor: pointer;
}

.export-button-wrapper .owlbear-header-export-btn:hover,
.export-button-wrapper .owlbear-header-export-btn:focus-visible {
    border-color: var(--primary-color);
    color: var(--primary-color);
    outline: none;
}

.owlbear-utilities-title {
    color: var(--text-secondary);
    font-size: .72em;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.owlbear-utilities-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 4px;
}

.owlbear-utilities-actions .owlbear-insert-btn {
    grid-column: 1 / -1;
    width: 100%;
    margin: 0;
    justify-content: center;
    min-height: 30px;
    padding: 4px 8px;
    font-size: .76em;
}

.owlbear-focus-btn {
    min-height: 30px;
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font: inherit;
    font-size: .76em;
    font-weight: 700;
    cursor: pointer;
}

.owlbear-focus-btn:hover:not(:disabled),
.owlbear-focus-btn:focus-visible {
    border-color: var(--primary-color);
    color: var(--primary-color);
    outline: none;
}

.owlbear-focus-btn:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.owlbear-owner-select {
    width: 100%;
    min-width: 0;
    min-height: 30px;
    margin: 0;
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: .76em;
    font-weight: 700;
    cursor: pointer;
}

.owlbear-owner-select:hover:not(:disabled),
.owlbear-owner-select:focus-visible {
    border-color: var(--primary-color);
    outline: none;
}

.owlbear-owner-select:disabled {
    cursor: default;
    opacity: .65;
}

.owlbear-visibility-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 30px;
    margin: 0;
    padding: 3px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: pointer;
}

.owlbear-visibility-toggle span {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3px 7px;
    border-radius: 4px;
    font-size: .78em;
    font-weight: 700;
}

.owlbear-visibility-toggle[data-visible="true"] .owlbear-visible-label,
.owlbear-visibility-toggle[data-visible="false"] .owlbear-hidden-label {
    background: var(--primary-color);
    color: white;
}

.owlbear-insert-btn[data-busy="true"] {
    cursor: wait;
}

.owlbear-visibility-toggle:disabled {
    cursor: default;
}

.owlbear-insert-btn:disabled:not([data-busy="true"]) {
    cursor: default;
}

.owlbear-visibility-toggle:disabled,
.owlbear-insert-btn:disabled {
    opacity: .65;
}

.owlbear-token-status {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-secondary);
    font-family: monospace;
    font-size: .68em;
}

.owlbear-token-status.is-error {
    color: #dc3545;
}

body.details-page.owlbear-embedded .export-button-wrapper {
    flex: 1 1 390px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

@media (max-width: 768px) {
    .pokemon-header-content {
        flex-wrap: wrap;
    }

    .export-button-wrapper {
        width: 100%;
        margin-left: 84px;
        flex-wrap: wrap;
        justify-content: flex-start;
    }
}

@media (max-width: 520px) {
    .export-button-wrapper {
        margin-left: 0;
    }

    .owlbear-export-group,
    .export-button-wrapper > .export-btn-main {
        width: 100%;
    }

    .owlbear-copy-btn {
        flex: 1;
        justify-content: center;
    }

    .owlbear-settings-btn {
        justify-content: center;
    }

    .owlbear-utilities-panel {
        width: 100%;
        max-width: none;
    }

}

.export-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 4px;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    min-width: 180px;
}

.export-dropdown-item {
    width: 100%;
    padding: 10px 16px;
    background: var(--bg-main);
    color: var(--text-primary);
    border: none;
    cursor: pointer;
    text-align: left;
    font-size: 0.85em;
    transition: background 0.2s;
}

.export-dropdown-item:not(:last-child) {
    border-bottom: 1px solid var(--border-color);
}

.export-dropdown-item:hover {
    background: var(--bg-secondary);
}

.export-dropdown-item:last-child {
    border-radius: 0 0 4px 4px;
}

.level-hp-wrapper {
    display: flex;
    gap: 20px;
    align-items: center;
    justify-content: center;
    margin-top: 8px;
}

.level-input-group {
    display: flex;
    gap: 6px;
    align-items: center;
}

.hp-display {
    text-align: center;
    min-width: 40px;
}

.hp-formula-input {
    width: 100%;
    margin-top: 8px;
}

.hp-damage-controls {
    display: grid;
    grid-template-columns: 68px 88px 82px auto;
    gap: 4px;
    margin-top: 8px;
    align-items: center;
    justify-content: center;
}

.hp-damage-input,
.hp-damage-select {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 5px 4px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-main);
    color: var(--text-primary);
    font-size: 0.78em;
}

.hp-damage-input {
    appearance: textfield;
}

.hp-damage-input::-webkit-inner-spin-button,
.hp-damage-input::-webkit-outer-spin-button {
    margin: 0;
    appearance: none;
}

.hp-damage-input:focus,
.hp-damage-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.hp-damage-btn {
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
    padding: 5px 8px;
    border: 1px solid var(--primary-color);
    border-radius: 4px;
    background: var(--primary-color);
    color: white;
    cursor: pointer;
    font-size: 0.78em;
    font-weight: 600;
}

.hp-damage-btn:hover {
    background: var(--primary-dark);
}

.hp-damage-preview {
    min-height: 18px;
    margin-top: 5px;
    color: var(--text-secondary);
    font-size: 0.78em;
    text-align: center;
}

@media (max-width: 640px) {
    .hp-damage-controls {
        grid-template-columns: 68px 88px;
    }

    .hp-damage-btn {
        grid-column: 1 / -1;
    }
}

.type-effectiveness-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}

.dropdown-arrow {
    font-size: 0.7em;
}

.distribution-button {
    padding: 4px 10px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75em;
    font-weight: 600;
    transition: all 0.2s;
}

.distribution-button:hover {
    background: var(--bg-tertiary);
}

.remaining-points-display {
    padding: 6px 10px;
    background: var(--info-bg);
    border: 1px solid var(--primary-color);
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: 600;
    color: var(--primary-color);
    white-space: nowrap;
}

.stats-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 7px;
}

.stats-section {
    container-type: inline-size;
}

.stats-buttons-group {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, auto));
    gap: 5px;
    align-items: center;
    max-width: 100%;
}

@container (max-width: 480px) {
    .stats-section-header {
        align-items: stretch;
    }

    .stats-section-header .section-title,
    .stats-buttons-group {
        flex: 1 0 100%;
    }

    .stats-buttons-group {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .distribution-button,
    .remaining-points-display {
        width: 100%;
        min-width: 0;
        text-align: center;
    }
}

.level-number-input {
    width: 60px;
    padding: 6px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-weight: 600;
    text-align: center;
    background: var(--bg-main);
    color: var(--text-primary);
}

.level-number-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.other-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    font-size: 0.9em;
}

.other-info-grid > div:last-child {
    grid-column: 1 / -1;
}

.remove-move-btn {
    padding: 4px 8px;
    background: var(--bg-secondary);
    color: var(--error-text);
    border: 1px solid var(--border-color);
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.7em;
    font-weight: 600;
    transition: all 0.2s ease;
}

.remove-move-btn:hover {
    background: var(--error-bg);
    border-color: var(--error-text);
}

.db-adjust-btn {
    min-width: 25px;
    min-height: 25px;
    padding: 2px 6px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.7em;
    font-weight: 600;
    transition: all 0.2s ease;
}

.db-adjust-btn:hover {
    background: var(--bg-tertiary);
}

.copy-roll-formula-btn {
    min-height: 25px;
    padding: 3px 8px;
    background: var(--bg-secondary);
    color: var(--primary-color);
    border: 1px solid var(--border-color);
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.75em;
    font-weight: 600;
    transition: all 0.2s ease;
}

.copy-roll-formula-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.db-field {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 6px 10px;
    min-width: 0;
    padding: 4px 6px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-main);
}

.db-summary,
.db-actions,
.db-identity,
.db-range,
.db-stepper {
    display: inline-flex;
    align-items: center;
}

.db-summary {
    flex: 1 1 auto;
    flex-wrap: wrap;
    gap: 4px 8px;
    min-width: 0;
}

.db-identity {
    gap: 4px;
    color: var(--primary-color);
    white-space: nowrap;
}

.db-stab-badge {
    padding: 1px 4px;
    border: 1px solid color-mix(in srgb, var(--primary-color) 45%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--primary-color) 12%, transparent);
    font-size: .68em;
    font-weight: 700;
    line-height: 1.2;
}

.db-formula {
    color: var(--text-primary);
    font-family: monospace;
    font-weight: 600;
    white-space: nowrap;
}

.db-attack-bonus {
    color: var(--primary-color);
}

.db-range {
    gap: 4px;
    padding: 2px 5px;
    border-radius: 4px;
    background: var(--bg-tertiary);
    color: var(--text-tertiary);
    font-size: .78em;
    white-space: nowrap;
}

.db-range strong {
    color: var(--text-primary);
}

.db-range-separator {
    opacity: .55;
}

.db-actions {
    flex: 0 0 auto;
    gap: 4px;
}

.db-stepper {
    gap: 2px;
}

@media (max-width: 640px) {
    .db-field {
        align-items: center;
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 4px;
    }

    .db-actions {
        width: auto;
        gap: 2px;
    }

    .db-actions .copy-roll-formula-btn {
        flex: 0 0 auto;
        padding-inline: 5px;
    }

    .db-summary {
        flex-wrap: nowrap;
        gap: 4px;
        overflow: hidden;
    }

    .db-formula {
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .db-adjust-btn {
        min-width: 23px;
        padding-inline: 4px;
    }
}

@media (max-width: 470px) {
    .db-range {
        display: none;
    }
}


/* Table Styles */
.details-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8em;
    margin-bottom: 8px;
}

.details-table thead tr {
    border-bottom: 1px solid var(--border-color);
    height: 36px;
}

.details-table-type-cell {
    padding: 4px;
    text-align: center;
    border-right: 1px solid var(--border-color);
    vertical-align: middle;
}

.details-table-value-cell {
    padding: 4px;
    text-align: center;
    border-right: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 0.95em;
    vertical-align: middle;
}

.details-table tbody tr {
    background: var(--bg-secondary);
    height: 30px;
}

/* Type badge in table */
.type-badge-table {
    display: inline-block;
    padding: 4px 8px;
    font-size: 0.7em;
    font-weight: 600;
    min-width: 50px;
    white-space: nowrap;
}

.type-effectiveness-button {
    border: 0;
    font-family: inherit;
    line-height: inherit;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.type-effectiveness-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
}

.type-effectiveness-button:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.type-effectiveness-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(64px, 100%), 1fr));
    gap: 5px;
    width: 100%;
    min-width: 0;
}

.type-effectiveness-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    margin-bottom: 7px;
}

.type-effectiveness-header .info-label {
    margin: 0;
}

.type-effectiveness-item {
    display: grid;
    grid-template-rows: auto minmax(24px, auto);
    min-width: 0;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background: var(--bg-secondary);
}

.type-effectiveness-item .type-effectiveness-button {
    width: 100%;
    min-width: 0;
    border-radius: 0;
}

.type-effectiveness-item .type-eff-value-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: 3px;
    border: 0;
    font-size: .78em;
    font-weight: 700;
}

.type-effectiveness-select {
    width: 100%;
    min-width: 0;
    min-height: 24px;
    padding: 2px 3px;
    border: 0;
    border-top: 1px solid var(--border-color);
    border-radius: 0;
    background: var(--bg-main);
    color: var(--text-primary);
    font: inherit;
    font-size: .75em;
    font-weight: 700;
    text-align: center;
}

.type-effectiveness-select:focus {
    position: relative;
    z-index: 2;
    outline: 2px solid var(--primary-color);
    outline-offset: -2px;
}

#editTypeEffectivenessBtn.editing {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

.details-table-type-cell.damage-type-selected-top {
    position: relative;
    z-index: 1;
    box-shadow:
        inset 2px 2px 0 var(--primary-color),
        inset -2px 0 0 var(--primary-color);
}

.type-eff-value-cell.damage-type-selected-bottom {
    position: relative;
    z-index: 1;
    box-shadow:
        inset 2px -2px 0 var(--primary-color),
        inset -2px 0 0 var(--primary-color);
}

.type-effectiveness-item.damage-type-selected-top {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 1px var(--primary-color);
}

.type-effectiveness-item .type-eff-value-cell.damage-type-selected-bottom {
    box-shadow: inset 0 2px 0 var(--primary-color);
}

/* Nature Select */
.nature-select,
.gender-select {
    width: 100%;
    min-width: 0;
    min-height: 30px;
    padding: 5px 28px 5px 8px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    margin: 0;
    background: var(--bg-main);
    color: var(--text-primary);
    font: inherit;
    transition: border-color .2s, background-color .2s;
}

.nature-select:hover,
.gender-select:hover {
    border-color: var(--primary-color);
    background: var(--bg-secondary);
}

.nature-select:focus,
.gender-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary-color) 18%, transparent);
}

.nature-control .nature-select {
    flex: 1 1 auto;
}

.nature-modifiers {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 5px;
}

.nature-info-row .nature-raise,
.nature-info-row .nature-lower {
    padding: 3px 7px;
    border: 1px solid currentColor;
    border-radius: 999px;
    background: var(--bg-main);
    font-size: .75em;
    line-height: 1.2;
    white-space: nowrap;
}

/* Capabilities Container */
.capabilities-container {
    color: var(--text-tertiary);
    font-size: 0.9em;
    margin-bottom: 12px;
}

/* Section Headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 7px;
}

.section-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    gap: 10px;
}

.edit-bn {
    padding: 6px 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75em;
    font-weight: 600;
    transition: all 0.2s ease;
}

.edit-bn:hover {
    background: var(--primary-dark);
}

.remove-ability-btn,
.remove-poke-edge-btn {
    padding: 4px 8px;
    background: var(--bg-secondary);
    color: var(--error-text);
    border: 1px solid var(--border-color);
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.7em;
    font-weight: 600;
    transition: all 0.2s ease;
}

.remove-ability-btn:hover,
.remove-poke-edge-btn:hover {
    background: var(--error-bg);
    border-color: var(--error-text);
}

/* Type Effectiveness Value Cell */
.type-eff-value-cell {
    padding: 4px;
    text-align: center;
    border-right: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 0.95em;
    vertical-align: middle;
}

/* Utility margin class */
.margin-top-8 {
    margin-top: 8px;
}

.flex-center-gap-15 {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.flex-gap-5 {
    display: flex;
    gap: 5px;
}

/* Spacing variants */
.flex-between-center-15 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 7px;
}

/* Type Effectiveness Display */
.type-effectiveness-display {
    display: block;
    width: 100%;
    min-width: 0;
}

/* Compact density for the details page */
body.details-page {
    padding: 0;
}

.details-page > .container {
    padding: 14px;
}

.details-page .header {
    margin: -14px -14px 10px;
}

.details-page .pokemon-display {
    padding: 14px;
}

.details-page .pokemon-info {
    gap: 8px;
    margin-bottom: 8px;
}

.details-page .info-box:not(.capture-rate-panel):not(.other-info-panel) {
    padding: 10px 12px;
}

.details-page .info-label {
    margin-bottom: 3px;
}

.details-page .level-hp-wrapper {
    gap: 12px;
    margin-top: 4px;
}

.details-page .level-hp-info-row .level-hp-wrapper {
    justify-content: flex-start;
    margin: 0;
}

.details-page .margin-top-8,
.details-page .hp-damage-controls {
    margin-top: 5px;
}

.details-page .level-hp-info-row .margin-top-8,
.details-page .level-hp-info-row .hp-damage-controls,
.details-page .nature-info-row .margin-top-8 {
    margin-top: 0;
}

.details-page .hp-damage-preview {
    min-height: 0;
    margin-top: 3px;
}

.details-page .hp-damage-preview:empty {
    display: none;
}

.details-page .other-info-grid {
    gap: 6px;
}

.details-page .stats-breakdown {
    gap: 2px;
    margin: 3px 0;
    padding: 8px 10px;
}

.details-page .stat-breakdown-row {
    grid-template-columns: minmax(78px, 1.1fr) minmax(70px, .8fr) minmax(96px, 1fr) minmax(58px, .7fr) minmax(52px, .65fr);
    gap: 4px;
    min-height: 30px;
    padding: 2px 4px;
}

.details-page .stat-breakdown-label,
.details-page .stat-breakdown-component,
.details-page .stat-breakdown-component.total {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 3px;
}

.details-page .stat-breakdown-label {
    justify-content: space-between;
    font-size: .78em;
}

.details-page .stat-breakdown-component label {
    flex: 0 0 auto;
    font-size: .56em;
    line-height: 1;
    letter-spacing: -.01em;
}

.details-page .stat-breakdown-component input,
.details-page .base-stat-value {
    box-sizing: border-box;
    height: 23px;
    padding: 1px 3px;
    line-height: 1;
}

.details-page .base-stat-value {
    display: flex;
    align-items: center;
    justify-content: center;
}

.details-page .stat-breakdown-component.total {
    justify-content: center;
    padding: 1px 4px;
}

.details-page .base-relation-summary {
    padding: 2px 6px;
    margin-bottom: 2px;
    font-size: .72em;
    line-height: 1.15;
}

.details-page .level-points-input {
    flex: 1 1 58px;
    min-width: 52px;
    max-width: 68px;
}

.details-page .nature-modifier-tag {
    padding: 1px 3px;
    font-size: .66em;
}

.details-page .base-stat-wrapper {
    flex-wrap: nowrap;
    gap: 2px;
}

.details-page .stats-section-header {
    gap: 4px;
    margin-bottom: 3px;
}

.details-page .distribution-button,
.details-page .remaining-points-display {
    min-height: 24px;
    padding: 2px 7px;
    line-height: 1.1;
}

@container (max-width: 430px) {
    .details-page .stat-breakdown-row {
        grid-template-columns: minmax(68px, 1fr) minmax(60px, .75fr) minmax(88px, 1fr) minmax(50px, .65fr) minmax(46px, .6fr);
    }

    .details-page .stat-breakdown-label {
        grid-column: auto;
    }

    .details-page .stat-breakdown-component.total {
        grid-column: 5;
    }
}

.details-page .section {
    margin: 10px 0;
}

.details-page .section-list {
    gap: 6px;
}

.details-page .section-card {
    padding: 8px 10px;
}

.details-page .section-card-header {
    margin-bottom: 4px;
}

.details-page .section-card-name {
    margin-bottom: 0;
}

.details-page .section-card-field {
    margin-bottom: 3px;
}

.details-page .move-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 12px;
    margin-bottom: 3px;
}

.details-page .move-meta-row .section-card-field {
    margin-bottom: 0;
    white-space: nowrap;
}

.details-page .section-card > .section-card-field:last-child {
    margin-bottom: 0;
}

.details-page .ability-table-wrap {
    margin: 4px 0 5px;
}

.details-page .ability-table th,
.details-page .ability-table td {
    padding: 4px 6px;
}

.details-page .usage-tracker {
    gap: 4px;
    margin-left: 8px;
}

.details-page .usage-boxes {
    gap: 3px;
}

.details-page .usage-checkbox {
    width: 18px;
    height: 18px;
}

.details-page .type-effectiveness-display {
    width: 100%;
}

.details-page .type-effectiveness-grid {
    gap: 3px;
}

.details-page .type-effectiveness-item {
    padding: 0;
}

.details-page .details-table {
    margin-bottom: 4px;
}

.details-page .type-effectiveness-display .details-table:last-child {
    margin-bottom: 0;
}

.details-page .details-table-header-row {
    height: 31px;
}

.details-page .details-table-body-row {
    height: 25px;
}

.details-page .details-table-type-cell,
.details-page .type-eff-value-cell {
    padding: 3px;
}

.details-page .type-badge-table {
    padding: 3px 6px;
}

.details-page .empty-state.compact {
    padding: 8px;
}

@media (max-width: 640px) {
    body.details-page {
        padding: 8px;
    }

    .details-page > .container {
        padding: 10px;
    }

    .details-page .header {
        margin: -10px -10px 8px;
    }

    .details-page .details-content {
        gap: 12px;
    }
}

/* Modal Search Bar Container */
.modal-search-bar {
    margin-bottom: 15px;
    display: flex;
    gap: 10px;
}

/* Modal Info Box with margin */
.modal-info-box-spaced {
    margin-bottom: 20px !important;
}

.details-table-header-row {
    border-bottom: 1px solid var(--border-color);
    height: 36px;
}

.details-table-body-row {
    background: var(--bg-secondary);
    height: 30px;
}

/* Base Relation summary line */
.base-relation-summary {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 2px;
    padding: 6px 12px;
    margin-bottom: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.8em;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}
.br-stat {
    color: var(--primary-color);
    font-weight: 700;
}
.br-stat-ignored {
    color: var(--text-tertiary);
    text-decoration: line-through;
    font-weight: 500;
}
.br-sep {
    color: var(--text-tertiary);
    font-weight: 400;
    margin: 0 2px;
}
.br-sep.br-gt {
    font-size: 0.95em;
}

/* Base Relation checkbox and tooltip */
.stat-relation-toggle {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
}

.stat-relation-checkbox {
    width: 15px;
    height: 15px;
    margin: 0;
    accent-color: var(--primary-color);
    cursor: pointer;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-content {
    background: var(--bg-main);
    border-radius: 10px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.modal-title {
    margin-top: 0;
    color: var(--primary-color);
    margin-bottom: 12px;
}

.modal-info-box {
    margin-bottom: 12px;
    padding: 10px;
    background: var(--info-bg);
    border-radius: 5px;
}

.modal-info-box p {
    margin: 0 0 10px 0;
    font-size: 0.9em;
    color: var(--text-secondary);
}

.modal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.modal-buttons {
    display: flex;
    gap: 10px;
}

.modal-btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.modal-btn-primary {
    background: var(--primary-color);
    color: white;
}

.modal-btn-primary:hover {
    background: var(--primary-dark);
}

.modal-btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.modal-btn-secondary:hover {
    background: var(--bg-tertiary);
}

/* Modal Search Input */
.modal-search-input {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 0.95em;
    background: var(--bg-main);
    color: var(--text-primary);
}

.modal-search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

/* Modal Action Button */
.modal-action-btn {
    padding: 10px 15px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9em;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.modal-action-btn:hover {
    background: var(--primary-dark);
}

/* Modal Info Text */
.modal-info-text {
    font-size: 0.9em;
    color: var(--text-secondary);
}

/* Move Grid */
.move-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 12px;
    max-height: 400px;
    overflow-y: auto;
}

/* Move Section Header */
.move-section-header {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 2px solid var(--primary-color);
}

/* Move Section */
.move-section {
    margin-bottom: 15px;
}

.move-section-list {
    display: grid;
    gap: 8px;
}
.empty-grid-message {
    padding: 20px;
    text-align: center;
    color: var(--text-tertiary);
}

/* Type Effectiveness Colors */
.eff-immune {
    color: #27ae60;
}

.eff-strong-resist {
    color: #3498db;
}

.eff-resist {
    color: #5dade2;
}

.eff-neutral {
    color: var(--text-primary);
}

.eff-weak {
    color: #e67e22;
}

.eff-strong-weak {
    color: #e74c3c;
}

/* Theme Toggle Button Container */
#theme-selector-container {
    position: relative;
}

/* Theme Toggle Button */
.theme-toggle-btn {
    position: relative;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
    background: var(--bg-main);
    color: var(--text-primary);
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px var(--shadow-color);
    z-index: 10001;
}

.theme-toggle-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 6px 16px var(--shadow-color);
}

.theme-toggle-btn:active {
    transform: scale(0.95);
}

/* Theme Menu */
.theme-menu {
    position: absolute;
    bottom: 70px;
    left: 0;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 8px 24px var(--shadow-color);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    min-width: 160px;
    overflow: hidden;
}

.theme-menu.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.theme-option {
    display: block;
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.95em;
    border-bottom: 1px solid var(--border-color);
}

.theme-option:last-child {
    border-bottom: none;
}

.theme-option:hover {
    background: var(--bg-secondary);
}

.theme-option.active {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
}


