/* Safi — Browser Recording UI Styles */

/* Design tokens */
:root {
    --navy: #1a2332;
    --navy-light: #243044;
    --green: #00c853;
    --green-dark: #00a844;
    --green-light: rgba(0, 200, 83, 0.1);
    --red: #ff1744;
    --red-dark: #d50032;
    --red-light: rgba(255, 23, 68, 0.1);
    --yellow: #ffc107;
    --yellow-light: rgba(255, 193, 7, 0.1);
    --gray-light: #f5f5f5;
    --gray: #e0e0e0;
    --gray-dark: #9e9e9e;
    --text: #333;
    --text-light: #666;
    --white: #fff;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.12);
    --radius: 8px;
    --radius-sm: 4px;
    --transition: 0.2s ease;
}

/* Reset & base */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
        Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    background: var(--gray-light);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
}

/* Header */
.header {
    background: var(--navy);
    color: var(--white);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-brand h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.header-brand .tagline {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 400;
}

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

.user-email {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
}

.sign-out-btn {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.8);
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.8rem;
    transition: all var(--transition);
}

.sign-out-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    color: var(--white);
}

/* Main content area */
.main-content {
    max-width: 600px;
    margin: 40px auto;
    padding: 0 20px;
}

/* Card */
.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 32px;
    margin-bottom: 24px;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--navy);
}

/* Login section */
#login-section {
    text-align: center;
    padding-top: 60px;
}

#login-section .brand-header {
    margin-bottom: 40px;
}

.safi-avatar-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin-bottom: 16px;
    filter: drop-shadow(0 4px 12px rgba(26, 35, 50, 0.15));
}

.safi-avatar-header {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
    vertical-align: middle;
}

#login-section .brand-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 4px;
}

#login-section .brand-header p {
    color: var(--text-light);
    font-size: 0.95rem;
}

.login-card {
    text-align: left;
}

/* Form elements */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-light);
    margin-bottom: 6px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"] {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--gray);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    color: var(--text);
    background: var(--white);
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}

.form-group input:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px var(--green-light);
}

.form-group input::placeholder {
    color: var(--gray-dark);
}

.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--gray);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    color: var(--text);
    background: var(--white);
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
    line-height: 1.5;
}

.form-group textarea:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px var(--green-light);
}

.form-group textarea::placeholder {
    color: var(--gray-dark);
}

.form-group select {
    width: 100%;
    padding: 10px 36px 10px 14px;
    border: 1px solid var(--gray);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 400;
    color: var(--text);
    background: var(--white);
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
    font-family: inherit;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239e9e9e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.form-group select:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px var(--green-light);
}

.form-group select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    outline: none;
    line-height: 1;
}

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

.btn-primary {
    background: var(--green);
    color: var(--white);
}

.btn-primary:hover:not(:disabled) {
    background: var(--green-dark);
    box-shadow: var(--shadow);
}

.btn-danger {
    background: var(--red);
    color: var(--white);
}

.btn-danger:hover:not(:disabled) {
    background: var(--red-dark);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background: var(--navy);
    color: var(--white);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--navy-light);
    box-shadow: var(--shadow);
}

.btn-google {
    background: var(--white);
    color: var(--text);
    border: 1px solid var(--gray);
    font-size: 1rem;
    padding: 14px 24px;
}

.btn-google:hover:not(:disabled) {
    background: var(--gray-light);
    border-color: var(--gray-dark);
    box-shadow: var(--shadow);
}

.btn-google svg {
    flex-shrink: 0;
}

.btn-full {
    width: 100%;
}

.btn-large {
    padding: 16px 32px;
    font-size: 1.1rem;
    border-radius: 12px;
}

/* Tab bar */
.tab-bar {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.tab-btn {
    flex: 1;
    padding: 14px 20px;
    border: none;
    background: var(--white);
    color: var(--text-light);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
}

.tab-btn:hover {
    background: var(--gray-light);
    color: var(--text);
}

.tab-btn.active {
    color: var(--navy);
    background: var(--white);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--green);
}

.tab-btn .tab-title {
    display: block;
    line-height: 1.2;
}

.tab-btn .tab-subtitle {
    display: block;
    font-size: 0.72rem;
    font-weight: 500;
    line-height: 1.2;
    opacity: 0.8;
    margin-top: 2px;
}

