:root {
    --bg-color: #0b0b0d;
    --card-bg: rgba(26, 26, 26, 0.4);
    --text-primary: #ffffff;
    --text-secondary: #a1a1a6;
    --accent-blue: #007AFF;
    --accent-green: #34c759;
    --accent-red: #ff3b30;
    --border-color: rgba(255, 255, 255, 0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
.hidden { display: none !important; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
}

.bg-logo {
    position: fixed;
    top: 50%;
    right: -5%;
    transform: translateY(-50%);
    width: 50%;
    height: 70%;
    background: url('logo.png') no-repeat center;
    background-size: contain;
    opacity: 0.05;
    z-index: -1;
    pointer-events: none;
}

/* FULLSCREEN LAYOUT */
.dashboard-layout {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 100vh;
    display: flex;
    background: #070709;
    z-index: 10;
}

.sidebar {
    width: 280px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(50px);
    -webkit-backdrop-filter: blur(50px);
    border-right: 1px solid var(--border-color);
    padding: 40px 24px;
    display: flex;
    flex-direction: column;
    z-index: 10;
}

.sidebar-header {
    margin-bottom: 48px;
}
.sidebar-header h2 { font-size: 24px; font-weight: 800; letter-spacing: -0.5px; }
.sidebar-header .subtitle { font-size: 13px; color: var(--accent-blue); font-weight: 600; text-transform: uppercase; margin-top: 4px; }

.sidebar-nav {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    background: transparent;
    color: var(--text-secondary);
    border: none;
    padding: 14px 18px;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    transform: translateX(4px);
}

.nav-item.active {
    background: rgba(0, 122, 255, 0.12);
    color: var(--accent-blue);
}

.nav-icon { font-size: 20px; }

.dashboard-content {
    flex: 1;
    overflow-y: auto;
    padding: 60px;
    background: radial-gradient(circle at top right, rgba(0, 122, 255, 0.05), transparent 40%);
}

.main-card {
    max-width: 1000px;
    margin: 0 auto;
}

/* COMPONENTS */
.card {
    background: rgba(255, 255, 255, 0.03);
    padding: 40px;
    border-radius: 28px;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}

.login-container {
    position: fixed;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--bg-color);
    z-index: 1000;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    text-align: center;
}

.login-card h2 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 8px;
}

.login-card .subtitle {
    margin-bottom: 32px;
}

.input-group {
    text-align: left;
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    margin-left: 4px;
}

.input-group input, .input-group select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 14px 18px;
    border-radius: 14px;
    color: white;
    font-size: 16px;
    width: 100%;
    outline: none;
    transition: all 0.3s;
}

.input-group input:focus, .input-group select:focus {
    border-color: var(--accent-blue);
    background: rgba(255, 255, 255, 0.08);
}

.error-text {
    color: var(--accent-red);
    font-size: 14px;
    margin-top: 16px;
    font-weight: 600;
}

.btn-primary {
    background: var(--accent-blue);
    color: white;
    padding: 18px;
    border-radius: 16px;
    font-weight: 700;
    font-size: 17px;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 122, 255, 0.3);
}

/* MOBILE */
@media (max-width: 768px) {
    .dashboard-layout { flex-direction: column; }
    .sidebar { 
        width: 100%; height: auto; padding: 20px; 
        flex-direction: row; justify-content: space-between; align-items: center;
        border-right: none; border-bottom: 1px solid var(--border-color);
    }
    .sidebar-header { margin-bottom: 0; }
    .sidebar-nav, .sidebar-footer { display: none; }
    .dashboard-content { padding: 30px 20px 100px 20px; }
    
    .mobile-nav {
        display: flex; position: fixed; bottom: 0; left: 0; right: 0;
        background: rgba(10, 10, 12, 0.85); backdrop-filter: blur(30px);
        border-top: 1px solid var(--border-color); padding: 14px 0;
        justify-content: space-around; z-index: 1000;
    }
    .mobile-nav-item {
        display: flex; flex-direction: column; align-items: center; gap: 4px;
        background: transparent; border: none; color: var(--text-secondary);
        font-size: 11px; font-weight: 600;
    }
    .mobile-nav-item.active { color: var(--accent-blue); }
}

