:root {
  --aals-red: #cc0a0a;
  --aals-red-dark: #a50707;
  --aals-ink: #171717;
  --aals-muted: #6b6b6b;
  --aals-line: #e7e3df;
  --aals-soft: #f7f5f2;
  --aals-warm: #fbfaf8;
  --aals-success: #1f6d45;
}

html.aals-lock,
body.aals-lock {
  overflow: hidden !important;
}

.aals-open-button {
  min-width: 200px !important;
  min-height: 52px !important;
  padding: 0 24px !important;
  margin: 0 0 18px 0 !important;
  border: 0 !important;
  border-radius: 6px !important;
  background: #2e2e2e !important;
  color: #fff !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: .02em !important;
  box-shadow: none !important;
}

.aals-open-button:hover,
.aals-open-button:focus {
  background: #161616 !important;
  color: #fff !important;
}

.aals-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: none;
  padding: 22px;
  background: rgba(18, 18, 18, .62);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}

.aals-overlay.is-open {
  display: grid;
  place-items: center;
}

.aals-modal,
.aals-modal * {
  box-sizing: border-box;
}

.aals-modal {
  position: relative;
  display: grid;
  grid-template-columns: minmax(300px, 36%) minmax(0, 64%);
  width: min(1380px, 96vw);
  height: min(860px, 94vh);
  overflow: hidden;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .24);
  color: var(--aals-ink);
}

.aals-close {
  position: absolute;
  z-index: 8;
  top: 18px;
  right: 18px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: var(--aals-ink);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 6px 22px rgba(0, 0, 0, .12);
}

.aals-close:hover,
.aals-close:focus {
  background: var(--aals-red);
  color: #fff;
}

.aals-product-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: linear-gradient(180deg, #f9f8f6 0%, #efede9 100%);
  border-right: 1px solid var(--aals-line);
}

.aals-product-image-wrap {
  display: grid;
  place-items: center;
  min-height: 0;
  flex: 1;
  padding: 42px;
}

.aals-product-image-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 520px;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.aals-product-copy {
  padding: 28px 34px 34px;
  border-top: 1px solid rgba(0,0,0,.06);
  background: rgba(255,255,255,.56);
}

.aals-product-copy h3 {
  margin: 5px 0 8px;
  font-size: clamp(21px, 2vw, 30px);
  line-height: 1.18;
}

.aals-product-copy p {
  margin: 0;
  color: var(--aals-muted);
  font-size: 14px;
}

.aals-config-panel {
  position: relative;
  min-width: 0;
  overflow-y: auto;
  padding: 38px 46px 118px;
  background: #fff;
}

.aals-topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  padding-right: 54px;
}

.aals-eyebrow,
.aals-step-kicker {
  display: inline-block;
  color: var(--aals-red);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.aals-topbar h2 {
  margin: 4px 0 0;
  font-size: clamp(30px, 3.2vw, 48px);
  font-weight: 500;
  line-height: 1.05;
}

.aals-progress-copy {
  color: var(--aals-muted);
  font-size: 13px;
  white-space: nowrap;
}

.aals-progress {
  height: 4px;
  margin: 24px 0 42px;
  overflow: hidden;
  border-radius: 999px;
  background: #efedeb;
}

.aals-progress-bar {
  display: block;
  width: 20%;
  height: 100%;
  border-radius: 999px;
  background: var(--aals-red);
  transition: width .25s ease;
}

.aals-step {
  display: none;
  animation: aalsFade .18s ease;
}

.aals-step.is-active {
  display: block;
}

@keyframes aalsFade {
  from { opacity: .3; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.aals-step-heading {
  max-width: 760px;
  margin-bottom: 26px;
}

.aals-step-heading h3 {
  margin: 6px 0 9px;
  font-size: clamp(26px, 2.4vw, 36px);
  font-weight: 550;
  line-height: 1.14;
}

.aals-step-heading p {
  margin: 0;
  color: var(--aals-muted);
  font-size: 15px;
  line-height: 1.6;
}

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

.aals-choice-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 164px;
  padding: 22px;
  border: 1px solid var(--aals-line);
  border-radius: 14px;
  background: #fff;
  color: var(--aals-ink);
  text-align: left;
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease, background .16s ease;
}

.aals-choice-card:hover,
.aals-choice-card:focus {
  border-color: #cfc7c0;
  box-shadow: 0 8px 25px rgba(0,0,0,.06);
  transform: translateY(-1px);
}

.aals-choice-card.is-selected {
  border: 2px solid var(--aals-red);
  padding: 21px;
  background: #fffafa;
}

.aals-choice-card.is-recommended:not(.is-selected) {
  border-color: #bdaea3;
}

.aals-choice-title {
  padding-right: 76px;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.25;
}

.aals-choice-card p {
  flex: 1;
  margin: 10px 0 18px;
  color: var(--aals-muted);
  font-size: 13.5px;
  line-height: 1.55;
}

.aals-choice-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 12px;
  border-top: 1px solid #f0eeec;
  color: #414141;
  font-size: 12px;
  font-weight: 700;
}

.aals-card-check {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border-radius: 999px;
  background: var(--aals-red);
  color: #fff;
  font-size: 13px;
}

.aals-choice-card:not(.is-selected) .aals-card-check {
  border: 1px solid #ddd8d3;
  background: transparent;
}

.aals-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 6px 8px;
  border-radius: 999px;
  background: #f1ece8;
  color: #5b4f48;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .02em;
}

