/* CallCher App Styles - Page-specific styles for base.html pages */
/* Shared components loaded via main.css */

/* ===========================================
   LAYOUT
   =========================================== */

.main-content {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.is-share .main-content {
    max-width: 1100px;
    padding-top: 1.5rem;
}

/* ===========================================
   APP TABS (override cards.css tabs)
   =========================================== */

.tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 2rem;
    background: var(--bg-card);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 0 0.5rem;
}

.tab-btn {
    font-family: var(--font-sans);
    background: transparent;
    border: none;
    padding: 1rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
    margin-bottom: -1px;
    border-radius: 0;
}

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

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: transparent;
}

.tab-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    padding: 1.5rem;
}

/* ===========================================
   INPUT SECTIONS
   =========================================== */

.input-section {
    background: var(--bg-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.input-section label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.input-row input {
    flex: 1;
}

/* Prompt Header */
.prompt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.prompt-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* ===========================================
   RESULT AREAS
   =========================================== */

.result-area {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.result-area h3 {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-weight: 500;
}

.transcript-box {
    font-family: var(--font-mono);
    background: var(--bg-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    font-size: 0.85rem;
    line-height: 1.8;
    max-height: 500px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: var(--text-primary);
}

/* Analysis Results */
.results-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.analysis-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.analysis-header {
    background: var(--bg-muted);
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.analysis-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.analysis-time {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.analysis-meta {
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 500;
}

.btn-export {
    margin-right: auto;
    margin-left: 1rem;
}

.analysis-content {
    font-family: var(--font-sans);
    padding: 1.5rem;
    font-size: 0.95rem;
    line-height: 1.8;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* ===========================================
   SHARE PAGE STYLES
   =========================================== */

.share-page {
    max-width: 1000px;
    margin: 0 auto;
}

/* Share Navigation Menu (in site header) */
.share-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    justify-content: center;
    flex: 1;
    direction: inherit;
}

.nav-item {
    padding: 0.5rem 0.875rem;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    white-space: nowrap;
    border-radius: var(--radius);
    transition: all 0.15s;
    text-decoration: none;
    cursor: pointer;
    text-align: center;
    direction: inherit;
}

.nav-item > a {
    color: inherit;
    text-decoration: none;
}

.nav-item:hover,
.nav-item.active {
    color: var(--primary);
    background: var(--primary-lighter);
}

/* Numbered improvement links - inline in nav */
.nav-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    text-decoration: none;
    transition: all 0.15s;
}

.nav-num:hover,
.nav-num.active {
    color: var(--primary);
    background: var(--primary-lighter);
}

/* Text-based improvement labels - same style as nav-item but smaller */
.nav-label {
    padding: 0.5rem 0.7rem;
    color: var(--text-secondary);
    font-size: 0.7rem;
    white-space: nowrap;
    border-radius: var(--radius);
    transition: all 0.15s;
    text-decoration: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
}

.nav-label:hover,
.nav-label.active {
    color: var(--primary);
    background: var(--primary-lighter);
}

/* Mobile nav */
@media (max-width: 640px) {
    .share-nav {
        gap: 0;
        justify-content: center;
    }

    .nav-item {
        padding: 0.5rem 0.5rem;
        font-size: 0.75rem;
    }

    /* Hide remarks and transcript nav on mobile - least used, at bottom anyway */
    .nav-item[data-section="remarks"],
    .nav-item[data-section="transcript"] {
        display: none;
    }
}

.share-header {
    margin-bottom: 1.5rem;
    padding: 1.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.share-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--success), var(--primary));
}

.share-header h2 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.share-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.meta-right,
.meta-left {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.meta-left {
    direction: ltr;
}

.meta-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.8rem;
}

/* Share Sections */
.share-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 1.75rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-sm);
}

.share-section h3 {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

/* Call Insights Section */
.insights-section h3 {
    margin-bottom: 1rem;
}

.insights-status-row {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.status-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    cursor: help;
}

.status-item * {
    cursor: help;
}

.status-label {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-faint);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: center;
}

.insights-meta-row {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 1rem;
}

.status-badge {
    padding: 0.4rem 1rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 0.01em;
}

.status-hot { background: rgba(239, 68, 68, 0.1); color: #dc2626; border: 1px solid rgba(239, 68, 68, 0.2); }
.status-warm { background: rgba(245, 158, 11, 0.1); color: #d97706; border: 1px solid rgba(245, 158, 11, 0.2); }
.status-cold { background: rgba(37, 99, 235, 0.1); color: #2563eb; border: 1px solid rgba(37, 99, 235, 0.2); }
.status-closed { background: rgba(22, 163, 74, 0.1); color: #16a34a; border: 1px solid rgba(22, 163, 74, 0.2); }

.interest-stars {
    font-size: 1.25rem;
    letter-spacing: 0.1em;
    white-space: nowrap;
}

.interest-stars .star {
    color: #d1d5db;
}

.interest-stars .star.filled {
    color: #fbbf24;
}

[data-theme="dark"] .interest-stars .star.filled {
    color: #f59e0b;
}

.momentum-indicator {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    font-weight: 600;
    font-size: 1rem;
}

.momentum-indicator.positive { color: #16a34a; }
.momentum-indicator.negative { color: #dc2626; }
.momentum-indicator.neutral { color: #6b7280; }

.momentum-arrow { font-size: 1.1rem; }

.insights-meta-item {
    display: flex;
    align-items: flex-start;
    gap: 0.35rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.insights-meta-item > span:last-child {
    white-space: pre-line;
}

.insights-meta-item ul {
    margin: 0;
    padding: 0;
    list-style: disc;
    padding-inline-start: 1rem;
    white-space: normal;
}

.insights-meta-item li {
    margin-bottom: 0.1rem;
}

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

.insights-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.insight-card {
    background: var(--bg-secondary);
    padding: 1.25rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    transition: box-shadow 0.2s ease;
}

.insight-card:hover {
    box-shadow: var(--shadow-sm);
}

.insight-label {
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.insight-value {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--text-primary);
}

.insight-value ul {
    margin: 0;
    padding-right: 1.25rem;
    padding-left: 0;
}

.insight-value li {
    margin-bottom: 0.25rem;
}

.insight-value p {
    margin: 0;
}

@media (max-width: 640px) {
    .insights-grid {
        grid-template-columns: 1fr;
    }

    .insights-status-row {
        gap: 0.5rem;
    }

    .interest-stars {
        font-size: 1rem;
    }
}

/* Analysis Tabs */
.analysis-tabs {
    display: inline-flex;
    gap: 8px;
    margin-bottom: 1.5rem;
}

.analysis-tab {
    padding: 10px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.analysis-tab:hover {
    color: var(--text-primary);
    border-color: var(--text-faint);
    background: var(--bg-muted);
}

.analysis-tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Analysis Panels */
.analysis-panel {
    display: none;
}

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

/* Analysis Footer */
.analysis-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
}

.analysis-footer .tooltip-hint {
    margin: 0;
}

.like-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 999px;
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.like-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--primary);
    color: var(--primary);
}

.like-btn.voted {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.like-btn.voted .like-icon {
    fill: currentColor;
}

.like-icon {
    width: 16px;
    height: 16px;
    stroke-width: 2;
}

/* Analysis Container */
.analysis-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 2rem 2rem;
}

.analysis-text {
    font-family: var(--font-sans);
    font-size: 1.05rem;
    line-height: 1.95;
    color: var(--text-primary);
    max-width: 78ch;
    margin: 0 auto;
    unicode-bidi: plaintext;
}

.analysis-text p { margin: 0 0 1rem 0; }

.analysis-text h1 {
    font-size: 1.35rem;
    color: var(--primary);
    margin: 1.75rem 0 0.75rem 0;
    font-weight: 700;
}

.analysis-text h2 {
    font-size: 1.25rem;
    color: var(--primary);
    margin: 1.5rem 0 0.75rem 0;
    font-weight: 600;
}

.analysis-text h3 {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin: 1.25rem 0 0.5rem 0;
    font-weight: 600;
}

.analysis-text strong {
    color: var(--primary);
    font-weight: 600;
}

.analysis-text hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 1.5rem 0;
}

.analysis-text ol,
.analysis-text ul {
    margin: 0.5rem 0 1rem 0;
    padding-inline-start: 1.5rem;
}

.analysis-text li { margin-bottom: 0.5rem; }
.analysis-text li > p { margin-bottom: 0; }

.analysis-text blockquote {
    margin: 0 0 1.25rem 0;
    padding: 0.5rem 1rem;
    border-right: 3px solid var(--primary-light);
    background: var(--bg-muted);
    color: var(--text-secondary);
    border-radius: var(--radius);
}

.analysis-text code {
    font-family: var(--font-mono);
    font-size: 0.95em;
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    background: var(--bg-muted);
    border: 1px solid var(--border);
    color: var(--text-primary);
}

.analysis-text pre {
    margin: 1rem 0;
    padding: 1rem;
    border-radius: var(--radius);
    background: var(--bg-muted);
    border: 1px solid var(--border);
    overflow: auto;
}

.analysis-text pre code {
    padding: 0;
    border: none;
    background: transparent;
}

.analysis-text a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.analysis-error {
    color: var(--danger);
    padding: 1.5rem;
    background: var(--bg-muted);
    border-radius: var(--radius);
    border: 1px solid var(--danger);
    text-align: center;
}

.tooltip-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 1rem;
    font-style: italic;
}

/* Critique Highlight (timestamp links) */
.critique-highlight {
    cursor: help;
    color: var(--primary);
    font-size: 0.7em;
    vertical-align: middle;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.1rem 0.4rem;
    text-decoration: none;
    transition: all 0.2s ease;
    margin: 0 0.15rem;
    font-weight: 500;
}

.critique-highlight:hover {
    background: var(--primary-lighter);
    border-color: var(--primary);
}

/* Tooltip - Light theme */
.tooltip {
    position: absolute;
    z-index: 1000;
    width: clamp(380px, 70vw, 760px);
    max-width: 760px;
    min-width: 380px;
    background: #f1f5f9;
    border: 1px solid #2563eb;
    border-radius: var(--radius);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.tooltip-header {
    background: #e2e8f0;
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    color: #2563eb;
    border-bottom: 1px solid #cbd5e1;
}

.tooltip-snippet {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.7;
    padding: 1rem;
    margin: 0;
    white-space: pre-wrap;
    color: #1e293b;
}

/* Tooltip - Dark theme */
[data-theme="dark"] .tooltip {
    background: #161616;
    border: 1px solid #d4a574;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .tooltip-header {
    background: #242424;
    color: #d4a574;
    border-bottom: 1px solid #333333;
}

[data-theme="dark"] .tooltip-snippet {
    color: #e8dcc8;
}

/* Collapsible sections */
.share-section details { cursor: pointer; }

.share-section summary {
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 600;
    padding: 0.5rem 0;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    letter-spacing: -0.01em;
}

.share-section summary::-webkit-details-marker { display: none; }

.share-section summary::before {
    content: '';
    width: 20px;
    height: 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5'%3E%3Cpolyline points='9 18 15 12 9 6'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    transition: all 0.2s ease;
}

.share-section details[open] summary::before {
    transform: rotate(90deg);
    background-color: var(--primary-lighter);
    border-color: var(--primary-light);
}

.prompt-text,
.transcript-text {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.8;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-top: 1rem;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: var(--text-primary);
    max-height: 60vh;
    overflow-y: auto;
}

.prompt-text { unicode-bidi: plaintext; }
.transcript-text { unicode-bidi: isolate; }

[dir="rtl"] .transcript-text { text-align: right; }
[dir="ltr"] .transcript-text { text-align: left; }

/* ===========================================
   ABOUT SECTION (Actions & Delete)
   =========================================== */

.about-content {
    padding-top: 0.5rem;
}

.danger-zone {
    padding-top: 0.5rem;
}

.danger-description {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.btn-danger {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1.25rem;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 999px;
    color: #dc2626;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.12);
    border-color: #dc2626;
}

[data-theme="dark"] .btn-danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.4);
    color: #f87171;
}

[data-theme="dark"] .btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #f87171;
    color: #fca5a5;
}

.deletion-pending-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #fef3c7;
    color: #92400e;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 500;
}

[data-theme="dark"] .deletion-pending-badge {
    background: #78350f;
    color: #fde68a;
}

/* ===========================================
   METRICS SECTION
   =========================================== */

.metrics-content { padding-top: 1rem; }

.metrics-loading,
.metrics-empty {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

.metrics-empty p { margin-bottom: 1rem; }

.metrics-display {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 1.75rem;
}

.metrics-header {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.overall-score-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.overall-score-label {
    font-size: 0.85rem;
    color: var(--text-label);
}

.overall-score {
    font-size: 3rem;
    font-weight: 700;
    font-family: var(--font-mono);
    line-height: 1;
}

.overall-score.high { color: var(--success); }
.overall-score.medium { color: var(--warning); }
.overall-score.low { color: var(--danger); }

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(3, auto);
    grid-auto-flow: column;
    row-gap: 1rem;
    column-gap: 2.75rem;
    margin-bottom: 1.5rem;
    position: relative;
}

.metrics-grid::before {
    content: '';
    position: absolute;
    top: 0.25rem;
    bottom: 0.25rem;
    left: 50%;
    width: 1px;
    background: linear-gradient(to bottom, transparent, var(--border), transparent);
    opacity: 0.7;
    pointer-events: none;
}

.metric-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.metric-label {
    flex: 0 0 110px;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.metric-bar {
    flex: 1;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.metric-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease, background-color 0.3s ease;
    width: 0;
}

.metric-fill.high { background: var(--success); }
.metric-fill.medium { background: var(--warning); }
.metric-fill.low { background: var(--danger); }

.metric-value {
    width: 3rem;
    text-align: center;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.metrics-extras {
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding: 1.25rem 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin-bottom: 1rem;
}

.extra-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 0.75rem 1.25rem;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

.extra-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.extra-value {
    font-family: var(--font-mono);
    font-size: 1.15rem;
    color: var(--text-primary);
    font-weight: 600;
}

.weaknesses-section { padding-top: 0.5rem; }

.weaknesses-section h4 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.weaknesses-section ul {
    margin: 0;
    padding-inline-start: 1.25rem;
}

.weaknesses-section li {
    font-size: 0.85rem;
    color: var(--danger);
    margin-bottom: 0.25rem;
}

/* ===========================================
   MANAGER REMARKS
   =========================================== */

.manager-remarks-display { margin-top: 1rem; }

.remarks-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 3rem 0 0 0;
    opacity: 0.5;
}

.remarks-content { padding-top: 1rem; }

.remarks-content textarea {
    width: 100%;
    min-height: 180px;
    padding: 1rem 1.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    font-family: var(--font-sans);
    font-size: 1rem;
    resize: vertical;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.remarks-content textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-lighter);
    background: var(--bg-card);
}

.remarks-content textarea::placeholder { color: var(--text-muted); }

.remarks-actions {
    margin-top: 0.75rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-save {
    padding: 0.55rem 1.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.btn-save:hover {
    background: var(--primary-hover);
    box-shadow: var(--shadow-md);
}

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

.remarks-status.success { color: var(--success); }
.remarks-status.error { color: var(--danger); }

/* ===========================================
   LOGIN PAGE STYLES
   Premium, centered, minimal design
   =========================================== */

/* Login button - match dashboard colors */
.is-login {
    --primary: #2d5a87;
    --primary-hover: #1e3a5f;
}

[data-theme="dark"] .is-login {
    --primary: #d97706;
    --primary-hover: #f59e0b;
}

.is-login .main-content {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 180px);
    padding: 24px;
}

.login-container {
    width: 100%;
    max-width: 400px;
}

.login-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px 32px;
    box-shadow: var(--shadow-md);
}

/* Logo centered at top */
.login-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 32px;
}

.login-logo .logo-icon {
    width: 48px;
    height: 48px;
    background: var(--primary);
    color: white;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-logo .logo-icon svg {
    width: 24px;
    height: 24px;
}

/* Header */
.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header h1 {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.login-header p {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.5;
}

/* Form */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.login-form .form-group {
    margin-bottom: 0;
}

.login-form .message {
    margin: 0;
}

/* Consent text */
.login-consent {
    font-size: 12px;
    color: var(--text-faint);
    text-align: center;
    margin: 0;
    line-height: 1.5;
}

/* Dark mode adjustments */
[data-theme="dark"] .login-card {
    box-shadow: var(--shadow-lg);
}

/* Responsive */
@media (max-width: 480px) {
    .login-card {
        padding: 32px 24px;
    }

    .login-header h1 {
        font-size: 18px;
    }
}

/* ===========================================
   SPEAKER TIMELINE
   =========================================== */

.timeline-section {
    width: 100%;
    padding: 1.5rem 0 1rem;
    margin-top: 1.5rem;
}

.timeline-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 4rem;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.timeline-wrapper {
    position: relative;
    margin-right: 35px;
}

.timeline-bar {
    height: 28px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    overflow: hidden;
    margin-bottom: 1rem;
}

.timeline-segment {
    height: 100%;
    min-width: 2px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.timeline-segment:hover { opacity: 0.75; }
.timeline-segment.rep { background: var(--chart-rep); }
.timeline-segment.client { background: var(--success); }

/* Multi-speaker timeline colors (supports up to 10 speakers) */
.timeline-segment.speaker-0 { background: var(--speaker-0); }
.timeline-segment.speaker-1 { background: var(--speaker-1); }
.timeline-segment.speaker-2 { background: var(--speaker-2); }
.timeline-segment.speaker-3 { background: var(--speaker-3); }
.timeline-segment.speaker-4 { background: var(--speaker-4); }
.timeline-segment.speaker-5 { background: var(--speaker-5); }
.timeline-segment.speaker-6 { background: var(--speaker-6); }
.timeline-segment.speaker-7 { background: var(--speaker-7); }
.timeline-segment.speaker-8 { background: var(--speaker-8); }
.timeline-segment.speaker-9 { background: var(--speaker-9); }

/* Improvement markers on timeline */
.timeline-markers {
    position: absolute;
    top: -28px;
    left: 0;
    right: 0;
    height: 0;
    pointer-events: none;
}

.timeline-marker {
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ef4444;
    color: white;
    font-size: 11px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: transform 0.15s, box-shadow 0.15s;
    z-index: 5;
}

/* RTL: positioned via 'right', translate positive to center */
[dir="rtl"] .timeline-marker {
    transform: translateX(50%);
}
[dir="rtl"] .timeline-marker:hover {
    transform: translateX(50%) scale(1.2);
}

/* LTR: positioned via 'left', translate negative to center */
[dir="ltr"] .timeline-marker {
    transform: translateX(-50%);
}
[dir="ltr"] .timeline-marker:hover {
    transform: translateX(-50%) scale(1.2);
}

.timeline-marker:hover {
    box-shadow: 0 3px 8px rgba(0,0,0,0.3);
}

/* Timeline markers with labels */
.timeline-marker.has-label {
    width: auto;
    min-width: 20px;
    border-radius: 10px;
    padding: 0 8px;
    gap: 4px;
}

.timeline-marker .marker-num {
    font-weight: bold;
}

.timeline-marker .marker-label {
    font-size: 10px;
    font-weight: 500;
    white-space: nowrap;
}

/* Scroll margins for smooth navigation */
#insights-section,
#analysis-section,
#metrics-section,
#remarks-section,
#transcript-section,
#speaker-timeline,
#energy-graph,
h2[id^="improvement-"],
h3[id^="improvement-"] {
    scroll-margin-top: 30vh;
}

/* Improvement headings - underline for emphasis */
h2[id^="improvement-"],
h3[id^="improvement-"] {
    text-decoration: underline solid var(--primary);
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
    margin-bottom: 1rem;
}

.timeline-legend {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    font-size: 0.85rem;
    color: var(--text-label);
}

.timeline-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 0.5rem;
    font-style: italic;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    display: inline-block;
}

.legend-dot.rep { background: var(--chart-rep); }
.legend-dot.client { background: var(--success); }

/* Multi-speaker legend colors (supports up to 10 speakers) */
.legend-dot.speaker-0 { background: var(--speaker-0); }
.legend-dot.speaker-1 { background: var(--speaker-1); }
.legend-dot.speaker-2 { background: var(--speaker-2); }
.legend-dot.speaker-3 { background: var(--speaker-3); }
.legend-dot.speaker-4 { background: var(--speaker-4); }
.legend-dot.speaker-5 { background: var(--speaker-5); }
.legend-dot.speaker-6 { background: var(--speaker-6); }
.legend-dot.speaker-7 { background: var(--speaker-7); }
.legend-dot.speaker-8 { background: var(--speaker-8); }
.legend-dot.speaker-9 { background: var(--speaker-9); }

/* Stage markers */
.stage-markers {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    pointer-events: none;
}

.stage-marker {
    position: absolute;
    top: -8px;
    height: 8px;
    width: 2px;
    background: currentColor;
    border-right: 2px solid;
    cursor: pointer;
    pointer-events: auto;
    z-index: 10;
}

.stage-marker:hover { opacity: 0.8; }

.stage-marker:hover .stage-label {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.stage-label {
    position: absolute;
    top: -22px;
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    font-size: 0.6rem;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    white-space: nowrap;
    opacity: 0.85;
    transition: opacity 0.2s, transform 0.2s;
}

/* ===========================================
   ENERGY GRAPH
   =========================================== */

.energy-graph-section {
    width: calc(100% + 2rem);
    margin-left: -1rem;
    margin-right: -1rem;
    padding: 1.5rem 1rem;
    margin-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.energy-graph-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    text-align: center;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.energy-chart-container {
    position: relative;
    height: 320px;
    width: 100%;
    margin-bottom: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0.75rem;
}

.energy-chart-container canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

.energy-legend {
    display: flex;
    justify-content: center;
    gap: 2rem;
    font-size: 0.85rem;
    color: var(--text-label);
}

.energy-legend .legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legend-line {
    display: inline-block;
    width: 20px;
    height: 2px;
}

.legend-line.salesman { background: var(--chart-rep); }
.legend-line.client { background: var(--success); }

/* ===========================================
   DASHBOARD PAGE STYLES
   Warm cream palette with blue accents
   =========================================== */

/* Dashboard-specific color overrides - warm cream palette */
.is-dashboard {
    --db-bg-page: #f8f7f4;
    --db-bg-card: #ffffff;
    --db-border: rgba(0, 0, 0, 0.06);
    --db-border-light: #f0eeeb;
    --db-border-medium: #e0dedb;
    --db-shadow: rgba(0, 0, 0, 0.04);
    --db-primary: #2d5a87;
    --db-primary-dark: #1e3a5f;
    --db-primary-bg: #e8f4f8;
    --db-primary-bg-gradient: linear-gradient(135deg, #e8f4f8, #d4e8f0);
    --db-text-primary: #1d1d1d;
    --db-text-secondary: #666666;
    --db-text-muted: #888888;
    --db-text-light: #999999;
    --db-tab-inactive: #666666;
    --db-tab-bg: #f8f7f4;
    --db-example-bg: #fafaf9;

    /* Override global button colors for dashboard */
    --primary: #2d5a87;
    --primary-hover: #1e3a5f;
    --primary-light: rgba(45, 90, 135, 0.12);
}

/* Dashboard dark mode - deep slate with amber accent */
[data-theme="dark"] .is-dashboard {
    --db-bg-page: #0f172a;
    --db-bg-card: #1e293b;
    --db-border: rgba(241, 245, 249, 0.08);
    --db-border-light: rgba(241, 245, 249, 0.06);
    --db-border-medium: rgba(241, 245, 249, 0.12);
    --db-shadow: rgba(0, 0, 0, 0.3);
    --db-primary: #d97706;
    --db-primary-dark: #f59e0b;
    --db-primary-bg: rgba(217, 119, 6, 0.18);
    --db-primary-bg-gradient: linear-gradient(135deg, rgba(217, 119, 6, 0.15), rgba(217, 119, 6, 0.10));
    --db-text-primary: #f1f5f9;
    --db-text-secondary: #cbd5e1;
    --db-text-muted: #94a3b8;
    --db-text-light: #64748b;
    --db-tab-inactive: #cbd5e1;
    --db-tab-bg: #0f172a;
    --db-example-bg: #1e293b;

    /* Override global button colors for dashboard dark */
    --primary: #d97706;
    --primary-hover: #f59e0b;
    --primary-light: rgba(217, 119, 6, 0.18);
}

.is-dashboard .main-content {
    max-width: 800px;
    padding: 32px 24px;
    background: var(--db-bg-page);
}

/* Apply warm background to full page */
body.is-dashboard {
    background: var(--db-bg-page);
}

.dashboard-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ─────────────────────────────────────────────
   WELCOME BANNER
   Subtle, professional - not gradient-heavy
   ───────────────────────────────────────────── */
.is-dashboard .welcome-banner {
    background: var(--db-bg-card);
    border: 1px solid var(--db-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: flex-start;
    gap: 24px;
    box-shadow: 0 1px 3px var(--db-shadow);
}

.is-dashboard .welcome-content {
    flex: 1;
}

.is-dashboard .welcome-content h2 {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--db-text-primary);
    margin: 0 0 8px 0;
}

.is-dashboard .welcome-content p {
    font-size: 14px;
    color: var(--db-text-secondary);
    margin: 0;
    line-height: 1.6;
}

.is-dashboard .welcome-content p + p {
    margin-top: 4px;
}


.is-dashboard .welcome-banner .btn {
    flex-shrink: 0;
    align-self: center;
}

/* ─────────────────────────────────────────────
   ANALYSIS CARD (Dashboard)
   ───────────────────────────────────────────── */
.is-dashboard .analysis-card {
    background: var(--db-bg-card);
    border: 1px solid var(--db-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: 0 1px 3px var(--db-shadow);
}

.is-dashboard .analysis-card > h2 {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--db-text-primary);
    margin: 0 0 20px 0;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--db-border-light);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Card header icon - Plus in circle for New Analysis */
.is-dashboard .analysis-card > h2::before {
    content: '';
    width: 32px;
    height: 32px;
    background: var(--db-primary-bg);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%232d5a87' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='12' y1='8' x2='12' y2='16'%3E%3C/line%3E%3Cline x1='8' y1='12' x2='16' y2='12'%3E%3C/line%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
}

/* Tabs row - full width tabs */
.is-dashboard .tabs-row {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
}

.is-dashboard .tabs-row .tabs {
    flex: 1;
    display: flex;
    margin-bottom: 0;
    background: var(--db-tab-bg);
    border-radius: var(--radius-lg);
    padding: 4px;
    border: 1px solid var(--db-border-medium);
    gap: 4px;
}

/* Dashboard pill-style tabs - full width */
.is-dashboard .tabs-row .tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: transparent;
    border: none;
    border-bottom: none;
    border-radius: var(--radius);
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--db-tab-inactive);
    margin-bottom: 0;
    transition: all var(--transition-fast);
}

.is-dashboard .tabs-row .tab-btn .tab-icon {
    flex-shrink: 0;
}

.is-dashboard .tabs-row .tab-btn:hover {
    color: var(--db-text-primary);
    background: rgba(255, 255, 255, 0.5);
}

.is-dashboard .tabs-row .tab-btn.active {
    background: var(--db-bg-card);
    color: var(--db-primary);
    border-bottom: none;
    box-shadow: 0 1px 3px var(--db-shadow);
}

/* Dashboard tabs - dark mode overrides */
[data-theme="dark"] .is-dashboard .tabs-row .tab-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .is-dashboard .tabs-row .tab-btn.active {
    background: #334155;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* Privacy note row - below record button */
.is-dashboard .privacy-note-row {
    border-top: 1px dashed var(--db-border-medium);
    margin-top: 12px;
    padding-top: 12px;
    text-align: center;
}

.is-dashboard .privacy-note {
    font-size: 13px;
    color: var(--db-text-light);
}

/* ─────────────────────────────────────────────
   UPLOAD AREA
   ───────────────────────────────────────────── */
.upload-area {
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-lg);
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition:
        border-color var(--transition-fast),
        background var(--transition-fast);
    margin-bottom: 16px;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--primary);
    background: var(--primary-lighter);
}

.upload-area input[type="file"] {
    display: none;
}

.upload-icon {
    color: var(--text-faint);
    margin-bottom: 6px;
}

.upload-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0 0 4px 0;
}

.upload-formats {
    font-size: 12px;
    color: var(--text-muted);
}

.file-info {
    background: var(--bg-muted);
    border: 1px solid var(--border);
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--text-secondary);
}

/* ─────────────────────────────────────────────
   LIVE RECORDING
   ───────────────────────────────────────────── */

.mobile-warning {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--warning-bg, #fef3cd);
    border: 1px solid var(--warning-border, #ffc107);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--warning-text, #856404);
}

.mobile-warning svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.recording-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 24px;
}

.is-dashboard .recording-row {
    margin-bottom: 16px;
}

/* Circular record button - default for non-dashboard */
.btn-record-circle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--bg-muted);
    border: 2px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Dashboard record button - blue gradient per design */
.is-dashboard .btn-record-circle {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, var(--db-primary) 0%, var(--db-primary-dark) 100%);
    border: none;
    color: white;
    box-shadow: 0 4px 16px rgba(45, 90, 135, 0.3);
}

.is-dashboard .btn-record-circle:not(.recording):hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 6px 24px rgba(45, 90, 135, 0.4);
    background: linear-gradient(135deg, var(--db-primary) 0%, var(--db-primary-dark) 100%);
    border: none;
    color: white;
}

