/* ===== Iconic Telefon — Dark theme (clone of Voiplix-Stack) ===== */
:root {
    --bg-1: #0d1117;
    --bg-2: #161b22;
    --bg-3: #1f2630;
    --bg-4: #2a313c;
    --border: #30363d;
    --text: #e6edf3;
    --text-dim: #8b949e;
    --accent: #0084c5;
    --accent-2: #006a9e;
    --green: #2ea043;
    --green-2: #238636;
    --red: #da3633;
    --red-2: #b62524;
    --yellow: #d29922;
    --shadow: 0 16px 40px rgba(0,0,0,0.55), 0 4px 12px rgba(0,0,0,0.35);
}

* { box-sizing: border-box; }
html, body {
    margin: 0; padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    background: radial-gradient(circle at 20% 10%, #1a2433 0%, #0d1117 60%);
    min-height: 100vh;
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ============================================ */
/*               LOGIN SCREEN                   */
/* ============================================ */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.login-card {
    width: 100%;
    max-width: 380px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 28px 24px;
    box-shadow: var(--shadow);
}
.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.brand-logo { font-size: 28px; }
.brand-img { height: 36px; width: auto; max-width: 180px; object-fit: contain; }
.brand h1 { margin: 0; font-size: 18px; font-weight: 600; }

.login-card label {
    display: block;
    margin-bottom: 12px;
    font-size: 12px;
    color: var(--text-dim);
    font-weight: 500;
}
.login-card label.row {
    display: flex; align-items: center; gap: 8px;
    color: var(--text);
}
.login-card input[type="text"],
.login-card input[type="password"] {
    width: 100%;
    margin-top: 4px;
    padding: 9px 11px;
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: 7px;
    color: var(--text);
    font-size: 13px;
    transition: border-color .15s;
}
.login-card input:focus {
    outline: none;
    border-color: var(--accent);
}

.btn-primary {
    width: 100%;
    margin-top: 4px;
    padding: 10px 14px;
    background: var(--accent);
    border: none;
    border-radius: 7px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}
.btn-primary:hover { background: var(--accent-2); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-secondary {
    width: 100%;
    padding: 9px 12px;
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: 7px;
    color: var(--text);
    font-size: 13px;
    cursor: pointer;
}
.btn-secondary:hover { background: var(--bg-4); }

.login-status {
    display: flex; align-items: center; gap: 6px;
    margin-top: 14px;
    font-size: 12px;
    color: var(--text-dim);
}

.dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--red);
    box-shadow: 0 0 6px var(--red);
}
.dot.connecting { background: var(--yellow); box-shadow: 0 0 6px var(--yellow); }
.dot.connected { background: var(--green); box-shadow: 0 0 6px var(--green); }

/* ============================================ */
/*           PHONE WIDGET (popup window)        */
/* ============================================ */
.popup-body {
    margin: 0;
    background: var(--bg-2);
    overflow: hidden;
}

.phone-widget {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 0;
    overflow: hidden;
    user-select: none;
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* When NOT in popup (e.g. demo) keep floating bottom-right */
.phone-widget:not(.popup-mode) {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 300px;
    min-height: auto;
    border-radius: 14px;
    box-shadow: var(--shadow);
    z-index: 9999;
}

.phone-widget.popup-mode .pw-body { flex: 1; }

/* HEADER */
.pw-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    background: var(--bg-3);
    border-bottom: 1px solid var(--border);
}
.pw-status {
    display: flex; align-items: center; gap: 6px;
    font-size: 11px;
    color: var(--text-dim);
}
.pw-header-actions { display: flex; gap: 2px; }

/* ICON BUTTONS */
.ico-btn {
    width: 30px; height: 30px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--text-dim);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .12s, color .12s;
}
.ico-btn svg { width: 16px; height: 16px; fill: currentColor; }
.ico-btn:hover { background: var(--bg-4); color: var(--text); }
.ico-btn.active { background: var(--accent); color: #fff; }
.ico-btn.recording { color: var(--red); animation: recPulse 1.2s infinite; }
@keyframes recPulse { 50% { opacity: 0.5; } }

/* BODY */
.pw-body {
    padding: 12px;
}

.pw-display { margin-bottom: 10px; }
#numberInput {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 16px;
    text-align: center;
    font-weight: 500;
    letter-spacing: 0.5px;
}
#numberInput:focus { outline: none; border-color: var(--accent); }
#numberInput::placeholder { color: var(--text-dim); }

