/* ============================================================
   Team Transcriber — design system
   Audio/console inspired: waveform marks, tape-counter timestamps,
   signal-teal accents. Not another generic blue SaaS dashboard.
   ============================================================ */

:root {
    /* Color */
    --ink: #1c1f26;
    --ink-soft: #2a2e37;
    --mist: #f3f5f7;
    --panel: #ffffff;
    --line: #e1e4ea;
    --line-soft: #ebedf1;

    --text: #1c1f26;
    --text-muted: #565f6d;
    --text-faint: #707986;
    --row: #f8f9fb;

    --teal: #1f9c8b;
    --teal-dark: #167a6d;
    --teal-tint: #e4f5f0;

    --amber: #e8a33d;
    --amber-dark: #a86b17;
    --amber-tint: #fdf1dc;

    --danger: #c4432b;
    --danger-dark: #9b3520;
    --danger-tint: #fbe9e5;

    --info: #3d7ae8;
    --info-tint: #e8f0fe;

    /* Type */
    --font-display: "Space Grotesk", "Segoe UI", sans-serif;
    --font-body: "IBM Plex Sans", "Segoe UI", Arial, sans-serif;
    --font-mono: "IBM Plex Mono", Consolas, Monaco, monospace;

    /* Shape */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow-card: 0 1px 2px rgba(28, 31, 38, 0.04), 0 8px 24px rgba(28, 31, 38, 0.06);
    --shadow-pop: 0 4px 12px rgba(28, 31, 38, 0.1);
}

* {
    box-sizing: border-box;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.001ms !important;
        transition-duration: 0.001ms !important;
    }
}

html {
    -webkit-font-smoothing: antialiased;
}

body {
    margin: 0;
    font-family: var(--font-body);
    background: var(--mist);
    color: var(--text);
    line-height: 1.5;
}

h1, h2, h3 {
    font-family: var(--font-display);
    color: var(--ink);
    letter-spacing: -0.01em;
}

a {
    color: var(--teal-dark);
}

:focus-visible {
    outline: 2px solid var(--teal);
    outline-offset: 2px;
}

/* ---------------------------------------------------------
   Topbar + waveform brand mark
   --------------------------------------------------------- */

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 64px;
    padding: 0 32px;
    background: var(--ink);
    color: white;
    border-bottom: 3px solid var(--teal);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.brand-mark {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 18px;
}

.brand-mark span {
    display: block;
    width: 3px;
    background: var(--teal);
    border-radius: 2px;
    animation: wave 1.6s ease-in-out infinite;
}

.brand-mark span:nth-child(1) { height: 40%; animation-delay: 0s; }
.brand-mark span:nth-child(2) { height: 100%; animation-delay: 0.2s; }
.brand-mark span:nth-child(3) { height: 65%; animation-delay: 0.4s; }
.brand-mark span:nth-child(4) { height: 85%; animation-delay: 0.6s; }
.brand-mark span:nth-child(5) { height: 50%; animation-delay: 0.8s; }

@keyframes wave {
    0%, 100% { transform: scaleY(0.55); }
    50% { transform: scaleY(1); }
}

.topbar nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.topbar nav a {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease;
}

.topbar nav a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* ---------------------------------------------------------
   Layout shell
   --------------------------------------------------------- */

.container {
    max-width: 1180px;
    margin: 40px auto 80px;
    padding: 0 24px;
}

.card {
    padding: 26px;
    background: var(--panel);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
}

/* ---------------------------------------------------------
   Auth (login)
   --------------------------------------------------------- */

.auth-shell {
    min-height: calc(100vh - 64px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    padding: 40px 36px;
    background: var(--panel);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-pop);
}

.auth-mark {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 26px;
    margin-bottom: 20px;
}

.auth-mark span {
    display: block;
    width: 4px;
    background: var(--teal);
    border-radius: 2px;
}

.auth-mark span:nth-child(1) { height: 45%; }
.auth-mark span:nth-child(2) { height: 100%; }
.auth-mark span:nth-child(3) { height: 65%; }
.auth-mark span:nth-child(4) { height: 85%; }
.auth-mark span:nth-child(5) { height: 55%; }
.auth-mark span:nth-child(6) { height: 75%; }

.auth-card h1 {
    margin: 0 0 6px;
    font-size: 24px;
}

.auth-card > p {
    margin: 0 0 24px;
    color: var(--text-muted);
    font-size: 14px;
}

/* ---------------------------------------------------------
   Dashboard
   --------------------------------------------------------- */