/* Pulse animation for dashboard idle state */
.is-dashboard .btn-record-circle:not(.recording) {
    animation: db-record-pulse 2s ease-in-out infinite;
}

@keyframes db-record-pulse {
    0%, 100% { box-shadow: 0 4px 16px rgba(45, 90, 135, 0.3), 0 0 0 0 rgba(45, 90, 135, 0.2); }
    50% { box-shadow: 0 4px 16px rgba(45, 90, 135, 0.3), 0 0 0 8px rgba(45, 90, 135, 0); }
}

.is-dashboard .btn-record-circle:hover:not(:disabled) {
    animation: none;
}

/* Idle hover - green to indicate "ready to record" (non-dashboard) */
.btn-record-circle:not(.recording):hover:not(:disabled) {
    background: var(--bg-muted);
    border-color: var(--success, #22c55e);
    color: var(--success, #22c55e);
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(34, 197, 94, 0.2);
}

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

.btn-record-circle .mic-icon {
    transition: all var(--transition-fast);
}

.is-dashboard .record-hint {
    font-size: 13px;
    color: var(--db-text-secondary);
    cursor: pointer;
    transition: color var(--transition-fast), opacity var(--transition-fast);
}

.is-dashboard .record-hint:hover {
    color: var(--db-primary);
}

.record-hint {
    font-size: 13px;
    color: var(--text-muted);
    cursor: pointer;
    transition: color var(--transition-fast), opacity var(--transition-fast);
}

.record-hint:hover {
    color: var(--success, #22c55e);
}

/* Recording state - button turns red with pulse */
.btn-record-circle.recording {
    background: #ef4444;
    border-color: #ef4444;
    color: white;
    animation: record-pulse 1.5s ease-in-out infinite;
}

.btn-record-circle.recording:hover:not(:disabled) {
    background: #dc2626;
    border-color: #dc2626;
    color: white;
    transform: scale(1.05);
    animation: none;
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.4);
}

.btn-record-circle .stop-icon {
    display: none !important;
}

.btn-record-circle.recording .mic-icon {
    display: none !important;
}

.btn-record-circle.recording .stop-icon {
    display: block !important;
    fill: white;
    width: 20px;
    height: 20px;
}

@keyframes record-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
}

/* Inline timer next to button */
.record-timer {
    font-size: 18px;
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--error);
}