/* Tab content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Recording section */
#recording-section {
    display: none;
}

.call-details {
    margin-bottom: 24px;
}

/* Recording controls */
.recording-controls {
    text-align: center;
    padding: 8px 0;
}

.recording-actions {
    display: flex;
    gap: 12px;
}

.btn-half {
    width: 48%;
    flex: 1;
}

/* Recording indicator */
.recording-indicator {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 24px;
    padding: 16px;
    background: var(--red-light);
    border-radius: var(--radius);
}

.recording-indicator.active {
    display: flex;
}

.recording-indicator.paused {
    background: var(--yellow-light);
}

.recording-indicator.paused .pulse-dot {
    background: var(--yellow);
    animation: none;
}

.recording-indicator.paused .recording-label {
    color: #856404;
}

.recording-indicator.paused .recording-label::after {
    content: ' — Paused';
}

.recording-indicator.paused .elapsed-time {
    color: #856404;
}

.pulse-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--red);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.3);
        opacity: 0.6;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.recording-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--red);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.elapsed-time {
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--red);
    min-width: 60px;
}

/* Audio level monitor */
.audio-monitor {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.audio-level-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.audio-level-track {
    flex: 1;
    height: 6px;
    background: var(--gray);
    border-radius: 3px;
    overflow: hidden;
}

.audio-level-fill {
    height: 100%;
    width: 0%;
    border-radius: 3px;
    transition: width 100ms ease-out;
}

.audio-level-fill.level-green {
    background: var(--green);
}

.audio-level-fill.level-yellow {
    background: var(--yellow);
}

.audio-level-fill.level-red {
    background: var(--red);
}

.audio-source-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-light);
    white-space: nowrap;
    flex-shrink: 0;
}

.silence-warning {
    font-size: 0.8rem;
    font-weight: 500;
    color: #856404;
    background: var(--yellow-light);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
}

.audio-monitor.paused .audio-level-fill {
    background: var(--gray-dark);
    opacity: 0.5;
}

.audio-monitor.paused .audio-source-label {
    opacity: 0.5;
}

/* Post-recording info */
.post-recording {
    display: none;
    text-align: center;
    margin-bottom: 16px;
}

.post-recording.active {
    display: block;
}

.duration-display {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 16px;
}

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

/* Status area */
.status-area {
    display: none;
    margin-top: 24px;
}

.status-area.active {
    display: block;
}

.status-message {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
}

.status-message.uploading,
.status-message.processing {
    background: var(--yellow-light);
    color: #856404;
}

.status-message.ready {
    background: var(--green-light);
    color: #1b5e20;
}

.status-message.error {
    background: var(--red-light);
    color: #c62828;
}

.status-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.status-check {
    font-size: 1.1rem;
}

.status-link {
    display: inline-block;
    margin-top: 10px;
    color: var(--green-dark);
    font-weight: 500;
    text-decoration: none;
}

.status-link:hover {
    text-decoration: underline;
}

/* Login error */
.login-error {
    display: none;
    padding: 10px 14px;
    background: var(--red-light);
    color: #c62828;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    margin-bottom: 16px;
}

.login-error.active {
    display: block;
}

/* Recording History */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-empty {
    text-align: center;
    color: var(--gray-dark);
    padding: 24px 0;
    font-size: 0.9rem;
}

.history-item {
    border: 1px solid var(--gray);
    border-radius: var(--radius);
    padding: 14px 16px;
    cursor: pointer;
    transition: all var(--transition);
}

.history-item:hover {
    border-color: var(--green);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.history-title {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-status {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 3px 8px;
    border-radius: 10px;
    white-space: nowrap;
    flex-shrink: 0;
}

.status-ready,
.status-completed {
    background: var(--green-light);
    color: #1b5e20;
}

.status-processing,
.status-transcribing,
.status-summarizing,
.status-uploading {
    background: var(--yellow-light);
    color: #856404;
}

.status-error,
.status-failed {
    background: var(--red-light);
    color: #c62828;
}

.history-meta {
    display: flex;
    gap: 12px;
    margin-top: 4px;
    font-size: 0.8rem;
    color: var(--gray-dark);
}

.history-error-reason {
    margin-top: 6px;
    font-size: 0.8rem;
    color: #b3261e;
}

/* History search bar */
.history-search {
    position: relative;
    margin-bottom: 12px;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-dark);
    pointer-events: none;
}

.history-search input {
    width: 100%;
    padding: 10px 36px 10px 36px;
    border: 1px solid var(--gray);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--text);
    background: var(--white);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.history-search input:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px var(--green-light);
}