.dashboard-header {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: flex-end;
    margin-bottom: 28px;
}

.dashboard-header h1 {
    margin: 0 0 6px;
    font-size: 26px;
}

.dashboard-header > div > p {
    margin: 0;
    color: var(--text-muted);
    font-size: 14px;
}

.account {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--panel);
    border: 1px solid var(--line-soft);
    border-radius: 999px;
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
}

.account strong {
    color: var(--text);
}

.role-pill {
    padding: 2px 9px;
    border-radius: 999px;
    background: var(--teal-tint);
    color: var(--teal-dark);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.grid {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 20px;
    align-items: start;
}

.card h2 {
    margin: 0 0 4px;
    font-size: 17px;
}

.card-hint {
    margin: 0 0 18px;
    color: var(--text-muted);
    font-size: 13px;
}

label {
    display: block;
    margin: 18px 0 7px;
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-soft);
}

input,
select,
textarea {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--mist);
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--text);
    transition: border-color 0.15s ease, background 0.15s ease;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--teal);
    background: var(--panel);
    outline: none;
}

input[type="file"] {
    padding: 9px 12px;
}

button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    padding: 11px 20px;
    border: 0;
    border-radius: var(--radius-sm);
    background: var(--teal);
    color: white;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
}

button:hover {
    background: var(--teal-dark);
}

button:active {
    transform: translateY(1px);
}

.alert {
    margin: 0 0 16px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    border: 1px solid transparent;
}

.alert.success {
    background: var(--teal-tint);
    color: var(--teal-dark);
    border-color: rgba(31, 156, 139, 0.25);
}

.alert.error {
    background: var(--danger-tint);
    color: var(--danger-dark);
    border-color: rgba(196, 67, 43, 0.25);
}

/* ---------------------------------------------------------
   Job list (replaces plain table)
   --------------------------------------------------------- */

.job-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.job-row {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    gap: 18px;
    align-items: center;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--row);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.job-row:hover {
    border-color: #cfd5de;
    box-shadow: 0 2px 8px rgba(28, 31, 38, 0.05);
}

.job-file {
    min-width: 0;
}

.job-file .name {
    display: block;
    font-weight: 600;
    color: var(--ink);
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.job-file .meta {
    display: block;
    margin-top: 3px;
    color: var(--text-faint);
    font-size: 12px;
    font-family: var(--font-mono);
}

.job-error {
    display: block;
    margin-top: 4px;
    color: var(--danger-dark);
    font-size: 12px;
}

.job-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.job-actions a {
    padding: 7px 11px;
    border-radius: var(--radius-sm);
    background: var(--panel);
    border: 1px solid var(--line);
    color: var(--text);
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.job-actions a.primary {
    background: var(--ink);
    border-color: var(--ink);
    color: white;
}

.job-actions a:hover {
    border-color: var(--teal);
    color: var(--teal-dark);
}

.job-actions a.primary:hover {
    background: var(--ink-soft);
    color: white;
}

.job-unavailable {
    color: var(--text-faint);
    font-size: 12px;
}

/* --- Bulk selection bar --- */

.bulk-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
    padding: 10px 14px;
    background: var(--row);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
}

.bulk-select-all {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
}

.bulk-select-all input {
    width: auto;
    margin: 0;
    accent-color: var(--teal);
    cursor: pointer;
}

.bulk-count {
    color: var(--text-faint);
    font-family: var(--font-mono);
    font-size: 12px;
}

.bulk-delete-btn {
    margin: 0 0 0 auto;
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--panel);
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.bulk-delete-btn:hover:not(:disabled) {
    border-color: var(--danger);
    background: var(--danger-tint);
    color: var(--danger-dark);
}

.bulk-delete-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.job-check {
    display: flex;
    align-items: center;
    margin: 0;
}

.job-check input {
    width: auto;
    margin: 0;
    accent-color: var(--teal);
    cursor: pointer;
}

.job-check input:disabled {
    cursor: not-allowed;
    opacity: 0.4;
}

/* --- Export dropdown --- */

.export-menu {
    position: relative;
    display: inline-block;
}

.export-toggle {
    margin: 0;
    padding: 7px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--panel);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.export-toggle:hover {
    border-color: var(--teal);
    color: var(--teal-dark);
}

.export-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 20;
    min-width: 190px;
    padding: 8px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-pop);
}

.export-menu.open .export-dropdown {
    display: block;
}