.pw-call-info {
    text-align: center;
    margin-top: 6px;
    min-height: 18px;
}
#callerName { font-size: 12px; color: var(--text-dim); }
.pw-timer { font-size: 13px; color: var(--accent); font-weight: 600; min-height: 16px; }

/* DIALPAD */
.pw-dialpad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-bottom: 10px;
}
.key {
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 18px;
    font-weight: 500;
    padding: 8px 0;
    cursor: pointer;
    transition: background .1s;
}
.key:hover { background: var(--bg-4); }
.key:active { background: var(--accent); color: #fff; }

/* ACTIONS ROW */
.pw-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Big round action buttons (call / hangup / answer / reject) */
.action-btn {
    width: 46px; height: 46px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: transform .08s, background .12s;
}
.action-btn svg { width: 22px; height: 22px; fill: currentColor; }
.action-btn:active { transform: scale(0.92); }
.action-btn.call { background: var(--green); }
.action-btn.call:hover { background: var(--green-2); }
.action-btn.hangup { background: var(--red); }
.action-btn.hangup:hover { background: var(--red-2); }
.action-btn.hangup svg { transform: rotate(135deg); }
.action-btn.small { width: 34px; height: 34px; }
.action-btn.small svg { width: 16px; height: 16px; }

/* CONTEXT VISIBILITY */
.phone-widget[data-state="idle"] .ctx-incall,
.phone-widget[data-state="idle"] .ctx-incoming { display: none; }
.phone-widget[data-state="incall"] .ctx-idle,
.phone-widget[data-state="incall"] .ctx-incoming { display: none; }
.phone-widget[data-state="incoming"] .ctx-idle,
.phone-widget[data-state="incoming"] .ctx-incall { display: none; }

/* incoming pulses */
.phone-widget[data-state="incoming"] {
    animation: incomingGlow 1.4s infinite;
}
@keyframes incomingGlow {
    0%, 100% { box-shadow: var(--shadow); }
    50% { box-shadow: var(--shadow), 0 0 0 4px rgba(46,160,67,0.4); }
}

/* PANELS (logs / settings) */
.pw-panel {
    border-top: 1px solid var(--border);
    background: var(--bg-2);
    max-height: 320px;
    overflow-y: auto;
}
.pw-panel-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-3);
}
.pw-panel-head h3 {
    margin: 0; font-size: 13px; font-weight: 600;
}
.pw-panel-body { padding: 12px; }
.hint {
    margin: 0 0 8px;
    font-size: 12px;
    color: var(--text-dim);
}
.hint.small { font-size: 11px; }

/* CALL LOG LIST */
.call-log-list { padding: 4px 0; }
.call-log-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    cursor: pointer;
    transition: background .1s;
}
.call-log-item:hover { background: var(--bg-3); }
.call-log-icon {
    width: 22px; height: 22px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}