.aals-method-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 22px;
  padding: 5px;
  border: 1px solid var(--aals-line);
  border-radius: 12px;
  background: var(--aals-soft);
}

.aals-method {
  flex: 1;
  min-height: 44px;
  padding: 8px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #4c4c4c;
  font-weight: 700;
  cursor: pointer;
}

.aals-method.is-active {
  background: #fff;
  color: var(--aals-ink);
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
}

.aals-prescription-panel {
  display: none;
}

.aals-prescription-panel.is-active {
  display: block;
}

.aals-rx-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--aals-line);
  border-radius: 14px;
}

.aals-rx-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
}

.aals-rx-table th,
.aals-rx-table td {
  padding: 13px 10px;
  border-bottom: 1px solid var(--aals-line);
  text-align: left;
  vertical-align: middle;
}

.aals-rx-table thead th {
  background: var(--aals-warm);
  color: #575757;
  font-size: 11px;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.aals-rx-table tbody tr:last-child th,
.aals-rx-table tbody tr:last-child td {
  border-bottom: 0;
}

.aals-rx-table tbody th {
  width: 84px;
  font-size: 14px;
}

.aals-rx-table tbody th small {
  display: block;
  margin-top: 2px;
  color: var(--aals-muted);
  font-weight: 400;
}

.aals-rx-table select,
.aals-pd-fields select {
  width: 100%;
  min-width: 96px;
  height: 42px;
  padding: 0 30px 0 10px;
  border: 1px solid #ddd8d3;
  border-radius: 8px;
  background: #fff;
  color: var(--aals-ink);
  font-size: 13px;
}

.aals-add-column.is-emphasized {
  background: #fff9f9;
}

.aals-pd-box {
  margin-top: 16px;
  padding: 18px;
  border: 1px solid var(--aals-line);
  border-radius: 14px;
}

.aals-field-head strong {
  display: block;
  font-size: 14px;
}

.aals-field-head span {
  display: block;
  margin-top: 3px;
  color: var(--aals-muted);
  font-size: 12.5px;
}

.aals-pd-toggle {
  display: flex;
  gap: 18px;
  margin: 15px 0;
  color: #454545;
  font-size: 13px;
}

.aals-pd-toggle label {
  display: flex;
  align-items: center;
  gap: 7px;
}

.aals-pd-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  max-width: 420px;
}

.aals-pd-fields[data-pd-panel="single"] {
  grid-template-columns: minmax(0, 200px);
}

.aals-pd-fields label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
}

.aals-inline-note,
.aals-recommendation {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 11px;
  background: #f6f4f1;
  color: #5e5955;
  font-size: 12.5px;
  line-height: 1.55;
}

.aals-inline-note strong,
.aals-recommendation strong {
  color: var(--aals-ink);
}

