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

/* Hide scrollbars while keeping scroll functionality */
* {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

*::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

:root {
    --primary-color: #8B4513;
    --secondary-color: #A0522D;
    --accent-color: #D4A574;
    --text-color: #2C1810;
    --bg-color: #EDE4D3;
    --paper-color: #F5EFDE;
    --paper-dark: #D8CCBA;
    --border-color: #C4B5A0;
    --error-color: #8B0000;
    --success-color: #556B2F;
    --warning-color: #CD853F;
    --modified-color: #FF8C00;
    --original-color: #228B22;
}

/* Resource Icon Styling */
.resource-icon {
    display: inline-block;
    vertical-align: middle;
    margin: 0 4px;
    color: var(--primary-color);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Georgia', 'Garamond', serif;
    background: linear-gradient(135deg, #6B4423 0%, #4A2511 100%);
    color: var(--text-color);
    min-height: 100vh;
    padding: 20px;
    background-attachment: fixed;
}

/* Texture overlay for aged paper effect */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 2px,
            rgba(139, 69, 19, 0.03) 2px,
            rgba(139, 69, 19, 0.03) 4px
        ),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(139, 69, 19, 0.03) 2px,
            rgba(139, 69, 19, 0.03) 4px
        );
    pointer-events: none;
    z-index: 1;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: var(--paper-color);
    border-radius: 2px;
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        inset 0 -2px 5px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 90vh;
    position: relative;
    z-index: 2;
    border: 1px solid var(--paper-dark);
}

