:root {
  color-scheme: light;
  --bg: #eef5f2;
  --bg-soft: #f8fbf9;
  --surface: rgba(255, 255, 255, .88);
  --surface-solid: #ffffff;
  --text: #122421;
  --muted: #667a74;
  --quiet: #8c9b96;
  --line: #d9e6e1;
  --line-strong: #c7d8d2;
  --brand: #0e766d;
  --brand-dark: #084c46;
  --brand-soft: #e2f2ee;
  --accent: #bd5b37;
  --accent-soft: #fff1eb;
  --focus: #1967d2;
  --shadow: 0 24px 70px rgba(22, 60, 52, .11);
  --shadow-soft: 0 14px 44px rgba(22, 60, 52, .08);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  font-family: "Avenir Next", "Trebuchet MS", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 12% -10%, rgba(14, 118, 109, .18), transparent 34rem),
    radial-gradient(circle at 96% 8%, rgba(189, 91, 55, .12), transparent 26rem),
    linear-gradient(180deg, #f8fbf9 0%, var(--bg) 48%, #f7faf8 100%);
  color: var(--text);
  line-height: 1.5;
  min-width: 320px;
}

body::before {
  background-image:
    linear-gradient(rgba(14, 118, 109, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(14, 118, 109, .045) 1px, transparent 1px);
  background-size: 42px 42px;
  content: "";
  inset: 0;
  mask-image: linear-gradient(to bottom, #000 0%, transparent 78%);
  pointer-events: none;
  position: fixed;
  z-index: -1;
}

button,
input,
textarea {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  align-items: center;
  backdrop-filter: blur(22px);
  background: rgba(248, 251, 249, .82);
  border-bottom: 1px solid rgba(199, 216, 210, .78);
  display: grid;
  gap: 18px;
  grid-template-columns: auto 1fr auto;
  min-height: 76px;
  padding: 14px clamp(18px, 4vw, 54px);
  position: sticky;
  top: 0;
  z-index: 30;
}

.brand {
  align-items: center;
  color: var(--brand-dark);
  display: inline-flex;
  font-size: 1.18rem;
  font-weight: 800;
  gap: 12px;
  letter-spacing: -.02em;
  white-space: nowrap;
}

.brand-mark {
  align-items: center;
  background: linear-gradient(145deg, var(--brand), #65aaa0);
  border-radius: 13px;
  box-shadow: 0 12px 30px rgba(14, 118, 109, .24);
  color: white;
  display: inline-flex;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.brand-mark svg {
  height: 23px;
  width: 23px;
}

.brand-mark path,
.status-mark path {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3.3;
}

.main-nav {
  align-items: center;
  display: flex;
  gap: 6px;
  justify-content: center;
}

.main-nav a,
.text-button,
.secondary-button,
.submit-button {
  border-radius: 999px;
}

.main-nav a {
  color: var(--muted);
  font-size: .95rem;
  font-weight: 760;
  padding: 10px 14px;
  transition: background .2s ease, color .2s ease, transform .2s ease;
}

.main-nav a:hover,
.main-nav a:focus-visible {
  background: rgba(226, 242, 238, .86);
  color: var(--brand-dark);
  transform: translateY(-1px);
}



main {
  margin: 0 auto;
  max-width: 1180px;
  padding: clamp(24px, 4vw, 52px) clamp(18px, 4vw, 54px) 72px;
}

.privacy-main {
  max-width: 800px;
  padding: 32px 20px 60px;
}

.legal-main {
  display: grid;
  gap: 14px;
}

.legal-main h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.05;
  margin-bottom: 4px;
}

.legal-main h2 {
  border-top: 1px solid var(--line);
  font-size: 1.35rem;
  margin: 16px 0 0;
  padding-top: 22px;
}

.legal-main a {
  color: var(--brand);
  font-weight: 750;
  overflow-wrap: anywhere;
}

.legal-warning,
.legal-ready {
  border-radius: var(--radius-md);
  margin: 10px 0 6px;
  padding: 18px 20px;
}

.legal-warning {
  background: var(--accent-soft);
  border: 1px solid rgba(189, 91, 55, .26);
}

.legal-ready {
  background: var(--brand-soft);
  border: 1px solid rgba(14, 118, 109, .2);
}

.legal-warning h2,
.legal-ready h2 {
  border-top: 0;
  font-family: inherit;
  font-size: 1rem;
  letter-spacing: 0;
  margin: 0 0 8px;
  padding-top: 0;
}

.legal-warning p,
.legal-ready p {
  margin-bottom: 8px;
}

.legal-warning ul {
  margin-bottom: 0;
}

.legal-definition-list {
  display: grid;
  gap: 8px 18px;
  grid-template-columns: minmax(160px, .36fr) minmax(0, 1fr);
  margin: 0;
}

.legal-definition-list dt {
  color: var(--muted);
  font-weight: 850;
}

.legal-definition-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.privacy-table-wrap {
  overflow-x: auto;
}

.privacy-process-table {
  border-collapse: collapse;
  font-size: .92rem;
  min-width: 860px;
  width: 100%;
}

.privacy-process-table th,
.privacy-process-table td {
  border: 1px solid var(--line);
  padding: 12px;
  text-align: left;
  vertical-align: top;
}

.privacy-process-table th {
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-weight: 850;
}

.privacy-process-table td:first-child {
  color: var(--text);
  font-weight: 850;
}

.legal-lines {
  display: grid;
  gap: 5px;
}

.site-footer {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: .9rem;
  gap: 10px 18px;
  justify-content: center;
  margin: 0 auto;
  max-width: 1180px;
  padding: 0 clamp(18px, 4vw, 54px) 34px;
}

.site-footer a {
  color: var(--brand-dark);
  font-weight: 800;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: -.045em;
}

.notice,
.request-panel,
.status-panel {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, .78);
  box-shadow: var(--shadow-soft);
}

.notice {
  align-items: flex-start;
  border-radius: var(--radius-lg);
  display: flex;
  gap: 14px;
  margin: 20px 0;
  padding: 18px 20px;
}

.notice-icon {
  align-items: center;
  background: var(--accent-soft);
  border: 1px solid rgba(189, 91, 55, .2);
  border-radius: 50%;
  color: var(--accent);
  display: inline-flex;
  flex: 0 0 auto;
  font-weight: 900;
  height: 32px;
  justify-content: center;
  width: 32px;
}

.notice strong {
  color: #7e3a22;
  display: block;
  font-weight: 850;
  margin-bottom: 4px;
}

.notice p {
  color: var(--muted);
  margin-bottom: 0;
}

.layout {
  align-items: start;
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1fr) 350px;
}

.request-panel,
.status-panel {
  backdrop-filter: blur(18px);
  border-radius: var(--radius-xl);
  padding: clamp(22px, 3.4vw, 38px);
}

.request-panel {
  display: grid;
  gap: 0;
}

.status-panel {
  position: sticky;
  top: 96px;
}

.status-mark {
  align-items: center;
  background: var(--brand-soft);
  border-radius: 18px;
  color: var(--brand-dark);
  display: inline-flex;
  height: 54px;
  justify-content: center;
  margin-bottom: 18px;
  width: 54px;
}

.status-mark svg {
  height: 30px;
  width: 30px;
}

.section-heading {
  margin-bottom: 24px;
}

.section-heading h2 {
  font-size: clamp(1.75rem, 3vw, 2.35rem);
  line-height: 1.04;
  margin-bottom: 7px;
}

.section-heading p,
.medication-title p {
  color: var(--muted);
  margin-bottom: 0;
}

.field-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field,
.field label {
  display: grid;
  gap: 8px;
}

.field span,
.field label span,
.notification legend {
  color: #2c443f;
  font-size: .92rem;
  font-weight: 820;
}

input,
textarea {
  appearance: none;
  background: rgba(255, 255, 255, .92);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  color: var(--text);
  min-height: 54px;
  outline: none;
  padding: 14px 16px;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
  width: 100%;
}

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

input::placeholder,
textarea::placeholder {
  color: #98a7a2;
}

.field-hint {
  color: var(--muted);
  display: block;
  font-size: .82rem;
  line-height: 1.35;
}

input:focus,
textarea:focus {
  background: white;
  border-color: var(--focus);
  box-shadow: 0 0 0 4px rgba(25, 103, 210, .12);
}

.medication-block {
  margin: 26px 0 24px;
}

.medication-title {
  align-items: end;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 14px;
}

.medication-title h3 {
  font-family: "Avenir Next", "Trebuchet MS", sans-serif;
  font-size: 1.08rem;
  letter-spacing: -.01em;
  margin-bottom: 2px;
}

.text-button {
  background: var(--brand-soft);
  border: 1px solid #b7dcd5;
  color: var(--brand-dark);
  cursor: pointer;
  flex: 0 0 auto;
  font-size: .94rem;
  font-weight: 850;
  min-height: 44px;
  padding: 10px 15px;
  transition: background .2s ease, transform .2s ease;
}

.text-button:hover,
.text-button:focus-visible {
  background: #d4ece7;
  transform: translateY(-1px);
}

.medication-list {
  display: grid;
  gap: 12px;
}

.medication-row {
  align-items: start;
  background: linear-gradient(180deg, rgba(255, 255, 255, .88), rgba(248, 252, 250, .9));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(180px, 1fr) minmax(140px, .6fr) 42px;
  padding: 16px;
  position: relative;
}

.remove-medication {
  align-items: center;
  background: #fff7f4;
  border: 1px solid rgba(189, 91, 55, .22);
  border-radius: 50%;
  color: #8c3f25;
  cursor: pointer;
  display: inline-flex;
  font-size: 1.3rem;
  height: 42px;
  justify-content: center;
  line-height: 1;
  order: 3;
  width: 42px;
}

.medication-search-field {
  position: relative;
  order: 1;
}

.dosage-field {
  order: 2;
}

.dosage-field input {
  min-width: 0;
}

.suggestions {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: 0 20px 50px rgba(15, 31, 36, .16);
  display: none;
  left: 0;
  max-height: 300px;
  overflow: auto;
  padding: 6px;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 20;
}

.suggestions.visible {
  display: block;
}

.suggestion {
  background: white;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  display: grid;
  gap: 2px;
  padding: 12px;
  text-align: left;
  width: 100%;
}

.suggestion strong {
  color: var(--text);
}

.suggestion span {
  color: var(--muted);
  font-size: .88rem;
  font-weight: 560;
}

.suggestion:hover,
.suggestion:focus {
  background: var(--brand-soft);
}

.manual-toggle,
.consent,
.notification label {
  align-items: center;
  color: var(--muted);
  display: flex;
  gap: 10px;
}

.manual-toggle {
  grid-column: 1 / -1;
  min-height: auto;
  white-space: nowrap;
  order: 4;
}

.manual-toggle input,
.consent input,
.notification input {
  accent-color: var(--brand);
  appearance: auto;
  flex: 0 0 auto;
  height: 20px;
  min-height: 20px;
  padding: 0;
  width: 20px;
}

.notification {
  background: rgba(248, 252, 250, .75);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  display: flex;
  gap: 22px;
  margin: 24px 0;
  padding: 18px;
}

.notification legend {
  padding: 0 8px;
}

.hidden {
  display: none;
}

.consent {
  align-items: flex-start;
  margin: 24px 0 8px;
}

.privacy-link {
  color: var(--muted);
  font-size: .85em;
  margin: 0 0 24px;
}

.privacy-link a {
  color: var(--brand);
}

.submit-bar {
  margin-top: 2px;
}

.submit-button,
.secondary-button {
  border: 0;
  cursor: pointer;
  font-weight: 900;
  letter-spacing: -.01em;
  min-height: 54px;
  padding: 14px 18px;
  transition: background .2s ease, box-shadow .2s ease, transform .2s ease, opacity .2s ease;
}

.submit-button {
  background: linear-gradient(135deg, var(--brand), #0a625b);
  box-shadow: 0 18px 34px rgba(14, 118, 109, .24);
  color: white;
  width: 100%;
}

.submit-button:hover,
.submit-button:focus-visible {
  background: linear-gradient(135deg, #0b6961, var(--brand-dark));
  transform: translateY(-1px);
}

.submit-button:disabled,
.secondary-button:disabled {
  cursor: wait;
  opacity: .7;
  transform: none;
}

.secondary-button {
  background: #172d29;
  box-shadow: 0 14px 30px rgba(18, 36, 33, .16);
  color: white;
  margin-top: 14px;
  width: 100%;
}

.secondary-button:hover,
.secondary-button:focus-visible {
  background: #0f211e;
  transform: translateY(-1px);
}

.status-result {
  background: rgba(248, 252, 250, .82);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  color: var(--muted);
  margin-top: 16px;
  min-height: 108px;
  padding: 16px;
}

.status-result strong {
  color: var(--text);
  display: block;
  margin-bottom: 5px;
}

dialog {
  background: transparent;
  border: 0;
  max-width: min(460px, calc(100vw - 28px));
  padding: 0;
}

dialog::backdrop {
  background: rgba(12, 28, 34, .48);
  backdrop-filter: blur(6px);
}

.dialog-content {
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: 0 28px 90px rgba(11, 23, 28, .28);
  padding: 28px;
}

.dialog-content h2 {
  font-size: 2rem;
  margin-bottom: 8px;
}

.dialog-content p {
  color: var(--muted);
}

@media (prefers-reduced-motion: no-preference) {
  .notice,
  .request-panel,
  .status-panel {
    animation: rise-in .55s ease both;
  }

  .notice {
    animation-delay: .05s;
  }

  .request-panel,
  .status-panel {
    animation-delay: .1s;
  }

  @keyframes rise-in {
    from {
      opacity: 0;
      transform: translateY(14px);
    }

    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

@media (max-width: 1024px) {
  .site-header {
    grid-template-columns: 1fr;
  }

  .main-nav {
    justify-content: flex-start;
  }

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

  .status-panel {
    position: static;
  }
}

@media (max-width: 720px) {
  .site-header {
    gap: 12px;
    min-height: 0;
    padding: 12px 16px;
  }

  .main-nav {
    background: rgba(255, 255, 255, .72);
    border: 1px solid rgba(199, 216, 210, .72);
    border-radius: 999px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 4px;
  }

  .main-nav a {
    text-align: center;
  }

  main {
    padding: 18px 14px 92px;
  }

  .request-panel,
  .status-panel {
    border-radius: 22px;
  }

  .field-grid,
  .medication-row {
    grid-template-columns: 1fr;
  }

  .remove-medication {
    justify-self: end;
    order: 5;
  }

  .manual-toggle {
    grid-column: auto;
  }

  .medication-title {
    align-items: stretch;
    flex-direction: column;
  }

  .text-button {
    width: 100%;
  }

  .notification {
    flex-direction: column;
    gap: 12px;
  }

  .legal-definition-list {
    grid-template-columns: 1fr;
  }

  .legal-definition-list dt {
    margin-top: 6px;
  }

  .submit-button {
    box-shadow: 0 18px 42px rgba(14, 118, 109, .32);
  }
}

@media (max-width: 420px) {
  .brand-text {
    font-size: 1.05rem;
  }

  h1 {
    font-size: 2.35rem;
  }

  .request-panel,
  .status-panel {
    padding: 20px 16px;
  }

  input,
  textarea {
    font-size: 16px;
  }
}
