* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
html, body {
    height: 100%;
    font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
    background: #e8f2f8;
    color: #1a3340;
    overflow: hidden;
    touch-action: manipulation;
}
button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    outline: none;
    background: none;
    -webkit-tap-highlight-color: transparent;
}
input, textarea {
    font-family: inherit;
    outline: none;
    border: none;
    background: none;
}
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: rgba(180, 210, 230, 0.15); border-radius: 10px; }
::-webkit-scrollbar-thumb { background: rgba(160, 195, 215, 0.4); border-radius: 10px; }

#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 480px;
    margin: 0 auto;
    background: #f2f9fe;
    box-shadow: 0 0 40px rgba(0, 40, 60, 0.08);
    position: relative;
    overflow: hidden;
}

.status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 14px 4px;
    background: rgba(255, 255, 255, 0.60);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(180, 210, 230, 0.15);
    flex-shrink: 0;
    min-height: 44px;
    gap: 6px;
    flex-wrap: wrap;
}
.status-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}
.status-left .brand {
    font-size: 16px;
    font-weight: 700;
    background: linear-gradient(135deg, #3a7b8f, #f06a8a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 2px;
}
.status-left .brand span {
    -webkit-text-fill-color: initial;
    color: #f06a8a;
    font-size: 18px;
}
.uid-pill {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.6);
    padding: 1px 10px 1px 12px;
    border-radius: 40px;
    border: 1px solid rgba(160, 195, 215, 0.2);
    font-size: 12px;
    font-weight: 600;
    color: #1d4b5e;
    white-space: nowrap;
    flex-shrink: 0;
}
.uid-pill .uid {
    font-family: 'Courier New', monospace;
    letter-spacing: 1.2px;
    font-size: 13px;
    background: rgba(180, 215, 235, 0.12);
    padding: 0 4px;
    border-radius: 16px;
}
.uid-pill .copy-btn {
    font-size: 13px;
    padding: 0 4px;
    border-radius: 30px;
    color: #6d9eb5;
    transition: 0.2s;
}
.uid-pill .copy-btn:active {
    transform: scale(0.8);
    background: rgba(180, 215, 235, 0.2);
}
.status-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    transition: 0.3s;
    flex-shrink: 0;
}
.status-dot.online { background: #4bc0a9; box-shadow: 0 0 10px rgba(75, 192, 169, 0.4); }
.status-dot.offline { background: #c0c8ce; }
.status-dot.connecting { background: #f7c948; animation: pulse-dot 1s infinite; }
@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.3; transform: scale(0.6); }
}
.status-label { font-size: 11px; font-weight: 500; color: #4f7a8c; }

.quick-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px 8px;
    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-bottom: 1px solid rgba(180, 210, 230, 0.10);
    flex-shrink: 0;
    flex-wrap: wrap;
}
.quick-bar .qb-label {
    font-size: 13px;
    font-weight: 600;
    color: #4f7a8c;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}
.quick-bar .qb-label span { font-size: 16px; }
.quick-bar .qb-input {
    flex: 1;
    min-width: 100px;
    background: rgba(255, 255, 255, 0.65);
    border-radius: 30px;
    padding: 7px 16px;
    font-size: 14px;
    border: 1px solid rgba(160, 195, 215, 0.15);
    color: #1a3340;
    transition: 0.2s;
    backdrop-filter: blur(4px);
}
.quick-bar .qb-input:focus {
    border-color: #8fc9e0;
    box-shadow: 0 0 0 3px rgba(140, 200, 220, 0.10);
    background: rgba(255, 255, 255, 0.85);
}
.quick-bar .qb-input::placeholder { color: #90b6c9; font-size: 13px; }
.quick-bar .qb-go {
    background: linear-gradient(135deg, #f8a4b8, #f06a8a);
    color: #fff;
    padding: 0 20px;
    height: 36px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(240, 106, 138, 0.20);
    transition: 0.2s;
    flex-shrink: 0;
}
.quick-bar .qb-go:active { transform: scale(0.92); }
.quick-bar .qb-go:disabled {
    opacity: 0.4; transform: none; box-shadow: none; cursor: not-allowed;
}
.quick-bar .qb-connect-btn {
    background: linear-gradient(135deg, #7ec8e3, #5fa3bb);
    color: #fff;
    padding: 0 18px;
    height: 36px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(95, 163, 187, 0.15);
    transition: 0.2s;
    flex-shrink: 0;
}
.quick-bar .qb-connect-btn:active { transform: scale(0.92); }
.quick-bar .qb-connect-btn:disabled {
    opacity: 0.4; transform: none; box-shadow: none; cursor: not-allowed;
}

.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(180, 210, 230, 0.10);
    flex-shrink: 0;
    min-height: 48px;
    gap: 6px;
}
.chat-header .peer-info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}
.chat-header .peer-info .avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #b5ddee, #f8a4b8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(240, 106, 138, 0.10);
}
.chat-header .peer-info .name {
    font-weight: 600;
    color: #1a3340;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chat-header .peer-info .sub {
    font-size: 11px;
    color: #6d9eb5;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chat-header .actions { display: flex; gap: 2px; flex-shrink: 0; }
.chat-header .actions button {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(160, 195, 215, 0.08);
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
    color: #3a7b8f;
}
.chat-header .actions button:active { transform: scale(0.85); background: rgba(255, 255, 255, 0.7); }
.chat-header .actions button.active-call {
    background: linear-gradient(135deg, #f06a8a, #d84a6a);
    color: #fff;
    border-color: #f06a8a;
    animation: pulse-call 1.5s infinite;
}
@keyframes pulse-call {
    0%, 100% { box-shadow: 0 0 0 0 rgba(240, 106, 138, 0.25); }
    50% { box-shadow: 0 0 0 10px rgba(240, 106, 138, 0); }
}
.chat-header .actions button:disabled { opacity: 0.3; cursor: not-allowed; transform: none; }

.messages-wrap {
    flex: 1;
    overflow-y: auto;
    padding: 10px 14px 6px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    background: rgba(240, 248, 252, 0.20);
}
.messages-wrap .empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #8db4c7;
    text-align: center;
    padding: 20px 16px;
    gap: 10px;
}
.messages-wrap .empty .big { font-size: 44px; opacity: 0.4; }
.messages-wrap .empty p { font-size: 14px; max-width: 260px; line-height: 1.6; }

.msg {
    max-width: 86%;
    padding: 7px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
    animation: msgPop 0.2s ease-out;
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    margin-bottom: 1px;
}
@keyframes msgPop {
    0% { opacity: 0; transform: translateY(6px) scale(0.96); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}
.msg.self {
    align-self: flex-end;
    background: linear-gradient(135deg, #b5ddee, #8fc9e0);
    color: #103845;
    border-bottom-right-radius: 4px;
    border: 1px solid rgba(140, 200, 220, 0.15);
}
.msg.peer {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.82);
    color: #1a3340;
    border-bottom-left-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(4px);
}
.msg.system {
    align-self: center;
    background: rgba(180, 210, 230, 0.10);
    color: #4f7a8c;
    font-size: 11px;
    padding: 3px 16px;
    border-radius: 30px;
    max-width: 94%;
    border: 1px dashed rgba(160, 195, 215, 0.15);
    text-align: center;
}
.msg .time { font-size: 9px; opacity: 0.4; margin-top: 2px; display: block; font-weight: 400; letter-spacing: 0.2px; }
.msg .sender-label { font-size: 10px; font-weight: 600; color: #3d7a8f; display: block; margin-bottom: 1px; }

.input-area {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 6px 12px 10px;
    background: rgba(255, 255, 255, 0.30);
    backdrop-filter: blur(8px);
    border-top: 1px solid rgba(180, 210, 230, 0.08);
    flex-shrink: 0;
}
.input-area textarea {
    flex: 1;
    background: rgba(255, 255, 255, 0.65);
    border-radius: 24px;
    padding: 8px 16px;
    font-size: 14px;
    resize: none;
    min-height: 38px;
    max-height: 90px;
    border: 1px solid rgba(160, 195, 215, 0.12);
    transition: 0.2s;
    color: #1a3340;
    backdrop-filter: blur(4px);
    line-height: 1.4;
}
.input-area textarea:focus {
    border-color: #8fc9e0;
    box-shadow: 0 0 0 3px rgba(140, 200, 220, 0.08);
    background: rgba(255, 255, 255, 0.8);
}
.input-area textarea::placeholder { color: #90b6c9; }
.input-area .send-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f8a4b8, #f06a8a);
    color: #fff;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: 0.25s;
    box-shadow: 0 4px 14px rgba(240, 106, 138, 0.20);
    border: none;
}
.input-area .send-btn:active { transform: scale(0.85); }
.input-area .send-btn:disabled { opacity: 0.25; transform: none; box-shadow: none; cursor: not-allowed; }

.bottom-nav {
    display: flex;
    align-items: center;
    justify-content: space-around;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(14px);
    border-top: 1px solid rgba(180, 210, 230, 0.08);
    padding: 2px 0 env(safe-area-inset-bottom, 6px) 0;
    flex-shrink: 0;
    min-height: 50px;
    gap: 2px;
}
.bottom-nav .tab-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0px;
    padding: 2px 8px;
    border-radius: 14px;
    font-size: 9px;
    font-weight: 500;
    color: #6d9eb5;
    transition: 0.2s;
    background: transparent;
    flex: 1;
    max-width: 72px;
}
.bottom-nav .tab-btn .icon { font-size: 20px; line-height: 1.2; }
.bottom-nav .tab-btn.active { color: #1d4b5e; background: rgba(180, 215, 235, 0.12); }
.bottom-nav .tab-btn:active { transform: scale(0.90); }
.bottom-nav .tab-btn .badge {
    background: #f06a8a;
    color: #fff;
    font-size: 8px;
    border-radius: 30px;
    padding: 0 5px;
    min-width: 16px;
    text-align: center;
    line-height: 14px;
    font-weight: 700;
    margin-top: -3px;
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 20, 30, 0.25);
    backdrop-filter: blur(6px);
    z-index: 100;
    display: none;
    align-items: flex-end;
    justify-content: center;
    animation: fadeIn 0.25s ease-out;
}
.sidebar-overlay.open { display: flex; }
@keyframes fadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}
.sidebar-sheet {
    background: #f2f9fe;
    border-radius: 28px 28px 0 0;
    width: 100%;
    max-width: 480px;
    max-height: 78vh;
    padding: 16px 16px env(safe-area-inset-bottom, 16px) 16px;
    overflow-y: auto;
    animation: slideUp 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 -10px 40px rgba(0, 20, 30, 0.08);
}
@keyframes slideUp {
    0% { transform: translateY(50px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}
.sidebar-sheet .handle {
    width: 36px;
    height: 4px;
    background: rgba(160, 195, 215, 0.2);
    border-radius: 10px;
    margin: 0 auto 12px;
}
.sidebar-sheet .sheet-title {
    font-size: 17px;
    font-weight: 700;
    color: #1a3340;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.sidebar-sheet .sheet-title .close-sheet {
    margin-left: auto;
    font-size: 22px;
    color: #6d9eb5;
    padding: 0 6px;
}
.sidebar-sheet .section { margin-bottom: 14px; }
.sidebar-sheet .section-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #5f8fa0;
    margin-bottom: 8px;
}
.connect-row {
    display: flex;
    gap: 8px;
    align-items: center;
}
.connect-row input {
    flex: 1;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 30px;
    padding: 8px 14px;
    font-size: 15px;
    font-family: 'Courier New', monospace;
    letter-spacing: 1.5px;
    border: 1px solid rgba(160, 195, 215, 0.12);
    text-align: center;
    color: #1a3340;
    min-height: 40px;
}
.connect-row input:focus {
    border-color: #8fc9e0;
    box-shadow: 0 0 0 3px rgba(140, 200, 220, 0.10);
    background: rgba(255, 255, 255, 0.85);
}
.connect-row input::placeholder {
    font-family: 'Segoe UI', sans-serif;
    letter-spacing: 0;
    color: #90b6c9;
    font-size: 13px;
}
.connect-row .connect-btn {
    background: linear-gradient(135deg, #7ec8e3, #5fa3bb);
    color: #fff;
    padding: 0 20px;
    height: 40px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(95, 163, 187, 0.12);
    transition: 0.2s;
}
.connect-row .connect-btn:active { transform: scale(0.92); }
.connect-row .connect-btn:disabled { opacity: 0.4; transform: none; box-shadow: none; cursor: not-allowed; }
.connect-status { font-size: 12px; color: #5f8fa0; margin-top: 6px; text-align: center; min-height: 18px; }

.history-list { display: flex; flex-direction: column; gap: 3px; }
.history-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.40);
    border: 1px solid rgba(160, 195, 215, 0.06);
    transition: 0.15s;
    cursor: pointer;
}
.history-item:active { transform: scale(0.97); background: rgba(255, 255, 255, 0.65); }
.history-item .h-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #b5ddee, #f8a4b8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    flex-shrink: 0;
}
.history-item .h-info { flex: 1; min-width: 0; }
.history-item .h-info .h-uid {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: #1a3340;
    font-size: 13px;
    letter-spacing: 0.3px;
}
.history-item .h-info .h-msg {
    font-size: 12px;
    color: #6d9eb5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}
.history-item .h-time { font-size: 10px; color: #90b6c9; flex-shrink: 0; }
.history-item .h-action { display: flex; gap: 3px; flex-shrink: 0; }
.history-item .h-action button {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(160, 195, 215, 0.06);
    color: #6d9eb5;
    transition: 0.15s;
}
.history-item .h-action button:active { transform: scale(0.82); background: rgba(180, 215, 235, 0.15); }
.empty-history { color: #90b6c9; font-size: 13px; text-align: center; padding: 18px 0; font-style: italic; }

.url-row {
    display: flex;
    gap: 8px;
    align-items: center;
}
.url-row input {
    flex: 1;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 30px;
    padding: 8px 14px;
    font-size: 13px;
    border: 1px solid rgba(160, 195, 215, 0.12);
    color: #1a3340;
    min-height: 40px;
}
.url-row input:focus {
    border-color: #8fc9e0;
    box-shadow: 0 0 0 3px rgba(140, 200, 220, 0.10);
    background: rgba(255, 255, 255, 0.85);
}
.url-row .go-btn {
    background: linear-gradient(135deg, #f8a4b8, #f06a8a);
    color: #fff;
    padding: 0 18px;
    height: 40px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(240, 106, 138, 0.15);
    transition: 0.2s;
}
.url-row .go-btn:active { transform: scale(0.92); }

.custom-uid-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 6px;
    flex-wrap: wrap;
}
.custom-uid-row input {
    flex: 1;
    min-width: 100px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 30px;
    padding: 8px 14px;
    font-size: 15px;
    font-family: 'Courier New', monospace;
    letter-spacing: 1.5px;
    border: 1px solid rgba(160, 195, 215, 0.12);
    text-align: center;
    color: #1a3340;
    min-height: 40px;
}
.custom-uid-row input:focus {
    border-color: #8fc9e0;
    box-shadow: 0 0 0 3px rgba(140, 200, 220, 0.10);
    background: rgba(255, 255, 255, 0.85);
}
.custom-uid-row input::placeholder {
    font-family: 'Segoe UI', sans-serif;
    letter-spacing: 0;
    color: #90b6c9;
    font-size: 13px;
}
.custom-uid-row .set-uid-btn {
    background: linear-gradient(135deg, #7ec8e3, #5fa3bb);
    color: #fff;
    padding: 0 18px;
    height: 40px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(95, 163, 187, 0.12);
    transition: 0.2s;
}
.custom-uid-row .set-uid-btn:active { transform: scale(0.92); }
.custom-uid-row .gen-uid-btn {
    background: linear-gradient(135deg, #f8a4b8, #f06a8a);
    color: #fff;
    padding: 0 18px;
    height: 40px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(240, 106, 138, 0.15);
    transition: 0.2s;
}
.custom-uid-row .gen-uid-btn:active { transform: scale(0.92); }
.custom-uid-status { font-size: 12px; color: #5f8fa0; margin-top: 4px; text-align: center; min-height: 18px; }

.url-history-list { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.url-history-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.30);
    border: 1px solid rgba(160, 195, 215, 0.06);
    transition: 0.15s;
    cursor: pointer;
}
.url-history-item:active { transform: scale(0.97); background: rgba(255, 255, 255, 0.6); }
.url-history-item .url-text {
    flex: 1;
    font-size: 13px;
    color: #1a3340;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}
.url-history-item .url-time { font-size: 10px; color: #90b6c9; flex-shrink: 0; margin-right: 4px; }
.url-history-item .url-del { font-size: 14px; color: #e74c3c; padding: 0 4px; border-radius: 30px; transition: 0.15s; }
.url-history-item .url-del:active { transform: scale(0.8); background: rgba(231, 76, 60, 0.08); }
.empty-url-history { color: #90b6c9; font-size: 12px; text-align: center; padding: 12px 0; font-style: italic; }

.call-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 20, 30, 0.75);
    backdrop-filter: blur(24px);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 20px 16px;
}
.call-overlay.open { display: flex; }
.call-overlay .call-box {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 36px;
    padding: 24px 20px 20px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.04);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.25);
}
.call-overlay .call-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, #b5ddee, #f8a4b8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    font-weight: 700;
    color: #fff;
    margin: 0 auto 10px;
    box-shadow: 0 8px 30px rgba(240, 106, 138, 0.15);
}
.call-overlay .call-name { font-size: 20px; font-weight: 700; color: #fff; }
.call-overlay .call-sub { font-size: 13px; color: rgba(255, 255, 255, 0.45); margin-top: 2px; }
.call-overlay .call-timer {
    font-size: 28px;
    font-weight: 300;
    color: #fff;
    margin: 8px 0 16px;
    font-variant-numeric: tabular-nums;
    letter-spacing: 2px;
}
.call-overlay .call-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.call-overlay .call-actions button {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.06);
}
.call-overlay .call-actions button:active { transform: scale(0.85); }
.call-overlay .call-actions .hangup { background: linear-gradient(135deg, #e74c3c, #c0392b); box-shadow: 0 4px 20px rgba(231, 76, 60, 0.25); }
.call-overlay .call-actions .mute { background: rgba(255, 255, 255, 0.06); }
.call-overlay .call-actions .mute.active { background: linear-gradient(135deg, #f39c12, #e67e22); }
.call-overlay .call-actions .video-toggle { background: rgba(255, 255, 255, 0.06); }
.call-overlay .call-actions .video-toggle.active { background: linear-gradient(135deg, #3498db, #2980b9); }
.call-overlay .call-actions .accept { background: linear-gradient(135deg, #2ecc71, #27ae60); box-shadow: 0 4px 20px rgba(46, 204, 113, 0.2); }
.call-overlay .call-actions .reject { background: linear-gradient(135deg, #e74c3c, #c0392b); box-shadow: 0 4px 20px rgba(231, 76, 60, 0.2); }
.call-overlay .local-video {
    position: fixed;
    bottom: 90px;
    right: 12px;
    width: 100px;
    height: 140px;
    border-radius: 14px;
    background: #0a1a24;
    border: 2px solid rgba(255, 255, 255, 0.08);
    object-fit: cover;
    z-index: 201;
    display: none;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}
.call-overlay .local-video.show { display: block; }
.call-overlay .remote-video {
    width: 100%;
    max-height: 260px;
    border-radius: 18px;
    background: #0a1a24;
    margin: 4px 0 12px;
    object-fit: cover;
    display: none;
    border: 1px solid rgba(255, 255, 255, 0.03);
}
.call-overlay .remote-video.show { display: block; }

.toast {
    position: fixed;
    bottom: 70px;
    left: 50%;
    transform: translateX(-50%) translateY(60px);
    background: rgba(20, 50, 65, 0.92);
    backdrop-filter: blur(14px);
    color: #f0f7fa;
    padding: 8px 22px;
    border-radius: 40px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.10);
    opacity: 0;
    transition: 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
    z-index: 999;
    border: 1px solid rgba(255, 255, 255, 0.04);
    max-width: 92%;
    text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 480px) {
    #app { max-width: 100%; border-radius: 0; box-shadow: none; }
    .status-bar { padding: 4px 10px 2px; min-height: 38px; }
    .status-left .brand { font-size: 14px; }
    .uid-pill { font-size: 10px; padding: 0 6px 0 8px; }
    .uid-pill .uid { font-size: 11px; letter-spacing: 0.8px; }
    .quick-bar { padding: 4px 10px 6px; gap: 5px; }
    .quick-bar .qb-label { font-size: 11px; }
    .quick-bar .qb-label span { font-size: 14px; }
    .quick-bar .qb-input { font-size: 13px; padding: 5px 12px; min-height: 32px; }
    .quick-bar .qb-go { height: 32px; padding: 0 14px; font-size: 12px; }
    .quick-bar .qb-connect-btn { height: 32px; padding: 0 14px; font-size: 12px; }
    .chat-header { padding: 4px 10px; min-height: 40px; }
    .chat-header .peer-info .avatar { width: 28px; height: 28px; font-size: 13px; }
    .chat-header .peer-info .name { font-size: 13px; }
    .chat-header .actions button { width: 30px; height: 30px; font-size: 14px; }
    .messages-wrap { padding: 6px 10px 4px; }
    .msg { font-size: 13px; padding: 6px 12px; max-width: 92%; }
    .input-area { padding: 4px 10px 8px; gap: 6px; }
    .input-area textarea { font-size: 13px; padding: 6px 12px; min-height: 34px; max-height: 76px; }
    .input-area .send-btn { width: 38px; height: 38px; font-size: 16px; }
    .bottom-nav { min-height: 44px; padding: 0 0 env(safe-area-inset-bottom, 4px) 0; }
    .bottom-nav .tab-btn { font-size: 8px; padding: 1px 4px; max-width: 60px; }
    .bottom-nav .tab-btn .icon { font-size: 17px; }
    .sidebar-sheet { padding: 12px 12px env(safe-area-inset-bottom, 12px) 12px; max-height: 76vh; }
    .call-overlay .call-box { padding: 16px 14px; }
    .call-overlay .call-avatar { width: 56px; height: 56px; font-size: 26px; }
    .call-overlay .call-name { font-size: 17px; }
    .call-overlay .call-timer { font-size: 24px; }
    .call-overlay .call-actions button { width: 46px; height: 46px; font-size: 20px; }
    .call-overlay .local-video { width: 76px; height: 108px; bottom: 76px; right: 8px; }
    .connect-row input { font-size: 14px; padding: 6px 10px; min-height: 34px; }
    .connect-row .connect-btn { height: 34px; padding: 0 14px; font-size: 12px; }
    .url-row input { font-size: 12px; padding: 6px 10px; min-height: 34px; }
    .url-row .go-btn { height: 34px; padding: 0 14px; font-size: 12px; }
    .custom-uid-row input { font-size: 14px; padding: 6px 10px; min-height: 34px; }
    .custom-uid-row .set-uid-btn, .custom-uid-row .gen-uid-btn { height: 34px; padding: 0 14px; font-size: 12px; }
    .history-item { padding: 6px 8px; gap: 6px; }
    .history-item .h-avatar { width: 28px; height: 28px; font-size: 12px; }
    .history-item .h-info .h-uid { font-size: 12px; }
    .history-item .h-info .h-msg { font-size: 11px; }
    .history-item .h-action button { width: 22px; height: 22px; font-size: 10px; }
    .url-history-item { padding: 4px 8px; }
    .url-history-item .url-text { font-size: 12px; }
    .url-history-item .url-time { font-size: 9px; }
}

@media (max-width: 380px) {
    .status-left .brand { font-size: 12px; }
    .uid-pill { font-size: 9px; padding: 0 4px 0 6px; }
    .uid-pill .uid { font-size: 10px; letter-spacing: 0.5px; }
    .quick-bar .qb-label { font-size: 10px; }
    .quick-bar .qb-input { font-size: 12px; padding: 4px 10px; min-height: 28px; }
    .quick-bar .qb-go { height: 28px; padding: 0 10px; font-size: 11px; }
    .quick-bar .qb-connect-btn { height: 28px; padding: 0 10px; font-size: 11px; }
    .bottom-nav .tab-btn { font-size: 7px; max-width: 50px; }
    .bottom-nav .tab-btn .icon { font-size: 15px; }
    .chat-header .peer-info .name { font-size: 12px; }
}

.hidden { display: none !important; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-6 { gap: 6px; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.mt-6 { margin-top: 6px; }
.mb-6 { margin-bottom: 6px; }