.live-transcript {
    background: var(--bg-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    overflow: hidden;
}

.transcript-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-subtle);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.connection-status {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    background: var(--bg-muted);
    color: var(--text-muted);
}

.connection-status.connecting {
    background: var(--primary-lighter);
    color: var(--primary);
}

.connection-status.connected {
    background: var(--success-bg, #d4edda);
    color: var(--success, #155724);
}

.connection-status.error {
    background: var(--error-bg, #f8d7da);
    color: var(--error, #721c24);
}

.transcript-content {
    padding: 16px 20px;
    height: 250px;
    overflow-y: auto;
    font-size: 15px;
    line-height: 1.9;
    direction: rtl;
    text-align: right;
}

.transcript-content > div {
    /* Each line div has its own bidi context - prevents cross-line interference */
    unicode-bidi: isolate;
}

.transcript-content .transcript-pause {
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
    padding: 8px 0;
    opacity: 0.7;
}

html[lang="en"] .transcript-content {
    direction: ltr;
    text-align: left;
}

.transcript-content .nonfinal {
    color: var(--text-muted);
    opacity: 0.7;
}

.transcript-content .speaker-tag {
    display: inline;
    font-size: 11px;
    font-weight: 600;
    color: var(--primary);
    margin-inline-start: 4px;
}

.transcript-empty {
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
}

.transcript-separator {
    color: var(--text-muted);
    text-align: center;
    padding: 12px 0;
    opacity: 0.6;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.multi-segment-info {
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
    padding: 8px 12px;
    margin-top: 8px;
    margin-bottom: 0;
    background: var(--surface-raised);
    border-radius: 6px;
    opacity: 0.9;
}

/* ─────────────────────────────────────────────
   PROCESSING STATUS
   ───────────────────────────────────────────── */
.processing-status {
    background: var(--primary-lighter);
    border: 1px solid var(--primary-light);
    border-radius: var(--radius);
    padding: 16px;
    margin-top: 16px;
}

.status-content #status-text {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.stages-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stage {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-muted);
    transition: color var(--transition-fast);
}

.stage::before {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-strong);
    border-radius: 50%;
    flex-shrink: 0;
    box-sizing: border-box;
}

.stage.active {
    color: var(--primary);
    font-weight: 500;
}

.stage.active::before {
    border-color: var(--primary);
    border-top-color: transparent;
    animation: stage-spin 0.8s linear infinite;
}

.stage.done {
    color: var(--success);
}

.stage.done::before {
    border-color: var(--success);
    background: var(--success);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
    background-size: 10px;
    background-repeat: no-repeat;
    background-position: center;
}

@keyframes stage-spin {
    to { transform: rotate(360deg); }
}

/* ─────────────────────────────────────────────
   HISTORY CARD
   ───────────────────────────────────────────── */
.is-dashboard .history-card {
    background: var(--db-bg-card);
    border: 1px solid var(--db-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: 0 1px 3px var(--db-shadow);
}

.is-dashboard .history-card .section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--db-border-light);
}

.is-dashboard .history-card .section-hint {
    font-size: 12px;
    color: var(--db-text-light);
}

.is-dashboard .history-card .section-header h2 {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--db-text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* History card header icon - Clock */
.is-dashboard .history-card .section-header h2::before {
    content: '';
    width: 32px;
    height: 32px;
    background: var(--db-primary-bg);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%232d5a87' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cpolyline points='12 6 12 12 16 14'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
}

/* Examples card header icon - Star */
.is-dashboard .examples-card .section-header h2::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%232d5a87' stroke-width='2'%3E%3Cpolygon points='12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2'%3E%3C/polygon%3E%3C/svg%3E");
}

/* Dashboard dark mode - icon color overrides */
[data-theme="dark"] .is-dashboard .analysis-card > h2::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23f59e0b' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='12' y1='8' x2='12' y2='16'%3E%3C/line%3E%3Cline x1='8' y1='12' x2='16' y2='12'%3E%3C/line%3E%3C/svg%3E");
}

[data-theme="dark"] .is-dashboard .history-card .section-header h2::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23f59e0b' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cpolyline points='12 6 12 12 16 14'%3E%3C/polyline%3E%3C/svg%3E");
}

