/* CallScope softphone shell — utilitarian outbound dialer */
@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=Outfit:wght@400;500;600;700&display=swap");

:root {
  --cs-bg: #0e1218;
  --cs-panel: #171d27;
  --cs-panel-2: #1e2633;
  --cs-line: #2a3444;
  --cs-text: #e8edf5;
  --cs-muted: #8b97a8;
  --cs-accent: #e8a54b;
  --cs-accent-press: #c9842d;
  --cs-ok: #3d9a6a;
  --cs-danger: #c45c5c;
  --cs-key: #242c3a;
  --cs-key-press: #323c4e;
  --cs-radius: 18px;
  --cs-font: "Outfit", system-ui, sans-serif;
  --cs-mono: "IBM Plex Mono", ui-monospace, monospace;
}

html,
body {
  background: var(--cs-bg) !important;
  font-family: var(--cs-font) !important;
}

/* Hide stock Browser Phone chrome while keeping SIP stack alive */
body.callscope-shell #Phone > *:not(#callscope-shell),
body.callscope-shell #leftContent,
body.callscope-shell #rightContent,
body.callscope-shell #SettingsMenu,
body.callscope-shell #regStatus,
body.callscope-shell #topBar,
body.callscope-shell #BuddyList,
body.callscope-shell #DialPad,
body.callscope-shell .ui-dialog,
body.callscope-shell .ui-widget-overlay {
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

body.callscope-shell #leftContent,
body.callscope-shell #rightContent {
  max-height: 1px !important;
  overflow: hidden !important;
}

/* Keep stock in-call chrome hidden — CallScope active panel owns hangup/controls */
body.callscope-shell.callscope-in-call #rightContent,
body.callscope-shell.callscope-in-call .streamSelected,
body.callscope-shell.callscope-in-call .ui-dialog {
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

#callscope-shell {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 28px 16px 40px;
  box-sizing: border-box;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(232, 165, 75, 0.12), transparent 55%),
    radial-gradient(800px 500px at 100% 100%, rgba(61, 154, 106, 0.08), transparent 45%),
    var(--cs-bg);
  color: var(--cs-text);
  overflow: auto;
}

#callscope-shell[hidden] {
  display: none !important;
}

.cs-brand {
  width: min(420px, 100%);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.cs-brand-text {
  min-width: 0;
}

.cs-brand h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.cs-brand-sub {
  margin: 4px 0 0;
  font-size: 0.8rem;
  color: var(--cs-muted);
  font-family: var(--cs-mono);
}

.cs-brand .cs-status {
  flex-shrink: 0;
  font-size: 0.8rem;
  color: var(--cs-muted);
  font-family: var(--cs-mono);
  padding-top: 4px;
}

.cs-brand .cs-status.ok {
  color: var(--cs-ok);
}

.cs-active-label {
  margin: 0 0 6px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--cs-muted);
}

.cs-active-company {
  margin: 0 0 18px;
  font-size: 1.15rem;
  font-weight: 600;
}

.cs-active-dest {
  margin: 0 0 8px;
  font-size: 2rem;
  font-weight: 500;
  font-family: var(--cs-mono);
  letter-spacing: 0.04em;
  text-align: center;
}

.cs-active-state {
  margin: 0 0 28px;
  text-align: center;
  font-size: 0.95rem;
  color: var(--cs-accent);
  font-family: var(--cs-mono);
}

.cs-btn-hangup {
  width: 100%;
  height: 58px;
  background: linear-gradient(180deg, #d66b6b 0%, var(--cs-danger) 100%);
  color: #fff;
  box-shadow: 0 10px 24px rgba(196, 92, 92, 0.28);
}

.cs-btn-hangup:hover {
  filter: brightness(1.05);
}

.cs-card {
  width: min(420px, 100%);
  background: linear-gradient(180deg, var(--cs-panel) 0%, #141a23 100%);
  border: 1px solid var(--cs-line);
  border-radius: calc(var(--cs-radius) + 4px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  padding: 22px 20px 24px;
  box-sizing: border-box;
}

.cs-field {
  margin-bottom: 16px;
}

.cs-field label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--cs-muted);
  margin-bottom: 8px;
}

.cs-field select,
.cs-dial-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--cs-line);
  background: var(--cs-panel-2);
  color: var(--cs-text);
  border-radius: 12px;
  font-family: var(--cs-font);
  outline: none;
}

.cs-field select {
  padding: 12px 14px;
  font-size: 0.95rem;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--cs-muted) 50%),
    linear-gradient(135deg, var(--cs-muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(50% - 3px), calc(100% - 12px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.cs-field select:focus,
.cs-dial-input:focus {
  border-color: var(--cs-accent);
  box-shadow: 0 0 0 3px rgba(232, 165, 75, 0.2);
}

.cs-dial-input {
  padding: 18px 16px;
  font-size: 1.85rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  font-family: var(--cs-mono);
  text-align: center;
}

.cs-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 8px 0 18px;
}

.cs-key {
  height: 64px;
  border: 1px solid var(--cs-line);
  border-radius: 14px;
  background: var(--cs-key);
  color: var(--cs-text);
  font-family: var(--cs-mono);
  font-size: 1.45rem;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.08s ease, background 0.12s ease;
  user-select: none;
}

.cs-key small {
  display: block;
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  color: var(--cs-muted);
  font-family: var(--cs-font);
  font-weight: 500;
  margin-top: 2px;
}

.cs-key:hover {
  background: var(--cs-key-press);
}

.cs-key:active {
  transform: scale(0.96);
  background: #3a4558;
}

.cs-actions {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 10px;
}

.cs-btn {
  height: 56px;
  border: none;
  border-radius: 14px;
  font-family: var(--cs-font);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.08s ease, filter 0.12s ease;
}

.cs-btn:active {
  transform: scale(0.98);
}

.cs-btn-back {
  background: var(--cs-panel-2);
  color: var(--cs-text);
  border: 1px solid var(--cs-line);
}

.cs-btn-call {
  background: linear-gradient(180deg, #f0b45c 0%, var(--cs-accent) 100%);
  color: #1a1206;
  box-shadow: 0 10px 24px rgba(232, 165, 75, 0.28);
}

.cs-btn-call:hover {
  filter: brightness(1.05);
}

.cs-btn-call:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.cs-hint {
  margin-top: 14px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--cs-muted);
}

@media (max-width: 480px) {
  .cs-key {
    height: 58px;
  }
  .cs-dial-input {
    font-size: 1.55rem;
  }
}