.aals-recommendation {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 0 0 16px;
  border-left: 3px solid var(--aals-red);
}

.aals-upload-box {
  display: grid;
  place-items: center;
  min-height: 240px;
  padding: 30px;
  border: 1.5px dashed #cfc8c2;
  border-radius: 16px;
  background: var(--aals-warm);
  text-align: center;
  cursor: pointer;
}

.aals-upload-box:hover {
  border-color: var(--aals-red);
  background: #fffafa;
}

.aals-upload-box strong {
  margin: 10px 0 5px;
  font-size: 18px;
}

.aals-upload-box span:last-of-type {
  color: var(--aals-muted);
  font-size: 12px;
}

.aals-upload-box input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.aals-upload-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  background: #fff;
  color: var(--aals-red);
  font-size: 25px;
  box-shadow: 0 5px 18px rgba(0,0,0,.08);
}

.aals-file-name {
  margin-top: 10px;
  color: #494949;
  font-size: 13px;
  text-align: center;
}

.aals-later-card {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  padding: 22px;
  border: 1px solid var(--aals-line);
  border-radius: 14px;
  background: var(--aals-warm);
}

.aals-later-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 999px;
  background: #e9f3ed;
  color: var(--aals-success);
  font-weight: 800;
}

.aals-later-card strong {
  display: block;
  margin-bottom: 5px;
}

.aals-later-card p {
  margin: 0;
  color: var(--aals-muted);
  font-size: 13px;
  line-height: 1.55;
}

.aals-review-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr);
  gap: 16px;
}

.aals-review-card,
.aals-price-card {
  padding: 20px;
  border: 1px solid var(--aals-line);
  border-radius: 14px;
  background: #fff;
}

.aals-price-card {
  background: var(--aals-warm);
}

.aals-review-row,
.aals-price-line,
.aals-price-total {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 18px;
  padding: 11px 0;
  border-bottom: 1px solid #efedeb;
  font-size: 13px;
}

.aals-review-row:last-child,
.aals-price-total:last-child {
  border-bottom: 0;
}

.aals-review-row span,
.aals-price-line span:first-child {
  color: var(--aals-muted);
}

.aals-review-row strong {
  font-weight: 700;
  line-height: 1.5;
}

.aals-price-line {
  grid-template-columns: 1fr auto;
}

.aals-price-total {
  grid-template-columns: 1fr auto;
  margin-top: 4px;
  padding-top: 16px;
  font-size: 18px;
}

.aals-price-total strong {
  font-size: 21px;
}

.aals-check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 18px;
  padding: 16px;
  border-radius: 12px;
  background: #f7f6f4;
  color: #555;
  font-size: 12.5px;
  line-height: 1.55;
}

.aals-check-row input {
  margin-top: 3px;
}

.aals-order-message {
  display: none;
  grid-column: 1 / -1;
  margin: 0;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.35;
}

.aals-order-message.is-error,
.aals-order-message.is-info,
.aals-order-message.is-success {
  display: block;
}

.aals-order-message.is-error {
  background: #fff0f0;
  color: #8a1010;
}

.aals-order-message.is-info {
  background: #f2f2f2;
  color: #454545;
}

.aals-order-message.is-success {
  background: #edf7f1;
  color: #1f6d45;
}

.aals-field-error {
  border-color: var(--aals-red) !important;
  box-shadow: 0 0 0 3px rgba(204,10,10,.10) !important;
}

.aals-upload-preview {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--aals-line);
  border-radius: 12px;
  background: var(--aals-warm);
}

.aals-upload-preview[hidden] {
  display: none !important;
}

.aals-upload-thumb {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  overflow: hidden;
  border-radius: 9px;
  background: #fff;
  border: 1px solid var(--aals-line);
  font-size: 12px;
  font-weight: 800;
}

.aals-upload-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.aals-upload-preview strong,
.aals-upload-preview span {
  display: block;
}

.aals-upload-preview strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.aals-upload-preview span {
  margin-top: 3px;
  color: var(--aals-muted);
  font-size: 12px;
}