[data-theme="dark"] .is-dashboard .examples-card .section-header h2::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23f59e0b' stroke-width='2'%3E%3Cpolygon points='12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2'%3E%3C/polygon%3E%3C/svg%3E");
}

/* Fallback for non-dashboard */
.history-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.history-card .section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.history-card .section-hint {
    font-size: 12px;
    color: var(--text-faint);
}

.history-card .section-header h2 {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin: 0;
}

/* ─────────────────────────────────────────────
   ANALYSES LIST
   ───────────────────────────────────────────── */
.analyses-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.analysis-item {
    display: grid;
    grid-template-columns: 70px 70px 1fr;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    background: var(--bg-muted);
    border: 1px solid transparent;
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    transition:
        background var(--transition-fast),
        border-color var(--transition-fast);
}

.analysis-item:hover {
    background: var(--bg-subtle);
    border-color: var(--border);
}

.analysis-info {
    display: contents;
}

.analysis-date {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    text-align: end;
    margin-inline-end: 12px;
}

.analysis-duration {
    font-size: 12px;
    font-family: var(--font-mono);
    color: var(--text-muted);
    white-space: nowrap;
    min-width: 60px;
    text-align: right;
    margin-inline-start: 8px;
    margin-inline-end: 12px;
}

.analysis-summary {
    font-size: 13px;
    color: var(--text-secondary);
    margin-inline-start: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Dashboard analysis items - warm colors only */
.is-dashboard .analysis-item {
    background: var(--db-example-bg);
}

.is-dashboard .analysis-item:hover {
    background: var(--db-bg-card);
    border-color: var(--db-border-medium);
}

.is-dashboard .analysis-date {
    color: var(--db-primary);
    background: var(--db-primary-bg);
    padding: 4px 10px;
    border-radius: 999px;
    text-align: center;
    margin-inline-end: 0;
}

.is-dashboard .analysis-duration {
    color: var(--db-text-muted);
}

.is-dashboard .analysis-summary {
    color: var(--db-text-primary);
}

/* ─────────────────────────────────────────────
   DASHBOARD EMPTY STATE & PRIVACY NOTE
   ───────────────────────────────────────────── */
.is-dashboard .empty-state {
    text-align: center;
    padding: 32px 24px;
    color: var(--db-text-light);
}

.is-dashboard .empty-state::before {
    content: '';
    display: block;
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    background: var(--db-tab-bg);
    border-radius: 50%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23999999' stroke-width='1.5'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'%3E%3C/path%3E%3Cpolyline points='14 2 14 8 20 8'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
}


/* ─────────────────────────────────────────────
   CONTACT MODAL
   ───────────────────────────────────────────── */
.contact-modal .modal-content {
    max-width: 540px;
}

.contact-modal .modal-header {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 24px;
}

.contact-modal .modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.contact-form .form-group {
    margin-bottom: 16px;
}

.contact-form .form-group:last-of-type {
    margin-bottom: 20px;
}

.contact-form label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.contact-form textarea {
    min-height: 100px;
    resize: vertical;
}

.contact-form .message {
    margin-bottom: 16px;
}

.contact-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 8px;
}

