body, html {
    margin: 0;
    padding: 0;
    height: 100vh;
    font-family: sans-serif;
    background: #1e1e1e;
    color: #fff;
}

/* --- Portal / Entry Panel --- */
#portal-view {
    padding: 2rem;
    max-width: 800px;
    margin: 0 auto;
}
#setup-container h2 {
    margin-top: 0;
}
input[type="text"] {
    width: 100%;
    padding: 0.75rem;
    background: #2d2d2d;
    color: #fff;
    border: 1px solid #444;
    border-radius: 4px;
    font-size: 1rem;
    box-sizing: border-box;
    margin-bottom: 1.5rem;
    transition: border-color 0.2s;
}
input[type="text"]:focus {
    border-color: #007bff;
    outline: none;
}

/* Search Container Specifics */
#search-container {
    margin-bottom: 1rem;
}
#search-input {
    border-color: #555;
    background: #252525;
}

/* --- Menu Grid --- */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}
.nav-btn {
    background: #2d2d2d;
    border: 1px solid #444;
    color: #fff;
    padding: 1rem;
    border-radius: 6px;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s, border-color 0.2s;
    display: flex;
    flex-direction: column;
}
.nav-btn:hover {
    background: #3a3a3a;
    border-color: #007bff;
}
.nav-btn .title {
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    word-break: break-all;
}
.nav-btn .subtitle {
    font-size: 0.8rem;
    color: #aaa;
}

/* --- Search Snippets --- */
.snippet-container {
    margin-top: 0.75rem;
    border-top: 1px solid #444;
    padding-top: 0.5rem;
    width: 100%;
}
.snippet-section {
    margin-top: 0.5rem;
    font-size: 0.85rem;
}
.snippet-section strong {
    color: #007bff;
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.75rem;
    text-transform: uppercase;
}
.snippet {
    font-size: 0.85rem;
    color: #ccc;
    background: #222;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    border-radius: 4px;
    white-space: normal;
    line-height: 1.4;
}
mark {
    background-color: #007bff;
    color: #fff;
    border-radius: 2px;
    padding: 0 3px;
}

.status-msg {
    color: #aaa;
    font-style: italic;
    font-size: 1.1rem;
    margin-top: 1rem;
}

/* --- Split Screen Layout --- */
#app-container {
    display: none;
    height: 100vh;
    width: 100vw;
}

/* Left Side: Images */
#left-panel {
    flex: 1;
    overflow-y: auto;
    background: #121212;
    padding: 1rem;
    border-right: 2px solid #333;
    position: relative;
}
.back-btn {
    display: inline-block;
    margin-bottom: 2rem;
    padding: 0.5rem 1rem;
    background: #333;
    color: #fff;
    border: 1px solid #555;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.9rem;
}
.back-btn:hover {
    background: #444;
}
.image-container {
    margin-bottom: 3rem;
    text-align: center;
}
.image-container img {
    max-width: 100%;
    height: auto;
    border: 3px solid transparent;
    transition: border 0.3s;
    cursor: pointer;
    border-radius: 4px;
}
.image-container.active img {
    border: 3px solid #007bff;
}
.image-name {
    font-size: 0.85rem;
    color: #888;
    margin-top: 0.5rem;
}

/* Right Side: Transcription */
#right-panel {
    flex: 1;
    background: #f4f1ea;
    color: #222;
    overflow: hidden;
    position: relative;
    scroll-behavior: smooth;
}
#transcription-content {
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    padding: 2.5rem;
    
    font-family: 'Courier New', Courier, monospace; 
    font-size: 1.1rem;
    line-height: 1.5;
    white-space: pre; 
    
    overflow: auto;
    cursor: grab;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
#transcription-content::-webkit-scrollbar {
    display: none;
}
#transcription-content:active {
    cursor: grabbing;
}

#loading-text {
    display: none;
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.2rem;
    color: #666;
    font-family: sans-serif;
}