:root {
  --ink: #312642;
  --muted: #7d7088;
  --fuchsia: #c01878;
  --purple: #6b3cc6;
  --line: rgba(112, 86, 135, 0.16);
  --glass: rgba(255, 255, 255, 0.72);
  --shadow: 0 22px 58px rgba(87, 38, 104, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 15% 0%, rgba(253, 234, 246, 0.92), transparent 36%),
    radial-gradient(circle at 92% 12%, rgba(246, 231, 255, 0.78), transparent 34%),
    linear-gradient(145deg, #fffafe, #f7f2fb 52%, #ffffff);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

.phone-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.phone-app {
  width: min(440px, 100%);
  max-height: min(920px, calc(100vh - 24px));
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 34px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.56)),
    linear-gradient(315deg, rgba(253, 234, 246, 0.38), rgba(246, 231, 255, 0.26));
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(30px) saturate(1.4);
  padding: 16px;
}

.phone-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 4px 10px;
}

.back-link,
.mini-button,
.ghost-button,
.primary-button {
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88), 0 10px 22px rgba(87, 38, 104, 0.1);
  color: var(--purple);
  cursor: pointer;
  font-weight: 900;
  text-decoration: none;
}

.back-link {
  padding: 10px 14px;
}

.phone-logo {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88), 0 12px 24px rgba(87, 38, 104, 0.12);
}

.phone-logo img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.phone-hero,
.phone-card,
.recorder-card {
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 22px;
  background: var(--glass);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 14px 32px rgba(87, 38, 104, 0.09);
  margin-top: 12px;
  padding: 16px;
}

.phone-hero h1 {
  margin: 4px 0 8px;
  font-size: 1.65rem;
  line-height: 1.05;
}

.phone-hero p {
  margin: 0;
  color: var(--muted);
  font-weight: 750;
  line-height: 1.35;
}

.eyebrow {
  margin: 0;
  color: var(--fuchsia);
  font-size: 0.74rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

label {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}

label:first-child {
  margin-top: 0;
}

label span,
.section-heading strong,
.te-pill span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(112, 86, 135, 0.18);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--ink);
  outline: none;
  padding: 13px 14px;
}

textarea {
  min-height: 150px;
  resize: vertical;
  line-height: 1.45;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(192, 24, 120, 0.38);
  box-shadow: 0 0 0 4px rgba(192, 24, 120, 0.08);
}

.patient-pick-list {
  display: grid;
  gap: 8px;
  max-height: 190px;
  overflow: auto;
  margin-top: 12px;
}

.patient-choice {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(112, 86, 135, 0.13);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--ink);
  cursor: pointer;
  padding: 12px;
  text-align: left;
}

.patient-choice.active {
  border-color: rgba(192, 24, 120, 0.42);
  background: rgba(253, 234, 246, 0.76);
}

.patient-choice strong {
  font-size: 1rem;
}

.patient-choice span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 760;
}

.mobile-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 0.8fr;
  gap: 10px;
}

.te-pill {
  display: grid;
  min-height: 76px;
  align-self: end;
  place-items: center;
  border: 1px solid rgba(192, 24, 120, 0.22);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.86), rgba(253, 234, 246, 0.74));
  color: var(--fuchsia);
  padding: 10px;
}

.te-pill strong {
  font-size: 1.65rem;
}

.recorder-card {
  display: flex;
  align-items: center;
  gap: 14px;
}

.record-button {
  display: grid;
  flex: 0 0 auto;
  width: 76px;
  height: 76px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(145deg, #ff4aa3, #7c4dff);
  box-shadow: 0 16px 32px rgba(192, 24, 120, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  cursor: pointer;
}

.record-button span {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
}

.record-button.recording span {
  border-radius: 7px;
}

.recorder-card strong {
  display: block;
  font-size: 1.05rem;
}

.recorder-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 760;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.mini-button {
  padding: 8px 11px;
  white-space: nowrap;
}

.summary-preview {
  min-height: 150px;
  border: 1px solid rgba(112, 86, 135, 0.13);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--ink);
  font-weight: 760;
  line-height: 1.45;
  padding: 14px;
  white-space: pre-wrap;
}

.summary-preview mark {
  border-radius: 7px;
  background: rgba(253, 234, 246, 0.92);
  color: var(--fuchsia);
  font-weight: 950;
  padding: 0 4px;
}

.phone-actions {
  position: sticky;
  bottom: 0;
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 10px;
  padding-top: 14px;
}

.ghost-button,
.primary-button {
  min-height: 48px;
  padding: 0 14px;
}

.primary-button {
  border-color: rgba(192, 24, 120, 0.2);
  background: linear-gradient(145deg, #d6298d, #7d55de);
  color: white;
}

@media (max-width: 520px) {
  .phone-shell {
    display: block;
    padding: 0;
  }

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

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

  .mobile-grid label:first-child,
  .te-pill {
    grid-column: 1 / -1;
  }
}
