:root {
  color-scheme: light;
  --bg: #edf3fb;
  --panel: #ffffff;
  --ink: #14213d;
  --muted: #64748b;
  --line: #dbe5f1;
  --primary: #1f6fff;
  --primary-dark: #17345c;
  --green: #14b89a;
  --green-dark: #08745f;
  --amber-bg: #fff3d8;
  --amber-line: #ffd88a;
  --red: #d43c3c;
  --red-bg: #ffe7e7;
  --shadow: 0 18px 40px rgba(39, 73, 125, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at top left, rgba(31, 111, 255, 0.12), transparent 34%),
    var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
input {
  font: inherit;
}

button {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
}

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

.app-shell {
  min-height: 100vh;
  padding: 14px 12px 24px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.96fr);
  gap: 14px;
  width: min(1100px, calc(100vw - 24px));
  margin: 0 auto;
}

.intro-panel,
.portal-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.intro-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: calc(100vh - 50px);
  padding: 20px;
}

.portal-panel {
  min-height: calc(100vh - 50px);
  padding: 20px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  margin: 0;
  padding: 7px 12px;
  border-radius: 999px;
  background: #e7f0ff;
  color: #1554c0;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
}

.eyebrow span,
.input-help span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(20, 184, 154, 0.12);
}

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

h1 {
  font-size: 38px;
  line-height: 1;
}

h2 {
  font-size: 21px;
  line-height: 1.15;
}

.lead,
.main-heading p,
.result-message,
.input-help,
.notice-box {
  color: var(--muted);
  line-height: 1.7;
}

.lead {
  font-size: 15px;
  font-weight: 650;
}

.feature-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.feature-row span {
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: #243b5f;
  font-weight: 800;
}

.notice-box {
  border: 1px solid var(--amber-line);
  border-radius: 14px;
  padding: 13px 14px;
  background: var(--amber-bg);
  color: #7a4a11;
  font-weight: 650;
}

.visual-card {
  position: relative;
  flex: 1;
  min-height: 210px;
  margin-top: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f8fbff;
  overflow: hidden;
}

.browser-mock {
  position: absolute;
  inset: 46px 52px 48px 52px;
  border-radius: 34px;
  background: #eaf2ff;
}

.mock-dots {
  display: flex;
  gap: 12px;
  width: 160px;
  margin: 24px 0 0 34px;
  padding: 14px 28px;
  border-radius: 999px;
  background: #d5e4fb;
}

.mock-dots i {
  width: 16px;
  height: 16px;
  border-radius: 50%;
}

.mock-dots i:nth-child(1) {
  background: var(--primary);
}

.mock-dots i:nth-child(2) {
  background: var(--green);
}

.mock-dots i:nth-child(3) {
  background: #f6b23b;
}

.mock-line,
.mock-button {
  height: 12px;
  border-radius: 999px;
  background: #c7d4e5;
}

.mock-inner {
  position: absolute;
  left: 34px;
  right: 44px;
  bottom: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  min-height: 70px;
  padding: 20px 28px;
  border: 1px solid #cfe0f6;
  border-radius: 28px;
  background: #fff;
}

.mock-line.long {
  width: 72%;
  max-width: 100%;
  margin-bottom: 14px;
}

.mock-line.short {
  width: 52%;
}

.mock-button {
  flex: 0 1 160px;
  max-width: 34%;
  min-width: 96px;
  height: 48px;
  background: var(--primary);
}

.mock-shadow-line {
  position: absolute;
  right: 140px;
  bottom: 38px;
  width: 140px;
  height: 24px;
  border-radius: 999px;
  background: #d2e2fa;
}

.floating-card {
  position: absolute;
  display: grid;
  gap: 5px;
  min-width: 150px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 14px 32px rgba(39, 73, 125, 0.1);
}

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

.floating-card strong {
  font-size: 22px;
}

.mode-card {
  top: 18px;
  right: 18px;
}

.region-card {
  left: 18px;
  bottom: 22px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.main-heading {
  align-items: flex-start;
  margin-bottom: 16px;
}

.main-heading p {
  margin-top: 8px;
  font-weight: 650;
}

.state-pill,
.result-pill {
  flex: 0 0 auto;
  min-width: 74px;
  padding: 8px 11px;
  border-radius: 999px;
  background: #eaf1fb;
  color: #45607f;
  text-align: center;
  font-size: 13px;
  font-weight: 850;
}

.state-pill.is-active,
.result-pill.is-active {
  background: #e8f1ff;
  color: var(--primary);
}

.state-pill.is-success,
.result-pill.is-success {
  background: rgba(20, 184, 154, 0.14);
  color: #0e7664;
}

.state-pill.is-error,
.result-pill.is-error {
  background: var(--red-bg);
  color: var(--red);
}

.cdk-form {
  display: grid;
  gap: 10px;
}

label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 850;
}