.aals-file-remove {
  border: 0;
  background: transparent;
  color: var(--aals-red);
  font-weight: 700;
  cursor: pointer;
}

.aals-upload-note {
  margin: 10px 0 0;
  color: var(--aals-muted);
  font-size: 12px;
}

.aals-pd-unknown {
  max-width: 520px;
  color: var(--aals-muted);
  line-height: 1.5;
}

.aals-footer {
  position: absolute;
  z-index: 5;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px 16px;
  min-height: 86px;
  padding: 14px 46px;
  border-top: 1px solid var(--aals-line);
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.aals-secondary,
.aals-primary {
  min-height: 50px;
  padding: 0 22px;
  border-radius: 8px;
  font-weight: 800;
  cursor: pointer;
}

.aals-secondary {
  border: 1px solid #d8d3cf;
  background: #fff;
  color: #333;
}

.aals-secondary:disabled {
  opacity: .45;
  cursor: default;
}

.aals-primary {
  min-width: 164px;
  border: 1px solid var(--aals-red);
  background: var(--aals-red);
  color: #fff;
}

.aals-primary:hover:not(:disabled),
.aals-primary:focus:not(:disabled) {
  border-color: var(--aals-red-dark);
  background: var(--aals-red-dark);
}

.aals-primary:disabled {
  opacity: .65;
  cursor: wait;
}

.aals-running-total {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  color: var(--aals-muted);
  font-size: 12px;
}

.aals-running-total strong {
  color: var(--aals-ink);
  font-size: 16px;
}

@media (max-width: 980px) {
  .aals-overlay {
    padding: 0;
  }

  .aals-modal {
    grid-template-columns: 1fr;
    width: 100vw;
    height: 100dvh;
    max-height: none;
    border-radius: 0;
  }

  .aals-product-panel {
    display: none;
  }

  .aals-config-panel {
    padding: 28px 22px 112px;
  }

  .aals-topbar {
    padding-right: 52px;
  }

  .aals-footer {
    position: fixed;
    left: 0;
    padding: 12px 18px;
  }
}

@media (max-width: 680px) {
  .aals-config-panel {
    padding: 22px 16px 118px;
  }

  .aals-close {
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
  }

  .aals-topbar {
    padding-right: 44px;
  }

  .aals-topbar h2 {
    font-size: 31px;
  }

  .aals-progress {
    margin: 18px 0 28px;
  }

  .aals-step-heading h3 {
    font-size: 25px;
  }

  .aals-card-grid {
    grid-template-columns: 1fr;
  }

  .aals-choice-card {
    min-height: 142px;
  }

  .aals-method-tabs {
    display: grid;
    grid-template-columns: 1fr;
  }

  .aals-rx-table th,
  .aals-rx-table td {
    padding: 9px 6px;
  }

  .aals-rx-table select {
    min-width: 82px;
    font-size: 12px;
  }

  .aals-pd-fields,
  .aals-pd-fields[data-pd-panel="single"] {
    grid-template-columns: 1fr;
    max-width: none;
  }

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

  .aals-review-row {
    grid-template-columns: 100px minmax(0, 1fr);
  }

  .aals-footer {
    grid-template-columns: auto 1fr;
    gap: 8px 10px;
    min-height: 96px;
    padding: 10px 14px;
  }

  .aals-running-total {
    justify-content: flex-end;
  }

  .aals-upload-preview {
    grid-template-columns: 46px minmax(0, 1fr);
  }

  .aals-upload-thumb {
    width: 46px;
    height: 46px;
  }

  .aals-file-remove {
    grid-column: 1 / -1;
    justify-self: start;
    padding: 2px 0;
  }

  .aals-primary {
    grid-column: 1 / -1;
    width: 100%;
  }
}

/* === v0.1.3 layout polish ================================================
   Keep the action bar in the document flow and make only the step content
   scroll. This prevents the footer from covering prescription rows/cards. */
.aals-config-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  padding: 0;
}

.aals-config-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 38px 46px 34px;
}

