:root {
  color-scheme: light;
  --page: #eef2ed;
  --ink: #17201b;
  --muted: #65736b;
  --line: #c9d2cb;
  --phone: #111614;
  --phone-edge: #2d3832;
  --screen: #f9fbf7;
  --screen-line: #dce4dd;
  --key: #fbfcf8;
  --key-ink: #1c2520;
  --green: #168a57;
  --green-dark: #0c6f43;
  --red: #c84848;
  --blue: #2766ad;
  --amber: #b27a23;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--page);
  color: var(--ink);
}

button,
input {
  font: inherit;
}

.simulator {
  width: min(1120px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 32px 20px;
  display: grid;
  grid-template-columns: minmax(300px, 380px) minmax(280px, 420px);
  align-items: center;
  justify-content: center;
  gap: 28px;
}

.phone {
  width: min(100%, 380px);
  margin: 0 auto;
  padding: 16px 16px 18px;
  border: 1px solid #020403;
  border-radius: 34px;
  background: var(--phone);
  box-shadow:
    0 22px 60px rgb(23 32 27 / 20%),
    inset 0 0 0 1px var(--phone-edge);
}

.speaker {
  width: 72px;
  height: 6px;
  margin: 4px auto 14px;
  border-radius: 999px;
  background: #34413a;
}

.screen {
  min-height: 332px;
  padding: 14px;
  border: 1px solid #d5ded6;
  border-radius: 18px;
  background: var(--screen);
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 12px;
}

.status-bar,
.brand-lockup,
.session-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.status-bar {
  min-height: 24px;
  color: var(--muted);
  font-size: 13px;
}

.dial-display {
  min-height: 46px;
  padding: 8px 10px;
  border: 1px solid var(--screen-line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  display: flex;
  align-items: center;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 22px;
  font-weight: 650;
  letter-spacing: 0;
}

.ussd-window {
  min-height: 174px;
  padding: 12px;
  border: 1px solid #cfdad1;
  border-radius: 8px;
  background: #f4f7f1;
}

.ussd-title {
  min-height: 22px;
  margin-bottom: 8px;
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 750;
}

.ussd-window pre {
  min-height: 126px;
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #202a24;
  font-family:
    "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 14px;
  line-height: 1.45;
}

.reply-row {
  min-height: 42px;
  display: grid;
  grid-template-columns: 1fr 76px;
  gap: 8px;
}

.reply-row input,
.controls input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
  outline: none;
}

.reply-row input:focus,
.controls input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgb(39 102 173 / 15%);
}

.small-action,
.control-actions button,
.utility-key,
.call-key,
.end-key {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 750;
}

.small-action {
  background: var(--blue);
  color: #fff;
}

.small-action:disabled,
.reply-row input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.keypad {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.keypad button {
  aspect-ratio: 1 / 0.74;
  min-height: 62px;
  border: 1px solid #d8ded8;
  border-radius: 999px;
  background: var(--key);
  color: var(--key-ink);
  box-shadow: inset 0 -2px 0 rgb(0 0 0 / 8%);
  cursor: pointer;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  font-size: 24px;
  font-weight: 760;
  letter-spacing: 0;
}

.keypad button span {
  color: #6d7770;
  font-size: 10px;
  font-weight: 750;
}

.keypad button:active,
.phone-actions button:active,
.control-actions button:active,
.small-action:active {
  transform: translateY(1px);
}

.phone-actions {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr 1.15fr 1fr;
  gap: 12px;
}

.utility-key {
  background: #e7ddd0;
  color: #4a3520;
}

.call-key {
  background: var(--green);
  color: #fff;
}

.end-key {
  background: var(--red);
  color: #fff;
}

.controls {
  width: min(100%, 420px);
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  display: grid;
  gap: 16px;
}

.brand-lockup span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.brand-lockup strong {
  color: var(--ink);
  font-size: 22px;
  letter-spacing: 0;
}

.controls label,
fieldset {
  display: grid;
  gap: 7px;
  margin: 0;
  color: #46524b;
  font-size: 13px;
  font-weight: 750;
}

fieldset {
  padding: 0;
  border: 0;
}

legend {
  padding: 0;
  margin-bottom: 7px;
}

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

.segments label {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
}

.segments input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segments label:has(input:checked) {
  border-color: var(--green);
  background: #e9f6ef;
  color: var(--green-dark);
}

.session-card {
  min-height: 50px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f5f7f3;
}

.session-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.session-card code {
  max-width: 230px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--blue);
  font-size: 12px;
}

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

.control-actions button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.control-actions button:first-child {
  border-color: #d5c39f;
  background: #fff8eb;
  color: #6a4616;
}

.transport-status {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.transport-status[data-kind="good"] {
  color: var(--green-dark);
}

.transport-status[data-kind="bad"] {
  color: var(--red);
}

@media (max-width: 820px) {
  .simulator {
    min-height: auto;
    padding: 18px 14px 28px;
    grid-template-columns: 1fr;
    align-items: start;
  }

  .controls {
    margin: 0 auto;
    order: -1;
  }

  .phone {
    max-width: 360px;
  }
}

@media (max-width: 390px) {
  .simulator {
    padding-inline: 10px;
  }

  .phone {
    padding: 12px;
    border-radius: 26px;
  }

  .screen {
    padding: 12px;
  }

  .keypad {
    gap: 9px;
  }

  .keypad button {
    min-height: 56px;
    font-size: 22px;
  }

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

/* Live-demo money warning */
.live-warning {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #e7cf9a;
  border-left: 3px solid var(--amber);
  border-radius: 10px;
  background: #fdf6e6;
  color: #6b4e15;
  font-size: 13px;
  line-height: 1.45;
}
.live-warning strong {
  color: var(--amber);
}

/* Try-on-a-real-phone note */
.real-phone {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f4f7f1;
}
.real-phone > span {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.real-phone strong {
  font-size: 15px;
  color: var(--ink);
}
.real-phone code {
  background: #e7efe8;
  border: 1px solid var(--screen-line);
  border-radius: 6px;
  padding: 1px 6px;
  color: var(--green-dark);
}
.real-phone em {
  font-style: normal;
  font-size: 12px;
  color: var(--muted);
}