label small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  min-width: 0;
  text-align: right;
  overflow-wrap: anywhere;
}

input {
  width: 100%;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 18px;
  background: #fff;
  color: var(--ink);
  font-size: 15px;
}

input:focus {
  border-color: var(--primary);
  outline: 3px solid rgba(31, 111, 255, 0.14);
}

.input-help {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  font-weight: 650;
}

.input-help span {
  flex: 0 0 auto;
  margin-top: 7px;
}

.button-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.95fr) minmax(0, 0.95fr);
  gap: 8px;
  margin-top: 4px;
}

.primary-button,
.dark-button,
.secondary-button {
  font-weight: 900;
}

.primary-button {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.dark-button {
  border-color: var(--primary-dark);
  background: var(--primary-dark);
  color: #fff;
}

.secondary-button {
  border-color: #d8e4f4;
  background: #e9f1ff;
  color: #243b5f;
}

.timer-card,
.result-card {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.timer-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 50px;
  padding: 0 16px;
}

.timer-card span,
.output-box span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

#elapsedText {
  color: var(--ink);
  font-size: 24px;
  font-variant-numeric: tabular-nums;
  font-weight: 950;
}

.result-card {
  padding: 16px;
  border-color: #93d4c5;
  background: linear-gradient(180deg, #ffffff 0%, #fbfffd 100%);
  box-shadow:
    0 0 0 1px rgba(8, 116, 95, 0.1),
    0 14px 30px rgba(8, 116, 95, 0.06);
}

.result-message {
  margin: 8px 0 12px;
  color: var(--ink);
  font-weight: 650;
}

.output-grid {
  display: grid;
  grid-template-columns: minmax(64px, 0.25fr) minmax(217px, 1.45fr) minmax(145px, 1fr);
  gap: 8px;
}

.output-box {
  display: grid;
  gap: 8px;
  min-width: 0;
  min-height: 68px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px;
  background: #fbfdff;
}

.output-box.wide {
  grid-column: auto;
}

.output-box strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 19px;
}

.copy-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.phone-value,
.phone-value .country-code,
.phone-value #phoneNumberText,
.code-value {
  color: var(--green-dark);
}

.phone-value {
  display: flex;
  align-items: baseline;
  gap: 4px;
  min-width: 0;
  line-height: 1.1;
}

.phone-value,
.code-value {
  overflow-wrap: normal;
}

.output-box .phone-value,
.output-box .code-value {
  font-size: 19px;
  font-weight: 950;
}

.country-code {
  flex: 0 0 auto;
}

.output-box .phone-value .country-code,
.output-box .phone-value #phoneNumberText {
  font-size: inherit;
  font-weight: inherit;
}

.icon-button {
  width: 38px;
  min-width: 38px;
  min-height: 38px;
  border-radius: 12px;
  padding: 0;
  color: var(--primary-dark);
  font-weight: 950;
}

.code-value {
  line-height: 1;
}

@media (max-width: 980px) {
  .app-shell {
    padding: 16px;
  }

  .workspace {
    grid-template-columns: 1fr;
    width: min(720px, calc(100vw - 32px));
  }

  .portal-panel {
    order: -1;
  }

  .intro-panel,
  .portal-panel {
    min-height: auto;
  }

  h1 {
    font-size: 40px;
  }

  .output-grid {
    grid-template-columns: minmax(120px, 0.7fr) minmax(0, 1fr);
  }

  .output-box.wide {
    grid-column: span 2;
  }
}

@media (max-width: 520px) {
  .app-shell {
    padding: 10px;
  }

  .intro-panel,
  .portal-panel {
    padding: 16px;
  }

  h1 {
    font-size: 30px;
  }

  h2 {
    font-size: 20px;
  }

  .main-heading {
    margin-bottom: 16px;
  }

  .main-heading p,
  .lead,
  .notice-box {
    font-size: 14px;
    line-height: 1.55;
  }

  input,
  button {
    min-height: 44px;
  }

  input {
    height: 46px;
    font-size: 15px;
  }

  .main-heading,
  label,
  .timer-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .button-row,
  .output-grid {
    grid-template-columns: 1fr;
  }

  .output-box.wide {
    grid-column: auto;
  }

  .region-output {
    display: none;
  }

  .timer-card {
    min-height: 52px;
  }

  .result-card {
    padding: 14px;
  }

  .result-message {
    margin-bottom: 12px;
  }

  .output-box {
    min-height: 68px;
  }

  .visual-card {
    display: none;
  }
}