.aals-footer {
  position: relative;
  z-index: 6;
  left: auto;
  right: auto;
  bottom: auto;
  flex: 0 0 auto;
  width: 100%;
  grid-template-columns: minmax(104px, auto) minmax(150px, 1fr) minmax(176px, auto);
  min-height: 82px;
  padding: 14px 46px;
  background: rgba(255,255,255,.98);
  box-shadow: 0 -8px 24px rgba(0,0,0,.035);
}

.aals-secondary,
.aals-primary {
  height: 50px;
  min-height: 50px;
  margin: 0 !important;
}

.aals-secondary {
  min-width: 104px;
}

.aals-primary {
  min-width: 176px;
}

.aals-running-total {
  min-width: 0;
  white-space: nowrap;
}

.aals-rx-helper {
  margin: 9px 3px 0;
  color: var(--aals-muted);
  font-size: 12px;
  line-height: 1.5;
}

/* Make long prescription content breathe above the fixed action area. */
.aals-prescription-panel,
.aals-step {
  min-width: 0;
}

.aals-rx-table-wrap {
  max-width: 100%;
}

.aals-rx-table select,
.aals-pd-fields select {
  max-width: 100%;
}

@media (max-width: 1180px) {
  .aals-config-scroll {
    padding: 32px 30px 30px;
  }
  .aals-footer {
    padding: 12px 30px;
  }
  .aals-choice-card {
    min-height: 150px;
  }
}

@media (max-width: 980px) {
  .aals-config-panel {
    padding: 0;
  }

  .aals-config-scroll {
    padding: 28px 22px 28px;
  }

  .aals-footer {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    grid-template-columns: minmax(96px, auto) minmax(130px, 1fr) minmax(160px, auto);
    min-height: 78px;
    padding: 11px 22px calc(11px + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 680px) {
  .aals-config-panel {
    padding: 0;
  }

  .aals-config-scroll {
    padding: 22px 16px 24px;
  }

  .aals-footer {
    grid-template-columns: minmax(82px, .72fr) minmax(92px, .9fr) minmax(124px, 1.18fr);
    gap: 8px;
    min-height: 72px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  }

  .aals-secondary,
  .aals-primary {
    width: 100%;
    min-width: 0;
    height: 48px;
    min-height: 48px;
    padding: 0 12px;
  }

  .aals-primary {
    grid-column: auto;
  }

  .aals-running-total {
    justify-content: center;
    flex-direction: column;
    align-items: center;
    gap: 0;
    line-height: 1.15;
    text-align: center;
  }

  .aals-running-total strong {
    margin-top: 3px;
  }

  /* Turn the prescription grid into two clean eye cards on phones. */
  .aals-rx-table-wrap {
    overflow: visible;
    border: 0;
    border-radius: 0;
  }

  .aals-rx-table,
  .aals-rx-table tbody {
    display: block;
    width: 100%;
  }

  .aals-rx-table thead {
    display: none;
  }

  .aals-rx-table tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 0 0 12px;
    padding: 15px;
    border: 1px solid var(--aals-line);
    border-radius: 14px;
    background: #fff;
  }

  .aals-rx-table tbody th {
    display: flex;
    grid-column: 1 / -1;
    align-items: baseline;
    gap: 7px;
    width: auto;
    padding: 0 0 3px;
    border: 0;
    font-size: 15px;
  }

  .aals-rx-table tbody th small {
    display: inline;
    margin: 0;
  }

  .aals-rx-table tbody td {
    display: block;
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .aals-rx-table tbody td::before {
    content: attr(data-label);
    display: block;
    margin: 0 0 6px 1px;
    color: #67615d;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
  }

  .aals-rx-table select {
    width: 100%;
    min-width: 0;
    height: 48px;
    font-size: 14px;
  }

  .aals-pd-box {
    margin-top: 14px;
    padding: 16px;
  }

  .aals-pd-toggle {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .aals-upload-box {
    min-height: 210px;
    padding: 24px 18px;
  }
}

@media (max-width: 390px) {
  .aals-footer {
    grid-template-columns: 78px minmax(62px, 1fr) minmax(112px, 1.25fr);
    gap: 6px;
    padding-left: 8px;
    padding-right: 8px;
  }

  .aals-running-total span {
    display: none;
  }

  .aals-secondary,
  .aals-primary {
    padding-left: 8px;
    padding-right: 8px;
    font-size: 13px;
  }
}

/* === v0.1.4 material recommendation polish =============================== */
.aals-choice-title {
  padding-right: 0;
}

.aals-choice-card.is-recommended:not(.is-selected) {
  border-color: #d8aaa7;
  background: #fffdfc;
  box-shadow: inset 0 0 0 1px rgba(204,10,10,.035);
}

.aals-choice-card.is-rimless-material:not(.is-selected):not(.is-recommended) {
  border-color: #d7d0c9;
  background: #fffdfa;
}

.aals-card-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: -5px 0 16px;
}

.aals-card-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  width: fit-content;
  padding: 6px 10px;
  border: 1px solid #e4ddd7;
  border-radius: 999px;
  background: #f7f4f1;
  color: #655d57;
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1.25;
}

.aals-card-tag.is-recommended-tag {
  border-color: #efc9c7;
  background: #fff1f0;
  color: #9b0b0b;
}

.aals-card-tag.is-frame-tag {
  background: #f4f1ed;
  color: #5c554f;
}

.aals-card-tag-icon {
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  border-radius: 999px;
  background: currentColor;
  color: #fff;
  font-size: 9px;
  line-height: 1;
}

.aals-card-tag.is-frame-tag .aals-card-tag-icon {
  background: #ded6cf;
  color: #625a53;
}

/* The main recommendation is now a dedicated callout rather than a badge
   competing with the material title. */
.aals-recommendation {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  margin: 0 0 18px;
  padding: 15px 16px;
  border: 1px solid #efddda;
  border-left: 1px solid #efddda;
  border-radius: 14px;
  background: #fff9f8;
}

.aals-recommendation-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--aals-red);
  color: #fff;
  font-size: 15px;
  font-weight: 900;
}

