/* AI Radio Show - Control Panel */

:root {
    --bg: #1a1209;
    --bg-light: #2a2015;
    --bg-dark: #110c05;
    --accent: #e8791d;
    --accent-hover: #f59a4a;
    --accent-red: #cc2222;
    --accent-green: #5a8a3c;
    --devon: #c4944a;
    --devon-hover: #d4a45a;
    --text: #f5f0e5;
    --text-muted: #9a8b78;
    --radius: 12px;
    --radius-sm: 8px;
    --transition: 0.2s ease;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

#app {
    max-width: 1400px;
    margin: 0 auto;
    padding: 16px 24px;
}

/* Header */
header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.show-clock {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    margin-top: 8px;
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-family: 'Monaco', 'Menlo', monospace;
}


.clock-time {
    color: var(--text);
    font-weight: 700;
}

.clock-divider {
    color: rgba(232, 121, 29, 0.3);
}

.clock-label {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.clock-value {
    color: var(--accent);
    font-weight: 700;
}

.clock-estimate {
    color: var(--accent-green);
}

.clock-cost { font-weight: 700; }
.cost-low { color: var(--accent-green); }
.cost-mid { color: #e8a91d; }
.cost-high { color: var(--accent-red); }

header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
}

.header-buttons {
    display: flex;
    gap: 8px;
}

header button {
    background: var(--bg-light);
    color: var(--text);
    border: 1px solid rgba(232, 121, 29, 0.15);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

header button:hover {
    background: #3a2e1f;
    border-color: rgba(232, 121, 29, 0.3);
}

.theme-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
}

.theme-label {
    font-size: 0.8rem;
    color: #aaa;
    white-space: nowrap;
}

.theme-input {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    color: #fff;
    padding: 4px 8px;
    font-size: 0.85rem;
    width: 200px;
}

.theme-input:focus {
    outline: none;
    border-color: #f5a623;
}

.theme-input.active {
    border-color: #f5a623;
    background: rgba(245, 166, 35, 0.1);
}

.theme-btn {
    padding: 4px 10px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 0.8rem;
}

.theme-btn.set {
    background: #f5a623;
    color: #000;
}

.theme-btn.set:hover {
    background: #e6991a;
}

.theme-btn.clear {
    background: rgba(255, 255, 255, 0.1);
    color: #aaa;
    padding: 4px 6px;
}

.theme-btn.clear:hover {
    background: rgba(255, 80, 80, 0.3);
    color: #ff5050;
}

.on-air-btn {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: background 0.2s;
}

.on-air-btn.off {
    background: #4a3d2e !important;
    border-color: transparent !important;
    color: var(--text-muted) !important;
}

.on-air-btn.on {
    background: var(--accent-red) !important;
    border-color: var(--accent-red) !important;
    animation: on-air-pulse 2s ease-in-out infinite;
}

@keyframes on-air-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.rec-btn {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: #4a3d2e !important;
    color: var(--text-muted) !important;
    border-color: transparent !important;
    transition: background 0.2s;
}

.rec-btn.recording {
    background: var(--accent-red) !important;
    color: var(--text) !important;
    border-color: var(--accent-red) !important;
    animation: on-air-pulse 2s ease-in-out infinite;
}

.new-session-btn {
    background: var(--accent) !important;
    border-color: var(--accent) !important;
    color: #fff !important;
}

.new-session-btn:hover {
    background: var(--accent-hover) !important;
}

.session-id {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: normal;
}

details.caller-background {
    font-size: 0.85rem;
    color: var(--text-muted);
    background: var(--bg);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    line-height: 1.4;
}

details.caller-background summary {
    cursor: pointer;
    padding: 8px 10px;
    font-weight: bold;
    color: var(--text);
    font-size: 0.8rem;
}

details.caller-background > div {
    padding: 0 10px 10px;
    white-space: pre-wrap;
}

details.caller-background.hidden {
    display: none;
}

/* Main layout */
main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

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

/* Sections */
section {
    background: var(--bg-light);
    padding: 16px;
    border-radius: var(--radius);
    border: 1px solid rgba(232, 121, 29, 0.08);
    transition: border-color var(--transition), box-shadow var(--transition);
}

section h2 {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
    color: var(--text-muted);
}

.section-subtitle {
    font-size: 0.7em;
    font-weight: normal;
    color: var(--text-muted);
    text-transform: none;
    letter-spacing: normal;
}

/* Callers */
.caller-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.caller-btn {
    background: var(--bg);
    color: var(--text);
    border: 2px solid transparent;
    padding: 10px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
    justify-content: center;
    position: relative;
}

.energy-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.shape-badge {
    font-size: 0.6rem;
    background: rgba(232, 121, 29, 0.25);
    color: var(--accent);
    padding: 1px 4px;
    border-radius: 3px;
    font-weight: bold;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.caller-btn:hover {
    border-color: var(--accent);
    background: #2a1e10;
}

.caller-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.call-status {
    text-align: center;
    padding: 8px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

/* Call action buttons row */
.call-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.hangup-btn {
    flex: 1;
    background: var(--accent-red);
    color: white;
    border: none;
    padding: 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: bold;
    transition: background 0.2s;
}

.wrapup-btn {
    flex: 2;
    background: #7a6020;
    color: #f0d060;
    border: 2px solid #d4a030;
    padding: 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
}

.wrapup-btn:hover:not(:disabled) {
    background: #d4a030;
    color: #1a1209;
}

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

.wrapup-btn.active {
    background: #d4a030;
    color: #1a1209;
    animation: wrapup-pulse 1.5s ease-in-out infinite;
}

@keyframes wrapup-pulse {
    0%, 100% { box-shadow: 0 0 8px rgba(212, 160, 48, 0.4); }
    50% { box-shadow: 0 0 16px rgba(212, 160, 48, 0.8); }
}

/* Caller info panel */
.caller-info-panel {
    background: var(--bg-light);
    border: 1px solid rgba(232, 121, 29, 0.15);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    margin: 8px 0;
}

.caller-info-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.info-badge {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.info-badge.shape {
    background: rgba(232, 121, 29, 0.2);
    color: var(--accent);
}

.info-badge.energy {
    color: white;
    font-size: 0.7rem;
}

.info-badge.emotion {
    background: rgba(154, 139, 120, 0.2);
    color: var(--text-muted);
    font-style: italic;
}

.caller-signature {
    font-size: 0.8rem;
    color: var(--accent);
    margin-bottom: 4px;
    font-style: italic;
}

.caller-situation {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.3;
}

/* Caller model indicator */
.info-badge.model {
    background: rgba(100, 140, 220, 0.2);
    color: #7ab0e8;
    font-size: 0.7rem;
    cursor: pointer;
}

.caller-model-override {
    font-size: 0.7rem;
    padding: 2px 4px;
    background: var(--bg);
    color: var(--text);
    border: 1px solid rgba(100, 140, 220, 0.3);
    border-radius: 4px;
    max-width: 140px;
}

/* Caller button model badge */
.model-tag {
    font-size: 0.55rem;
    color: #7ab0e8;
    background: rgba(100, 140, 220, 0.15);
    padding: 0 3px;
    border-radius: 2px;
    font-weight: 700;
    letter-spacing: 0.3px;
    flex-shrink: 0;
}

/* Caller Models settings section */
.caller-model-row {
    margin-bottom: 8px;
}

.caller-model-row label {
    margin-bottom: 0;
}

.cm-pool-input {
    font-size: 0.8rem;
}

.cm-style-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    margin-bottom: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.cm-style-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    padding: 3px 6px;
}

.cm-style-name {
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.cm-style-select {
    font-size: 0.7rem;
    padding: 2px 3px;
    background: var(--bg);
    color: var(--text);
    border: 1px solid rgba(232, 121, 29, 0.15);
    border-radius: 4px;
    max-width: 110px;
}

.caller-background-full {
    margin-top: 8px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.caller-background-full summary {
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.7rem;
}

.hangup-btn:hover {
    background: #e03030;
}

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

/* Chat */
.chat-section {
    grid-column: span 2;
}

@media (max-width: 700px) {
    .chat-section {
        grid-column: span 1;
    }
}

.chat-log {
    height: 420px;
    overflow-y: auto;
    background: var(--bg-dark);
    border-radius: var(--radius-sm);
    padding: 12px;
    margin-bottom: 12px;
    border: 1px solid rgba(232, 121, 29, 0.06);
}

.message {
    padding: 8px 12px;
    margin-bottom: 8px;
    border-radius: var(--radius-sm);
    line-height: 1.4;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.msg-content {
    flex: 1;
    min-width: 0;
}

.msg-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
    border: 2px solid var(--accent);
}

.msg-avatar-devon {
    border-color: var(--devon);
}

.msg-avatar-caller {
    border-color: var(--text-muted);
}

.msg-avatar-system {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
    color: #fff;
    background: var(--text-muted);
}

.message.host {
    background: #3a2510;
}

.message.system {
    padding: 2px 12px;
    margin-bottom: 2px;
    opacity: 0.45;
    font-size: 0.75rem;
    min-height: auto;
}

.system-compact {
    color: var(--text-muted);
    font-style: italic;
}

.message.caller {
    background: #2a1a0a;
}

.message strong {
    display: block;
    font-size: 0.8rem;
    opacity: 0.7;
    margin-bottom: 4px;
}

.talk-controls {
    display: flex;
    gap: 10px;
}

.talk-btn {
    flex: 1;
    background: var(--accent);
    color: white;
    border: none;
    padding: 20px;
    border-radius: var(--radius-sm);
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.talk-btn:hover {
    background: var(--accent-hover);
}

.talk-btn.recording {
    background: var(--accent-red);
    animation: pulse 1s infinite;
}

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

.type-btn {
    background: var(--bg);
    color: var(--text);
    border: 1px solid rgba(232, 121, 29, 0.15);
    padding: 16px 24px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.type-btn:hover {
    border-color: var(--accent);
}

.status {
    text-align: center;
    padding: 12px;
    color: var(--accent);
    font-weight: bold;
}

.status.hidden {
    display: none;
}

/* Music */
.music-section select {
    width: 100%;
    padding: 10px;
    background: var(--bg);
    color: var(--text);
    border: 1px solid rgba(232, 121, 29, 0.15);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
}

.music-section select optgroup {
    color: var(--accent);
    font-weight: bold;
    font-style: normal;
    padding: 4px 0;
}

.music-section select option {
    color: var(--text);
    font-weight: normal;
    padding: 2px 8px;
}

.music-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.music-controls button {
    background: var(--bg);
    color: var(--text);
    border: 1px solid rgba(232, 121, 29, 0.15);
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.music-controls button:hover {
    border-color: var(--accent);
    background: #2a1e10;
}

.music-controls input[type="range"] {
    flex: 1;
    accent-color: var(--accent);
}

/* Soundboard */
.sounds-section {
    grid-column: span 2;
}

@media (max-width: 700px) {
    .sounds-section {
        grid-column: span 1;
    }
}

.soundboard-pinned {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 10px;
}

.sound-btn {
    background: var(--bg);
    color: var(--text);
    border: 1px solid rgba(232, 121, 29, 0.1);
    padding: 12px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.1s;
}

.sound-btn.pinned {
    padding: 18px 12px;
    font-size: 1rem;
    font-weight: 700;
    border-width: 2px;
}

.sound-btn.pin-cheer {
    border-color: #5a8a3c;
    color: #7abf52;
}
.sound-btn.pin-cheer:hover {
    background: #5a8a3c;
    border-color: #5a8a3c;
    color: #fff;
}

.sound-btn.pin-applause {
    border-color: var(--accent);
    color: var(--accent);
}
.sound-btn.pin-applause:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.sound-btn.pin-boo {
    border-color: var(--accent-red);
    color: #e85050;
}
.sound-btn.pin-boo:hover {
    background: var(--accent-red);
    border-color: var(--accent-red);
    color: #fff;
}

.sound-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.sound-btn:active {
    transform: scale(0.95);
}

.soundboard-toggle {
    width: 100%;
    background: none;
    border: 1px solid rgba(232, 121, 29, 0.1);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    padding: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    margin-bottom: 10px;
    transition: all 0.2s;
}

.soundboard-toggle:hover {
    color: var(--text);
    border-color: rgba(232, 121, 29, 0.3);
}

.toggle-arrow {
    font-size: 0.7rem;
    margin-left: 4px;
}

.soundboard-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
}

/* Keyboard shortcut labels */
.shortcut-label {
    display: inline-block;
    font-size: 0.6rem;
    color: var(--text-muted);
    background: rgba(232, 121, 29, 0.08);
    border: 1px solid rgba(232, 121, 29, 0.12);
    border-radius: 3px;
    padding: 1px 4px;
    margin-left: 6px;
    font-family: 'Monaco', 'Menlo', monospace;
    vertical-align: middle;
    opacity: 0.7;
}

.caller-btn .shortcut-label {
    display: block;
    margin: 3px auto 0;
    width: fit-content;
}

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

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--bg-light);
    padding: 24px;
    border-radius: var(--radius);
    width: 90%;
    max-width: 550px;
    border: 1px solid rgba(232, 121, 29, 0.15);
}

.modal-content h2 {
    margin-bottom: 16px;
    color: var(--accent);
}

.modal-content h3 {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 16px 0 8px 0;
    border-bottom: 1px solid rgba(232, 121, 29, 0.1);
    padding-bottom: 4px;
}

.settings-group {
    margin-bottom: 16px;
}

.device-row {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.device-row label:first-child {
    flex: 1;
}

.routing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.routing-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    padding: 5px 8px;
}

.routing-item label {
    margin-bottom: 0 !important;
}

.routing-label {
    font-size: 0.75rem;
    color: var(--text-muted, #9a8b78);
    white-space: nowrap;
}

.channel-input {
    width: 40px !important;
    text-align: center;
    font-size: 0.8rem;
    padding: 3px !important;
}

.model-routing-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.model-routing-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.model-routing-item label {
    margin-bottom: 0 !important;
}

.model-routing-label {
    font-size: 0.75rem;
    color: var(--text-muted, #9a8b78);
}

.model-select {
    font-size: 0.8rem !important;
    padding: 4px 6px !important;
}

.modal-content label {
    display: block;
    margin-bottom: 16px;
}

.modal-content label.checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-content select,
.modal-content input[type="text"],
.modal-content textarea {
    width: 100%;
    padding: 10px;
    background: var(--bg);
    color: var(--text);
    border: 1px solid rgba(232, 121, 29, 0.15);
    border-radius: var(--radius-sm);
    margin-top: 4px;
}

.modal-content select:focus,
.modal-content input[type="text"]:focus,
.modal-content textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.modal-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.modal-buttons button {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
}

.modal-buttons button:first-child {
    background: var(--accent);
    color: white;
}

.modal-buttons button:first-child:hover {
    background: var(--accent-hover);
}

.modal-buttons button:last-child {
    background: var(--bg);
    color: var(--text);
    border: 1px solid rgba(232, 121, 29, 0.15);
}

.refresh-btn {
    background: var(--bg);
    color: var(--text-muted);
    border: 1px solid rgba(232, 121, 29, 0.15);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.85rem;
    margin-top: 8px;
    transition: all 0.2s;
}

.refresh-btn:hover {
    background: var(--bg-light);
    color: var(--text);
    border-color: var(--accent);
}

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

.hidden {
    display: none !important;
}

/* Server Log */
.log-section {
    grid-column: span 2;
}

@media (max-width: 700px) {
    .log-section {
        grid-column: span 1;
    }
}

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

.log-header h2 {
    margin-bottom: 0;
}

.server-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.server-btn {
    border: none;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: bold;
    transition: all 0.2s;
}

.server-btn.restart {
    background: var(--accent);
    color: white;
}

.server-btn.restart:hover {
    background: var(--accent-hover);
}

.server-btn.stop {
    background: var(--accent-red);
    color: white;
}

.server-btn.stop:hover {
    background: #e03030;
}

.auto-scroll-label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    color: var(--text-muted);
    cursor: pointer;
}

.auto-scroll-label input[type="checkbox"] {
    accent-color: var(--accent);
}

.server-log {
    height: 200px;
    overflow-y: auto;
    background: var(--bg-dark);
    border-radius: var(--radius-sm);
    padding: 12px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.75rem;
    line-height: 1.5;
    color: #b8a88a;
    border: 1px solid rgba(232, 121, 29, 0.06);
}

.server-log .log-line {
    white-space: pre-wrap;
    word-break: break-all;
}

.server-log .log-line.error {
    color: #e8604a;
}

.server-log .log-line.warning {
    color: #e8b84a;
}

.server-log .log-line.tts {
    color: var(--accent);
}

.server-log .log-line.chat {
    color: var(--accent-hover);
}

/* Call Queue */
.call-queue {
    border: 1px solid rgba(232, 121, 29, 0.15);
    border-radius: var(--radius-sm);
    padding: 8px;
    max-height: 150px;
    overflow-y: auto;
}

.queue-empty {
    color: var(--text-muted);
    text-align: center;
    padding: 8px;
}

.queue-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 8px;
    border-bottom: 1px solid rgba(232, 121, 29, 0.08);
    flex-wrap: wrap;
}

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

.queue-phone {
    font-family: monospace;
    color: var(--accent);
}

.queue-wait {
    color: var(--text-muted);
    font-size: 0.85rem;
    flex: 1;
}

.queue-take-btn {
    background: var(--accent-green);
    color: white;
    border: none;
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s;
}

.queue-take-btn:hover {
    background: #6a9a4c;
}

.queue-drop-btn {
    background: var(--accent-red);
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s;
}

.queue-drop-btn:hover {
    background: #e03030;
}

/* Active Call Indicator */
.active-call {
    border: 1px solid rgba(232, 121, 29, 0.15);
    border-radius: var(--radius-sm);
    padding: 12px;
    margin: 8px 0;
    background: var(--bg);
}

.caller-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.caller-info:last-of-type {
    margin-bottom: 0;
}

.caller-type {
    font-size: 0.7rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
}

.caller-type.real {
    background: var(--accent-red);
    color: white;
}

.caller-type.ai {
    background: var(--accent);
    color: white;
}

.channel-badge {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-light);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
}

.call-duration {
    font-family: monospace;
    color: var(--accent);
}

.ai-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.mode-toggle {
    display: flex;
    border: 1px solid rgba(232, 121, 29, 0.2);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.mode-btn {
    background: var(--bg-light);
    color: var(--text-muted);
    border: none;
    padding: 3px 8px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.mode-btn.active {
    background: var(--accent);
    color: white;
}

.respond-btn {
    background: var(--accent-green);
    color: white;
    border: none;
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.2s;
}

.respond-btn:hover {
    background: #6a9a4c;
}

.hangup-btn.small {
    font-size: 0.75rem;
    padding: 3px 8px;
}

.auto-followup-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 8px;
}

/* Returning Caller */
.caller-btn.returning {
    border-color: var(--accent);
    color: var(--accent);
}

.caller-btn.returning:hover {
    border-color: var(--accent-hover);
    color: var(--accent-hover);
}

.caller-btn.returning.active {
    color: #fff;
}

/* Screening Badges */
.screening-badge {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-weight: bold;
}

.screening-badge.screening {
    background: var(--accent);
    color: white;
    animation: pulse 1.5s infinite;
}

.screening-badge.screened {
    background: var(--accent-green);
    color: white;
}

.screening-summary {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
    flex-basis: 100%;
    margin-top: 3px;
}

/* Three-Party Chat */
.message.real-caller {
    border-left: 3px solid var(--accent-red);
    padding-left: 8px;
}

.message.ai-caller {
    border-left: 3px solid var(--accent);
    padding-left: 8px;
}

.message.host {
    border-left: 3px solid var(--accent-green);
    padding-left: 8px;
}

/* Voicemail */
.voicemail-list {
    border: 1px solid rgba(232, 121, 29, 0.15);
    border-radius: var(--radius-sm);
    padding: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.voicemail-badge {
    background: var(--accent-red);
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 2px 7px;
    border-radius: 10px;
    margin-left: 6px;
    vertical-align: middle;
}

.vm-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px;
    border-bottom: 1px solid rgba(232, 121, 29, 0.08);
}

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

.vm-item.vm-unlistened {
    background: rgba(232, 121, 29, 0.06);
}

.vm-info {
    display: flex;
    gap: 10px;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.vm-phone {
    font-family: monospace;
    color: var(--accent);
    font-size: 0.85rem;
}

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

.vm-dur {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.vm-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.vm-btn {
    border: none;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.75rem;
    transition: background 0.2s;
}

.vm-btn.listen {
    background: var(--accent);
    color: white;
}

.vm-btn.listen:hover {
    background: var(--accent-hover);
}

.vm-btn.on-air {
    background: var(--accent-green);
    color: white;
}

.vm-btn.on-air:hover {
    background: #6a9a4c;
}

.vm-btn.save {
    background: #3a7bd5;
    color: white;
}

.vm-btn.save:hover {
    background: #2a5db0;
}

.vm-btn.delete {
    background: var(--accent-red);
    color: white;
}

.vm-btn.delete:hover {
    background: #e03030;
}

/* Listener Emails */
.email-list {
    max-height: 300px;
}

.email-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    border-bottom: 1px solid rgba(232, 121, 29, 0.08);
}

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

.email-item.vm-unlistened {
    background: rgba(232, 121, 29, 0.06);
}

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

.email-sender {
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.email-subject {
    font-size: 0.85rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.email-preview {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.3;
}

.email-item .vm-actions {
    margin-top: 4px;
}

.email-body-expanded {
    margin-top: 6px;
    padding: 8px;
    background: rgba(232, 121, 29, 0.08);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    line-height: 1.5;
    white-space: pre-wrap;
    max-height: 200px;
    overflow-y: auto;
}

/* === Visual Polish === */

/* 1. Thinking pulse on chat when waiting for AI */
@keyframes thinking-pulse {
    0%, 100% { border-color: rgba(232, 121, 29, 0.06); }
    50% { border-color: rgba(232, 121, 29, 0.3); }
}

.chat-log.thinking {
    animation: thinking-pulse 1.5s ease-in-out infinite;
}

/* 3 & 5. Active call section glow + chat highlight when call is live */
.callers-section.call-active {
    border-color: rgba(232, 121, 29, 0.5);
    box-shadow: 0 0 20px rgba(232, 121, 29, 0.15), inset 0 0 0 1px rgba(232, 121, 29, 0.1);
}

.chat-section.call-active {
    border-color: rgba(232, 121, 29, 0.35);
    box-shadow: 0 0 16px rgba(232, 121, 29, 0.1);
}

/* 7. Compact media row — Music / Ads / Idents side by side */
.media-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    grid-column: span 2;
}

@media (max-width: 700px) {
    .media-row {
        grid-template-columns: 1fr;
        grid-column: span 1;
    }
}

.media-row .music-section {
    padding: 12px;
}

.media-row .music-section h2 {
    font-size: 0.75rem;
    margin-bottom: 8px;
}

.media-row .music-section select {
    padding: 6px 8px;
    font-size: 0.8rem;
    margin-bottom: 6px;
}

.media-row .music-controls {
    gap: 4px;
}

.media-row .music-controls button {
    padding: 6px 10px;
    font-size: 0.8rem;
}

/* Devon (Intern) */
.message.devon {
    border-left: 3px solid var(--devon);
    padding-left: 0.5rem;
    background: rgba(196, 148, 74, 0.06);
}

.message.devon strong {
    color: var(--devon);
}

.devon-bar {
    margin-bottom: 10px;
}

.devon-ask-row {
    display: flex;
    gap: 6px;
    align-items: center;
}

.devon-input {
    flex: 1;
    padding: 8px 10px;
    background: var(--bg);
    color: var(--text);
    border: 1px solid rgba(196, 148, 74, 0.2);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
}

.devon-input:focus {
    outline: none;
    border-color: var(--devon);
}

.devon-input::placeholder {
    color: var(--text-muted);
}

.devon-ask-btn {
    background: var(--devon);
    color: #fff;
    border: none;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background 0.2s;
    white-space: nowrap;
}

.devon-ask-btn:hover {
    background: var(--devon-hover);
}

.devon-interject-btn {
    background: var(--bg);
    color: var(--devon);
    border: 1px solid rgba(196, 148, 74, 0.25);
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
    white-space: nowrap;
}

.devon-interject-btn:hover {
    border-color: var(--devon);
    background: rgba(196, 148, 74, 0.1);
}

.devon-monitor-label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
}

.devon-monitor-label input[type="checkbox"] {
    accent-color: var(--devon);
}

.devon-suggestion {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    padding: 8px 12px;
    background: rgba(196, 148, 74, 0.08);
    border: 1px solid rgba(196, 148, 74, 0.25);
    border-radius: var(--radius-sm);
    animation: devon-pulse 2s ease-in-out infinite;
}

.devon-suggestion.hidden {
    display: none !important;
}

@keyframes devon-pulse {
    0%, 100% { border-color: rgba(196, 148, 74, 0.25); }
    50% { border-color: rgba(196, 148, 74, 0.6); }
}

.devon-suggestion-text {
    flex: 1;
    font-size: 0.85rem;
    color: var(--devon);
    font-weight: 600;
}

.devon-play-btn {
    background: var(--devon);
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background 0.2s;
}

.devon-play-btn:hover {
    background: var(--devon-hover);
}

.devon-dismiss-btn {
    background: none;
    color: var(--text-muted);
    border: 1px solid rgba(232, 121, 29, 0.15);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.devon-dismiss-btn:hover {
    color: var(--text);
    border-color: rgba(232, 121, 29, 0.3);
}

/* Focus-visible styles for keyboard navigation */
button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.devon-input:focus-visible,
.modal-content select:focus-visible,
.modal-content input:focus-visible,
.modal-content textarea:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

/* Collapsible Server Log */
.log-section .log-body {
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    max-height: 250px;
    opacity: 1;
}

.log-section .log-body.collapsed {
    max-height: 0;
    opacity: 0;
}

.log-toggle-btn {
    border: none;
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.8rem;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: color 0.2s;
}

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