.history-search input::placeholder {
    color: var(--gray-dark);
}

.search-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--gray-dark);
    cursor: pointer;
    padding: 2px 6px;
    line-height: 1;
}

.search-clear:hover {
    color: var(--text);
}

/* History filter chips */
.history-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.filter-chip {
    padding: 5px 14px;
    border-radius: 20px;
    border: 1px solid var(--gray);
    background: var(--white);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-light);
    cursor: pointer;
    transition: all var(--transition);
}

.filter-chip:hover {
    border-color: var(--green);
    color: var(--green-dark);
}

.filter-chip.active {
    background: var(--green-light);
    border-color: var(--green);
    color: var(--green-dark);
    font-weight: 600;
}

/* Client filter */
.filter-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.client-filter-row {
    margin-top: 8px;
}

.client-filter-select {
    width: 100%;
    padding: 7px 32px 7px 12px;
    border: 1px solid var(--gray);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-light);
    background: var(--white);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    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='%239e9e9e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    transition: all var(--transition);
    outline: none;
}

.client-filter-select:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px var(--green-light);
}

.client-filter-select.active-filter {
    background-color: var(--green-light);
    border-color: var(--green);
    color: var(--green-dark);
    font-weight: 600;
}

/* Client badge (in history items and detail) */
.client-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(26, 35, 50, 0.08);
    color: var(--navy);
    white-space: nowrap;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.client-badge-detail {
    padding: 3px 12px;
    font-size: 0.8rem;
    border-radius: 14px;
    cursor: pointer;
    transition: all var(--transition);
}

.client-badge-detail:hover {
    background: rgba(26, 35, 50, 0.14);
}

.client-tag-add {
    font-size: 0.8rem;
    color: var(--green-dark);
    cursor: pointer;
    font-weight: 500;
    transition: color var(--transition);
}

.client-tag-add:hover {
    color: var(--green);
}

/* Client picker (inline dropdown) */
.client-picker-overlay {
    position: fixed;
    inset: 0;
    z-index: 300;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.client-picker {
    background: var(--white);
    border-radius: 12px;
    padding: 20px;
    width: 90%;
    max-width: 340px;
    box-shadow: var(--shadow-lg);
}

.client-picker h4 {
    margin: 0 0 12px;
    font-size: 1rem;
    color: var(--navy);
}

.client-picker select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--gray);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    margin-bottom: 8px;
    outline: none;
}

.client-picker select:focus {
    border-color: var(--green);
}

.client-picker input[type="text"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--gray);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    margin-bottom: 12px;
    outline: none;
}

.client-picker input[type="text"]:focus {
    border-color: var(--green);
}

.client-picker-actions {
    display: flex;
    gap: 8px;
}

.client-picker-actions .btn {
    flex: 1;
    padding: 8px 16px;
    font-size: 0.85rem;
}

/* Load more button */
.load-more-btn {
    margin-top: 16px;
}

.load-more-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Calendar tab */
.calendar-status-card,
.calendar-prefs-card,
.calendar-events-card {
    border: 1px solid var(--gray);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 14px;
    background: var(--white);
}

.calendar-status-header {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
}

.calendar-status-badge {
    display: inline-flex;
    width: fit-content;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.calendar-status-badge.connected {
    background: var(--green-light);
    color: #1b5e20;
}

.calendar-status-badge.disconnected {
    background: var(--red-light);
    color: #b71c1c;
}

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

.calendar-status-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.calendar-prefs-card h4,
.calendar-events-header h4 {
    margin: 0 0 10px 0;
    font-size: 0.95rem;
    color: var(--navy);
}

.calendar-prefs-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 10px;
}

.calendar-pref-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text);
}

.calendar-pref-item select {
    margin-left: 8px;
    width: auto;
    min-width: 150px;
}

.calendar-events-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.calendar-events-subtitle {
    font-size: 0.8rem;
    color: var(--text-light);
}

.calendar-events-loading,
.calendar-events-empty,
.calendar-events-error {
    font-size: 0.85rem;
    color: var(--text-light);
    padding: 10px 4px;
}