.aals-recommendation-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.aals-recommendation-label {
  color: var(--aals-red);
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.aals-recommendation-copy strong {
  color: var(--aals-ink);
  font-size: 14px;
  line-height: 1.35;
}

.aals-recommendation-copy > span:last-child {
  color: #655f5a;
  font-size: 11.5px;
  line-height: 1.48;
}

@media (max-width: 680px) {
  .aals-card-tag {
    border-radius: 10px;
    line-height: 1.35;
  }

  .aals-recommendation {
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 10px;
    padding: 13px 14px;
  }

  .aals-recommendation-mark {
    width: 30px;
    height: 30px;
  }
}

/* === v0.1.6 cleaner vision cards + adaptive/tint/polarized customizer === */
.aals-choice-footer.is-selection-only {
  justify-content: flex-end;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid #f0eeec;
}

.aals-finish-customization {
  margin-top: 18px;
  padding: 20px;
  border: 1px solid var(--aals-line);
  border-radius: 16px;
  background: #fbfaf8;
}

.aals-finish-customization[hidden] {
  display: none !important;
}

.aals-customization-heading {
  display: grid;
  gap: 4px;
  margin-bottom: 20px;
}

.aals-customization-kicker {
  color: var(--aals-red);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.aals-customization-heading strong {
  color: var(--aals-ink);
  font-size: 18px;
  line-height: 1.35;
}

.aals-customization-heading > span:last-child {
  max-width: 680px;
  color: var(--aals-muted);
  font-size: 12.5px;
  line-height: 1.55;
}

.aals-customization-group + .aals-customization-group {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid #ebe7e3;
}

.aals-customization-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 11px;
}

.aals-customization-label span {
  color: #625d58;
  font-size: 12px;
  font-weight: 700;
}

.aals-customization-label strong {
  color: var(--aals-ink);
  font-size: 12px;
}

.aals-swatch-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.aals-swatch-choice,
.aals-depth-choice {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 10px 12px;
  border: 1px solid #ded9d4;
  border-radius: 12px;
  background: #fff;
  color: var(--aals-ink);
  text-align: left;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.aals-swatch-choice:hover,
.aals-depth-choice:hover,
.aals-swatch-choice:focus,
.aals-depth-choice:focus {
  border-color: #c8bdb5;
  box-shadow: 0 5px 16px rgba(0,0,0,.045);
}

.aals-swatch-choice.is-selected,
.aals-depth-choice.is-selected {
  border: 2px solid var(--aals-red);
  padding: 9px 11px;
  background: #fffafa;
}

.aals-swatch {
  width: 27px;
  height: 27px;
  flex: 0 0 27px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--aals-swatch);
  box-shadow: 0 0 0 1px rgba(0,0,0,.15);
}

.aals-swatch-choice > span:nth-child(2) {
  min-width: 0;
  font-size: 12.5px;
  font-weight: 800;
}

.aals-swatch-check,
.aals-depth-check {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-left: auto;
  flex: 0 0 20px;
  border-radius: 999px;
  background: var(--aals-red);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
}

.aals-depth-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.aals-depth-choice {
  align-items: center;
  min-height: 72px;
}

.aals-depth-visual {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  overflow: hidden;
  border: 1px solid #d8d3ce;
  border-radius: 8px;
  background: linear-gradient(135deg, #fff 0 50%, #f0efed 50% 100%);
}

.aals-depth-visual i {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--aals-tint-color, #767676);
  opacity: var(--aals-tint-opacity, .25);
  transition: background-color .18s ease, opacity .18s ease;
}

.aals-depth-choice > span:nth-child(2) {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.aals-depth-choice strong {
  font-size: 12.5px;
  line-height: 1.25;
}

.aals-depth-choice small {
  color: var(--aals-muted);
  font-size: 10.5px;
  line-height: 1.35;
}

@media (max-width: 680px) {
  .aals-finish-customization {
    padding: 16px;
    border-radius: 14px;
  }

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

  .aals-depth-grid {
    grid-template-columns: 1fr;
  }

  .aals-customization-label {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }
}

/* === v0.1.7 pricing + tint style ========================================= */
.aals-starts-from {
  display: inline-block;
  margin-right: 3px;
  color: var(--aals-muted);
  font-size: 10.5px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: .035em;
}

.aals-choice-footer strong {
  color: var(--aals-ink);
  font-size: 13px;
}

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

.aals-style-choice {
  position: relative;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 76px;
  padding: 12px 14px;
  border: 1px solid var(--aals-line);
  border-radius: 12px;
  background: #fff;
  color: var(--aals-ink);
  text-align: left;
  cursor: pointer;
}

.aals-style-choice.is-selected {
  border: 2px solid var(--aals-red);
  padding: 11px 13px;
  background: #fffafa;
}

.aals-style-choice strong,
.aals-style-choice small {
  display: block;
}

.aals-style-choice strong { font-size: 13px; }
.aals-style-choice small { margin-top: 3px; color: var(--aals-muted); font-size: 11px; line-height: 1.35; }

.aals-style-visual {
  width: 44px;
  height: 44px;
  border: 1px solid #d9d4cf;
  border-radius: 9px;
  background: color-mix(in srgb, var(--aals-style-color) 55%, transparent);
}

.aals-style-visual.is-gradient {
  background: linear-gradient(to bottom,
    color-mix(in srgb, var(--aals-style-color) 75%, transparent) 0%,
    color-mix(in srgb, var(--aals-style-color) 42%, transparent) 48%,
    color-mix(in srgb, var(--aals-style-color) 8%, transparent) 100%);
}

.aals-depth-visual.is-gradient i {
  background: linear-gradient(to bottom,
    rgb(from var(--aals-tint-color) r g b / var(--aals-tint-opacity)) 0%,
    rgb(from var(--aals-tint-color) r g b / calc(var(--aals-tint-opacity) * .62)) 52%,
    rgb(from var(--aals-tint-color) r g b / calc(var(--aals-tint-opacity) * .12)) 100%);
}

@supports not (color: rgb(from red r g b)) {
  .aals-depth-visual.is-gradient i {
    background: linear-gradient(to bottom, var(--aals-tint-color), rgba(255,255,255,.92));
    opacity: var(--aals-tint-opacity);
  }
}

@media (max-width: 640px) {
  .aals-style-grid { grid-template-columns: 1fr; }
}


/* === v0.1.8 educational polish ========================================== */
.aals-context-note {
  margin-top: 14px;
  line-height: 1.55;
}

.aals-preview-disclaimer {
  margin: 10px 0 0;
  color: var(--aals-muted);
  font-size: 10.5px;
  line-height: 1.45;
}

/* Slightly larger tint sample improves visibility of lighter colours. */
.aals-depth-visual {
  width: 42px;
  height: 42px;
  flex-basis: 42px;
}

/* === v0.1.9 pricing matrix, bifocal style and stackable Drive coating === */
.aals-availability-note {
  margin-top: 12px;
  color: #6b625b;
  font-size: 12px;
  line-height: 1.55;
}

.aals-option-price {
  display: block;
  margin-top: 7px;
  color: #2e2b29 !important;
  font-weight: 800;
}

.aals-drive-choice {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto 26px;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px;
  border: 1px solid #ded9d4;
  border-radius: 14px;
  background: #fff;
  color: var(--aals-ink);
  text-align: left;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.aals-drive-choice:hover,
.aals-drive-choice:focus {
  border-color: #c9bdb3;
  box-shadow: 0 7px 20px rgba(0,0,0,.05);
}

.aals-drive-choice.is-selected {
  border: 2px solid var(--aals-red);
  padding: 15px;
  background: #fffafa;
}

.aals-drive-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f6e9bd, #caa85c);
  color: #5b4517;
  font-size: 20px;
  box-shadow: inset 0 0 0 1px rgba(91,69,23,.12);
}

.aals-drive-copy {
  display: grid;
  gap: 4px;
}

.aals-drive-copy strong {
  font-size: 14px;
}

.aals-drive-copy small {
  color: var(--aals-muted);
  font-size: 11.5px;
  line-height: 1.45;
}

.aals-drive-price {
  white-space: nowrap;
  font-size: 12px;
  font-weight: 800;
}

@media (max-width: 640px) {
  .aals-drive-choice {
    grid-template-columns: 38px minmax(0, 1fr) 24px;
  }
  .aals-drive-price {
    grid-column: 2 / 3;
    margin-top: 2px;
  }
  .aals-drive-choice .aals-card-check {
    grid-column: 3;
    grid-row: 1 / span 2;
  }
}


/* === v0.1.12 bifocal style visuals and layout fix ======================== */
#aals-bifocal-style .aals-style-choice {
  grid-template-columns: 72px minmax(0, 1fr) auto;
  align-items: center;
}

#aals-bifocal-style .aals-style-choice span,
#aals-bifocal-style .aals-style-choice strong,
#aals-bifocal-style .aals-style-choice small {
  word-break: normal;
  overflow-wrap: normal;
  white-space: normal;
}

.aals-bifocal-visual {
  width: 58px;
  height: 44px;
  border: 1px solid #d9d4cf;
  border-radius: 10px;
  background: linear-gradient(to bottom, rgba(114, 127, 148, .18), rgba(114, 127, 148, .08));
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.4);
}

.aals-bifocal-visual::before,
.aals-bifocal-visual::after {
  content: '';
  position: absolute;
  left: 6px;
  right: 6px;
  border-radius: 8px;
}

.aals-bifocal-visual::before {
  top: 5px;
  bottom: 5px;
  border: 1px solid rgba(43, 42, 40, .14);
}

.aals-bifocal-visual--line::after {
  left: 12px;
  right: 12px;
  bottom: 9px;
  height: 12px;
  border: 1px solid rgba(43, 42, 40, .22);
  border-top: 2px solid rgba(43, 42, 40, .34);
  background: rgba(255,255,255,.58);
  border-radius: 0 0 12px 12px;
}

.aals-bifocal-visual--no-line::after {
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to bottom,
    rgba(114, 127, 148, .36) 0%,
    rgba(114, 127, 148, .22) 38%,
    rgba(114, 127, 148, .10) 74%,
    rgba(114, 127, 148, .03) 100%);
}

@media (max-width: 640px) {
  #aals-bifocal-style .aals-style-choice {
    grid-template-columns: 58px minmax(0, 1fr) 24px;
  }
}
