/* ========================================
   CHE Tools - カルネージハート エクサ風テーマ
   メカ・ミリタリー・ハイテクUIデザイン
   ======================================== */

:root {
    /* Color Palette - EXA/Tactical Theme */
    --bg-primary: #0a0c10;
    --bg-secondary: rgba(22, 27, 34, 0.7);
    --bg-tertiary: rgba(33, 38, 45, 0.6);
    --bg-hover: rgba(48, 54, 61, 0.8);

    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
    --text-glow: #a5d6ff;

    /* Tactical Accents */
    --accent-primary: #3fb950;
    /* OKE Green */
    --accent-secondary: #2f81f7;
    /* OKE Cyan/Blue */
    --accent-warning: #d29922;
    /* Alert Orange */
    --accent-danger: #f85149;
    /* Critical Red */
    --accent-glow: rgba(63, 185, 80, 0.4);

    --border-color: #30363d;
    --border-active: #58a6ff;

    /* Decoration */
    --scanline-color: rgba(0, 255, 255, 0.03);

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #1f6feb 0%, #238636 100%);

    /* Shadows & Glows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.8);
    --shadow-glow: 0 0 15px rgba(63, 185, 80, 0.3);
    --text-shadow-glow: 0 0 8px rgba(63, 185, 80, 0.6);

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;

    /* Border Radius - More angular for mech feel */
    --radius-sm: 2px;
    --radius-md: 4px;
    --radius-lg: 8px;
    --radius-xl: 12px;

    /* Transitions */
    --transition-fast: 0.15s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-normal: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Background Pattern */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(10, 12, 16, 0.9), rgba(10, 12, 16, 0.9)),
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M54.627 0l.83.828-1.415 1.415L51.8 0h2.827zM5.373 0l-.83.828L5.96 2.243 8.2 0H5.374zM48.97 0l3.657 3.657-1.414 1.414L46.143 0h2.828zM11.03 0L7.372 3.657 8.787 5.07 13.857 0H11.03zm32.284 0L49.8 6.485 48.384 7.9l-7.9-7.9h2.83zM16.686 0L10.2 6.485 11.616 7.9l7.9-7.9h-2.83zm20.97 0l9.315 9.314-1.414 1.414L34.828 0h2.83zM22.344 0L13.03 9.314l1.414 1.414L25.172 0h-2.83zM32 0l12.142 12.142-1.414 1.414L30 .828 17.272 13.556l-1.414-1.414L28 0h4zM.284 0l28 28-1.414 1.414L0 2.544V0h.284zM0 5.373l25.456 25.455-1.414 1.414L0 8.2V5.373zm0 5.656l22.627 22.627-1.414 1.414L0 13.86v-2.83zm0 5.656l19.8 19.8-1.414 1.414L0 19.515v-2.83zm0 5.657l16.97 16.97-1.414 1.414L0 25.172v-2.83zM0 28l14.142 14.142-1.414 1.414L0 30.828V28zm0 5.657L11.314 44.97 9.9 46.386l-9.9-9.9v-2.828zm0 5.657L8.485 47.8 7.07 49.212 0 42.14v-2.828zm0 5.657l5.657 5.657-1.414 1.414L0 47.8v-2.83zm0 5.657l2.828 2.83-1.414 1.414L0 53.456v-2.83zM54.627 60L30 35.373 5.373 60H8.2L30 38.2 51.8 60h2.827zm-5.656 0L30 41.03 11.03 60h2.828L30 43.858 46.142 60h2.83zm-5.656 0L30 46.686 16.686 60h2.83L30 49.515 40.485 60h2.83zm-5.656 0L30 52.343 22.344 60h2.83L30 55.172 34.828 60h2.83zM32 60l-2-2-2 2h4zM59.716 0l-28 28 1.414 1.414L60 2.544V0h-.284zM60 5.373L34.544 30.828l1.414 1.414L60 8.2V5.373zm0 5.656L37.373 33.656l1.414 1.414L60 13.86v-2.83zm0 5.656l-19.8 19.8 1.414 1.414L60 19.515v-2.83zm0 5.657l-16.97 16.97 1.414 1.414L60 25.172v-2.83zM60 28L45.858 42.142l1.414 1.414L60 30.828V28zm0 5.657L48.686 44.97l1.414 1.414L60 36.485v-2.83zm0 5.657L51.515 47.8l1.414 1.414L60 42.14v-2.828zm0 5.657l-5.657 5.657 1.414 1.414L60 47.8v-2.83zm0 5.657l-2.828 2.83 1.414 1.414L60 53.456v-2.83zM60 60V0h-2.83v60H60z' fill='%232f81f7' fill-opacity='0.03' fill-rule='evenodd'/%3E%3Csvg%3E");
    pointer-events: none;
    z-index: -1;
}