@media (min-width: 769px) { .mobile-nav { display: none; } }

/* FORM ELEMENTS */
.ios-form-group {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    margin-bottom: 24px;
    overflow: hidden;
}

.ios-input-row {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}
.ios-input-row:last-child { border-bottom: none; }

input, select, textarea {
    background: transparent;
    border: none;
    color: white;
    font-size: 17px;
    width: 100%;
    outline: none;
    padding: 8px 0;
}

.badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
}
.badge-green { background: rgba(52, 199, 89, 0.15); color: #32d74b; }
.badge-red { background: rgba(255, 59, 48, 0.15); color: #ff453a; }

/* LISTS & TABLES */
.list-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 24px;
}

.list-item-row {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 18px;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid var(--border-color);
}

.list-item-row:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: scale(1.01);
}

.action-bar {
    margin-bottom: 24px;
    display: flex;
    justify-content: flex-end;
}

/* MEDIA GRID */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.media-item {
    aspect-ratio: 1;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.media-item:hover {
    transform: scale(1.05);
    border-color: var(--accent-blue);
}

.media-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-item .delete-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 59, 48, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.media-item:hover .delete-btn {
    opacity: 1;
}

/* DIVIDERS & TITLES */
.divider {
    border: none;
    height: 1px;
    background: var(--border-color);
    margin: 24px 0;
}

.header-content h1 {
    font-size: 32px;
    font-weight: 800;
}

.info-text {
    color: var(--text-secondary);
    text-align: center;
    padding: 40px;
    font-style: italic;
}

.full-width { width: 100%; }

/* AI TOLK SPECIFIC */
.status-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.03);
    padding: 20px;
    border-radius: 18px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 18px;
}