.calendar-events-error {
    color: #b71c1c;
}

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

.calendar-event-row {
    border: 1px solid var(--gray);
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: flex-start;
}

.calendar-event-details {
    min-width: 0;
    flex: 1;
}

.calendar-event-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.4;
}

.calendar-event-meta {
    font-size: 0.78rem;
    color: var(--text-light);
    margin-top: 2px;
}

.calendar-event-link {
    display: inline-block;
    margin-top: 4px;
    font-size: 0.78rem;
    color: var(--green-dark);
    text-decoration: none;
}

.calendar-event-link:hover {
    text-decoration: underline;
}

.calendar-event-controls {
    flex-shrink: 0;
}

.calendar-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text);
}

.calendar-toggle input[type="checkbox"] {
    accent-color: var(--green);
}

.history-summary {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--gray);
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-light);
    white-space: pre-wrap;
}

/* Step-by-step processing stepper */
.stepper-active {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--yellow-light);
    color: #856404;
}

.stepper-header {
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
}

.stepper-track {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
}

.stepper-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
}

.stepper-dot.completed {
    background: var(--green);
    color: var(--white);
    font-size: 0.8rem;
}

.stepper-dot.current {
    background: var(--yellow);
    color: var(--white);
}

.stepper-dot.upcoming {
    background: var(--gray);
    color: var(--text-light);
}

.stepper-dot-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: block;
}

.stepper-connector {
    flex: 1;
    height: 3px;
    background: var(--gray);
    min-width: 16px;
    max-width: 40px;
}

.stepper-connector.completed {
    background: var(--green);
}

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

.consent-modal-overlay.hidden { display: none; }

.consent-modal {
    background: var(--white);
    border-radius: 12px;
    padding: 32px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.consent-icon { width: 64px; height: 64px; margin-bottom: 12px; }

.consent-modal h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 8px;
}

.consent-modal p {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 20px;
    line-height: 1.5;
}

.consent-copy-box {
    background: var(--gray-light);
    border: 1px solid var(--gray);
    border-radius: var(--radius);
    padding: 12px 14px;
    margin-bottom: 16px;
    position: relative;
    text-align: left;
}

.consent-copy-text {
    font-size: 0.85rem;
    color: var(--text);
    line-height: 1.5;
    margin: 0 0 8px 0;
    font-style: italic;
}

.consent-copy-btn {
    background: var(--white);
    border: 1px solid var(--gray);
    border-radius: var(--radius-sm);
    padding: 4px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    transition: all var(--transition);
}

.consent-copy-btn:hover {
    border-color: var(--green);
    color: var(--green-dark);
}

.clickup-opt-out {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-light);
    cursor: pointer;
    margin-top: 6px;
    float: right;
}

.consent-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-ghost {
    background: none;
    color: var(--text-light);
    border: none;
    font-size: 0.9rem;
    cursor: pointer;
}

.btn-ghost:hover { color: var(--text); }

/* What's New banner */
.whats-new-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    padding: 12px 16px;
    border-radius: var(--radius);
    background: var(--green-light);
    border: 1px solid var(--green);
    font-size: 0.9rem;
    color: var(--text);
}

.whats-new-dismiss {
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    color: var(--text-light);
    padding: 0 4px;
    line-height: 1;
}

.whats-new-dismiss:hover {
    color: var(--text);
}

/* --- API Token Button & Modal --- */

.token-btn {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.8);
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.8rem;
    transition: all var(--transition);
}

.token-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    color: var(--white);
}

.token-modal-inner {
    text-align: left;
}

.token-modal-desc {
    text-align: left;
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 20px;
    line-height: 1.5;
}

.token-hint {
    text-align: center;
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.token-display-box {
    background: var(--gray-light);
    border: 1px solid var(--gray);
    border-radius: var(--radius);
    padding: 12px 14px;
    margin-bottom: 12px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.token-display-text {
    flex: 1;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.78rem;
    word-break: break-all;
    line-height: 1.5;
    color: var(--text);
}

.token-warning {
    font-size: 0.8rem;
    font-weight: 600;
    color: #c62828;
    text-align: center;
    margin-bottom: 8px;
}

.token-expiry {
    font-size: 0.8rem;
    color: var(--text-light);
    text-align: center;
}

.token-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--gray-light);
    font-size: 0.85rem;
}

.token-info-row:last-of-type {
    border-bottom: none;
}