/* Scanline Animation */
@keyframes scanline {
    0% {
        transform: translateY(-100%);
    }

    100% {
        transform: translateY(100%);
    }
}

body::after {
    /* Existing vignette + scanline */
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, transparent 0%, rgba(0, 0, 0, 0.4) 100%),
        linear-gradient(to bottom, transparent 50%, var(--scanline-color) 51%, transparent 51%);
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 9999;
    /* Ensure it's on top */
    animation: scanline 0.1s infinite;
    opacity: 0.3;
}

/* Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 15px;
}

body {
    font-family: 'Roboto Mono', 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* App Container */
.app-container {
    max-width: 1300px;
    margin: 0 auto;
    padding: var(--spacing-md);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.app-header {
    text-align: center;
    padding: var(--spacing-lg) var(--spacing-md);
    margin-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
    background: var(--gradient-header);
}

.logo {
    font-family: 'Orbitron', 'Segoe UI', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: 2px;
    background: white;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 15px rgba(63, 185, 80, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
}

.logo-icon {
    font-size: 1.6rem;
}

.subtitle {
    color: var(--text-secondary);
    margin-top: var(--spacing-xs);
    font-size: 0.85rem;
    letter-spacing: 0.1em;
}

/* Tab Navigation */
.tab-nav {
    display: flex;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm);
    background: var(--bg-secondary);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-lg);
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.tab-btn:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.tab-btn.active {
    background: rgba(47, 129, 247, 0.15);
    border: 1px solid var(--accent-secondary);
    color: var(--text-primary);
    text-shadow: var(--text-shadow-glow);
    box-shadow: 0 0 10px rgba(47, 129, 247, 0.2);
}

/* Panel Decorations (Brackets) */
.tab-panel,
.team-list-panel,
.viewer-container,
.calc-results,
.calc-options {
    position: relative;
    border: 1px solid var(--border-color);
}

.tab-panel::before,
.team-list-panel::before,
.viewer-container::before,
.calc-results::before,
.calc-options::before {
    content: "";
    position: absolute;
    top: -1px;
    left: -1px;
    width: 20px;
    height: 20px;
    border-top: 2px solid var(--accent-secondary);
    border-left: 2px solid var(--accent-secondary);
    transition: all var(--transition-normal);
    opacity: 0.7;
}

.tab-panel::after,
.team-list-panel::after,
.viewer-container::after,
.calc-results::after,
.calc-options::after {
    content: "";
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 20px;
    height: 20px;
    border-bottom: 2px solid var(--accent-secondary);
    border-right: 2px solid var(--accent-secondary);
    transition: all var(--transition-normal);
    opacity: 0.7;
}

.tab-icon {
    font-size: 1.1rem;
}

/* Drop Zone */
.drop-zone {
    border: 2px dashed var(--border-light);
    border-radius: var(--radius-md);
    padding: var(--spacing-xl);
    text-align: center;
    background: var(--bg-secondary);
    transition: all var(--transition-normal);
    cursor: pointer;
    margin-bottom: var(--spacing-md);
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--accent-primary);
    background: rgba(42, 127, 255, 0.05);
}

.drop-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
}

.drop-icon {
    font-size: 2.5rem;
    opacity: 0.6;
}