.export-group-label {
    display: block;
    padding: 6px 10px 4px;
    color: var(--text-faint);
    font-family: var(--font-display);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.export-dropdown a {
    display: block;
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
}

.export-dropdown a:hover {
    background: var(--teal-tint);
    color: var(--teal-dark);
}

.empty-state {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

.empty-state .brand-mark {
    justify-content: center;
    margin: 0 auto 14px;
    opacity: 0.4;
}

/* ---------------------------------------------------------
   Status pills — styled like recording level indicators
   --------------------------------------------------------- */

.status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--line-soft);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
    white-space: nowrap;
}

.status::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.status.queued { background: var(--amber-tint); color: var(--amber-dark); }
.status.processing { background: var(--info-tint); color: #2453ad; }
.status.processing::before { animation: pulse 1.2s ease-in-out infinite; }
.status.completed { background: var(--teal-tint); color: var(--teal-dark); }
.status.failed { background: var(--danger-tint); color: var(--danger-dark); }

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

/* ---------------------------------------------------------
   Transcript editor
   --------------------------------------------------------- */

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 24px;
}

.eyebrow {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--teal-dark);
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.editor-header h1 {
    margin: 4px 0 0;
    font-size: 24px;
}

.editor-description {
    margin: 8px 0 0;
    color: var(--text-muted);
    font-size: 14px;
    max-width: 52ch;
}

.editor-card {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.transcript-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 18px;
    padding: 16px 18px;
    background: var(--row);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
}

.detail-label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-faint);
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.editor-form textarea {
    width: 100%;
    min-height: 520px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--panel);
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.7;
    resize: vertical;
}

.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    align-items: center;
    margin-bottom: 12px;
    padding: 12px 14px;
    background: var(--row);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.toolbar-group-right {
    margin-left: auto;
}

.toolbar-input {
    width: 160px;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--panel);
    font-family: var(--font-body);
    font-size: 13px;
}

.toolbar-btn {
    margin: 0;
    padding: 7px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--panel);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.toolbar-btn:hover:not(:disabled) {
    border-color: var(--teal);
    color: var(--teal-dark);
}

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

.toolbar-match-count {
    min-width: 64px;
    color: var(--text-faint);
    font-family: var(--font-mono);
    font-size: 12px;
}

.editor-shortcuts-hint {
    margin: 10px 0 0;
    color: var(--text-faint);
    font-size: 12px;
}

.editor-shortcuts-hint kbd {
    padding: 1px 6px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--row);
    font-family: var(--font-mono);
    font-size: 11px;
}

.save-status {
    margin-left: auto;
    align-self: center;
    color: var(--text-muted);
    font-size: 13px;
}

.save-status.dirty {
    color: var(--amber-dark);
    font-weight: 600;
}

.editor-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.secondary-button {
    display: inline-flex;
    align-items: center;
    padding: 11px 18px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    transition: border-color 0.15s ease;
}

.secondary-button:hover {
    border-color: var(--teal);
    color: var(--teal-dark);
}

.editor-export-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--line-soft);
    font-size: 13px;
    color: var(--text-muted);
}

.editor-export-links a {
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    background: var(--mist);
    color: var(--ink-soft);
    font-weight: 600;
    font-size: 12px;
    text-decoration: none;
    font-family: var(--font-mono);
    letter-spacing: 0.02em;
}

.editor-export-links a:hover {
    background: var(--teal-tint);
    color: var(--teal-dark);
}

/* ---------------------------------------------------------
   Media player panel
   --------------------------------------------------------- */

.media-player-panel {
    padding: 20px;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-md);
    background: var(--ink);
}

.media-player-panel .detail-label {
    color: rgba(255, 255, 255, 0.5);
}

.media-player-panel h2 {
    margin: 4px 0 16px;
    font-size: 16px;
    color: white;
    overflow-wrap: anywhere;
}

.transcript-media {
    display: block;
    width: 100%;
    border-radius: var(--radius-sm);
}

.transcript-video {
    max-height: 520px;
    border-radius: var(--radius-sm);
    background: #000;
}

.media-player-help {
    margin: 12px 0 0;
    color: rgba(255, 255, 255, 0.55);
    font-size: 13px;
    line-height: 1.5;
}

.media-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
}

.media-control-btn {
    margin: 0;
    padding: 8px 14px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.06);
    color: white;
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.media-control-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: var(--teal);
}

.media-speed-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 0 auto;
    color: rgba(255, 255, 255, 0.55);
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.media-speed-select {
    width: auto;
    padding: 7px 10px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.06);
    color: white;
    font-family: var(--font-mono);
    font-size: 13px;
}

.media-speed-select:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--teal);
}