.led {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
}
.dot-red { background: #ff3b30; box-shadow: 0 0 15px rgba(255, 59, 48, 0.5); }
.dot-green { background: #34c759; box-shadow: 0 0 15px rgba(52, 199, 89, 0.5); }
.dot-yellow { background: #f59e0b; box-shadow: 0 0 15px rgba(245, 158, 11, 0.6); }
.dot-blue { background: #3b82f6; box-shadow: 0 0 15px rgba(59, 130, 246, 0.5); }

.timer {
    font-family: 'Courier New', Courier, monospace;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.usage-section { margin-bottom: 30px; }
.usage-header { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 12px; font-weight: 700; }
.progress-bar-bg { background: rgba(255, 255, 255, 0.1); height: 8px; border-radius: 4px; overflow: hidden; }
.progress-bar-fill { background: var(--accent-blue); height: 100%; width: 0%; transition: width 0.5s ease; }
.usage-text { font-size: 13px; color: var(--text-secondary); margin-top: 8px; }

.language-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
    margin-top: 20px;
    margin-bottom: 40px;
}

.lang-checkbox {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 14px 12px;
    color: var(--text-secondary, #ccc);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    text-align: center;
}

.lang-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.lang-checkbox .lang-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 100%;
}

.lang-checkbox .lang-name {
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
    transition: color 0.2s ease;
}

.lang-checkbox .listener-count {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color 0.2s ease;
}

.lang-checkbox.checked {
    background: linear-gradient(135deg, rgba(76, 201, 240, 0.15), rgba(76, 201, 240, 0.05));
    border-color: var(--accent-blue, #4cc9f0);
    box-shadow: 0 0 12px rgba(76, 201, 240, 0.2);
    transform: translateY(-2px);
}

.lang-checkbox.checked .lang-name {
    color: var(--accent-blue, #4cc9f0);
}

.lang-checkbox.checked .listener-count {
    color: rgba(76, 201, 240, 0.8);
}

.lang-checkbox:hover:not(.disabled):not(.checked) {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.lang-checkbox.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.01);
    border-color: rgba(255, 255, 255, 0.03);
}

.lang-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 20px 16px;
    border-radius: 16px;
    color: white;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
    font-size: 16px;
    font-weight: 700;
}

.lang-btn.active {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
}

.btn-stop-large {
    background: var(--accent-red) !important;
}

.btn-start-large {
    width: 100%;
    padding: 24px;
    border-radius: 20px;
    background: var(--accent-green);
    color: white;
    font-size: 20px;
    font-weight: 800;
    border: none;
    cursor: pointer;
    margin-bottom: 30px;
    transition: all 0.3s;
}

.btn-start-large.stop { background: var(--accent-red); }

.btn-pause-large {
    width: 100%;
    padding: 18px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.08);
    color: white;
    font-size: 16px;
    font-weight: 700;
    border: 1px solid var(--border-color);
    cursor: pointer;
    margin-bottom: 20px;
    transition: all 0.3s;
}
.btn-pause-large:hover {
    background: rgba(255, 255, 255, 0.15);
}
.btn-pause-large.active {
    background: #f59e0b;
    color: #121214;
    border-color: #f59e0b;
    animation: pulse-orange 1.5s infinite;
}

@keyframes pulse-orange {
    0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(245, 158, 11, 0); }
    100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

.transcript-box {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    height: 150px;
    overflow-y: auto;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* MODAL STYLES */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

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

.modal-content {
    background: var(--bg-color);
    width: 90%;
    max-width: 800px;
    max-height: 80%;
    border-radius: 28px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
}

/* IMAGE PREVIEW BOX */
.image-preview-box {
    width: 100%;
    height: 200px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 16px;
    border: 2px dashed var(--border-color);
    background-size: cover;
    background-position: center;
    margin-bottom: 16px;
}

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

.media-buttons button {
    flex: 1;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: white;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.media-buttons button:hover { background: rgba(255, 255, 255, 0.1); }

/* HIDE SIDEBAR & NAV FOR DEDICATED AI TOLK BROADCAST CONSOLE */
.sidebar, .mobile-nav {
    display: none !important;
}

/* FULL-BLEED DASHBOARD CONTAINER */
.dashboard-content {
    flex: 1;
    padding: 24px !important;
    background: #070709 !important; /* ultra dark */
    min-height: 100%;
    height: auto;
    display: flex;
    flex-direction: column;
}

/* PREMIUM BROADCAST HEADER */
.aitolk-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
    margin-bottom: 20px;
}

.aitolk-header .header-left h1 {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.aitolk-header .header-left .subtitle {
    font-size: 12px;
    color: var(--accent-blue);
    font-weight: 600;
    text-transform: uppercase;
    margin-top: 4px;
    letter-spacing: 0.5px;
}

.aitolk-header .header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.aitolk-header .timer {
    font-family: 'Courier New', Courier, monospace;
    font-size: 20px;
    font-weight: 700;
    color: white;
    background: rgba(255, 255, 255, 0.03);
    padding: 6px 12px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.btn-logout {
    background: rgba(255, 59, 48, 0.1);
    color: var(--accent-red);
    border: 1px solid rgba(255, 59, 48, 0.2);
    padding: 8px 16px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: rgba(255, 59, 48, 0.2);
    transform: translateY(-1px);
}

/* 2-COLUMN DASHBOARD GRID */
.aitolk-dashboard {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 20px;
    flex: 1;
    min-height: auto;
}

@media (max-width: 1024px) {
    .aitolk-dashboard {
        grid-template-columns: 1fr;
    }
}

.aitolk-controls-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.aitolk-feedback-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 0;
}

/* CARDS IN REDESIGN */
.control-card, .feedback-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 20px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.control-card h3, .feedback-card h3 {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.3px;
    margin-bottom: 6px;
}

.usage-card {
    padding: 16px;
}

/* FULLSCREEN TEXT BOXES */
.transcript-panel {
    display: flex;
    flex-direction: column;
    height: 280px;
    max-height: 280px;
}

.transcript-box-fullscreen {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-primary);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3);
}

.log-panel {
    height: 180px;
    display: flex;
    flex-direction: column;
}

.log-box-fullscreen {
    background: #050507;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 10px 14px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 13px;
    color: #32d74b;
    flex: 1;
    overflow-y: auto;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
}

.info-footnote {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 8px;
}

/* COOKIE & PRIVACY BANNER */
.cookie-banner {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 600px;
    background: rgba(20, 20, 24, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 16px 20px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
    z-index: 1000;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

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

.cookie-content p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

.btn-cookie {
    background: var(--accent-blue);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.2s;
}

.btn-cookie:hover {
    opacity: 0.85;
}

/* ==========================================================================
   PREKENOPPTAK & PODCAST-BESKJÆRING
   ========================================================================== */
.recording-panel-card {
    background: var(--card-bg);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 18px 24px;
    margin-bottom: 24px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.recording-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.recording-status-badge {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    border-radius: 6px;
    transition: all 0.2s;
}

.badge-idle {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
}

.badge-recording {
    background: rgba(255, 59, 48, 0.15);
    color: #ff453a;
    border: 1px solid rgba(255, 59, 48, 0.35);
    animation: recPulse 1.5s infinite;
}

.badge-finished {
    background: rgba(52, 199, 89, 0.15);
    color: var(--accent-green);
    border: 1px solid rgba(52, 199, 89, 0.3);
}

@keyframes recPulse {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.65; transform: scale(0.98); }
    100% { opacity: 1; transform: scale(1); }
}

.rec-timer {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 17px;
    font-weight: 700;
    color: #ff453a;
    background: rgba(255, 59, 48, 0.12);
    border: 1px solid rgba(255, 59, 48, 0.25);
    padding: 6px 14px;
    border-radius: 8px;
}

.btn-rec-start {
    background: #ff3b30;
    color: white;
    border: none;
    border-radius: 12px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 14px rgba(255, 59, 48, 0.35);
}

.btn-rec-start:hover {
    background: #e03126;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(255, 59, 48, 0.45);
}

.rec-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: white;
    display: inline-block;
}

.btn-rec-stop {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border: 1px solid rgba(255, 59, 48, 0.6);
    border-radius: 12px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-rec-stop:hover {
    background: rgba(255, 59, 48, 0.2);
    border-color: #ff3b30;
}

.rec-square {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    background: #ff3b30;
    display: inline-block;
}

.recording-visualizer-container {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--border-color);
    animation: fadeInRec 0.3s ease;
}

@keyframes fadeInRec {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.waveform-wrapper {
    position: relative;
    width: 100%;
    height: 110px;
    background: rgba(0, 0, 0, 0.55);
    border-radius: 12px;
    overflow: visible;
    border: 1px solid var(--border-color);
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
    user-select: none;
    margin-top: 36px;
    margin-bottom: 16px;
}

#waveformCanvas {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 11px;
}

.trimmer-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: visible;
}

.trimmer-dim-left {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    background: rgba(7, 7, 9, 0.78);
    pointer-events: auto;
    will-change: width;
}

.trimmer-dim-right {
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    background: rgba(7, 7, 9, 0.78);
    pointer-events: auto;
    will-change: width;
}

.trimmer-selection {
    position: absolute;
    top: 0;
    bottom: 0;
    background: rgba(0, 122, 255, 0.08);
    border: 2px solid var(--accent-blue);
    border-radius: 11px;
    box-sizing: border-box;
    pointer-events: auto;
    will-change: left, width;
}

.trimmer-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 34px;
    cursor: ew-resize;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    touch-action: none;
    pointer-events: auto;
}

.handle-left {
    left: 0;
    transform: translateX(-50%);
}

.handle-right {
    right: 0;
    transform: translateX(50%);
}

.handle-line {
    width: 4px;
    height: 52px;
    background: var(--accent-blue);
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(0, 122, 255, 0.9);
}

.handle-label {
    position: absolute;
    font-size: 8.5px;
    font-weight: 800;
    color: white;
    background: var(--accent-blue);
    padding: 2px 6px;
    border-radius: 4px;
    pointer-events: none;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
    white-space: nowrap;
}

.handle-label.label-left {
    top: 6px;
    left: 16px;
}

.handle-label.label-right {
    bottom: 6px;
    right: 16px;
}

.trimmer-playhead {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    margin-left: -1px;
    background: #4cc9f0;
    box-shadow: 0 0 10px #4cc9f0, 0 0 2px #ffffff;
    z-index: 25;
    cursor: ew-resize;
    pointer-events: auto;
    touch-action: none;
    transition: none;
}

/* Sirkel plassert på bunnen av nålen / på kanten av vinduet */
.trimmer-playhead::before {
    content: '';
    position: absolute;
    bottom: -9px;
    left: 50%;
    transform: translateX(-50%);
    box-sizing: border-box;
    width: 18px;
    height: 18px;
    background: #4cc9f0;
    border: 2px solid #ffffff;
    border-radius: 50%;
    box-shadow: 0 0 12px rgba(76, 201, 240, 1), 0 2px 6px rgba(0, 0, 0, 0.6);
    cursor: grab;
    z-index: 26;
    transition: transform 0.15s ease;
}

.trimmer-playhead:active::before {
    cursor: grabbing;
    transform: translateX(-50%) scale(1.25);
}

.trimmer-playhead::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 26px;
    cursor: ew-resize;
    z-index: 25;
}

.playhead-badge {
    position: absolute;
    bottom: 100%;
    margin-bottom: 8px;
    left: 0;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.95);
    color: #4cc9f0;
    border: 1px solid rgba(76, 201, 240, 0.6);
    border-radius: 8px;
    padding: 4px 10px;
    font-size: 11px;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
    z-index: 35;
    text-align: center;
    backdrop-filter: blur(8px);
}