/* Honeypot - hidden from users */
.honeypot {
    position: absolute;
    left: -9999px;
}

/* ─────────────────────────────────────────────
   RESPONSIVE
   ───────────────────────────────────────────── */
@media (max-width: 640px) {
    .is-dashboard .main-content {
        padding: 16px;
    }

    .dashboard-container {
        gap: 16px;
    }

    .welcome-banner {
        flex-direction: column;
        padding: 20px;
        gap: 16px;
    }

    .welcome-banner .btn {
        width: 100%;
        justify-content: center;
    }

    .analysis-card,
    .history-card {
        padding: 20px;
    }

    .upload-area {
        padding: 20px 16px;
    }

    .analysis-item {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    .analysis-info {
        display: flex;
        align-items: baseline;
        gap: 12px;
    }

    .analysis-date {
        min-width: unset;
        order: 2;
        font-size: 13px;
    }

    .analysis-duration {
        min-width: unset;
        margin-inline-start: 0;
        order: 1;
        font-size: 13px;
    }

    .analysis-summary {
        text-align: start;
    }

    /* Contact modal responsive */
    .contact-modal .modal-content {
        padding: 20px;
        max-height: calc(100vh - 32px);
    }

    .contact-actions {
        flex-direction: column-reverse;
    }

    .contact-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ===========================================
   RESPONSIVE
   =========================================== */

@media (max-width: 900px) {
    .metrics-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        grid-auto-flow: row;
    }

    .metrics-grid::before { display: none; }
}

@media (max-width: 768px) {
    .main-content { padding: 1rem; }

    .input-row { flex-direction: column; }

    /* Move privacy note under header on mobile */
    .analysis-card h2 {
        margin-bottom: 8px;
    }

    .tabs-row {
        flex-wrap: wrap;
        justify-content: center;
    }

    .tabs-row .tabs {
        width: 100%;
        flex: none;
    }

    .is-dashboard .tabs-row .tab-btn {
        padding: 10px 8px;
        font-size: 13px;
        gap: 4px;
        min-width: 0;
    }

    .tabs-row .privacy-note {
        order: -1;
        width: 100%;
        margin-bottom: 8px;
        margin-inline-start: 0;
    }

    /* History section header - stack on mobile */
    .history-card .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .prompt-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .prompt-actions { width: 100%; }
    .prompt-actions select { flex: 1; }

    .tab-btn { padding: 0.75rem 1rem; }

    .analysis-tabs {
        gap: 1.5rem;
    }

    .analysis-tab {
        font-size: 0.9rem;
    }

    .tooltip {
        width: calc(100vw - 20px);
        max-width: calc(100vw - 20px);
        min-width: 200px;
    }

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

    /* Share page mobile: remove double borders, reduce padding */
    .share-section {
        padding: 1rem;
        border-radius: var(--radius-lg);
        margin-bottom: 0.75rem;
    }

    .share-header {
        padding: 1.25rem 1rem;
        margin-bottom: 1rem;
    }

    .share-header h2 {
        font-size: 1.25rem;
    }

    /* Remove inner borders on mobile - section border is enough */
    .analysis-container {
        padding: 1rem;
        border: none;
        background: transparent;
    }

    .metrics-display {
        padding: 1rem;
        border: none;
        background: transparent;
    }

    .insight-card {
        padding: 1rem;
        border: none;
        background: var(--bg-muted);
    }

    .insights-grid {
        gap: 0.5rem;
    }

    .prompt-text,
    .transcript-text {
        padding: 1rem;
        border: none;
        margin-top: 0.75rem;
    }

    .remarks-content textarea {
        min-height: 120px;
        padding: 0.875rem 1rem;
    }

    .timeline-bar { height: 18px; }

    .stage-label {
        font-size: 0.55rem;
        padding: 1px 4px;
        top: -18px;
    }

    .stage-marker {
        top: -6px;
        bottom: -6px;
    }

    .energy-graph-section {
        padding: 1rem 0;
        margin-top: 1rem;
        width: 100%;
        margin-left: 0;
        margin-right: 0;
    }

    .energy-chart-container {
        height: 250px;
        padding: 0.5rem;
        border: none;
    }

    .energy-legend {
        gap: 1rem;
        font-size: 0.7rem;
    }

    .metrics-extras {
        flex-wrap: wrap;
        gap: 0.75rem;
        padding: 1rem 0;
    }

    .extra-item {
        padding: 0.5rem 1rem;
        border: none;
        background: var(--bg-muted);
    }

    .timeline-section {
        padding: 1rem 0 0.5rem;
        margin-top: 1rem;
    }

    .timeline-wrapper {
        margin-right: 0;
    }
}

@media (max-width: 640px) {
    .analysis-info {
        gap: 0.5rem;
        font-size: 0.9rem;
    }

    .analysis-item {
        padding: 0.75rem;
        flex-wrap: wrap;
    }

    .analysis-summary {
        width: 100%;
        margin-top: 0.5rem;
        font-size: 0.85rem;
    }

    .header-user { gap: 0.5rem; }

    .demo-banner {
        flex-direction: column;
        text-align: center;
        padding: 1.25rem;
        gap: 1rem;
    }

    .demo-banner .btn-contact {
        width: auto;
        text-align: center;
    }

    /* Share page: extra compact on small screens */
    .share-section {
        padding: 0.875rem;
        margin-bottom: 0.5rem;
    }

    .share-header {
        padding: 1rem 0.875rem;
    }

    .analysis-container {
        padding: 0.75rem;
    }

    .analysis-text {
        font-size: 0.95rem;
        line-height: 1.8;
    }

    .insight-card {
        padding: 0.75rem;
    }

    .insight-label {
        font-size: 0.7rem;
        margin-bottom: 0.4rem;
    }

    .insight-value {
        font-size: 0.875rem;
    }

    .metric-label {
        flex: 0 0 90px;
        font-size: 0.8rem;
    }

    .metric-value {
        width: 2.5rem;
        font-size: 0.8rem;
    }

    .extra-item {
        padding: 0.4rem 0.75rem;
        flex: 1 1 30%;
        min-width: 80px;
    }

    .extra-label {
        font-size: 0.65rem;
    }

    .extra-value {
        font-size: 1rem;
    }

    .analysis-footer {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }

    .like-btn {
        align-self: flex-end;
    }
}

/* RTL Support */
[dir="rtl"] .input-row input { text-align: right; }
[dir="rtl"] .analysis-info { flex-direction: row-reverse; }