.media-speed-select option {
    background: #ffffff;
    color: var(--text);
}

/* ---------------------------------------------------------
   Timestamp panel — "tape counter" styling
   --------------------------------------------------------- */

.timestamp-panel {
    padding: 20px;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-md);
    background: var(--panel);
}

.timestamp-panel-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 14px;
}

.timestamp-panel-header h2 {
    margin: 4px 0 0;
    font-size: 18px;
}

.timestamp-count {
    padding: 5px 11px;
    border-radius: 999px;
    background: var(--teal-tint);
    color: var(--teal-dark);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.timestamp-segments {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 440px;
    overflow-y: auto;
    padding-right: 4px;
}

.timestamp-segment {
    display: grid;
    grid-template-columns: 76px 1fr;
    gap: 4px 12px;
    width: 100%;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-left: 3px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--row);
    color: var(--text);
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.timestamp-segment:hover {
    border-left-color: var(--teal);
    background: var(--teal-tint);
}

.timestamp-segment.active {
    border-color: var(--teal);
    border-left-color: var(--teal);
    border-left-width: 4px;
    background: var(--teal-tint);
    box-shadow: 0 0 0 1px rgba(31, 156, 139, 0.35), 0 2px 8px rgba(31, 156, 139, 0.15);
}

.timestamp-segment.active .timestamp-badge {
    background: var(--teal);
    color: white;
}

.timestamp-segment.active .timestamp-text {
    color: var(--ink);
    font-weight: 500;
}

.timestamp-badge {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    height: fit-content;
    padding: 4px 6px;
    border-radius: 4px;
    background: var(--ink);
    color: #9fe8dc;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.timestamp-text {
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
}

.speaker-tag {
    display: inline-block;
    margin-right: 6px;
    padding: 1px 7px;
    border-radius: 4px;
    background: var(--line-soft);
    color: var(--text-muted);
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    vertical-align: 1px;
}

/* Colour-code the first few speakers so turns are scannable. */
.speaker-tag[data-speaker="Speaker 1"] {
    background: var(--teal-tint);
    color: var(--teal-dark);
}

.speaker-tag[data-speaker="Speaker 2"] {
    background: var(--info-tint);
    color: #2453ad;
}

.speaker-tag[data-speaker="Speaker 3"] {
    background: var(--amber-tint);
    color: var(--amber-dark);
}

.speaker-tag[data-speaker="Speaker 4"] {
    background: #f0e6fb;
    color: #6b3fa0;
}

.timestamp-empty {
    padding: 16px;
    border: 1px dashed var(--line);
    border-radius: var(--radius-md);
    background: var(--mist);
    color: var(--text-muted);
    font-size: 14px;
}

/* ---------------------------------------------------------
   Segment clip markers
   --------------------------------------------------------- */

.segment-clip-actions {
    grid-column: 2;
    display: flex;
    gap: 6px;
    margin-top: 6px;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.timestamp-segment:hover .segment-clip-actions,
.timestamp-segment:focus-within .segment-clip-actions,
.timestamp-segment.active .segment-clip-actions {
    opacity: 1;
}

.segment-clip-btn {
    margin: 0;
    padding: 3px 8px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--panel);
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 11px;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.segment-clip-btn:hover {
    border-color: var(--teal);
    color: var(--teal-dark);
}

/* ---------------------------------------------------------
   Clip creation panel
   --------------------------------------------------------- */

.clip-panel {
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--row);
}

.clip-panel h2 {
    margin: 4px 0 6px;
    font-size: 17px;
}

.clip-help {
    margin: 0 0 16px;
    color: var(--text-muted);
    font-size: 13px;
}

.clip-range,
.clip-options,
.clip-actions {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 12px;
}

.clip-options {
    margin-top: 14px;
}

.clip-actions {
    align-items: center;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.clip-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
    color: var(--text-faint);
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.clip-time-display {
    width: 92px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--ink);
    color: #9fe8dc;
    font-family: var(--font-mono);
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    text-align: center;
}

.clip-set-btn {
    margin: 0;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--panel);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.clip-set-btn:hover {
    border-color: var(--teal);
    color: var(--teal-dark);
}

.clip-duration {
    align-self: center;
    padding: 5px 11px;
    border-radius: 999px;
    background: var(--teal-tint);
    color: var(--teal-dark);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.clip-duration.invalid {
    background: var(--danger-tint);
    color: var(--danger-dark);
}

.clip-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding-bottom: 9px;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    text-transform: none;
    letter-spacing: normal;
    color: var(--text);
    cursor: pointer;
}

.clip-checkbox input {
    width: auto;
    margin: 0;
    accent-color: var(--teal);
    cursor: pointer;
}

.clip-options select {
    width: auto;
    min-width: 240px;
    font-family: var(--font-body);
    text-transform: none;
    letter-spacing: normal;
}

.clip-create-btn {
    margin: 0;
    padding: 11px 20px;
    border: 0;
    border-radius: var(--radius-sm);
    background: var(--teal);
    color: white;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}

.clip-create-btn:hover:not(:disabled) {
    background: var(--teal-dark);
}

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

.clip-preview-btn {
    margin: 0;
    padding: 10px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--panel);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.clip-preview-btn:hover {
    border-color: var(--teal);
    color: var(--teal-dark);
}

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

/* ---------------------------------------------------------
   Responsive
   --------------------------------------------------------- */

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

    .dashboard-header,
    .editor-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .job-row {
        grid-template-columns: 1fr;
        align-items: flex-start;
    }

    .editor-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .editor-actions button,
    .editor-actions .secondary-button {
        width: 100%;
    }

    .timestamp-panel-header {
        flex-direction: column;
    }

    .timestamp-segment {
        grid-template-columns: 1fr;
    }
}