.token-info-label {
    color: var(--text-light);
    font-weight: 500;
}

.token-info-value {
    color: var(--text);
    font-weight: 500;
}

.token-info-value code,
code.token-info-value {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.82rem;
}

.token-copy-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.token-copy-icon {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-light);
    padding: 2px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    transition: color var(--transition);
}

.token-copy-icon:hover {
    color: var(--primary);
}

.token-instructions-box { margin-top: 16px; }

.token-instructions-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 8px;
}

.token-instructions-text {
    background: var(--gray-light);
    border: 1px solid var(--gray);
    border-radius: var(--radius-sm);
    padding: 12px;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.72rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 200px;
    overflow-y: auto;
    color: var(--text);
    margin-bottom: 8px;
}

/* Hidden utility */
.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }

    .header-brand {
        flex-direction: column;
        align-items: center;
        gap: 2px;
    }

    .header-actions {
        gap: 12px;
    }

    .main-content {
        margin: 24px auto;
        padding: 0 16px;
    }

    .card {
        padding: 24px;
    }

    #login-section {
        padding-top: 32px;
    }

    .btn-large {
        padding: 14px 24px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .header-brand h1 {
        font-size: 1.25rem;
    }

    .header-brand .tagline {
        font-size: 0.75rem;
    }

    .card {
        padding: 20px;
    }

    .recording-indicator {
        flex-direction: column;
        gap: 8px;
    }

    .audio-level-row {
        flex-direction: column;
        gap: 6px;
        align-items: stretch;
    }

    .audio-source-label {
        text-align: center;
    }

    .stepper-dot {
        width: 24px;
        height: 24px;
        font-size: 0.6rem;
    }

    .stepper-dot-spinner {
        width: 12px;
        height: 12px;
    }

    .stepper-connector {
        min-width: 12px;
    }

    .stepper-header {
        font-size: 0.8rem;
    }

    .filter-chip {
        padding: 4px 10px;
        font-size: 0.75rem;
    }

    .calendar-status-actions {
        flex-direction: column;
    }

    .calendar-event-row {
        flex-direction: column;
    }
}

/* =========================================================================
   Call Detail Overlay
   ========================================================================= */

#call-detail-section {
    position: fixed;
    inset: 0;
    z-index: 150;
    background: var(--gray-light);
    overflow-y: auto;
    animation: slideInRight 0.25s ease-out;
}

@keyframes slideInRight {
    from { transform: translateX(30px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Detail header */
.detail-header {
    background: var(--navy);
    color: var(--white);
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 160;
    box-shadow: var(--shadow);
}

.detail-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* PDF download button */
.btn-pdf {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.8);
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all var(--transition);
}

.btn-pdf:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    color: var(--white);
}

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

.detail-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    color: var(--white);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}

.detail-back-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.detail-capture-badge {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 4px 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.8);
}

/* Detail content area */
.detail-content {
    max-width: 800px;
    margin: 24px auto;
    padding: 0 20px;
}

/* Meta card */
.detail-meta-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px 28px;
    margin-bottom: 20px;
}

.detail-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 8px;
    line-height: 1.3;
}

.detail-meta-row {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.85rem;
    color: var(--text-light);
    flex-wrap: wrap;
}

.detail-clickup-link {
    color: var(--green-dark);
    font-weight: 500;
    text-decoration: none;
}

.detail-clickup-link:hover {
    text-decoration: underline;
}

.detail-error-banner {
    margin-top: 12px;
    background: #fdecea;
    color: #b3261e;
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 0.88rem;
    line-height: 1.4;
}

/* Detail tab bar */
.detail-tab-bar {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.detail-tab-bar .tab-btn {
    flex: 1;
}

/* Detail panel header (copy button row) */
.detail-panel-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 12px;
}

/* Copy button */
.btn-copy {
    background: var(--white);
    border: 1px solid var(--gray);
    border-radius: var(--radius-sm);
    padding: 6px 16px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    transition: all var(--transition);
}

.btn-copy:hover {
    border-color: var(--green);
    color: var(--green-dark);
}

.btn-copy.copied {
    border-color: var(--green);
    background: var(--green-light);
    color: var(--green-dark);
}

/* ---- Summary rendering ---- */
.summary-rendered {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px 32px;
    line-height: 1.7;
    color: var(--text);
}

