.phone-tool {
    position: fixed;
    inset: 0;
    z-index: 70;
}

body.phone-is-open .outerContainer {
    overflow: hidden;
}

#phone-call-screen.phone-screen {
    overflow: hidden;
}

.phone-hidden {
    display: none;
}

.phone-tool-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(3, 7, 18, 0.82);
    backdrop-filter: blur(2px);
}

.phone-tool-window {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 10px;
}

.phone-close {
    position: absolute;
    top: 58px;
    right: 54px;
    z-index: 5;
    width: 28px;
    height: 28px;
    border: 2px solid #050505;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: #0b1724;
    cursor: pointer;
    box-shadow: 1px 1px 0 #050505;
    font-size: 18px;
    font-weight: 900;
    line-height: 21px;
}

.phone-close-blocked .phone-close {
    display: none;
}

.phone-shell {
    position: relative;
    width: min(430px, 96vw);
    height: min(790px, 96vh);
    min-height: 620px;
    transform: translateY(-24px) scale(0.9);
    transform-origin: center;
    overflow: hidden;
    color: #eef7ff;
    background: url("../resources/phone/overlay-phone.png") center / 100% 100% no-repeat;
    border: 0;
    border-radius: 0;
    filter:
        drop-shadow(0 28px 38px rgba(0, 0, 0, 0.72))
        drop-shadow(6px 6px 0 rgba(5, 5, 5, 0.82));
}

.phone-screen-surface {
    position: absolute;
    inset: 16px 42px 50px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    padding: 6px 8px 12px;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.phone-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 22px;
    padding: 0 2px;
}

.phone-screen-title {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.phone-clock {
    color: #ffffff;
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
    margin-left: 8px;
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
    text-shadow: 2px 2px 0 #050505;
}

.phone-status-icons {
    display: flex;
    align-items: center;
    gap: 1px;
    transform: translateX(9px);
}

.phone-signal {
    width: 22px;
    height: 15px;
    background: #ffffff;
    -webkit-mask: url("../resources/phone/icon-phone-signal.svg") center / contain no-repeat;
    mask: url("../resources/phone/icon-phone-signal.svg") center / contain no-repeat;
}

.phone-wifi {
    width: 19px;
    height: 15px;
    background: #ffffff;
    -webkit-mask: url("../resources/phone/icon-phone-wifi.svg") center / contain no-repeat;
    mask: url("../resources/phone/icon-phone-wifi.svg") center / contain no-repeat;
}

.phone-battery {
    width: 31px;
    height: 19px;
    background: #ffffff;
    -webkit-mask: url("../resources/phone/icon-phone-battery.svg") center / contain no-repeat;
    mask: url("../resources/phone/icon-phone-battery.svg") center / contain no-repeat;
}

.phone-screen {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 48px 14px 4px;
    scrollbar-color: rgba(189, 232, 255, 0.8) transparent;
}

.phone-screen[hidden] {
    display: none;
}

.phone-screen-heading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0 0 12px;
    padding-bottom: 7px;
    border-bottom: 3px solid rgba(125, 211, 252, 0.35);
}

.phone-screen-heading strong {
    color: #ffffff;
    font-size: 18px;
    font-weight: 900;
    text-transform: uppercase;
}

.phone-screen-heading span {
    color: #9fd5ff;
    font-weight: 900;
}

.phone-call-list {
    display: grid;
    gap: 9px;
    margin: 0;
    padding: 0 2px 8px;
    list-style: none;
}

.phone-call-item {
    position: relative;
    width: 100%;
    min-height: 88px;
    display: grid;
    grid-template-columns: 62px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 8px;
    color: #111827;
    background: #f5f1e6;
    border: 4px solid #050505;
    border-radius: 6px;
    box-shadow: 4px 4px 0 #050505;
    text-align: left;
    cursor: pointer;
}

.phone-call-item.is-missed {
    background: #eee8e0;
    cursor: default;
}

.phone-call-item.is-new::before {
    position: absolute;
    left: -5px;
    top: -5px;
    padding: 4px 8px;
    color: #ffffff;
    border: 3px solid #050505;
    font-size: 12px;
    font-weight: 900;
    transform: rotate(-2deg);
}

.phone-call-item.is-new::before {
    content: "NEW";
    background: #b91c1c;
}

.phone-call-avatar,
.phone-detail-person > img,
.phone-detail-person > .phone-avatar-fallback {
    width: 58px;
    height: 58px;
    display: block;
    overflow: hidden;
    border: 3px solid #050505;
    background: #102234;
}

.phone-call-avatar img,
.phone-detail-person img,
.phone-live-avatar img {
    width: 100%;
    height: 100%;
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    object-fit: cover;
}

