:root {
    --bg: #f7f8fa;
    --panel: #ffffff;
    --text: #17202a;
    --muted: #637083;
    --line: #dfe4ea;
    --accent: #1f6feb;
    --success: #16833a;
    --danger: #c42b2b;
    --shadow: 0 12px 30px rgba(17, 24, 39, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
}

a {
    color: var(--accent);
}

.shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 42px;
}

.shell.narrow {
    width: min(680px, calc(100% - 32px));
}

.topbar {
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

h1,
h2,
p {
    margin: 0;
}

h1 {
    font-size: 28px;
    line-height: 1.1;
    letter-spacing: 0;
}

h2 {
    margin-bottom: 16px;
    font-size: 18px;
    line-height: 1.25;
    letter-spacing: 0;
}

.topbar p,
.muted {
    color: var(--muted);
}

.grid {
    display: grid;
    grid-template-columns: minmax(280px, 430px) minmax(280px, 1fr);
    gap: 18px;
    align-items: start;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 20px;
}

.phone-panel {
    grid-row: span 2;
}

.log-panel {
    grid-column: 2;
}

.login-panel {
    max-width: 520px;
}

.status-row {
    height: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #98a2b3;
}

.status-dot.ready {
    background: var(--success);
}

.status-dot.busy {
    background: #d08700;
}

.dial-display input {
    width: 100%;
    height: 54px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 14px;
    font-size: 24px;
    line-height: 1;
    letter-spacing: 0;
}

.keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 14px 0;
}

.keypad button {
    height: 52px;
    font-size: 20px;
}

button,
.link-button {
    min-height: 40px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
    color: var(--text);
    padding: 9px 13px;
    font: inherit;
    font-size: 14px;
    font-weight: 650;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
}

button:hover,
.link-button:hover {
    border-color: #9aa8ba;
}

button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.success {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

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

.call-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.form-stack {
    display: grid;
    gap: 13px;
}

.form-stack.compact {
    gap: 10px;
}

label {
    display: grid;
    gap: 6px;
    color: #374151;
    font-size: 13px;
    font-weight: 650;
}

input {
    min-width: 0;
    height: 40px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 11px;
    color: var(--text);
    font: inherit;
    font-size: 14px;
}

.check-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.check-row input {
    width: 16px;
    height: 16px;
}

.alert,
.notice {
    margin-bottom: 14px;
    border-radius: 8px;
    padding: 12px 13px;
    font-size: 14px;
    line-height: 1.45;
}

.alert {
    border: 1px solid #f0a6a6;
    background: #fff1f1;
    color: #8f1717;
}

.notice {
    border: 1px solid #b9d4ff;
    background: #eef5ff;
    color: #1e477d;
}

.live-log {
    display: grid;
    gap: 8px;
    margin-bottom: 12px;
}

.live-log div {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 9px 10px;
    color: var(--muted);
    font-size: 13px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 10px 8px;
    text-align: left;
    vertical-align: top;
}

th {
    color: #475569;
    font-size: 12px;
    text-transform: uppercase;
}

code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.92em;
}

#callMessage {
    min-height: 22px;
    margin-top: 12px;
    font-size: 14px;
}

.remote-audio {
    width: 100%;
    height: 34px;
    margin-top: 8px;
}

@media (max-width: 820px) {
    .grid,
    .log-panel {
        grid-template-columns: 1fr;
        grid-column: auto;
    }

    .phone-panel {
        grid-row: auto;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }
}