.summary-rendered h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--navy);
    margin: 24px 0 12px 0;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--green);
}

.summary-rendered h2:first-child {
    margin-top: 0;
}

.summary-rendered ul {
    list-style: none;
    padding: 0;
    margin: 0 0 16px 0;
}

.summary-rendered li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 6px;
    font-size: 0.95rem;
}

.summary-rendered li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 9px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
}

.summary-rendered li.action-item {
    padding-left: 28px;
}

.summary-rendered li.action-item::before {
    content: '';
    width: 14px;
    height: 14px;
    border-radius: 3px;
    border: 2px solid var(--green);
    background: none;
    top: 5px;
    left: 0;
}

.summary-rendered blockquote {
    border-left: 3px solid var(--green);
    padding: 8px 16px;
    margin: 8px 0 16px 0;
    color: var(--text-light);
    font-style: italic;
    background: var(--green-light);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.summary-rendered p {
    margin: 0 0 12px 0;
    font-size: 0.95rem;
}

.summary-rendered p:last-child {
    margin-bottom: 0;
}

/* ---- Transcript viewer ---- */
.speaker-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.speaker-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text);
}

.speaker-legend-item.editable {
    cursor: pointer;
}

.speaker-legend-item input {
    border: 1px solid var(--gray);
    border-radius: 6px;
    padding: 2px 6px;
    font-size: 0.8rem;
    min-width: 120px;
}

.speaker-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.transcript-viewer {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px 24px;
    max-height: 60vh;
    overflow-y: auto;
}

.transcript-turn {
    display: grid;
    grid-template-columns: 70px 120px 1fr auto;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--gray-light);
    font-size: 0.9rem;
    transition: background var(--transition);
}

.transcript-turn:last-child {
    border-bottom: none;
}

.transcript-turn:hover {
    background: var(--gray-light);
}

.transcript-turn.editable .transcript-text {
    cursor: text;
    border: 1px dashed transparent;
    border-radius: 6px;
    padding: 4px 6px;
}

.transcript-turn.editable .transcript-text[contenteditable="true"]:focus {
    outline: none;
    border-color: var(--navy);
    background: rgba(26, 35, 50, 0.06);
}

.transcript-turn.deleted {
    opacity: 0.65;
    background: var(--gray-light);
}

.transcript-turn.deleted .transcript-text {
    text-decoration: line-through;
}

.transcript-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.transcript-action-link {
    border: none;
    background: none;
    color: var(--navy);
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0;
}

.transcript-action-link.danger {
    color: var(--red);
}

.transcript-timestamp {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.8rem;
    color: var(--gray-dark);
    padding-top: 2px;
}

.transcript-speaker {
    font-weight: 600;
    font-size: 0.85rem;
    padding-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 5px;
}

.transcript-text {
    color: var(--text);
    line-height: 1.6;
}

.transcript-empty {
    text-align: center;
    color: var(--gray-dark);
    padding: 32px 0;
    font-size: 0.9rem;
}

.transcript-conflict-warning {
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    background: var(--yellow-light);
    color: var(--text);
    font-size: 0.85rem;
}

/* ---- Sensitivity review ---- */
.sensitivity-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    background: rgba(232, 167, 53, 0.12);
    border: 1px solid rgba(232, 167, 53, 0.35);
    font-size: 0.85rem;
    color: #7a5d1a;
}

.sensitivity-banner-text {
    flex: 1;
}

.sensitivity-banner-dismiss {
    background: none;
    border: none;
    color: #7a5d1a;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    opacity: 0.6;
}

.sensitivity-banner-dismiss:hover {
    opacity: 1;
}

.summary-filtered-hint {
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.85rem;
    color: #6d4c00;
}

.transcript-turn.sensitivity-flagged {
    border-left: 3px solid #e8a735;
    background: rgba(232, 167, 53, 0.06);
    padding-left: 10px;
}