.trimmer-meta-bar {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.trimmer-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
}

.trim-time-group {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.trim-label {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.trim-val {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-weight: 700;
    color: var(--text-primary);
    font-size: 14px;
}

.trim-time-group.highlight .trim-val {
    color: var(--accent-blue);
}

.trim-translations-badge {
    font-size: 12px;
    color: var(--accent-green);
    background: rgba(52, 199, 89, 0.1);
    border: 1px solid rgba(52, 199, 89, 0.25);
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 600;
}

.trimmer-actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 14px;
}

.btn-trim-primary {
    background: var(--accent-blue);
    color: white;
    border: none;
    padding: 9px 18px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

.btn-trim-primary:hover {
    background: #0069d9;
    transform: translateY(-1px);
}

.btn-trim-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-trim-download {
    background: rgba(76, 201, 240, 0.12);
    color: #4cc9f0;
    border: 1px solid rgba(76, 201, 240, 0.3);
    padding: 9px 16px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-trim-download:hover {
    background: rgba(76, 201, 240, 0.22);
    border-color: #4cc9f0;
    transform: translateY(-1px);
}

.btn-trim-download:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-trim-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 9px 15px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-trim-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.btn-trim-danger {
    background: transparent;
    color: #ff453a;
    border: 1px solid rgba(255, 69, 58, 0.3);
    padding: 9px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-trim-danger:hover {
    background: rgba(255, 69, 58, 0.15);
    border-color: #ff453a;
}

/* Modal for lagret opptak */
.rec-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    animation: fadeInRec 0.2s ease;
}

.rec-modal-card {
    background: #141416;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 32px 28px;
    max-width: 480px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.rec-modal-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(52, 199, 89, 0.15);
    border: 1px solid rgba(52, 199, 89, 0.35);
    color: var(--accent-green);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px auto;
}

/* ==========================================================================
   TO-KNAPPER LAYOUT FOR TOLK OG OPPTAK
   ========================================================================== */
.main-buttons-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
}

.btn-tolk-start {
    background: #34c759;
    color: white;
    border: none;
    border-radius: 12px;
    padding: 14px 10px;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: 0 4px 14px rgba(52, 199, 89, 0.35);
}

.btn-tolk-start:hover {
    background: #2db84c;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(52, 199, 89, 0.45);
}

.btn-tolk-stop {
    background: rgba(255, 59, 48, 0.15);
    color: #ff453a;
    border: 1px solid rgba(255, 59, 48, 0.5);
    border-radius: 12px;
    padding: 14px 10px;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.btn-tolk-stop:hover {
    background: rgba(255, 59, 48, 0.25);
    border-color: #ff3b30;
}

.btn-both-start {
    background: linear-gradient(135deg, #007AFF 0%, #ff3b30 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 14px 10px;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: 0 4px 14px rgba(255, 59, 48, 0.3);
}

.btn-both-start:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(255, 59, 48, 0.45);
    filter: brightness(1.08);
}

.btn-rec-start-state {
    background: #ff3b30;
    color: white;
    border: none;
    border-radius: 12px;
    padding: 14px 10px;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: 0 4px 14px rgba(255, 59, 48, 0.35);
}

.btn-rec-start-state:hover {
    background: #e03126;
    transform: translateY(-1px);
}

.btn-rec-stop-state {
    background: rgba(255, 59, 48, 0.15);
    color: #ff453a;
    border: 1px solid rgba(255, 59, 48, 0.5);
    border-radius: 12px;
    padding: 14px 10px;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.btn-rec-stop-state:hover {
    background: rgba(255, 59, 48, 0.25);
    border-color: #ff3b30;
}

/* ==========================================================================
   TRIMMER ZOOM & PANORERING + INTERAKTIV SETNINGSMARKERING I LOGG/UTSKRIFT
   ========================================================================== */
.trimmer-zoom-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 6px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 10px;
}

.zoom-controls-group,
.pan-controls-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.zoom-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-blue);
    margin-right: 4px;
}

.btn-zoom-ctrl {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 7px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.btn-zoom-ctrl:hover:not(:disabled) {
    background: rgba(76, 201, 240, 0.16);
    border-color: rgba(76, 201, 240, 0.45);
    color: #ffffff;
}

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

.transcript-sentence-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 12px;
    margin-bottom: 6px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.025);
    border-left: 3px solid rgba(76, 201, 240, 0.4);
    transition: background 0.15s ease, opacity 0.15s ease, border-color 0.15s ease;
}

