:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --ink: #18212f;
  --muted: #687384;
  --line: #d8dee8;
  --panel: #ffffff;
  --soft: #eef4f1;
  --accent: #0d766e;
  --accent-strong: #075e58;
  --warn: #b05225;
  --focus: rgba(13, 118, 110, 0.22);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(13, 118, 110, 0.08), transparent 34%),
    linear-gradient(315deg, rgba(64, 104, 142, 0.08), transparent 36%),
    var(--bg);
}

button,
input,
select,
textarea {
  font: inherit;
}

.shell {
  display: grid;
  grid-template-columns: minmax(360px, 430px) minmax(560px, 1fr);
  gap: 28px;
  width: min(1480px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 28px 0;
  min-height: 100vh;
  align-items: start;
}

.phone-stage {
  position: sticky;
  top: 28px;
  display: flex;
  justify-content: center;
}

.phone {
  width: min(100%, 390px);
  min-height: calc(100vh - 56px);
  max-height: calc(100vh - 56px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fbfcfd;
  border: 10px solid #121821;
  border-radius: 34px;
  box-shadow: 0 24px 70px rgba(20, 32, 46, 0.2);
}

.phone-header {
  display: grid;
  grid-template-columns: 40px 1fr 116px;
  gap: 10px;
  align-items: center;
  padding: 20px 18px 14px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.icon-button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  font-size: 26px;
  line-height: 1;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 22px;
}

h2 {
  font-size: 24px;
}

h3 {
  font-size: 16px;
}

.country-switch,
.route-strip label,
.field,
.business-field {
  display: grid;
  gap: 7px;
}

.country-switch span,
.route-strip span,
.field-label,
.business-field label {
  color: var(--muted);
  font-size: 12px;
}

select,
input,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

textarea {
  min-height: 84px;
  resize: vertical;
}

select:focus,
input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--focus);
}

.route-strip {
  padding: 14px 18px;
  display: grid;
  gap: 10px;
  background: var(--soft);
  border-bottom: 1px solid #d7e5df;
}

.route-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 26px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid #cddbd5;
  color: #315a55;
  font-size: 12px;
}

.mobile-form {
  flex: 1;
  overflow: auto;
  padding: 18px;
  display: grid;
  gap: 14px;
}

.field {
  padding-bottom: 14px;
  border-bottom: 1px solid #edf0f4;
}

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

.inline-field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.inline-field .field-top {
  min-height: 20px;
}

.inline-field .field-label {
  font-size: 12px;
}

.inline-field .badge {
  display: none;
}

.inline-field input,
.inline-field select {
  min-width: 0;
  padding-left: 9px;
  padding-right: 9px;
}

.field-top {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.field-label {
  color: #2f3a49;
  font-weight: 650;
}

.badge {
  flex: none;
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 11px;
  color: var(--muted);
  background: #f0f3f7;
}

.badge.required {
  color: var(--warn);
  background: #fff1e8;
}

.hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.phone-footer {
  padding: 14px 18px 18px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.primary-button,
.secondary-button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  font-weight: 750;
  cursor: pointer;
}

.primary-button {
  width: 100%;
  color: #fff;
  background: var(--accent);
}

.secondary-button {
  color: #fff;
  background: #27415d;
}

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

.secondary-button:hover {
  background: #1d344e;
}

.web-stage {
  min-height: calc(100vh - 56px);
}

.empty-panel,
.web-panel {
  min-height: calc(100vh - 56px);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 18px 56px rgba(20, 32, 46, 0.1);
}

.empty-panel {
  display: grid;
  place-items: center;
  padding: 24px;
  color: var(--muted);
  border-radius: 14px;
  text-align: center;
}

.web-panel {
  border-radius: 14px;
  overflow: hidden;
}

.is-hidden {
  display: none;
}

.web-header {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.panel-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(320px, 1.1fr);
  gap: 18px;
  padding: 20px 24px;
}

.param-section,
.json-section {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.section-title {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.section-title span {
  color: var(--muted);
  font-size: 12px;
}

.readonly-list,
.business-form {
  padding: 14px 16px 16px;
  display: grid;
  gap: 12px;
}

.readonly-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.42fr) 1fr;
  gap: 12px;
  align-items: start;
  padding-bottom: 10px;
  border-bottom: 1px solid #edf0f4;
}

.readonly-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.readonly-row dt {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.readonly-row dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 14px;
}

.business-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.business-field.wide {
  grid-column: 1 / -1;
}

.json-section {
  margin: 0 24px 24px;
}

pre {
  margin: 0;
  max-height: 420px;
  overflow: auto;
  padding: 16px;
  background: #101721;
  color: #d9f7ee;
  font-size: 13px;
  line-height: 1.55;
  border-radius: 0 0 8px 8px;
}

@media (max-width: 980px) {
  .shell {
    grid-template-columns: 1fr;
    width: min(760px, calc(100vw - 24px));
    gap: 18px;
  }

  .phone-stage {
    position: static;
  }

  .phone {
    min-height: 720px;
    max-height: none;
  }

  .web-stage,
  .empty-panel,
  .web-panel {
    min-height: 420px;
  }
}

@media (max-width: 680px) {
  .shell {
    width: 100%;
    padding: 0;
  }

  .phone {
    width: 100%;
    min-height: 100vh;
    border: 0;
    border-radius: 0;
  }

  .phone-header {
    grid-template-columns: 36px 1fr 108px;
    padding-top: 16px;
  }

  .web-panel,
  .empty-panel {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }

  .web-header,
  .panel-grid,
  .json-section {
    margin: 0;
  }

  .panel-grid {
    grid-template-columns: 1fr;
    padding: 14px;
  }

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

  .json-section {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }
}