.call-log-icon svg { width: 12px; height: 12px; fill: #fff; }
.call-log-icon.in { background: var(--green); }
.call-log-icon.out { background: var(--accent); }
.call-log-icon.missed { background: var(--red); }
.call-log-meta {
    flex: 1;
    overflow: hidden;
}
.call-log-num {
    color: var(--text);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.call-log-time {
    color: var(--text-dim);
    font-size: 10px;
}
.call-log-empty {
    padding: 20px 12px;
    text-align: center;
    color: var(--text-dim);
    font-size: 12px;
}

/* STANDALONE LOGS WINDOW */
.logs-window {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: var(--bg-1);
    color: var(--text);
}
.logs-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--bg-2);
    border-bottom: 1px solid var(--bg-3);
}
.logs-header h2 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
}
.logs-filters {
    display: flex;
    gap: 4px;
    padding: 8px;
    background: var(--bg-2);
    border-bottom: 1px solid var(--bg-3);
}
.logs-filter {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 4px;
    background: var(--bg-3);
    border: 1px solid transparent;
    color: var(--text-dim);
    border-radius: 6px;
    cursor: pointer;
    font-size: 10px;
    transition: all .15s;
}
.logs-filter svg { width: 16px; height: 16px; fill: currentColor; }
.logs-filter:hover { color: var(--text); }
.logs-filter.active {
    color: var(--accent);
    border-color: var(--accent);
    background: rgba(255,255,255,.04);
}
.logs-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0;
}
.logs-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--bg-2);
}
.logs-item:hover { background: var(--bg-2); }
.logs-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.logs-icon svg { width: 14px; height: 14px; fill: #fff; }
.logs-icon.in { background: var(--green); }
.logs-icon.out { background: var(--accent); }
.logs-icon.missed { background: var(--red); }
.logs-meta { flex: 1; min-width: 0; }
.logs-num {
    font-size: 13px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.logs-sub {
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 2px;
}
.logs-call {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--green);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.logs-call svg { width: 14px; height: 14px; fill: #fff; }
.logs-call:hover { filter: brightness(1.15); }
.logs-empty {
    padding: 30px 12px;
    text-align: center;
    color: var(--text-dim);
    font-size: 12px;
}
.logs-footer {
    padding: 8px;
    border-top: 1px solid var(--bg-3);
    background: var(--bg-2);
}
.logs-clear {
    width: 100%;
    padding: 8px;
    background: var(--bg-3);
    color: var(--text-dim);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
}
.logs-clear:hover { color: var(--red); }

/* INCOMING SECOND-LINE WINDOW */
.incoming-window {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: linear-gradient(180deg, #1a1f2e 0%, #0f1218 100%);
    color: var(--text);
    text-align: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}
.incoming-pulse {
    position: absolute;
    width: 200px; height: 200px;
    border-radius: 50%;
    background: var(--green);
    opacity: 0;
    animation: incomingPulse 1.6s ease-out infinite;
    top: 50%; left: 50%;
    transform: translate(-50%, -80%);
    z-index: 0;
}
@keyframes incomingPulse {
    0%   { transform: translate(-50%, -80%) scale(.6); opacity: .35; }
    100% { transform: translate(-50%, -80%) scale(1.6); opacity: 0; }
}
.incoming-icon {
    width: 80px; height: 80px;
    border-radius: 50%;
    background: var(--green);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    z-index: 1;
    box-shadow: 0 8px 24px rgba(0,0,0,.4);
    animation: incomingShake 1s ease-in-out infinite;
}
.incoming-icon svg { width: 40px; height: 40px; fill: #fff; }
@keyframes incomingShake {
    0%,100% { transform: rotate(0deg); }
    25%     { transform: rotate(-12deg); }
    75%     { transform: rotate(12deg); }
}
.incoming-title {
    font-size: 13px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    z-index: 1;
}
.incoming-from {
    font-size: 22px;
    font-weight: 600;
    margin: 6px 0 16px;
    z-index: 1;
    word-break: break-all;
    max-width: 100%;
}
.incoming-hint {
    font-size: 11px;
    color: var(--text-dim);
    margin-bottom: 30px;
    z-index: 1;
    max-width: 240px;
}
.incoming-actions {
    display: flex;
    gap: 50px;
    z-index: 1;
}
.action-btn.big {
    width: 64px;
    height: 64px;
    box-shadow: 0 4px 16px rgba(0,0,0,.4);
}
.action-btn.big svg { width: 28px; height: 28px; }

/* LINE BAR (multi-call switching) */
.pw-lines {
    display: flex;
    gap: 6px;
    padding: 6px 8px 0;
}
.line-btn {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    background: var(--bg-3);
    border: 1px solid transparent;
    color: var(--text-dim);
    border-radius: 8px;
    cursor: pointer;
    font-size: 11px;
    text-align: left;
    overflow: hidden;
    min-width: 0;
}
.line-btn:hover { background: rgba(255,255,255,.08); }
.line-tag {
    font-weight: 700;
    font-size: 10px;
    background: var(--bg-2);
    padding: 2px 5px;
    border-radius: 4px;
    flex-shrink: 0;
}
.line-num {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text);
}
.line-state {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: .5px;
    flex-shrink: 0;
    padding: 2px 5px;
    border-radius: 3px;
}
.line-btn.active {
    border-color: var(--green);
    background: rgba(80,180,120,.12);
}
.line-btn.active .line-state {
    background: var(--green);
    color: #fff;
}
.line-btn.held {
    border-color: rgba(255,255,255,.1);
}
.line-btn.held .line-state {
    background: var(--accent);
    color: #fff;
}
.line-btn.empty {
    opacity: .35;
    cursor: default;
    pointer-events: none;
}

/* SECOND LINE BANNER */
.pw-banner {
    position: absolute;
    top: -52px;
    left: 0; right: 0;
    background: var(--bg-3);
    border: 1px solid var(--accent);
    border-radius: 10px;
    padding: 8px 10px;
    display: flex; align-items: center; justify-content: space-between;
    box-shadow: var(--shadow);
    animation: bannerSlide .25s ease-out;
}
@keyframes bannerSlide {
    from { transform: translateY(10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.pw-banner-text { font-size: 11px; color: var(--text-dim); display: flex; flex-direction: column; }
.pw-banner-text strong { color: var(--text); font-size: 12px; }
.pw-banner-actions { display: flex; gap: 4px; }

/* responsive */
@media (max-width: 420px) {
    .phone-widget {
        right: 8px; bottom: 8px; width: calc(100vw - 16px);
        max-width: 320px;
    }
}

/* ===== Embed-Mode (?embed=1) — fills the CRM-Iframe ===== */
body.embed { background: transparent; }
body.embed .phone-widget {
    position: static;
    right: auto; bottom: auto;
    width: 100%; height: 100vh;
    max-width: none;
    border-radius: 0;
    box-shadow: none;
    border: none;
}
/* Login-View inside iframe: drop fixed sizing, fit panel */
body.embed .login-card,
body.embed .login-wrap {
    width: 100%;
    max-width: none;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    min-height: 100vh;
}

/* ============================================
   COMPACT POPUP MODE (phone.html?popup=1)
   ============================================ */

/* Override global min-height for popup window */
body.popup-body {
    min-height: auto;
    background: var(--bg-3);
    overflow: hidden;
}

/* Compact widget resets */
.phone-widget.popup-mode {
    min-height: auto;
    border: none;
    border-radius: 0;
    box-shadow: none;
}

/* ── Main compact bar ── */
.cw-bar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 8px 0 10px;
    height: 58px;
    background: var(--bg-3);
    border-bottom: 1px solid var(--border);
    box-sizing: border-box;
}

/* Left: dot + status / caller info */
.cw-left {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    min-width: 0;
}

.cw-status-lbl {
    font-size: 11px;
    color: var(--text-dim);
    white-space: nowrap;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cw-call-meta {
    display: flex;
    align-items: baseline;
    gap: 6px;
    min-width: 0;
}

.cw-peer {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 130px;
}

.cw-timer-text {
    font-size: 11px;
    color: var(--accent);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* Hide/show meta vs status label based on call state */
.phone-widget.popup-mode[data-state="idle"] .cw-call-meta { display: none; }
.phone-widget.popup-mode[data-state="incall"] #pwStatusText,
.phone-widget.popup-mode[data-state="incoming"] #pwStatusText { display: none; }

/* Number input area (idle only — ctx-idle hides it in other states) */
.cw-input-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

.cw-input-wrap input {
    flex: 1;
    min-width: 0;
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
    padding: 7px 10px;
    text-align: center;
    font-weight: 500;
    letter-spacing: 0.5px;
    box-sizing: border-box;
}
.cw-input-wrap input:focus { outline: none; border-color: var(--accent); }
.cw-input-wrap input::placeholder { color: var(--text-dim); }

/* Action buttons row */
.cw-actions {
    display: flex;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
}

/* Round call / answer / hangup buttons */
.cw-call-btn,
.cw-answer-btn,
.cw-hangup-btn {
    width: 36px; height: 36px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
    transition: transform .08s, filter .12s;
}
.cw-call-btn svg,
.cw-answer-btn svg,
.cw-hangup-btn svg { width: 17px; height: 17px; fill: currentColor; }
.cw-call-btn:active,
.cw-answer-btn:active,
.cw-hangup-btn:active { transform: scale(0.92); }

.cw-call-btn   { background: var(--green); }
.cw-answer-btn { background: var(--green); }
.cw-call-btn:hover,
.cw-answer-btn:hover { filter: brightness(1.15); }

.cw-hangup-btn { background: var(--red); }
.cw-hangup-btn:hover { filter: brightness(1.15); }
.cw-hangup-btn svg { transform: rotate(135deg); }

/* Compact icon-only buttons */
.cw-icon-btn {
    width: 28px; height: 28px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--text-dim);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .12s, color .12s;
    flex-shrink: 0;
}
.cw-icon-btn svg { width: 14px; height: 14px; fill: currentColor; }
.cw-icon-btn:hover { background: var(--bg-4); color: var(--text); }
.cw-icon-btn.active { background: var(--accent); color: #fff; }
.cw-icon-btn.recording { color: var(--red); animation: recPulse 1.2s infinite; }

/* Header icons (logs / settings / logout) — always visible */
.cw-header-icons {
    display: flex;
    align-items: center;
    gap: 1px;
    flex-shrink: 0;
    padding-left: 6px;
    border-left: 1px solid var(--border);
    margin-left: 2px;
}

/* ── Dialpad below bar ── */
.phone-widget.popup-mode .pw-dialpad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    padding: 8px 10px;
    background: var(--bg-2);
    border-top: 1px solid var(--border);
}
.phone-widget.popup-mode .pw-dialpad.hidden { display: none; }
.phone-widget.popup-mode .pw-dialpad .key {
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 16px;
    font-weight: 500;
    padding: 7px 0;
    cursor: pointer;
    transition: background .1s;
}
.phone-widget.popup-mode .pw-dialpad .key:hover { background: var(--bg-4); }
.phone-widget.popup-mode .pw-dialpad .key:active { background: var(--accent); color: #fff; }

/* ── Line switcher ── */
.phone-widget.popup-mode .pw-lines {
    display: flex;
    gap: 6px;
    padding: 6px 10px;
    border-top: 1px solid var(--border);
    background: var(--bg-2);
}
.phone-widget.popup-mode .pw-lines.hidden { display: none !important; }

/* ── Second call banner ── */
.phone-widget.popup-mode .pw-banner {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    gap: 8px;
    background: var(--bg-3);
    border-top: 2px solid var(--green);
}
.phone-widget.popup-mode .pw-banner.hidden { display: none !important; }

/* ── Panels (settings) ── */
.phone-widget.popup-mode .pw-panel {
    border-top: 1px solid var(--border);
    background: var(--bg-2);
    max-height: none;
    overflow-y: auto;
}
.phone-widget.popup-mode .pw-panel.hidden { display: none !important; }

/* ── Incoming call: pulse the bar background ── */
.phone-widget.popup-mode[data-state="incoming"] .cw-bar {
    animation: compactIncomingGlow 1.4s infinite;
}
.phone-widget.popup-mode[data-state="incoming"] {
    animation: none; /* disable full-widget glow in compact mode */
}
@keyframes compactIncomingGlow {
    0%, 100% { background: var(--bg-3); }
    50%       { background: #1c3022; }
}