.drop-zone p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.drop-hint {
    color: var(--text-muted) !important;
    font-size: 0.8rem !important;
}

.file-btn {
    display: inline-block;
    padding: var(--spacing-sm) var(--spacing-lg);
    background: var(--gradient-primary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    color: white;
    font-weight: 500;
    font-size: 0.9rem;
}

.file-btn:hover {
    box-shadow: var(--shadow-glow);
}

/* File List */
.file-list {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    font-family: 'Roboto Mono', monospace;
}

.file-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
}

.file-list h3 {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.file-list ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.file-list li {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
}

.file-list .file-type {
    padding: 2px 6px;
    border-radius: 2px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
}

.file-type.team {
    background: var(--accent-secondary);
    color: var(--bg-primary);
}

.file-type.match {
    background: var(--accent-primary);
    color: white;
}

/* Tab Content */
.tab-content {
    flex: 1;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* Team Editor */
.editor-container {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: var(--spacing-md);
    min-height: 420px;
}

.team-list-panel {
    background: var(--bg-secondary);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-md);
}

.team-list-panel h3 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text-primary);
}

.team-list-panel h3 span {
    font-size: 0.8rem;
    color: var(--accent-energy);
    font-weight: 400;
}

.team-list-panel .controls {
    display: flex;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-sm);
}

.team-list {
    list-style: none;
    flex: 1;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
}

.team-list li {
    padding: var(--spacing-sm) var(--spacing-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    transition: background var(--transition-fast);
    border-bottom: 1px solid var(--border-color);
}

.team-list li:last-child {
    border-bottom: none;
}

.team-list li:hover {
    background: rgba(47, 129, 247, 0.1);
    border-left: 2px solid var(--accent-secondary);
    padding-left: calc(var(--spacing-sm) + 2px);
}

.team-list li.selected {
    background: rgba(47, 129, 247, 0.2);
    border: 1px solid var(--accent-secondary);
    box-shadow: 0 0 10px rgba(47, 129, 247, 0.1);
}

/* ドラッグ&ドロップ */
.team-list li.dragging {
    opacity: 0.5;
}

.team-list li.drag-over {
    background: rgba(0, 200, 160, 0.1);
    border-top: 2px solid var(--accent-secondary);
}

.team-list .team-name {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 500;
}

.team-list .team-owner {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.transfer-controls {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: var(--spacing-sm);
}

.transfer-btn {
    width: 36px;
    height: 36px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.action-bar {
    margin-top: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

/* Table Viewer */
.viewer-container {
    background: var(--bg-secondary);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-md);
}

.match-info {
    margin-bottom: var(--spacing-lg);
    padding: var(--spacing-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--accent-primary);
}

.match-info h2 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    color: var(--text-highlight);
}

.match-info .meta {
    display: flex;
    gap: var(--spacing-lg);
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.table-container {
    overflow-x: auto;
}

table.result-table,
table.match-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.result-table th,
.result-table td,
.match-table th,
.match-table td {
    padding: var(--spacing-sm);
    text-align: center;
    border: 1px solid var(--border-color);
}

.result-table th,
.match-table th {
    background: var(--bg-tertiary);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.result-table td.win,
.match-table td.win {
    background: rgba(0, 200, 160, 0.15);
    color: var(--accent-secondary);
    font-weight: 600;
}

.result-table td.draw,
.match-table td.draw {
    background: rgba(240, 160, 48, 0.15);
    color: var(--accent-warning);
    font-weight: 600;
}

.result-table td.lose,
.match-table td.lose {
    background: rgba(224, 64, 64, 0.15);
    color: var(--accent-danger);
    font-weight: 600;
}

.result-table td.self,
.match-table td.diagonal {
    background: var(--bg-primary);
}

.match-table td.result-cell {
    cursor: pointer;
    transition: background var(--transition-fast);
    user-select: none;
}

.match-table td.result-cell:hover {
    background: var(--bg-hover);
}

#standings-table-element tbody tr {
    cursor: move;
}

#standings-table-element tbody tr:hover {
    background: var(--bg-hover);
}

.team-detail {
    margin-top: var(--spacing-lg);
    padding: var(--spacing-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

/* Result Calculator */
.calc-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: var(--spacing-lg);
}

.calc-options {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    height: fit-content;
}

.calc-options h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--border-color);
}

.option-group {
    margin-bottom: var(--spacing-md);
}

.option-group label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: var(--spacing-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.point-inputs {
    display: flex;
    gap: var(--spacing-sm);
}

.point-inputs label {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    text-transform: none;
    color: var(--text-secondary);
}

.point-inputs input {
    width: 50px;
    padding: var(--spacing-xs);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    text-align: center;
    font-weight: 500;
}

.point-inputs input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

select {
    width: 100%;
    padding: var(--spacing-sm);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
}

select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.calc-results {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
}

.calc-results h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--border-color);
}