/* ---------------------------------------------------------
   Sales analysis panel
   --------------------------------------------------------- */

.analysis-panel {
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--panel);
}

.analysis-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.analysis-header h2 {
    margin: 4px 0 0;
    font-size: 17px;
}

.analysis-run-form {
    margin: 0;
}

.analysis-run-btn {
    margin: 0;
    padding: 9px 16px;
    border: 0;
    border-radius: var(--radius-sm);
    background: var(--ink);
    color: white;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease;
}

.analysis-run-btn:hover:not(:disabled) {
    background: var(--ink-soft);
}

.analysis-run-btn:disabled {
    opacity: 0.6;
    cursor: progress;
}

.analysis-empty {
    padding: 16px;
    border: 1px dashed var(--line);
    border-radius: var(--radius-md);
    background: var(--row);
    color: var(--text-muted);
    font-size: 14px;
}

.analysis-empty code {
    padding: 1px 6px;
    border-radius: 4px;
    background: var(--line-soft);
    font-family: var(--font-mono);
    font-size: 12px;
}

.analysis-summary {
    margin: 0 0 14px;
    color: var(--text);
    font-size: 15px;
    line-height: 1.6;
}

.analysis-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.analysis-chip {
    padding: 5px 11px;
    border-radius: 999px;
    background: var(--line-soft);
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
}

.analysis-chip.outcome-booked {
    background: var(--teal-tint);
    color: var(--teal-dark);
}

.analysis-chip.outcome-follow_up {
    background: var(--amber-tint);
    color: var(--amber-dark);
}

.analysis-chip.outcome-no_interest {
    background: var(--danger-tint);
    color: var(--danger-dark);
}

.analysis-block {
    margin-bottom: 22px;
}

.analysis-block h3 {
    margin: 0 0 10px;
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-faint);
}

.analysis-block.coaching {
    padding: 16px;
    border-left: 3px solid var(--teal);
    border-radius: var(--radius-sm);
    background: var(--teal-tint);
}

.analysis-block.coaching h3 {
    color: var(--teal-dark);
}

.analysis-block.coaching p {
    margin: 0;
    color: var(--ink);
    font-size: 14px;
    line-height: 1.6;
}

.analysis-item {
    margin-bottom: 10px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-left: 3px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--row);
}

.analysis-item.good {
    border-left-color: var(--teal);
}

.analysis-item.needs-work {
    border-left-color: var(--amber);
}

.analysis-item-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 6px;
}

.analysis-item-head strong {
    font-size: 14px;
    color: var(--ink);
}

.analysis-tag {
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--line-soft);
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
}

.jump-btn {
    margin: 0 0 0 auto;
    padding: 3px 10px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--panel);
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 11px;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.jump-btn:hover {
    border-color: var(--teal);
    color: var(--teal-dark);
}

.analysis-quote {
    margin: 6px 0;
    padding-left: 12px;
    border-left: 2px solid var(--line);
    color: var(--text-muted);
    font-size: 13px;
    font-style: italic;
    line-height: 1.5;
}

.analysis-detail {
    margin: 6px 0 0;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.5;
}

.analysis-detail.improve {
    color: var(--teal-dark);
}

.analysis-list {
    margin: 0;
    padding-left: 20px;
    color: var(--text);
    font-size: 14px;
    line-height: 1.7;
}
