.demo-phone[hidden], .demo-phone [hidden] { display: none !important; }

.demo-phone {
  --demo-ink: #12243a;
  --demo-muted: #465a73;
  --demo-accent: #153b66;
  --demo-line: #c5d2e0;
  --demo-screen: #f7f9fc;
  width: min(100%, 365px);
  min-width: 0;
  padding: 5px;
  border: 1px solid #b1c6d966;
  border-radius: 25px;
  color: var(--demo-ink);
  background: #0b1a29;
  box-shadow: 0 16px 45px #060d1b80;
  font-family: system-ui, sans-serif;
  container-type: inline-size;
}

.demo-screen {
  min-width: 0;
  padding: 12px 12px 0;
  border-radius: 19px;
  background: var(--demo-screen);
}

.demo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 8px;
  padding: 0 2px 9px;
}
.demo-header strong {
  font: 600 1.27rem/1.2 var(--title);
  letter-spacing: -.045em;
}

.demo-phone button,
.demo-phone input,
.demo-phone select {
  color: inherit;
  font: inherit;
}

.demo-phone :is(button, input, select):focus-visible,
.demo-segments input:focus-visible + span {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.demo-phone button { cursor: pointer; }

.demo-phone :is(.demo-reset, .demo-add, .demo-remove) {
  min-height: 44px;
  border: 1px solid var(--demo-line);
  border-radius: 10px;
  padding: 5px 10px;
  background: #fff;
  font-size: .8rem;
  font-weight: 700;
}

.demo-tab {
  border-radius: 10px;
  padding: 8px;
  background: var(--demo-accent);
  color: white;
  text-align: center;
  font-size: .8rem;
  font-weight: 650;
}

.demo-form {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 500px;
}

.demo-options {
  display: grid;
  gap: 15px;
  padding: 12px 2px 16px;
}

.demo-fieldset {
  min-inline-size: 0;
  margin: 0;
  border: 0;
  padding: 0;
}

.demo-fieldset legend {
  padding: 0;
  margin-bottom: 7px;
  font: 600 .99rem/1.15 var(--title);
  letter-spacing: -.015em;
}

.demo-segments {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--demo-line);
  border-radius: 12px;
  background: #fff;
}

.demo-segments label { position: relative; cursor: pointer; }

.demo-segments input,
.demo-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.demo-segments span {
  display: grid;
  align-items: center;
  min-height: 42px;
  padding: 4px;
  border-radius: 8px;
  text-align: center;
  font-size: .8rem;
  font-weight: 700;
}

.demo-segments input:checked + span { background: var(--demo-accent); color: white; }

.demo-card {
  border: 1px solid var(--demo-line);
  border-radius: 12px;
  background: #fff;
}

.demo-row, .demo-one-time {
  display: grid;
  align-items: center;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.45fr);
  gap: 5px 8px;
  padding: 4px 8px;
  font-size: .78rem;
  line-height: 1.35;
}

.demo-row + .demo-row, .demo-one-time + .demo-one-time { border-top: 1px solid #e1e8f0; }

.demo-row-stacked, .demo-one-time {
  grid-template-columns: minmax(0, 1fr);
  padding-block: 7px;
}

.demo-row :is(select, input), .demo-one-time input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 4px 6px;
  border: 1px solid #d9e3ee;
  border-radius: 7px;
  background: #f7f9fc;
  color: var(--demo-accent);
  font-size: 1rem;
}

.demo-row input[type="number"] { text-align: right; }

.demo-time-heading { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.demo-phone .demo-remove { color: #922d26; }
.demo-add { margin-top: 7px; }
.demo-add:disabled { opacity: .55; cursor: default; }

.demo-actions {
  margin-top: auto;
  padding: 9px 0 12px;
  border-top: 1px solid #dbe5ee;
  background: var(--demo-screen);
}

.demo-actions button {
  width: 100%;
  min-height: 45px;
  border: 1px solid var(--demo-accent);
  border-radius: 10px;
  padding: 6px 10px;
  font-size: .87rem;
  font-weight: 700;
}

.demo-actions .demo-submit { background: var(--demo-accent); color: white; }
.demo-submit:hover { background: #22496c; }

.demo-actions .demo-stop { background: #fff; color: #8d2b25; border-color: var(--demo-line); }

.demo-message { color: var(--demo-muted); font-size: .78rem; line-height: 1.4; }
.demo-message:not(:empty) { margin-bottom: 7px; }
.demo-message[data-error] { color: #8d2b25; }

.demo-status {
  margin: 14px 0;
  border: 1px solid var(--demo-line);
  border-radius: 14px;
  padding: 14px;
  background: white;
}
.demo-status h3 { font-size: 1.05rem; color: var(--demo-accent); }
.demo-next-time { margin-top: 6px; font-size: 1.25rem; font-weight: 700; }
.demo-summary { margin: 12px 0 0; font-size: .79rem; line-height: 1.4; }
.demo-summary div { display: grid; grid-template-columns: minmax(0, .7fr) minmax(0, 1.4fr); gap: 4px 8px; padding: 6px 0; border-top: 1px solid #e1e8f0; }
.demo-summary dt { color: var(--demo-muted); }
.demo-summary dd { margin: 0; overflow-wrap: anywhere; }

@media (min-width: 761px) {
  .demo-form { height: 652px; }
  .demo-options { flex: 1; min-height: 0; overflow: auto; }
  .demo-status { min-height: 0; overflow: auto; }
  .demo-actions { flex: none; }
}

@media (max-width: 370px) {
  .product-background:has(.demo-phone:not([hidden])) { padding-inline: 8px; }
  .demo-screen { padding-inline: 8px; }
}

@container (max-width: 300px) {
  .demo-row { grid-template-columns: minmax(0, 1fr); }
}