#standings-table {
    margin-bottom: var(--spacing-md);
}

#standings-table table {
    width: 100%;
    border-collapse: collapse;
}

#standings-table th,
#standings-table td {
    padding: var(--spacing-sm);
    border: 1px solid var(--border-color);
    text-align: center;
}

#standings-table th {
    background: var(--bg-tertiary);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.8rem;
}

#standings-table tr:nth-child(1) td:first-child {
    color: #ffd700;
    font-weight: 700;
}

#standings-table tr:nth-child(2) td:first-child {
    color: #c0c0c0;
    font-weight: 700;
}

#standings-table tr:nth-child(3) td:first-child {
    color: #cd7f32;
    font-weight: 700;
}

.result-actions {
    margin-bottom: var(--spacing-md);
}

.result-text {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    color: var(--accent-primary);
    text-shadow: 0 0 5px rgba(63, 185, 80, 0.5);
    padding: var(--spacing-md);
    border-radius: var(--radius-sm);
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.85rem;
    white-space: pre-wrap;
    max-height: 280px;
    overflow-y: auto;
    color: var(--text-secondary);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-lg);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-primary {
    background: rgba(35, 134, 54, 0.2);
    border: 1px solid var(--accent-primary);
    color: var(--accent-primary);
    text-shadow: 0 0 5px rgba(63, 185, 80, 0.5);
    box-shadow: 0 0 10px rgba(63, 185, 80, 0.1);
}

.btn-primary:hover:not(:disabled) {
    background: rgba(35, 134, 54, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 0 15px rgba(63, 185, 80, 0.4);
}

.btn-primary:hover:not(:disabled) {
    box-shadow: var(--shadow-glow);
}

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

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-hover);
    border-color: var(--border-light);
}

.btn-sm {
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: 0.8rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-sm:hover {
    background: var(--bg-hover);
}

.btn-danger {
    background: var(--accent-danger);
    border: none;
    color: white;
}

.btn-danger:hover {
    background: #c03030;
}

/* Toast */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translate(-50%, 20px);
    }

    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: var(--spacing-sm) var(--spacing-lg);
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    font-size: 0.9rem;
}

.toast.success {
    border-left: 3px solid var(--accent-secondary);
}

.toast.error {
    border-left: 3px solid var(--accent-danger);
}

/* Footer */
.app-footer {
    text-align: center;
    padding: var(--spacing-md);
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: auto;
    border-top: 1px solid var(--border-color);
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Responsive */
@media (max-width: 768px) {
    .tab-nav {
        flex-direction: column;
    }

    .editor-container {
        grid-template-columns: 1fr;
    }

    .transfer-controls {
        flex-direction: row;
        justify-content: center;
    }

    .calc-container {
        grid-template-columns: 1fr;
    }
}

/* Save Options */
.save-options {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.save-options label {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.save-options select {
    min-width: 180px;
}

.save-options .input-group {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.save-options input[type="text"] {
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
}

.save-options input[type="text"]:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.file-ext {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Section Headers */
.viewer-container h3 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: var(--spacing-lg) 0 var(--spacing-sm);
    padding-bottom: var(--spacing-xs);
    border-bottom: 1px solid var(--border-color);
}