.transcript-sentence-row:hover {
    background: rgba(255, 255, 255, 0.06);
}

.transcript-sentence-row.outside-trim {
    opacity: 0.42;
    border-left-color: rgba(255, 255, 255, 0.12);
}

.transcript-sentence-row.is-trim-start {
    border-left-color: #34c759;
    background: rgba(52, 199, 89, 0.09);
}

.transcript-sentence-row.is-trim-end {
    border-left-color: #007AFF;
    background: rgba(0, 122, 255, 0.1);
}

.sentence-meta,
.transcript-sentence-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.sentence-num,
.transcript-sentence-num {
    background: rgba(255, 255, 255, 0.06);
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 3px 7px;
    border-radius: 5px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 11px;
    font-weight: 600;
    min-width: 34px;
    text-align: center;
    flex-shrink: 0;
}

.sentence-time {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    line-height: 1.25;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 11px;
    color: #94a3b8;
    font-weight: 600;
    flex-shrink: 0;
}

.sentence-text,
.transcript-sentence-text {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 14px;
    line-height: 1.45;
    color: var(--text-primary);
    word-break: normal;
    overflow-wrap: break-word;
    cursor: pointer;
    padding: 2px 4px;
}

.sentence-actions,
.transcript-sentence-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    flex-shrink: 0;
}

