:root {
  color-scheme: light;
  --bg: #eef2f0;
  --panel: #fbfcfb;
  --ink: #18211f;
  --muted: #65716d;
  --line: #ccd6d2;
  --accent: #126b5f;
  --accent-strong: #0b4f46;
  --warn: #cc5a26;
  --shadow: 0 18px 60px rgb(20 31 29 / 18%);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

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

button,
input,
select {
  font: inherit;
}

.shell {
  display: grid;
  grid-template-columns: minmax(360px, 440px) minmax(420px, 1fr);
  gap: 18px;
  min-height: 100%;
  padding: 18px;
}

.phone-panel,
.control-panel {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  gap: 16px;
  margin-bottom: 12px;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.eyebrow,
.muted {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 2px 0 0;
  font-size: 24px;
  line-height: 1.15;
}

.icon-button {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
}

.icon-button:hover {
  border-color: var(--accent);
}

.console-toggle {
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  font-weight: 750;
}

.console-toggle:hover,
.console-toggle.is-active {
  border-color: var(--accent);
  background: #e8f3ef;
  color: var(--accent-strong);
}

.phone {
  position: relative;
  width: min(100%, 410px);
  aspect-ratio: 390 / 844;
  margin: 0 auto;
  padding: 22px 12px 16px;
  border: 10px solid #161b1a;
  border-radius: 36px;
  background: #111;
  box-shadow: var(--shadow);
}

.speaker {
  position: absolute;
  top: 9px;
  left: 50%;
  width: 76px;
  height: 5px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: #313b38;
}

iframe {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 24px;
  background: white;
}

.api-select {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

select,
input {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
}

select {
  padding: 0 34px 0 12px;
}

.map-wrap {
  min-height: 0;
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #dfe8e3;
  box-shadow: 0 8px 26px rgb(20 31 29 / 10%);
}

.map {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 440px;
  overflow: hidden;
  cursor: crosshair;
  touch-action: none;
}

.tiles {
  position: absolute;
  inset: 0;
}

.tile {
  position: absolute;
  width: 256px;
  height: 256px;
  user-select: none;
}

.marker {
  position: absolute;
  width: 28px;
  height: 28px;
  padding: 0;
  transform: translate(-50%, -100%);
  border: 3px solid white;
  border-radius: 50% 50% 50% 8px;
  background: var(--warn);
  box-shadow: 0 6px 18px rgb(0 0 0 / 28%);
  cursor: grab;
}

.marker:active {
  cursor: grabbing;
}

.crosshair {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 18px;
  height: 18px;
  transform: translate(-50%, -50%);
  border: 1px solid rgb(24 33 31 / 28%);
  border-radius: 50%;
  pointer-events: none;
}

.crosshair::before,
.crosshair::after {
  position: absolute;
  background: rgb(24 33 31 / 28%);
  content: "";
}

.crosshair::before {
  top: 8px;
  left: -8px;
  width: 32px;
  height: 1px;
}

.crosshair::after {
  top: -8px;
  left: 8px;
  width: 1px;
  height: 32px;
}

.location-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 10px;
  align-items: end;
  padding: 12px 0;
}

.location-form label {
  display: grid;
  gap: 4px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

.location-form input {
  width: 100%;
  padding: 0 10px;
  font-variant-numeric: tabular-nums;
}

.location-form button {
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  font-weight: 750;
}

.location-form button:hover {
  background: var(--accent-strong);
}

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

.status-grid div {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.status-grid strong {
  display: block;
  overflow: hidden;
  margin-top: 4px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.api-console {
  display: flex;
  min-height: 220px;
  max-height: 42vh;
  flex-direction: column;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101614;
  color: #eef5f2;
  overflow: hidden;
}

.api-console[hidden] {
  display: none;
}

.console-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 10px 8px;
  border-bottom: 1px solid rgb(255 255 255 / 12%);
}

.console-header h3 {
  margin: 2px 0 0;
  font-size: 17px;
  line-height: 1.2;
}

.console-header .icon-button {
  width: 34px;
  height: 34px;
  border-color: rgb(255 255 255 / 16%);
  background: rgb(255 255 255 / 8%);
  color: #eef5f2;
}

.console-list {
  display: grid;
  gap: 8px;
  min-height: 0;
  padding: 10px;
  overflow: auto;
}

.console-entry {
  border: 1px solid rgb(255 255 255 / 14%);
  border-radius: 8px;
  background: rgb(255 255 255 / 5%);
}

.console-entry summary {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
  cursor: pointer;
  list-style: none;
}

.console-entry summary::-webkit-details-marker {
  display: none;
}

.status-badge,
.console-method {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  height: 24px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.status-badge.is-success {
  background: #d8f2e0;
  color: #19592d;
}

.status-badge.is-redirect,
.status-badge.is-pending {
  background: #e8edf5;
  color: #34425a;
}

.status-badge.is-warning {
  background: #ffe6c7;
  color: #794100;
}

.status-badge.is-error {
  background: #ffd8d4;
  color: #861c17;
}

.console-method {
  min-width: 54px;
  background: rgb(255 255 255 / 10%);
  color: #eef5f2;
}

.console-path {
  overflow: hidden;
  color: #eef5f2;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.console-meta {
  color: #a9b7b2;
  font-size: 12px;
  white-space: nowrap;
}

.console-body {
  display: grid;
  gap: 8px;
  padding: 0 8px 8px;
}

.console-block {
  min-width: 0;
}

.console-block h4 {
  margin: 0 0 4px;
  color: #a9b7b2;
  font-size: 11px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.console-block pre {
  max-height: 180px;
  margin: 0;
  padding: 8px;
  overflow: auto;
  border-radius: 6px;
  background: rgb(0 0 0 / 28%);
  color: #eef5f2;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 900px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .phone {
    width: min(100%, 390px);
  }

  .map {
    min-height: 360px;
  }

  .location-form {
    grid-template-columns: 1fr 1fr;
  }

  .location-form button {
    grid-column: 1 / -1;
  }

  .status-grid {
    grid-template-columns: 1fr;
  }

  .toolbar-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .api-select {
    justify-content: flex-end;
  }

  .console-entry summary {
    grid-template-columns: auto auto minmax(0, 1fr);
  }

  .console-meta {
    grid-column: 1 / -1;
  }
}
