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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f4f4;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.status-card {
    margin: 4rem auto 0;
    max-width: 720px;
    background: #fff;
    border-radius: 14px;
    padding: 2.5rem;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
}

.logo-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.logo-mark {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: linear-gradient(135deg, #1a2b6d, #2b88d8);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    letter-spacing: 1px;
    font-size: 1.1rem;
}

.status-meta {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 1.5rem;
    color: #2a2a2a;
}

.pin-form {
    display: grid;
    gap: 0.75rem;
}

.pin-form label {
    font-weight: 600;
    color: #1a2b6d;
}

.pin-form input {
    padding: 0.75rem 0.9rem;
    border: 1px solid #ccd6e0;
    border-radius: 8px;
    font-size: 1rem;
}

.pin-form button {
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 8px;
    background: #1a2b6d;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

.pin-form button:hover {
    background: #142152;
}

.error-text {
    color: #b00020;
    font-weight: 600;
}

.muted {
    color: #6c6c6c;
}

.staff-header {
    background: linear-gradient(135deg, #0f1d4a, #0f2f6d);
    color: #fff;
    padding: 1.5rem 0;
    box-shadow: 0 8px 20px rgba(15, 29, 74, 0.25);
}

.header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.staff-nav {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.staff-nav .nav-link {
    color: #fff;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.12);
    font-weight: 600;
}

.staff-nav .nav-link:hover {
    background: rgba(255, 255, 255, 0.2);
}

.dashboard {
    margin-top: 2.5rem;
}

.hero-card {
    background: linear-gradient(135deg, #ffffff, #f2f6ff);
    border-radius: 16px;
    padding: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 12px 30px rgba(15, 29, 74, 0.1);
    gap: 1.5rem;
    flex-wrap: wrap;
    border: 1px solid #e1e8f6;
}

.health-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.health-card {
    background: #fff;
    border-radius: 14px;
    padding: 1.5rem;
    border: 1px solid #e3e8f3;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.health-card h3 {
    margin-top: 0;
    color: #0f1d4a;
}

.health-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.metric {
    background: #f4f7ff;
    border-radius: 10px;
    padding: 0.75rem;
    border: 1px solid #e1e8f6;
}

.metric-label {
    display: block;
    font-size: 0.85rem;
    color: #43507b;
    margin-bottom: 0.25rem;
    text-transform: capitalize;
}

.metric-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: #0f1d4a;
}

.health-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0 0;
    display: grid;
    gap: 0.75rem;
}

.health-list li {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.5rem 1rem;
    align-items: center;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    background: #f9fbff;
    border: 1px solid #e3e8f3;
}

.health-actions {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}

.action-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.action-result {
    background: #f9fbff;
    border: 1px solid #e3e8f3;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    word-break: break-word;
}

.health-name {
    font-weight: 600;
    color: #0f1d4a;
    text-transform: capitalize;
}

.health-badge {
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: capitalize;
}

.health-badge.ok {
    background: #d1fae5;
    color: #065f46;
}

.health-badge.error {
    background: #fee2e2;
    color: #991b1b;
}

.health-badge.unavailable {
    background: #e5e7eb;
    color: #374151;
}

.health-detail {
    grid-column: 1 / -1;
    font-size: 0.85rem;
    color: #6b7280;
}

.hero-card h2 {
    margin: 0;
    color: #0f1d4a;
    font-size: 2rem;
}

.hero-tag {
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #2b58b8;
    margin-bottom: 0.5rem;
}

.status-chip {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    background: #e8eefc;
    color: #0f1d4a;
    padding: 0.75rem 1.25rem;
    border-radius: 10px;
    font-weight: 600;
}

.status-chip small {
    font-weight: 400;
    color: #43507b;
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.action-card {
    background: #fff;
    border-radius: 14px;
    padding: 1.5rem;
    text-decoration: none;
    color: #1b1b1b;
    border: 1px solid #e3e8f3;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}

.action-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
}

.action-card h3 {
    margin-top: 0;
    color: #0f1d4a;
}

.action-card p {
    color: #4a4a4a;
}

.card-icon {
    font-size: 1.8rem;
    margin-bottom: 0.75rem;
}

.card-link {
    display: inline-block;
    margin-top: 0.75rem;
    font-weight: 600;
    color: #2b58b8;
}

/* Header */
header {
    background: linear-gradient(135deg, #0078d4 0%, #005a9e 100%);
    color: white;
    padding: 1.5rem 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

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

header h1 {
    font-size: 1.75rem;
    font-weight: 600;
    margin: 0;
}

header nav {
    display: flex;
    gap: 0.5rem;
}

header nav a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1.25rem;
    border-radius: 6px;
    transition: all 0.3s;
    font-weight: 500;
}

header nav a:hover {
    background-color: rgba(255,255,255,0.2);
    transform: translateY(-1px);
}

header nav a.active {
    background-color: rgba(255,255,255,0.25);
    font-weight: 600;
}

/* Main Content */
main {
    background-color: white;
    margin: 2rem auto;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    min-height: 500px;
}

h2 {
    color: #0078d4;
    margin-bottom: 0.5rem;
    font-size: 2rem;
    font-weight: 700;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #e1e1e1;
}

.filters {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
    padding: 1rem 1.25rem;
    background: #f7f9ff;
    border-radius: 10px;
    border: 1px solid #e1e8f6;
    margin-bottom: 1.5rem;
}

.filters label {
    font-weight: 600;
    color: #0f1d4a;
}

.filters select {
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    border: 1px solid #ccd6e0;
}

.table-wrap {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e3e8f3;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.06);
    padding: 1rem;
    overflow-x: auto;
}

.transcript-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.transcript-table thead th {
    background: #f1f5ff;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid #dbe3f3;
}

.transcript-table tbody td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid #eef2f8;
    vertical-align: middle;
}

.transcript-table tbody tr:nth-child(even) {
    background: #fafbff;
}

.transcript-table tbody tr:hover {
    background: #eef3ff;
}

.segment.active {
    background: #f3f7ff;
    border-left: 3px solid #1a63d1;
}

.word.active {
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

.segment.match-text {
    border-left: 3px solid #ffb020;
    background: #fff8e6;
}

.segment-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.segment-speaker-label {
    font-weight: 700;
    color: #1a63d1;
}

.segment-speaker-edit {
    border: none;
    background: #e6eefc;
    color: #1a63d1;
    border-radius: 999px;
    padding: 0.2rem 0.6rem;
    font-size: 0.75rem;
    cursor: pointer;
}

.segment-speaker-input {
    padding: 0.35rem 0.5rem;
    border-radius: 6px;
    border: 1px solid #ccd6e0;
    font-size: 0.85rem;
    width: 180px;
    display: none;
}

.speaker-editor {
    display: grid;
    gap: 0.75rem;
    margin: 1rem 0 1.5rem;
}

.speaker-editor-row {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 0.75rem;
    align-items: center;
}

.speaker-editor-row label {
    font-weight: 600;
    color: #0f1d4a;
}

.speaker-editor-row input {
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    border: 1px solid #ccd6e0;
}

.transcript-panel {
    margin-top: 2rem;
    background: #fff;
    border: 1px solid #e3e8f3;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}

.advanced-labels-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.advanced-labels-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.advanced-labels-results {
    display: grid;
    gap: 0.75rem;
    margin-top: 1rem;
}

.advanced-label-card {
    border: 1px solid #e3e8f3;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    background: #f9fbff;
}

.advanced-label-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.advanced-label-title {
    font-weight: 700;
    color: #0f1d4a;
}

.advanced-label-badge {
    background: #1a63d1;
    color: #fff;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
}

.advanced-label-confidence {
    background: #e6eefc;
    color: #1a63d1;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.advanced-label-reasons {
    list-style: none;
    padding: 0;
    margin: 0.6rem 0 0;
    display: grid;
    gap: 0.35rem;
    color: #48536a;
    font-size: 0.85rem;
}

.transcript-table th {
    text-align: left;
    color: #0f1d4a;
    font-weight: 700;
}

.page-subtitle {
    color: #666;
    font-size: 1.05rem;
    margin-top: 0.5rem;
}

.stats-badge {
    background: linear-gradient(135deg, #0078d4 0%, #005a9e 100%);
    color: white;
    padding: 1.25rem 1.75rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 120, 212, 0.2);
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
}

.stat-label {
    display: block;
    font-size: 0.85rem;
    margin-top: 0.25rem;
    opacity: 0.9;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.stats-card {
    background: #fff;
    border: 1px solid #e3e8f3;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
    display: grid;
    gap: 0.35rem;
}

.stats-section {
    margin-top: 2.5rem;
}

.alert {
    padding: 1rem 1.25rem;
    border-radius: 10px;
    margin: 1rem 0 1.5rem;
    font-weight: 600;
}

.alert-warning {
    background: #fff7e6;
    color: #7a4a00;
    border: 1px solid #ffe0a3;
}

.agent-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.agent-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e3e8f3;
    padding: 1rem;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
    display: grid;
    gap: 0.35rem;
}

.agent-name {
    font-weight: 700;
    color: #0f1d4a;
}

.agent-role {
    color: #5b647a;
    font-size: 0.9rem;
}

.agent-stage {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    width: fit-content;
}

.agent-stage.design {
    background: #e0f2fe;
    color: #075985;
}

.agent-stage.implementation {
    background: #e6f7ed;
    color: #166534;
}

.agent-stage.testing {
    background: #f3e8ff;
    color: #6b21a8;
}

.agent-stage.deployment {
    background: #fee2e2;
    color: #991b1b;
}

.agent-stage.all {
    background: #e5e7eb;
    color: #374151;
}

h3 {
    color: #333;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

/* Transcript Grid */
.transcript-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.transcript-card {
    background: white;
    border: 2px solid #e1e1e1;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.transcript-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    border-color: #0078d4;
}

.transcript-card.ready {
    border-color: #e1e1e1;
}

.transcript-card.processing {
    border-color: #ffa500;
    background: linear-gradient(to bottom, #fffbf0 0%, white 50px);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem;
    background: linear-gradient(to bottom, #f8f9fa 0%, white 100%);
    border-bottom: 1px solid #e1e1e1;
}

.file-icon {
    font-size: 2rem;
}

.card-body {
    padding: 1.25rem;
    flex: 1;
}

.file-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin: 0 0 1rem 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #666;
}

.meta-icon {
    font-size: 1rem;
}

.meta-value {
    font-weight: 500;
}

.card-footer {
    padding: 1rem 1.25rem 1.25rem;
}

.status-badge {
    padding: 0.375rem 0.875rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.status-ready {
    background-color: #d1f2d1;
    color: #107c10;
}

.status-processing {
    background-color: #fff4e5;
    color: #ff8c00;
}

.text-muted {
    color: #999;
    font-style: italic;
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(to bottom, #f8f9fa 0%, white 100%);
    border-radius: 12px;
    border: 2px dashed #ddd;
    margin-top: 2rem;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    color: #333;
    font-size: 1.5rem;
    margin: 1rem 0 0.5rem;
}

.empty-state p {
    color: #666;
    font-size: 1.05rem;
    margin-bottom: 1.5rem;
}

.empty-hint {
    background-color: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    padding: 1rem 1.5rem;
    display: inline-block;
    text-align: left;
    color: #555;
    font-size: 0.95rem;
}

.empty-hint strong {
    color: #0078d4;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
}

.btn-block {
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #0078d4 0%, #005a9e 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 120, 212, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 120, 212, 0.4);
}

.btn-disabled {
    background-color: #e1e1e1;
    color: #999;
    cursor: not-allowed;
}

.btn-icon {
    font-size: 1.2rem;
    font-weight: 700;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
    transform: translateY(-2px);
}

/* Audio Player */
.audio-player {
    margin: 2rem 0;
    padding: 1.5rem;
    background-color: #f8f8f8;
    border-radius: 8px;
}

.audio-panel {
    margin: 2rem 0;
    padding: 1.5rem;
    background-color: #f8f8f8;
    border-radius: 12px;
    border: 1px solid #e2e6f0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(15, 29, 74, 0.1);
}

.audio-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.audio-controls .btn {
    padding: 0.6rem 1.25rem;
    border-radius: 8px;
    border: none;
    background: #1a63d1;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

.audio-controls .btn:hover {
    background: #154faa;
}

.speed-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: #0f1d4a;
}

.speed-label select {
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    border: 1px solid #ccd6e0;
}

.audio-time {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.95rem;
    font-weight: 600;
    color: #0f1d4a;
    background: #e8f0fe;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    min-width: 110px;
    text-align: center;
}

.waveform {
    width: 100%;
    height: 96px;
}

/* Transcript View */
.transcript-view {
    max-width: 1000px;
}

.transcript-container {
    margin-top: 2rem;
}

.transcript-text {
    background-color: #fafafa;
    padding: 2rem;
    border-radius: 8px;
    max-height: 600px;
    overflow-y: auto;
    line-height: 2;
}

.transcript-tools {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.search-input {
    flex: 1;
    max-width: 400px;
    padding: 0.5rem 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.search-option {
    font-size: 0.95rem;
    color: #555;
}

.search-stats {
    margin-left: auto;
    color: #666;
    font-size: 0.9rem;
}

.segment {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: white;
    border-left: 4px solid #0078d4;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.segment:hover {
    background-color: #f0f7ff;
}

.segment.hidden {
    display: none;
}

.speaker {
    font-weight: 600;
    color: #0078d4;
    display: block;
    margin-bottom: 0.5rem;
}

.word {
    display: inline;
    padding: 2px 4px;
    transition: background-color 0.2s;
    cursor: pointer;
}

.word:hover {
    background-color: #e1f0ff;
}

.word.active {
    background-color: #ffeb3b;
    font-weight: 700;
    text-decoration: underline;
    text-decoration-thickness: 2px;
}

.word.match {
    background-color: #a7f3d0; /* teal-200 */
}

/* Word editing */
.word.edited {
    background-color: #fef3c7; /* amber-100 - indicates edited */
    border-bottom: 2px solid #f59e0b; /* amber-500 */
    cursor: help;
}

/* Non-English / Māori words — soft teal underline for quick visual review */
.word.word-foreign {
    border-bottom: 2px dotted #0d9488; /* teal-600 */
    background-color: #f0fdfa; /* teal-50 */
    border-radius: 2px;
    cursor: help;
}
.word.word-foreign:hover {
    background-color: #ccfbf1; /* teal-100 */
}
/* Don't double-style if also edited */
.word.word-foreign.edited {
    background-color: #fef3c7;
    border-bottom: 2px solid #f59e0b;
}

.word.edited:hover {
    background-color: #fde68a; /* amber-200 */
}

.word.edited.showing-original {
    background-color: #dbeafe; /* blue-100 - showing original */
    border-bottom: 2px dashed #3b82f6; /* blue-500 */
}

.word.edited.showing-original:hover {
    background-color: #bfdbfe; /* blue-200 */
}

#toggleOriginalView.active {
    background-color: #3b82f6;
    color: #fff;
}

.word-edit-input {
    display: inline-block;
    font: inherit;
    font-size: 1rem;
    padding: 2px 4px;
    border: 2px solid #3b82f6;
    border-radius: 4px;
    outline: none;
    min-width: 60px;
    max-width: 200px;
    background: #eff6ff;
}

.word-edit-input:focus {
    border-color: #2563eb;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

/* Word edit panel */
.word-edit-panel {
    background: #fffbeb;
    border: 1px solid #fcd34d;
}

.word-edit-stats {
    font-size: 0.9rem;
    color: #92400e;
    margin-bottom: 1rem;
}

/* Combined view - continuous text flow */
.combined-view {
    max-height: 70vh;
    overflow-y: auto;
}

.combined-words {
    line-height: 1.8;
    font-size: 1rem;
    color: #333;
}

.combined-words .word {
    display: inline;
    margin: 0 1px;
}

.timestamp {
    display: inline-block;
    margin-left: 1rem;
    color: #999;
    font-size: 0.9rem;
    font-family: monospace;
}

/* Controls */
.controls {
    margin-top: 2rem;
    text-align: center;
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Error Message */
.error-message {
    text-align: center;
    padding: 3rem;
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
    border-radius: 8px;
    color: #856404;
}

.error-message h2 {
    color: #856404;
    border: none;
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(12, 19, 33, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    z-index: 1000;
}

.modal.is-open {
    display: flex;
}

.modal-content {
    background: #fff;
    border-radius: 16px;
    width: min(520px, 100%);
    box-shadow: 0 20px 40px rgba(15, 29, 74, 0.25);
    border: 1px solid #e3e8f3;
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.5rem 1.5rem 0.75rem;
}

.modal-header h3 {
    margin: 0;
    color: #0f1d4a;
}

.modal-close {
    border: none;
    background: #f2f5fb;
    color: #2c3e50;
    font-size: 1.5rem;
    line-height: 1;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
}

.modal-close:hover {
    background: #e0e8f7;
}

.modal-body {
    padding: 0 1.5rem 1.5rem;
}

.modal-loading {
    color: #43507b;
    font-weight: 600;
}

.modal-error {
    background: #fdecea;
    border: 1px solid #f5c2c0;
    color: #8b1e16;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-weight: 600;
}

.modal-stats {
    display: grid;
    gap: 1rem;
    margin: 0;
}

.modal-stats div {
    background: #f5f7ff;
    border-radius: 12px;
    padding: 0.85rem 1rem;
    border: 1px solid #e1e8f6;
}

.modal-stats dt {
    font-size: 0.85rem;
    color: #43507b;
    margin-bottom: 0.35rem;
}

.modal-stats dd {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f1d4a;
}

/* Generate Document Panel */
.generate-doc-panel {
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
}

.generate-doc-panel h3 {
    margin: 0 0 1rem 0;
    color: #166534;
    font-size: 1.1rem;
}

.generate-doc-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.template-select {
    flex: 1;
    min-width: 200px;
    padding: 0.6rem 1rem;
    border: 1px solid #86efac;
    border-radius: 8px;
    font-size: 1rem;
    background: #fff;
}

.template-select:focus {
    outline: none;
    border-color: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

.generate-doc-controls .btn {
    white-space: nowrap;
}

/* Templates Page */
.templates-container {
    max-width: 900px;
    margin: 0 auto;
}

.upload-zone {
    border: 2px dashed #ccd6e0;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    background: #f8fafc;
    transition: all 0.2s ease;
    margin-bottom: 2rem;
}

.upload-zone.dragover {
    border-color: #1a63d1;
    background: #e7f1ff;
}

.upload-zone p {
    margin: 0.5rem 0;
    color: #43507b;
}

.templates-list {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(15, 29, 74, 0.08);
    overflow: hidden;
}

.template-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e1e8f6;
}

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

.template-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.template-icon {
    width: 40px;
    height: 40px;
    background: #e7f1ff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1a63d1;
}

.template-name {
    font-weight: 600;
    color: #0f1d4a;
}

.template-date {
    font-size: 0.85rem;
    color: #666;
}

.placeholder-guide {
    background: #f8fafc;
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 2rem;
}

.placeholder-guide h3 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    color: #0f1d4a;
}

.placeholder-guide code {
    background: #e1e8f6;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

.placeholder-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.75rem;
}

.placeholder-list li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Generate Document Panel */
.generate-doc-panel {
    background: #f0fdf4;
    border: 1px solid #86efac;
}

.generate-doc-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.template-select {
    flex: 1;
    min-width: 200px;
    padding: 0.6rem 1rem;
    border: 1px solid #ccd6e0;
    border-radius: 8px;
    font-size: 1rem;
    background: #fff;
}

.template-select:focus {
    outline: none;
    border-color: #1a63d1;
    box-shadow: 0 0 0 3px rgba(26, 99, 209, 0.15);
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem 0;
    color: #666;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    header h1 {
        font-size: 1.3rem;
    }
    
    header nav {
        width: 100%;
    }
    
    .page-header {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .stats-badge {
        width: 100%;
    }
    
    .transcript-grid {
        grid-template-columns: 1fr;
    }
    
    main {
        padding: 1rem;
    }
    
    .transcript-text {
        padding: 1rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
}

/* ========== Comments Panel ========== */
.comments-panel {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.25rem;
}

.comments-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.comments-empty {
    color: #64748b;
    font-style: italic;
    font-size: 0.9rem;
}

.comment-item {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.75rem;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
    flex-wrap: wrap;
}

.comment-author {
    font-weight: 600;
    color: #1a63d1;
    font-size: 0.9rem;
}

.comment-ts-btn {
    background: #e1f0ff;
    border: 1px solid #b3d7ff;
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 0.8rem;
    cursor: pointer;
    color: #005a9e;
}

.comment-ts-btn:hover {
    background: #c7e3ff;
}

.comment-date {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-left: auto;
}

.comment-text {
    margin: 0.5rem 0;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #334155;
}

.btn-delete-comment {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0;
    opacity: 0.7;
}

.btn-delete-comment:hover {
    opacity: 1;
}

.comment-form {
    border-top: 1px solid #e2e8f0;
    padding-top: 1rem;
}

.comment-form h4 {
    margin: 0 0 0.75rem;
    font-size: 0.95rem;
    color: #1e293b;
}

.comment-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    box-sizing: border-box;
}

.comment-input:focus {
    outline: none;
    border-color: #1a63d1;
    box-shadow: 0 0 0 2px rgba(26, 99, 209, 0.15);
}

.comment-textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9rem;
    resize: vertical;
    min-height: 60px;
    margin-bottom: 0.5rem;
    box-sizing: border-box;
    font-family: inherit;
}

.comment-textarea:focus {
    outline: none;
    border-color: #1a63d1;
    box-shadow: 0 0 0 2px rgba(26, 99, 209, 0.15);
}

.comment-form-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

/* Comment add button on segments */
.btn-comment-add {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    opacity: 0.4;
    margin-left: 0.5rem;
    padding: 0 4px;
    transition: opacity 0.2s;
    position: relative;
}

.segment:hover .btn-comment-add {
    opacity: 0.9;
}

.btn-comment-add:hover {
    opacity: 1;
}

/* Badge showing comment count */
.btn-comment-add.has-comments {
    opacity: 1;
    color: #1a63d1;
}

.btn-comment-add.has-comments::after {
    content: attr(data-comment-count);
    position: absolute;
    top: -6px;
    right: -6px;
    background: #1a63d1;
    color: white;
    font-size: 0.65rem;
    font-weight: 600;
    min-width: 14px;
    height: 14px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
}

/* Inline comments container */
.inline-comments {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: #f0f7ff;
    border: 1px solid #b3d7ff;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        padding: 0;
        margin: 0;
    }
    to {
        opacity: 1;
        max-height: 500px;
    }
}

.inline-comments.collapsed {
    display: none;
}

/* Individual inline comment */
.inline-comment {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
}

.inline-comment.is-private {
    background: #fef3c7;
    border-color: #fcd34d;
}

.inline-comment-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.inline-comment-author {
    font-weight: 600;
    color: #1a63d1;
    font-size: 0.8rem;
}

.inline-comment-private,
.comment-mini-private {
    font-size: 0.75rem;
    color: #d97706;
    cursor: help;
}

.inline-comment-time {
    font-size: 0.7rem;
    color: #94a3b8;
    margin-left: auto;
}

.inline-comment-delete {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 1rem;
    padding: 0;
    opacity: 0.5;
    line-height: 1;
}

.inline-comment-delete:hover {
    opacity: 1;
}

.inline-comment-text {
    margin: 0;
    color: #334155;
    line-height: 1.4;
}

/* Bottom panel summary */
.comments-summary {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.comments-list-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.comment-item-mini {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.6rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
}

.comment-item-mini:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.comment-item-mini.is-private {
    background: #fef3c7;
    border-color: #fcd34d;
}

.comment-item-mini.is-private:hover {
    background: #fef9c3;
}

.comment-item-mini.is-clickable {
    cursor: pointer;
}

.comment-item-mini.is-clickable:hover {
    background: #eff6ff;
    border-color: #93c5fd;
}

.comment-ts-badge {
    font-size: 0.75rem;
    background: #dbeafe;
    color: #1d4ed8;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    flex-shrink: 0;
    font-weight: 500;
}

/* ── Suggestions panel ── */
.suggestions-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f59e0b;
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 9999px;
    padding: 0 0.4rem;
    min-width: 1.2rem;
    height: 1.2rem;
    margin-left: 0.3rem;
    vertical-align: middle;
}

.suggestions-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    max-height: 340px;
    overflow-y: auto;
}

.suggestion-card {
    border: 1px solid #fcd34d;
    border-radius: 6px;
    background: #fffbeb;
    padding: 0.5rem 0.6rem;
    font-size: 0.8rem;
}

.suggestion-card:hover {
    border-color: #f59e0b;
    background: #fef3c7;
}

.suggestion-rule {
    font-size: 0.7rem;
    color: #92400e;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.25rem;
}
.sug-source-badge {
    display: inline-block;
    font-size: 0.6rem;
    background: #dbeafe;
    color: #1d4ed8;
    border-radius: 3px;
    padding: 1px 5px;
    margin-left: 0.4rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    vertical-align: middle;
    text-transform: none;
}

.suggestion-change {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.35rem;
    flex-wrap: wrap;
}

.suggestion-original {
    background: #fee2e2;
    color: #991b1b;
    border-radius: 3px;
    padding: 0.1rem 0.35rem;
    text-decoration: line-through;
    font-family: monospace;
}

.suggestion-arrow {
    color: #64748b;
    font-size: 0.75rem;
}

.suggestion-new {
    background: #dcfce7;
    color: #166534;
    border-radius: 3px;
    padding: 0.1rem 0.35rem;
    font-family: monospace;
    font-weight: 600;
}

.suggestion-context {
    color: #64748b;
    font-size: 0.72rem;
    margin-bottom: 0.35rem;
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.suggestion-actions {
    display: flex;
    gap: 0.35rem;
}

.suggestion-accept-btn {
    background: #16a34a;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.15rem 0.55rem;
    font-size: 0.75rem;
    cursor: pointer;
    font-weight: 600;
}

.suggestion-accept-btn:hover { background: #15803d; }

.suggestion-ignore-btn {
    background: transparent;
    color: #64748b;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    padding: 0.15rem 0.55rem;
    font-size: 0.75rem;
    cursor: pointer;
}

.suggestion-ignore-btn:hover { background: #f1f5f9; color: #1e293b; }
/* ── end suggestions ── */

.comment-mini-author {
    font-weight: 600;
    color: #1a63d1;
    flex-shrink: 0;
}

.comment-mini-text {
    color: #64748b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Bulk Selection Styles */
.word.selected {
    background: #bfdbfe !important;
    border-radius: 2px;
    outline: 2px solid #3b82f6;
    outline-offset: 1px;
}

.bulk-edit-toolbar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #1e293b;
    color: white;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
}

.bulk-edit-toolbar.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    visibility: visible;
}

.bulk-selection-count {
    font-weight: 600;
    font-size: 0.9rem;
}

.bulk-edit-toolbar .btn {
    background: #374151;
    border: 1px solid #4b5563;
    color: white;
}

.bulk-edit-toolbar .btn:hover {
    background: #4b5563;
}

.bulk-clear-btn {
    background: transparent !important;
    border: none !important;
    opacity: 0.7;
    font-size: 1rem;
}

.bulk-clear-btn:hover {
    opacity: 1;
}

/* ---- Transcript Layout (side-by-side with comments) ---- */
.transcript-layout {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    margin-top: 2rem;
}

.transcript-layout .transcript-container {
    flex: 1 1 60%;
    margin-top: 0;
}

/* ---- Comment add button on segment ---- */
.btn-comment-add {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    opacity: 0.4;
    margin-left: 0.5rem;
    padding: 0 4px;
    transition: opacity 0.2s;
}
.segment:hover .btn-comment-add {
    opacity: 0.9;
}

/* ---- Comments Panel ---- */
.comments-panel {
    flex: 0 0 320px;
    background: #f8f8f8;
    border-radius: 8px;
    padding: 1.25rem;
    border: 1px solid #e1e1e1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 700px;
    overflow: hidden;
}

.comments-panel h3 {
    margin: 0 0 0.5rem;
    color: #0078d4;
}

.comments-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.comments-empty {
    color: #999;
    font-style: italic;
    font-size: 0.9rem;
}

.comment-item {
    background: white;
    border: 1px solid #e1e1e1;
    border-radius: 6px;
    padding: 0.75rem;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
    flex-wrap: wrap;
}

.comment-author {
    font-weight: 600;
    color: #0078d4;
    font-size: 0.9rem;
}

.comment-ts-btn {
    background: #e1f0ff;
    border: 1px solid #b3d7ff;
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 0.8rem;
    cursor: pointer;
    color: #005a9e;
}
.comment-ts-btn:hover {
    background: #cce4ff;
}

.comment-date {
    margin-left: auto;
    font-size: 0.78rem;
    color: #999;
}

.comment-text {
    font-size: 0.9rem;
    color: #333;
    margin: 0 0 0.5rem;
    white-space: pre-wrap;
}

.btn-delete-comment {
    background: none;
    border: none;
    color: #999;
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0;
}
.btn-delete-comment:hover {
    color: #c0392b;
}

/* ---- Comment form ---- */
.comment-form {
    border-top: 1px solid #e1e1e1;
    padding-top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.comment-form h4 {
    margin: 0;
    font-size: 0.95rem;
    color: #333;
}

.comment-input {
    padding: 0.4rem 0.6rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    width: 100%;
}

.comment-textarea {
    padding: 0.4rem 0.6rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    resize: vertical;
    width: 100%;
}

.comment-form-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

/* ---- Small button variant ---- */
.btn-sm {
    padding: 0.3rem 0.8rem;
    font-size: 0.85rem;
}

/* ---- Danger button ---- */
.btn-danger {
    background-color: #c0392b;
    color: white;
}
.btn-danger:hover {
    background-color: #a93226;
}

/* ---- Modal Overlay ---- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-overlay[hidden] {
    display: none;
}

.modal {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    max-width: 520px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
}

.modal h3 {
    margin: 0 0 0.75rem;
    color: #0078d4;
}

.modal p {
    color: #555;
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.modal-field {
    margin-bottom: 1.25rem;
}

.modal-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.4rem;
    font-size: 0.95rem;
}

.modal-select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.modal-hint {
    font-size: 0.85rem;
    color: #666;
    margin: 0.5rem 0 0;
    line-height: 1.6;
}

.modal-hint code {
    background: #f4f4f4;
    border-radius: 3px;
    padding: 1px 5px;
    font-size: 0.83rem;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* ---- Template management page ---- */
.template-info-box {
    background: #f0f7ff;
    border: 1px solid #b3d7ff;
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
}

.template-info-box h3 {
    margin-top: 0;
    color: #0078d4;
}

.placeholder-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.75rem;
    font-size: 0.9rem;
}

.placeholder-table th,
.placeholder-table td {
    padding: 0.6rem 0.75rem;
    border: 1px solid #d0e4f7;
    text-align: left;
}

.placeholder-table th {
    background: #d0e4f7;
}

.placeholder-table code {
    background: #fff;
    border-radius: 3px;
    padding: 1px 5px;
    font-size: 0.85rem;
}

.template-upload-section,
.template-list-section {
    margin-bottom: 2rem;
}

.upload-form {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.file-input {
    flex: 1;
    min-width: 200px;
}

.upload-status {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: #333;
}

.template-items {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.template-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: #f8f8f8;
    border: 1px solid #e1e1e1;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    flex-wrap: wrap;
}

.template-name {
    font-weight: 500;
    flex: 1;
}

.template-meta {
    font-size: 0.85rem;
    color: #888;
}

@media (max-width: 768px) {
    .transcript-layout {
        flex-direction: column;
    }
    .comments-panel {
        flex: unset;
        max-height: 400px;
    }
}