/* Aged paper edges */
.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(ellipse at 0% 0%, rgba(101, 67, 33, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 100% 0%, rgba(101, 67, 33, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 0% 100%, rgba(101, 67, 33, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 100% 100%, rgba(101, 67, 33, 0.15) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: #FFF5E6;
    padding: 30px 40px;
    text-align: center;
    position: relative;
    z-index: 1;
    border-bottom: 3px solid var(--accent-color);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 8px;
    font-weight: bold;
    letter-spacing: 1px;
}

header p {
    font-size: 1.1em;
    opacity: 0.9;
    letter-spacing: 1px;
}

header .subtitle {
    font-size: 1.1em;
    opacity: 0.9;
    letter-spacing: 1px;
}

/* Navigation Styles */
.nav-section {
    background: rgba(0, 0, 0, 0.2);
    padding: 15px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.nav-links {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    padding: 0 20px;
}

.nav-link {
    display: inline-block;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    color: #FFF5E6;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.nav-link.active {
    background: var(--accent-color);
    color: var(--text-color);
    border-color: var(--accent-color);
}

main {
    flex: 1;
    padding: 30px 40px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
    position: relative;
    z-index: 1;
}

/* Panel Sections */
.panel-section {
    background: rgba(255, 255, 255, 0.5);
    padding: 20px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

.panel-section h3 {
    color: var(--primary-color);
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 10px;
    margin-bottom: 15px;
    font-size: 1.2em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Control Panel */
.control-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    background: var(--bg-color);
    padding: 20px;
    border-radius: 4px;
    border: 2px solid var(--border-color);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.file-upload-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.upload-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 30px;
    border: 3px dashed var(--secondary-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, rgba(255, 245, 230, 0.8) 0%, rgba(245, 239, 222, 0.8) 100%);
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1.05em;
}

.upload-label:hover {
    background: linear-gradient(135deg, rgba(255, 245, 230, 1) 0%, rgba(245, 239, 222, 1) 100%);
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.upload-icon {
    font-size: 1.8em;
}

.file-info {
    font-size: 0.9em;
    color: var(--secondary-color);
    font-weight: 500;
}

/* Buttons */
.action-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
}

.action-buttons .btn {
    flex: 1;
    min-width: 150px;
    padding: 30px 20px;
    justify-content: center;
}

.btn {
    padding: 12px 20px;
    border: 2px solid var(--primary-color);
    border-radius: 4px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Georgia', serif;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: #FFF5E6;
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(139, 69, 19, 0.3);
    border-color: var(--accent-color);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--accent-color) 0%, #C9A876 100%);
    color: var(--text-color);
    border-color: var(--secondary-color);
}

.btn-secondary:hover:not(:disabled) {
    background: linear-gradient(135deg, #C9A876 0%, var(--accent-color) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(212, 165, 116, 0.3);
}

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

.button-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.button-grid .btn {
    flex: 1 1 calc(50% - 5px);
    min-width: 200px;
    min-height: 44px;
    justify-content: center;
}

/* Form Styling */
.form-group {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    position: relative;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--primary-color);
    font-size: 0.95em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group label i {
    font-size: 1.1em;
    width: 20px;
    text-align: center;
}

.form-group input,
.form-group select {
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.95em;
    font-family: 'Georgia', serif;
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-color);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 8px rgba(212, 165, 116, 0.3);
}

/* Field change indicators */
.field-modified {
    border-color: var(--modified-color) !important;
    border-width: 2px !important;
    background: rgba(255, 140, 0, 0.05) !important;
}

.field-original {
    border-color: var(--original-color) !important;
}

.field-indicator {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    font-weight: bold;
    pointer-events: none;
    z-index: 10;
}

.field-indicator-modified {
    color: var(--modified-color);
    animation: pulse 2s ease-in-out infinite;
}

.field-indicator-original {
    color: var(--original-color);
    opacity: 0.6;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Field change legend */
.field-legend {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 15px;
    background: rgba(139, 69, 19, 0.08);
    border-radius: 4px;
    margin-bottom: 15px;
    font-size: 0.9em;
    border-left: 3px solid var(--primary-color);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-color);
    font-weight: 500;
}

.legend-item span:first-child {
    font-size: 1.2em;
    width: 20px;
    text-align: center;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

/* Editor Section */
.editor-section {
    display: flex;
    flex-direction: column;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    background: var(--bg-color);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

.editor-tabs {
    display: flex;
    background: var(--paper-dark);
    border-bottom: 2px solid var(--border-color);
    flex-wrap: wrap;
}

.tab-btn {
    flex: 1;
    min-width: 120px;
    padding: 15px 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-color);
    transition: all 0.3s ease;
    position: relative;
    font-family: 'Georgia', serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tab-btn:hover {
    background: rgba(139, 69, 19, 0.1);
}

.tab-btn.active {
    color: #FFF5E6;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-bottom: 3px solid var(--accent-color);
}

.tab-content {
    display: none;
    flex: 1;
    min-height: 500px;
    overflow-y: auto;
}

.tab-content.active {
    display: flex;
}

.vault-panel,
.dwellers-panel,
.rooms-panel,
.wasteland-panel,
.others-panel {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
}

/* JSON Editor */
.json-editor {
    flex: 1;
    padding: 20px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    border: none;
    resize: none;
    outline: none;
    line-height: 1.6;
    color: var(--text-color);
    background: rgba(255, 255, 255, 0.8);
}

/* Search Section */
.search-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.search-box {
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    font-size: 1em;
    transition: border-color 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-color);
    font-family: 'Georgia', serif;
}

.search-box:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 8px rgba(212, 165, 116, 0.3);
}

.search-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
    max-height: 300px;
    overflow-y: auto;
}

.search-result-item {
    padding: 12px;
    background: rgba(255, 255, 255, 0.8);
    border-left: 4px solid var(--accent-color);
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.search-result-item:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateX(5px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.search-result-path {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 4px;
}

.search-result-value {
    color: var(--secondary-color);
    word-break: break-word;
}

/* Dwellers Section */
.dwellers-panel {
    display: grid;
    grid-template-columns: 35% 1fr;
    gap: 20px;
}

.guides-panel {
    display: grid;
    grid-template-columns: 35% 1fr;
    gap: 20px;
}

.guides-list-container {
    border-right: 2px solid var(--border-color);
    padding-right: 20px;
}

.guide-details {
    flex: 1;
}

.dwellers-list-container {
    border-right: 2px solid var(--border-color);
    padding-right: 20px;
}

.dwellers-list-container h3,
.dweller-details h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.search-input {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-bottom: 15px;
    font-family: 'Georgia', serif;
    background: rgba(255, 255, 255, 0.9);
}

.dwellers-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 600px;
    overflow-y: auto;
}

.dweller-item {
    padding: 12px;
    background: rgba(255, 255, 255, 0.9);
    border-left: 4px solid var(--accent-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.dweller-item:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.dweller-item.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: #FFF5E6;
    border-left-color: var(--accent-color);
}

.dweller-item.exploring {
    opacity: 0.7;
    border-left-color: #CD853F;
}

.dweller-item.exploring:hover {
    opacity: 1;
}

.dweller-section-header {
    padding: 12px 12px;
    margin-top: 15px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: #FFF5E6;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 4px;
    font-size: 13px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.dweller-section-header:first-child {
    margin-top: 0;
}

.dweller-section-header.exploring {
    background: linear-gradient(135deg, #CD853F 0%, #A0522D 100%);
}

.dweller-details {
    flex: 1;
}

.back-link {
    display: inline-block;
    margin-bottom: 15px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
}

.back-link:hover {
    color: var(--secondary-color);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin: 20px 0;
    padding: 15px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-item label {
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 5px;
    font-size: 0.9em;
}

.stat-item input {
    width: 100%;
    text-align: center;
    padding: 8px 4px;
}

/* Inspector Specific Styles */
.notice {
    background: #3f3f00;
    border-left: 6px solid #ff9800;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 5px;
    color: #FFD700;
    font-weight: bold;
}

.notice strong {
    color: #ff9800;
}

.upload-section {
    background: var(--bg-color);
    padding: 30px;
    border-radius: 8px;
    border: 2px dashed var(--secondary-color);
    margin-bottom: 30px;
    text-align: center;
}

.section {
    background: rgba(255, 255, 255, 0.5);
    padding: 25px;
    margin-bottom: 20px;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.section h2 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.5em;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 10px;
}

.file-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.info-item {
    background: rgba(255, 255, 255, 0.6);
    padding: 15px;
    border-radius: 5px;
    border: 1px solid var(--border-color);
}

.info-item strong {
    color: var(--primary-color);
    display: block;
    margin-bottom: 5px;
}

.info-item code {
    color: var(--secondary-color);
    word-break: break-all;
    font-family: 'Courier New', monospace;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    background: white;
}

thead {
    background: var(--bg-color);
}

th, td {
    padding: 12px;
    text-align: left;
    border: 1px solid var(--border-color);
    color: var(--text-color);
}

th {
    color: var(--primary-color);
    font-weight: bold;
    background: var(--paper-dark);
}

tr:hover {
    background: rgba(212, 165, 116, 0.1);
}

.stat-card {
    background: var(--bg-color);
    padding: 15px;
    border-radius: 5px;
    border: 1px solid var(--border-color);
    text-align: center;
}

.stat-card .value {
    font-size: 1.8em;
    font-weight: bold;
    color: var(--primary-color);
    margin: 10px 0;
}

.stat-card .label {
    color: var(--text-color);
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status {
    padding: 15px;
    border-radius: 5px;
    margin: 15px 0;
    display: none;
}

.status.show {
    display: block;
}

.status.success {
    background: #E8F5E9;
    border: 1px solid #4CAF50;
    color: #2E7D32;
}

.status.error {
    background: #FFEBEE;
    border: 1px solid #F44336;
    color: #C62828;
}

.status.info {
    background: #E3F2FD;
    border: 1px solid #2196F3;
    color: #1565C0;
}

.disclaimer {
    background: linear-gradient(135deg, rgba(212, 165, 116, 0.1) 0%, rgba(212, 165, 116, 0.05) 100%);
    padding: 20px;
    border-radius: 5px;
    border: 2px solid var(--border-color);
    margin-top: 30px;
    color: var(--text-color);
}

.disclaimer h3 {
    margin-bottom: 10px;
    color: var(--primary-color);
}

.disclaimer ul {
    margin-left: 20px;
    list-style-position: inside;
}

.disclaimer li {
    margin: 5px 0;
}

/* Editor Info */
.editor-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: var(--paper-dark);
    border-top: 1px solid var(--border-color);
    font-size: 0.9em;
    color: var(--text-color);
}

.error {
    color: var(--error-color);
    font-weight: 600;
}

/* Footer */
footer {
    background: var(--paper-dark);
    padding: 25px 40px;
    text-align: center;
    color: var(--text-color);
    font-size: 0.9em;
    border-top: 3px solid var(--primary-color);
    position: relative;
    z-index: 1;
}

footer p {
    margin-bottom: 12px;
    font-weight: 600;
    font-size: 1.1em;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 25px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.footer-links a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    padding: 5px 10px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.footer-links a:hover {
    color: var(--secondary-color);
    background: rgba(139, 69, 19, 0.1);
    transform: translateY(-2px);
}

.footer-section {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(139, 69, 19, 0.2);
    color: rgba(44, 24, 16, 0.7);
}

.footer-section h3 {
    color: rgba(139, 69, 19, 0.8);
    margin-bottom: 12px;
    font-size: 1em;
}

.footer-section p {
    font-weight: 400;
    font-size: 0.9em;
    line-height: 1.5;
}

/* Change History */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.history-item {
    background: var(--paper-color);
    border: 2px solid var(--border-color);
    border-radius: 6px;
    padding: 15px;
    transition: all 0.2s ease;
}

.history-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(139, 69, 19, 0.2);
}

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

.history-item-action {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 15px;
}

.history-item-time {
    font-size: 12px;
    color: rgba(44, 24, 16, 0.6);
}

.history-item-details {
    font-size: 13px;
    color: var(--text-color);
    line-height: 1.4;
}

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

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

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
}

/* Responsive */
@media (max-width: 768px) {
    .control-panel {
        grid-template-columns: 1fr;
    }

    .action-buttons {
        justify-content: stretch;
    }

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

    header h1 {
        font-size: 1.8em;
    }

    main {
        padding: 20px;
    }

    .search-results {
        grid-template-columns: 1fr;
    }

    .dwellers-panel {
        grid-template-columns: 1fr;
    }

    .dwellers-list-container {
        border-right: none;
        border-bottom: 2px solid var(--border-color);
        padding-right: 0;
        padding-bottom: 20px;
    }

    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .editor-tabs {
        overflow-x: auto;
    }

    .tab-btn {
        min-width: 100px;
        font-size: 0.8em;
    }

    .nav-links {
        flex-direction: column;
        gap: 10px;
    }

    .nav-link {
        text-align: center;
        width: 100%;
    }

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

    table {
        font-size: 0.9em;
    }

    th, td {
        padding: 8px;
    }
}

/* Room Editor Styles */
.rooms-panel {
    display: grid;
    grid-template-columns: 35% 1fr;
    gap: 20px;
}

.rooms-list-container {
    border-right: 2px solid var(--border-color);
    padding-right: 20px;
}

.rooms-list-container h3,
.room-details h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rooms-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 600px;
    overflow-y: auto;
}

.room-item {
    padding: 12px;
    background: rgba(255, 255, 255, 0.9);
    border-left: 4px solid var(--accent-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.room-item:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.room-item.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: #FFF5E6;
    border-left-color: var(--accent-color);
}

.room-details {
    flex: 1;
}

.back-link {
    display: inline-block;
    margin-bottom: 15px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
}

.back-link:hover {
    text-decoration: underline;
}

.panel-section {
    margin-bottom: 25px;
}

.panel-section h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.95rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 12px;
}

.form-group {
    display: flex;
    flex-direction: column;
    position: relative;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-color);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: rgba(139, 69, 19, 0.15);
    color: var(--primary-color);
    border-radius: 50%;
    font-size: 0.85rem;
    cursor: help;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.info-icon:hover {
    background: rgba(139, 69, 19, 0.25);
    transform: scale(1.1);
}

.form-group input,
.form-group select {
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: 'Georgia', serif;
    background: rgba(255, 255, 255, 0.95);
    font-size: 0.9rem;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 0 4px rgba(139, 69, 19, 0.1);
}

.form-group input:disabled,
.form-group select:disabled {
    background: rgba(200, 200, 200, 0.3);
    color: #999;
    cursor: not-allowed;
    opacity: 0.6;
}

.form-group input.field-unavailable,
.form-group select.field-unavailable {
    background: rgba(150, 150, 150, 0.15);
    border-color: #ccc;
    color: #888;
}

/* Recipes Editor Styles */
.recipes-checklist {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.recipe-checkbox {
    display: flex;
    align-items: center;
    padding: 10px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.recipe-checkbox:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.recipe-checkbox input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.recipe-checkbox label {
    margin: 0;
    cursor: pointer;
    flex: 1;
    font-size: 0.9rem;
}

.recipe-checkbox input[type="checkbox"]:checked + label {
    color: var(--primary-color);
    font-weight: 600;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.85rem;
}

/* Season Pass Styles */
.seasonpass-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 100%;
    width: 100%;
}

.season-rewards-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-height: 500px;
    overflow-y: auto;
    padding: 15px;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.season-rewards-list h4 {
    margin: 0;
    padding: 10px 0;
    border-bottom: 2px solid var(--border-color);
    font-size: 1.1rem;
}

.season-reward-item {
    padding: 12px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--accent-color);
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    gap: 10px;
}

.season-reward-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.season-reward-item.premium {
    border-left-color: #D4AF37;
    background: rgba(212, 175, 55, 0.05);
}

.reward-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.reward-level {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.9rem;
}

.reward-type {
    font-size: 0.85rem;
    color: #555;
    text-transform: capitalize;
}

.reward-value {
    font-size: 0.8rem;
    color: #888;
    font-style: italic;
}

.reward-title {
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--primary-color);
}

.reward-description {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 8px;
}

.reward-status {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.reward-status.unlocked {
    color: #4CAF50;
}

.reward-status.locked {
    color: #999;
}

/* Toast Animations */
@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

.toast-message {
    transition: all 0.3s ease-out;
}

/* Empty State Styles */
.empty-state {
    padding: 40px 20px;
    text-align: center;
    color: #999;
    font-size: 1.1rem;
    background: rgba(200, 200, 200, 0.1);
    border: 2px dashed #ccc;
    border-radius: 8px;
    margin: 20px 0;
}

.empty-state small {
    display: block;
    margin-top: 10px;
    font-size: 0.85rem;
    color: #aaa;
}

/* Disabled Editor State */
.editor-disabled {
    opacity: 0.5;
    pointer-events: none;
    position: relative;
}

.editor-disabled::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(200, 200, 200, 0.1);
    cursor: not-allowed;
}

.editor-disabled input,
.editor-disabled select,
.editor-disabled button,
.editor-disabled textarea {
    cursor: not-allowed;
}

/* Wasteland Tab Styles */
.wasteland-panel {
    display: grid;
    grid-template-columns: 35% 1fr;
    gap: 20px;
}

.wasteland-teams-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 600px;
    overflow-y: auto;
}

.wasteland-team-item {
    padding: 12px;
    background: rgba(255, 255, 255, 0.9);
    border-left: 4px solid var(--accent-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.wasteland-team-item:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.wasteland-team-item.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: #FFF5E6;
    border-left-color: var(--accent-color);
}

.wasteland-details {
    flex: 1;
}
/* Vault Statistics Section */
.vault-stats-section {
    background: var(--paper-color);
    border-top: 3px solid var(--primary-color);
    padding: 30px;
    margin-top: 20px;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.1);
    position: relative;
    min-height: 300px;
}

.stats-no-data {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.no-data-message {
    text-align: center;
    padding: 40px;
    background: rgba(139, 69, 19, 0.05);
    border: 2px dashed var(--border-color);
    border-radius: 10px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.no-data-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 15px;
    opacity: 0.5;
}

.no-data-message p {
    font-size: 20px;
    color: var(--text-color);
    margin-bottom: 10px;
    font-weight: 600;
}

.no-data-message small {
    font-size: 14px;
    color: rgba(44, 24, 16, 0.6);
}

.vault-stats-section h2 {
    color: var(--primary-color);
    font-size: 28px;
    margin-bottom: 25px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 3px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
    font-weight: bold;
}

.stats-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.stat-card {
    background: linear-gradient(135deg, #F5EFDE 0%, #EDE4D3 100%);
    border: 3px solid var(--primary-color);
    border-radius: 10px;
    padding: 25px;
    transition: all 0.3s ease;
    box-shadow: 
        0 4px 10px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.stat-card:hover {
    border-color: var(--secondary-color);
    box-shadow: 
        0 6px 20px rgba(139, 69, 19, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    transform: translateY(-3px);
}

.stat-card h3 {
    color: var(--primary-color);
    font-size: 20px;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: bold;
    text-shadow: 1px 1px 1px rgba(255, 255, 255, 0.5);
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 5px;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s ease;
}

.stat-row:hover {
    background: rgba(139, 69, 19, 0.08);
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-row span {
    color: var(--text-color);
    font-size: 15px;
    font-weight: 500;
}

.stat-row strong {
    color: var(--primary-color);
    font-size: 18px;
    font-weight: 700;
    text-shadow: 1px 1px 1px rgba(255, 255, 255, 0.5);
}

/* Vault Layout Visualizer */
.vault-layout-section {
    background: var(--paper-color);
    border-top: 3px solid var(--primary-color);
    padding: 30px;
    margin-top: 20px;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.1);
    position: relative;
}

.vault-layout-section h2 {
    color: var(--primary-color);
    font-size: 28px;
    margin-bottom: 25px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 3px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    justify-content: center;
}

.beta-badge {
    background: linear-gradient(135deg, #FF6B6B 0%, #C92A2A 100%);
    color: white;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 600;
    letter-spacing: 1px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.layout-no-data {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px 20px;
}

.vault-grid-container {
    background: linear-gradient(135deg, #F5EFDE 0%, #EDE4D3 100%);
    border: 3px solid var(--primary-color);
    border-radius: 10px;
    padding: 25px;
    max-width: 900px;
    margin: 0 auto;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.vault-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 25px;
}

.room-tile {
    aspect-ratio: 1;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.2);
    padding: 10px;
    text-align: center;
    font-size: 12px;
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    position: relative;
}

.room-tile:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.5);
}

.room-tile.tier-0 {
    background: linear-gradient(135deg, #4CAF50 0%, #388E3C 100%);
}

.room-tile.tier-1 {
    background: linear-gradient(135deg, #2196F3 0%, #1565C0 100%);
}

.room-tile.tier-2 {
    background: linear-gradient(135deg, #9C27B0 0%, #6A1B9A 100%);
}

.room-tile.empty {
    background: linear-gradient(135deg, #9E9E9E 0%, #616161 100%);
    cursor: not-allowed;
    opacity: 0.6;
}

.room-tile-icon {
    font-size: 20px;
    margin-bottom: 5px;
}

.room-tile-name {
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.room-tile-level {
    font-size: 10px;
    opacity: 0.9;
    margin-top: 3px;
}

.grid-legend {
    display: flex;
    gap: 25px;
    justify-content: center;
    flex-wrap: wrap;
    padding-top:2px solid var(--primary-color);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-color);
    font-size: 14px;
    font-weight: 600, 255, 255, 0.8);
    font-size: 14px;
}

.legend-item .room-tile {
    width: 30px;
    height: 30px;
    cursor: default;
    margin: 0;
    padding: 0;
    font-size: 0;
}

.legend-item .room-tile:hover {
    transform: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Inventory Styles */
.inventory-panel {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    height: 100%;
    width: 100%;
    flex: 1;
}

.inventory-subtabs {
    display: flex;
    gap: 5px;
    border-bottom: 2px solid var(--border-color);
    flex-wrap: wrap;
}

.inventory-subtab-btn {
    background: transparent;
    border: none;
    padding: 10px 16px;
    font-size: 13px;
    color: var(--text-color);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    font-weight: 500;
}

.inventory-subtab-btn:hover {
    color: var(--primary-color);
    background: rgba(255, 138, 76, 0.05);
}

.inventory-subtab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.inventory-subtab-content {
    display: none;
    flex: 1;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    min-height: 0;
}

.inventory-subtab-content.active {
    display: flex;
}

.inventory-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.inventory-header h3 {
    margin: 0;
    color: var(--primary-color);
    font-size: 14px;
    flex-shrink: 0;
}

.inventory-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex: 1;
    min-width: 200px;
}

.inventory-actions input {
    flex: 1;
    min-width: 150px;
    padding: 6px 10px;
    font-size: 12px;
}

.inventory-actions button {
    padding: 6px 12px;
    font-size: 12px;
    white-space: nowrap;
    flex-shrink: 0;
}

.inventory-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    overflow-y: auto;
    width: 100%;
    min-height: 0;
}

.inventory-item {
    background: var(--secondary-bg);
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
    display: grid;
    grid-template-columns: 1fr 80px 80px;
    gap: 8px;
    align-items: center;
    font-size: 12px;
    width: 100%;
}

.inventory-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(255, 138, 76, 0.15);
    background: rgba(255, 138, 76, 0.05);
}

.inventory-item-header {
    display: flex;
    gap: 8px;
    align-items: center;
    min-width: 0;
}

.inventory-item-name {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.inventory-item-type {
    font-size: 10px;
    color: #999;
    background: rgba(255, 138, 76, 0.1);
    padding: 2px 6px;
    border-radius: 3px;
    white-space: nowrap;
    flex-shrink: 0;
}

.inventory-item-details {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
}

.inventory-item-stat {
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.inventory-item-stat strong {
    color: var(--text-color);
    font-weight: 600;
}

.inventory-item-actions {
    display: flex;
    gap: 4px;
    justify-self: end;
}

.inventory-item-actions button {
    padding: 4px 8px;
    font-size: 11px;
    flex-shrink: 0;
}

.inventory-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(139, 69, 19, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.inventory-modal.active {
    display: flex;
}

.inventory-modal-content {
    background: var(--paper-color);
    padding: 30px;
    border-radius: 12px;
    border: 2px solid var(--primary-color);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.inventory-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.inventory-modal-header h3 {
    margin: 0;
    color: var(--primary-color);
}

.inventory-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-color);
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.inventory-modal-close:hover {
    color: var(--primary-color);
}

/* Guides / Tutorials styles */
.guides-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 12px;
}

.guide-card {
    background: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(245,239,222,0.9));
    border: 1px solid var(--border-color);
    padding: 14px;
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.guide-card h4 {
    margin: 0;
    color: var(--primary-color);
    font-size: 1.05em;
}

.guide-excerpt {
    color: #3b2a20;
    font-size: 0.9em;
    line-height: 1.3;
}

.guide-actions {
    margin-top: auto;
    display: flex;
    gap: 8px;
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    border-radius: 8px;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.video-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 140px;
    border: 2px dashed var(--border-color);
    color: var(--secondary-color);
    background: linear-gradient(180deg, rgba(255,255,255,0.6), rgba(245,239,222,0.6));
    border-radius: 8px;
    font-weight: 700;
}

/* Extra small screens: improve layout and touch usability */
@media (max-width: 480px) {
    /* reduce heavy paddings that cause horizontal overflow */
    body {
        padding: 10px;
        background-attachment: scroll; /* avoid fixed backgrounds on mobile */
    }

    .container {
        max-width: 100%;
        margin: 0;
        border-radius: 0;
        min-height: auto;
    }

    header {
        padding: 16px 12px;
        text-align: center;
    }

    header h1 {
        font-size: 1.4em;
        line-height: 1.1;
    }

    header p, header .subtitle {
        font-size: 0.95em;
    }

    main {
        padding: 12px;
    }

    .panel-section,
    .section,
    .upload-section,
    .inventory-modal-content,
    .inventory-modal {
        padding: 12px;
    }

    .control-panel {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .action-buttons {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }

    .btn {
        min-width: 0;
        padding: 10px 12px;
        font-size: 0.95em;
    }

    .button-grid .btn {
        min-width: 0;
        flex: 1 1 100%;
    }

    .upload-label {
        padding: 18px;
        font-size: 0.98em;
    }

    /* Collapse multi-column layouts */
    .dwellers-panel,
    .rooms-panel,
    .wasteland-panel,
    .guides-panel {
        grid-template-columns: 1fr;
    }

    .dwellers-list-container,
    .rooms-list-container,
    .guides-list-container {
        border-right: none;
        border-bottom: 2px solid var(--border-color);
        padding-right: 0;
        padding-bottom: 12px;
    }

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

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

    .vault-grid-container,
    .stats-grid-container {
        padding: 8px;
        max-width: 100%;
    }

    .editor-tabs {
        overflow-x: auto;
    }

    .tab-btn {
        min-width: 80px;
        padding: 10px 12px;
        font-size: 0.85em;
    }

    .tab-content {
        min-height: 240px;
    }

    .search-results {
        grid-template-columns: 1fr;
    }

    table {
        font-size: 0.85em;
    }

    th, td {
        padding: 6px 8px;
    }

    footer {
        padding: 12px 10px;
    }

    /* Make interactive targets larger for touch */
    .nav-link,
    .btn,
    .tab-btn,
    .dweller-item,
    .room-item,
    .wasteland-team-item {
        touch-action: manipulation;
        -webkit-tap-highlight-color: rgba(0,0,0,0.05);
    }

    /* Prevent accidental horizontal overflow from long code/text */
    .json-editor,
    .search-result-value,
    .info-item code {
        word-break: break-word;
        white-space: normal;
    }
}