.sensitivity-meta {
    grid-column: 3 / -1;
    font-size: 0.78rem;
    color: #9a7d2e;
    margin-top: -4px;
    padding-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sensitivity-category {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-size: 0.7rem;
    background: rgba(232, 167, 53, 0.15);
    padding: 1px 6px;
    border-radius: 3px;
}

.sensitivity-dismiss-btn {
    border: none;
    background: none;
    color: #9a7d2e;
    cursor: pointer;
    font-size: 0.78rem;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.sensitivity-dismiss-btn:hover {
    color: #6b5615;
}

.transcript-turn.sensitivity-dismissed {
    opacity: 0.55;
}

.sensitivity-meta.dismissed {
    text-decoration: line-through;
}

.sensitivity-meta.dismissed .sensitivity-dismiss-btn {
    text-decoration: none;
}

/* ---- Notes content ---- */
.notes-content {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px 32px;
    white-space: pre-wrap;
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text);
    min-height: 100px;
}

.notes-empty {
    text-align: center;
    color: var(--gray-dark);
    font-style: italic;
}

/* Speaker color palette */
.speaker-color-0 { color: #1976d2; }
.speaker-color-1 { color: #d32f2f; }
.speaker-color-2 { color: #388e3c; }
.speaker-color-3 { color: #7b1fa2; }
.speaker-color-4 { color: #e65100; }
.speaker-color-5 { color: #00838f; }
.speaker-color-6 { color: #5d4037; }
.speaker-color-7 { color: #455a64; }

.speaker-bg-0 { background: #1976d2; }
.speaker-bg-1 { background: #d32f2f; }
.speaker-bg-2 { background: #388e3c; }
.speaker-bg-3 { background: #7b1fa2; }
.speaker-bg-4 { background: #e65100; }
.speaker-bg-5 { background: #00838f; }
.speaker-bg-6 { background: #5d4037; }
.speaker-bg-7 { background: #455a64; }

/* ---- Responsive: Call Detail ---- */
@media (max-width: 768px) {
    .detail-content {
        padding: 0 16px;
    }

    .detail-meta-card {
        padding: 20px;
    }

    .summary-rendered {
        padding: 20px 24px;
    }

    .transcript-viewer {
        padding: 16px;
    }

    .transcript-turn {
        grid-template-columns: 60px 100px 1fr auto;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .detail-content {
        margin: 16px auto;
    }

    .detail-title {
        font-size: 1.2rem;
    }

    .transcript-turn {
        grid-template-columns: 1fr;
        gap: 2px;
        padding: 10px 0;
    }

    .transcript-timestamp {
        font-size: 0.75rem;
    }

    .transcript-speaker {
        font-size: 0.8rem;
    }

    .speaker-legend {
        flex-direction: column;
        gap: 6px;
    }

    .summary-rendered {
        padding: 16px 20px;
    }

    .notes-content {
        padding: 16px 20px;
    }
}

/* --- Shared Calls --- */

.status-shared {
    background: rgba(33, 150, 243, 0.1);
    color: #1976d2;
}

.history-shared-by {
    color: #1976d2;
    font-size: 0.8rem;
    font-style: italic;
}

.conflict-dialog {
    text-align: center;
    padding: 8px 0;
}

.conflict-dialog p {
    margin: 0 0 12px;
    font-size: 0.95rem;
}

.conflict-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.my-notes-textarea {
    width: 100%;
    margin-top: 4px;
    padding: 8px;
    border: 1px solid var(--gray);
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
    box-sizing: border-box;
}

.notes-label {
    display: block;
    margin-top: 12px;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-light);
}

.share-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.btn-small {
    padding: 4px 12px;
    font-size: 0.85rem;
}

.participant-count {
    font-size: 0.85rem;
    color: var(--text-light);
}

.detected-hint {
    font-size: 0.8rem;
    color: #1976d2;
    font-style: italic;
}

/* Share Modal */

.share-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.share-modal {
    background: var(--white);
    border-radius: 12px;
    padding: 24px;
    max-width: 400px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.share-modal h3 {
    margin: 0 0 16px;
    font-size: 1.1rem;
}

.share-section-header {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 12px 0 6px;
}

.share-coach-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 4px;
    cursor: pointer;
    border-radius: 6px;
}

.share-coach-row:hover {
    background: var(--gray-light);
}

.share-coach-row input[type="checkbox"] {
    accent-color: var(--green);
}

.share-already {
    font-size: 0.75rem;
    color: var(--gray-dark);
    margin-left: auto;
}

.share-modal .btn-full {
    margin-top: 16px;
}

/* --- Recovery Banner --- */

.recovery-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    margin-bottom: 20px;
    background: var(--yellow-light);
    border: 1px solid var(--yellow);
    border-radius: var(--radius);
    flex-wrap: wrap;
}

.recovery-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.recovery-text {
    flex: 1;
    font-size: 0.9rem;
    color: #856404;
    min-width: 160px;
}

.recovery-text strong {
    color: #664d00;
}

.recovery-text span {
    font-size: 0.85rem;
}

.recovery-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

@media (max-width: 480px) {
    .recovery-banner {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .recovery-actions {
        justify-content: center;
    }
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--navy-light);
    color: var(--green);
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
}
.toast-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.toast-error {
    color: var(--red);
}

/* --- Inline Title Editing --- */

.editable-title {
    cursor: pointer;
    border-bottom: 1px dashed transparent;
    transition: border-color 0.2s;
}

.editable-title:hover {
    border-bottom-color: var(--gray);
}

.title-edit-input {
    width: 100%;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--navy);
    line-height: 1.3;
    border: none;
    border-bottom: 2px solid var(--green);
    background: transparent;
    padding: 0 0 2px;
    outline: none;
    font-family: inherit;
    box-sizing: border-box;
}

/* --- Summary Editing --- */

.summary-edit-area {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px 24px;
}

.summary-edit-textarea {
    width: 100%;
    min-height: 300px;
    padding: 12px;
    border: 1px solid var(--gray);
    border-radius: var(--radius-sm);
    font-family: 'SFMono-Regular', 'Consolas', 'Liberation Mono', 'Menlo', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text);
    resize: vertical;
    box-sizing: border-box;
}

.summary-edit-textarea:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 2px rgba(39, 174, 96, 0.15);
}

.summary-edit-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    justify-content: flex-end;
}

/* --- Delete Call Button --- */

.detail-share-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-delete-call {
    background: none;
    border: none;
    color: var(--red, #e74c3c);
    font-size: 0.82rem;
    cursor: pointer;
    padding: 4px 8px;
    margin-left: auto;
    border-radius: 4px;
}

.btn-delete-call:hover {
    background: rgba(231, 76, 60, 0.08);
    text-decoration: underline;
}

/* --- Find & Replace Modal --- */

.find-replace-modal {
    max-width: 360px;
}

.fr-mode-row {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    background: var(--gray-light, #f5f5f5);
    border-radius: 8px;
    padding: 3px;
}

.fr-mode-btn {
    flex: 1;
    border: none;
    background: none;
    padding: 6px 10px;
    font-size: 0.82rem;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-light, #666);
    font-weight: 500;
}

.fr-mode-btn.fr-mode-active {
    background: var(--white, #fff);
    color: var(--text, #333);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.fr-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-light, #666);
    margin-bottom: 4px;
    margin-top: 10px;
}

.fr-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border, #ddd);
    border-radius: 6px;
    font-size: 0.9rem;
    box-sizing: border-box;
}

.fr-input:focus {
    outline: none;
    border-color: var(--green, #27ae60);
    box-shadow: 0 0 0 2px rgba(39, 174, 96, 0.15);
}

.fr-match-count {
    font-size: 0.78rem;
    color: var(--text-light, #666);
    margin-top: 8px;
    min-height: 1.2em;
}

@media (max-width: 480px) {
    .title-edit-input {
        font-size: 1.2rem;
    }
}

/* ---------------------------------------------------------------------------
   Custom Summary Templates (F2)
   --------------------------------------------------------------------------- */

.template-manage-link {
    display: inline-block;
    margin-top: 4px;
    font-size: 0.8rem;
}

.template-modal {
    max-height: 85vh;
    overflow-y: auto;
}

.template-list {
    margin-bottom: 12px;
}

.template-empty {
    font-size: 0.85rem;
    color: var(--text-light, #666);
    padding: 8px 0;
}

.template-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border, #eee);
}

.template-row-info {
    min-width: 0;
}

.template-row-title {
    font-weight: 600;
    font-size: 0.9rem;
}

.template-row-desc {
    font-size: 0.8rem;
    color: var(--text-light, #666);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.template-row-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.template-delete-btn {
    color: var(--red, #e74c3c);
}

.template-form-group {
    margin-bottom: 10px;
}

.template-form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.template-form-group input,
.template-instructions-input {
    width: 100%;
    box-sizing: border-box;
}

.resummarize-template-select {
    font-size: 0.78rem;
    max-width: 180px;
    padding: 2px 4px;
}