.btn-sentence-trim {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 7px;
    padding: 7px 11px;
    min-height: 32px;
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-sentence-trim:hover {
    background: rgba(76, 201, 240, 0.2);
    color: #ffffff;
    border-color: #4cc9f0;
}

.btn-sentence-trim.active-start {
    background: #34c759;
    color: #ffffff;
    border-color: #34c759;
}

.btn-sentence-trim.active-end {
    background: #007AFF;
    color: #ffffff;
    border-color: #007AFF;
}

.log-sentence-btn {
    background: rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 10.5px;
    font-weight: 700;
    cursor: pointer;
    margin-left: 4px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.log-sentence-btn:hover {
    background: rgba(76, 201, 240, 0.25);
    color: #ffffff;
    border-color: #4cc9f0;
}

.server-session-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    transition: all 0.15s ease;
}

.server-session-item:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(76, 201, 240, 0.4);
}

.trimmer-progress-container {
    margin-top: 12px;
    padding: 10px 14px;
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(76, 201, 240, 0.35);
    border-radius: 10px;
}

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

.trimmer-progress-label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.trimmer-progress-pct {
    font-size: 12px;
    font-weight: 700;
    color: #4cc9f0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    flex-shrink: 0;
}

.trimmer-progress-track {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    overflow: hidden;
}

.trimmer-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #007AFF 0%, #4cc9f0 100%);
    border-radius: 999px;
    transition: width 0.2s ease-out;
}