.phone-avatar-fallback,
.phone-live-avatar > span {
    display: block;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 50% 30%, #31536f 0 18%, transparent 19%),
        radial-gradient(ellipse at 50% 82%, #31536f 0 31%, transparent 32%),
        linear-gradient(135deg, #071421, #17334d);
}

.phone-call-copy {
    min-width: 0;
}

.phone-call-copy strong,
.phone-call-copy small,
.phone-call-copy em,
.phone-call-meta time,
.phone-call-status {
    display: block;
}

.phone-tool .phone-call-copy strong {
    color: #111827;
    font-size: 16px;
    font-weight: 900;
}

.phone-call-copy small {
    color: #111827;
    font-size: 12px;
    font-weight: 800;
}

.phone-call-copy em {
    color: #31536f;
    font-size: 12px;
    font-style: normal;
    font-weight: 900;
}

.phone-call-meta {
    display: grid;
    justify-items: end;
    gap: 7px;
    color: #111827;
    font-weight: 900;
}

.phone-call-status {
    display: inline-block;
    width: max-content;
    padding: 4px 6px;
    color: #ffffff;
    background: #2563eb;
    border: 2px solid #050505;
    border-radius: 999px;
    box-shadow: 2px 2px 0 #050505;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
}

.phone-call-status.is-missed {
    background: #6b7280;
}

.phone-empty,
.phone-muted {
    color: #b8d7f1;
    font-weight: 800;
}

.phone-call-state {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 14px 4px 4px;
}

.phone-live-label {
    color: #ffffff;
    font-size: 24px;
    font-weight: 900;
    text-transform: uppercase;
    text-shadow: 3px 3px 0 #050505;
}

.phone-call-state.is-incoming .phone-live-label {
    color: #ffffff;
}

.phone-live-avatar {
    width: 156px;
    height: 156px;
    margin: 24px 0 16px;
    overflow: hidden;
    border: 5px solid #050505;
    border-radius: 999px;
    background: #102234;
    box-shadow:
        0 0 0 6px rgba(125, 211, 252, 0.42),
        0 12px 30px rgba(0, 0, 0, 0.52);
}

.phone-call-state.is-incoming .phone-live-avatar {
    box-shadow:
        0 0 0 6px rgba(240, 180, 41, 0.55),
        0 0 0 15px rgba(220, 38, 38, 0.2),
        0 12px 30px rgba(0, 0, 0, 0.52);
    animation: phoneRing 1.25s ease-in-out infinite;
}

@keyframes phoneRing {
    0%, 100% { transform: translateX(0); box-shadow: 0 0 0 6px rgba(240, 180, 41, 0.55), 0 0 0 15px rgba(220, 38, 38, 0.2), 0 12px 30px rgba(0, 0, 0, 0.52); }
    18% { transform: translateX(-2px) rotate(-1deg); }
    36% { transform: translateX(2px) rotate(1deg); }
    50% { box-shadow: 0 0 0 8px rgba(240, 180, 41, 0.5), 0 0 0 23px rgba(220, 38, 38, 0.06), 0 12px 30px rgba(0, 0, 0, 0.52); }
}

.phone-live-name {
    color: #ffffff;
    font-size: 27px;
    font-weight: 900;
    line-height: 1.1;
}

.phone-live-role {
    margin-top: 7px;
    color: #dff3ff;
    font-size: 18px;
    font-weight: 800;
}

.phone-live-time {
    margin-top: 4px;
    color: #4ade80;
    font-size: 17px;
    font-weight: 900;
}

.phone-voiceline {
    width: min(320px, 94%);
    height: 82px;
    margin: 13px 0 8px;
    background: url("../resources/phone/asset-phone-voiceline.png") center / contain no-repeat;
}

.phone-live-actions {
    width: 100%;
    margin-top: auto;
    display: flex;
    justify-content: center;
    gap: 38px;
    padding-top: 4px;
}

.phone-action-accept,
.phone-action-decline,
.phone-action-end {
    min-width: 118px;
    min-height: 116px;
    border: 0;
    color: #ffffff;
    background: transparent;
    cursor: pointer;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    font-size: 16px;
    font-weight: 900;
    text-transform: uppercase;
    filter: drop-shadow(4px 4px 0 #050505);
}

.phone-action-accept span,
.phone-action-decline span,
.phone-action-end span {
    width: 92px;
    height: 92px;
    display: block;
    background-position: center;
    background-size: contain;
    background-repeat: no-repeat;
}

.phone-action-accept span {
    background-image: url("../resources/phone/icon-phone-call.png");
}

.phone-action-decline span,
.phone-action-end span {
    background-image: url("../resources/phone/icon-phone-hang-up.png");
}

.phone-action-end {
    min-width: 140px;
}

.phone-subtitle-layer {
    position: absolute;
    z-index: 6;
    right: 0;
    bottom: 0;
    left: 0;
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px clamp(18px, 5vw, 72px);
    color: #ffffff;
    background: rgba(3, 7, 18, 0.94);
    border-top: 3px solid rgba(189, 232, 255, 0.76);
    box-shadow: 0 -7px 0 rgba(5, 5, 5, 0.48);
    pointer-events: none;
}

.phone-subtitle-layer[hidden] {
    display: none;
}

.phone-subtitle-content {
    width: min(960px, 100%);
    min-height: 52px;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 3px;
    text-align: center;
}

.phone-subtitle-speaker {
    color: #f0b429;
    font-size: 13px;
    font-weight: 900;
    line-height: 1.1;
}

.phone-subtitle-text {
    display: -webkit-box;
    overflow: hidden;
    color: #ffffff;
    font-size: clamp(15px, 1.7vw, 20px);
    font-weight: 800;
    line-height: 1.28;
    text-wrap: balance;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.phone-back {
    min-height: 32px;
    margin: 0 0 9px;
    padding: 4px 10px;
    border: 3px solid #050505;
    border-radius: 4px;
    color: #06121d;
    background: #bde8ff;
    box-shadow: 2px 2px 0 #050505;
    cursor: pointer;
    font-weight: 900;
    text-transform: uppercase;
}

.phone-detail-section {
    margin-bottom: 12px;
    padding: 11px;
    color: #111827;
    background: #f3f0e8;
    border: 4px solid #050505;
    border-radius: 4px;
    box-shadow: 3px 3px 0 #050505;
}

.phone-detail-summary {
    padding: 13px;
    background:
        linear-gradient(180deg, rgba(255, 253, 246, 0.94), rgba(245, 241, 230, 0.98)),
        #f5f1e6;
}

.phone-detail-section h4 {
    display: inline-block;
    margin: -17px 0 9px -5px;
    padding: 4px 8px;
    color: #bde8ff;
    background: #07314d;
    border: 3px solid #050505;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    transform: skew(-5deg);
}

.phone-detail-person {
    display: grid;
    grid-template-columns: 58px 1fr;
    gap: 10px;
    align-items: center;
}

.phone-detail-person > img,
.phone-detail-person > .phone-avatar-fallback {
    width: 56px;
    height: 56px;
}

.phone-detail-person strong,
.phone-detail-person span,
.phone-detail-person small {
    display: block;
}

.phone-tool .phone-detail-person strong {
    color: #111827;
    font-size: 17px;
    font-weight: 900;
}

.phone-detail-person span,
.phone-detail-person small,
.phone-detail-meta {
    color: #111827;
    font-weight: 800;
}

.phone-detail-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.phone-call-details p,
.phone-transcript p {
    margin: 8px 0 0;
    color: #111827;
    font-size: 13px;
    line-height: 1.4;
}

.phone-detail-review {
    display: grid;
    gap: 12px;
    padding-top: 12px;
}

.phone-detail-block {
    padding: 10px;
    background: rgba(255, 253, 246, 0.74);
    border: 3px solid #050505;
    box-shadow: 2px 2px 0 #050505;
}

.phone-detail-transcript-block {
    background: #fff7dc;
    border-width: 4px;
    box-shadow: 4px 4px 0 #050505;
}

.phone-transcript {
    max-height: none;
    overflow: visible;
}

.phone-attachments {
    display: grid;
    gap: 8px;
}

.phone-attachment {
    display: grid;
    grid-template-columns: 38px 1fr;
    gap: 8px;
    align-items: center;
}

.phone-attachment > span {
    width: 34px;
    height: 40px;
    background: url("../resources/phone/icon-phone-pdf-file.png") center / contain no-repeat;
}

.phone-attachment strong,
.phone-attachment small {
    display: block;
    color: #111827;
}

@media (max-height: 700px) {
    .phone-shell {
        min-height: 0;
        height: 96vh;
    }

    .phone-screen-surface {
        inset: 15px 38px 42px;
        padding: 5px 8px 10px;
    }

    .phone-live-avatar {
        width: 112px;
        height: 112px;
        margin: 12px 0 10px;
    }

    .phone-voiceline {
        height: 58px;
    }

    .phone-subtitle-layer {
        min-height: 62px;
        padding-block: 7px;
    }

    .phone-subtitle-content {
        min-height: 46px;
    }

    .phone-subtitle-text {
        font-size: 14px;
    }
}
