/*
 * Present mode: the patient screens under /present. Everything is scoped
 * to .present. --brand-primary and --brand-highlight are set on the root
 * from the practice's settings; the rest is derived from them.
 * Layout targets: iPad landscape 1180x820 and portrait 820x1180.
 */

.present {
  --brand-on-primary: #ffffff;
  --brand-soft: color-mix(in srgb, var(--brand-primary) 8%, #ffffff);
  --brand-soft-track: color-mix(in srgb, var(--brand-primary) 18%, #ffffff);
  --brand-insurance: color-mix(in srgb, var(--brand-primary) 32%, #ffffff);
  --brand-highlight-border: color-mix(in oklch, var(--brand-highlight), #000000 32%);
  --brand-sentence: color-mix(in srgb, var(--brand-highlight) 24%, #ffffff);
  --p-focus: 0 0 0 2px #ffffff, 0 0 0 4px var(--brand-primary);

  --phase-1-bg: #fdf3ec;
  --phase-1-border: #f7e3d5;
  --phase-1-ink: #b4532a;
  --phase-2-bg: #eef5fd;
  --phase-2-border: #dce9f8;
  --phase-2-ink: #1c5fa8;
  --phase-3-bg: #f3f1fc;
  --phase-3-border: #e5e1f7;
  --phase-3-ink: #5b4bb7;
  --phase-4-bg: #f2f4f7;
  --phase-4-border: #e4e7ec;
  --phase-4-ink: #475467;

  /* Fluid layout. Values equal the mockup at 1180 px and grow toward
     2560 px, so large chairside monitors are filled rather than framed by
     empty gutters. */
  --p-max: clamp(1180px, 60vw + 472px, 1880px);
  --p-pad: clamp(20px, 1.5vw + 10px, 48px);
  --p-gap: clamp(18px, 0.9vw + 7.4px, 30px);
  --p-fs-body: clamp(15px, 0.22vw + 12.4px, 18px);
  --p-fs-read: clamp(17px, 0.3vw + 14.5px, 21px);
  --p-fs-display: clamp(32px, 1.2vw + 24px, 54px);
  --p-fs-title: clamp(28px, 1.1vw + 21px, 48px);
  --p-fs-detail: clamp(26px, 1vw + 20px, 44px);
  --p-fs-figure: clamp(34px, 1.3vw + 26.6px, 58px);
  --p-fs-share: clamp(26px, 0.6vw + 23px, 36px);
  --p-fs-card-title: clamp(18px, 0.3vw + 16.5px, 23px);
  --p-measure: 68ch;

  position: relative;
  min-height: 100vh;
  height: 100vh;
  background: #ffffff;
  color: #101828;
  font-size: var(--p-fs-body);
  line-height: 1.45;
}

.present .p-frame {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.present :focus-visible {
  outline: none;
  box-shadow: var(--p-focus);
}

.present button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.present h1,
.present h2,
.present p,
.present ol,
.present ul {
  margin: 0;
}

.present ul,
.present ol {
  padding: 0;
  list-style: none;
}

.p-skip {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 20;
  padding: 12px 16px;
  border-radius: 10px;
  background: var(--brand-primary);
  color: var(--brand-on-primary);
  font-weight: 600;
}

.p-skip:focus {
  top: 12px;
}

/* Loading, error and ended screens */

.p-center {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
}

.p-overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  background: #ffffff;
}

.p-center-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.p-center-text {
  font-size: 18px;
  color: #344054;
  text-align: center;
  max-width: 520px;
}

.p-ended {
  font-size: 24px;
  line-height: 1.35;
  font-weight: 600;
  color: #101828;
}

/* Header */

.p-header {
  flex: none;
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 var(--p-pad);
  border-bottom: 1px solid #e4e7ec;
}

.p-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.p-logo {
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 10px;
  background: var(--brand-primary);
  color: var(--brand-on-primary);
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Lets the name shrink inside the flex row, so a long practice name ends
   in an ellipsis instead of running under the language menu. */
.p-brand-text {
  min-width: 0;
}

.p-brand-name {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.p-demo-note {
  font-size: 12px;
  color: #667085;
}

.p-tabs {
  flex: 1;
  display: flex;
  justify-content: center;
  min-width: 0;
}

.p-tabs {
  gap: 2px;
}

.p-tabs::before,
.p-tabs::after {
  content: "";
  flex: 1;
}

.p-tab {
  height: 48px;
  padding: 0 clamp(16px, 0.6vw + 9px, 24px);
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #475467;
  font-size: var(--p-fs-body);
  white-space: nowrap;
  transition:
    background-color var(--dur-base) var(--ease-standard),
    color var(--dur-base) var(--ease-standard),
    transform var(--dur-fast) var(--ease-standard);
}

.p-tab:active {
  transform: scale(var(--press-scale));
}

.p-tab:hover {
  background: #f5f7fa;
}

.p-tab.is-current {
  background: var(--brand-primary);
  color: var(--brand-on-primary);
  font-weight: 600;
}

.p-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

.p-select {
  height: 44px;
  padding: 0 38px 0 12px;
  border: 1px solid #868e9c;
  border-radius: 10px;
  /* Drawn chevron instead of the native arrow, which sits against the
     right edge. Gradients, not an image, so the CSP's img-src stays tight. */
  appearance: none;
  background-color: #ffffff;
  background-image:
    linear-gradient(45deg, transparent 50%, #475467 50%),
    linear-gradient(135deg, #475467 50%, transparent 50%);
  background-position:
    calc(100% - 20px) 50%,
    calc(100% - 15px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  font: inherit;
  font-size: 15px;
  color: #101828;
}

.p-exit {
  position: relative;
}

.p-done {
  transition: background-color var(--dur-base) var(--ease-standard), transform var(--dur-fast) var(--ease-standard);
  height: 44px;
  min-width: 44px;
  padding: 0 16px;
  border: 1px solid #d0d5dd;
  border-radius: 10px;
  background: #ffffff;
  font-weight: 600;
  color: #344054;
}

.p-done:hover {
  background: #f5f7fa;
}

.p-done:active:not(:disabled) {
  transform: scale(var(--press-scale));
}

.p-done:disabled {
  opacity: 0.6;
  cursor: default;
}

.p-exit-error {
  animation: dc-scale-in var(--dur-base) var(--ease-emphasized) backwards;
  transform-origin: top right;
  position: absolute;
  right: 0;
  top: 52px;
  z-index: 10;
  width: 280px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #f8dcdc;
  background: #fdefef;
  color: #b42318;
  font-size: 14px;
}

/* Main area */

.p-main {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  outline: none;
}

.p-main:focus-visible {
  box-shadow: none;
}

.p-page {
  max-width: var(--p-max);
  margin: 0 auto;
  padding: var(--p-pad);
  display: flex;
  flex-direction: column;
  gap: var(--p-gap);
}

.p-page-title {
  font-size: var(--p-fs-title);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.p-page-sub {
  font-size: 16px;
  color: #475467;
}

.p-eyebrow {
  font-size: 14px;
  font-weight: 600;
  color: var(--brand-primary);
}

.p-eyebrow-muted {
  font-size: 12px;
  font-weight: 700;
  color: #667085;
  padding: 0 4px 4px;
}

.p-held {
  padding: 18px 20px;
  border-radius: 14px;
  border: 1px solid #e4e7ec;
  background: #f2f4f7;
  color: #475467;
  font-size: 17px;
}

/* Buttons */

.p-button {
  min-height: 52px;
  padding: 0 22px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 16px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  transition:
    background-color var(--dur-base) var(--ease-standard),
    border-color var(--dur-base) var(--ease-standard),
    box-shadow var(--dur-base) var(--ease-standard),
    filter var(--dur-base) var(--ease-standard),
    transform var(--dur-fast) var(--ease-standard);
}

.p-button:active:not([aria-disabled="true"]) {
  transform: scale(var(--press-scale));
}

.p-button.primary:hover:not([aria-disabled="true"]) {
  filter: brightness(1.12);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--brand-primary) 28%, transparent);
}

.p-button.secondary:hover {
  background: #f5f7fa;
}

.p-button.primary {
  background: var(--brand-primary);
  color: var(--brand-on-primary);
}

.p-button.secondary {
  background: #ffffff;
  border-color: #d0d5dd;
  color: #344054;
}

.p-button[aria-disabled="true"] {
  opacity: 0.6;
}

.p-mini-button {
  transition: background-color var(--dur-base) var(--ease-standard), transform var(--dur-fast) var(--ease-standard);
  min-height: 44px;
  padding: 0 12px;
  border-radius: 8px;
  border: 0;
  background: #ffffff;
  font-size: 14px;
  font-weight: 600;
}

/* Narrated blocks */

.p-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.p-block.is-note {
  padding: 16px 18px;
  border-radius: 14px;
  background: var(--brand-soft);
}

.p-block-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  min-height: 44px;
}

.p-block-title {
  font-size: 13px;
  font-weight: 700;
  color: #667085;
  text-transform: none;
}

.p-note-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--brand-primary);
}

.p-block-head .p-play {
  margin-left: auto;
}

/* A small label with the play control beside it, between a headline and
   its text. */
.p-block-head.is-compact {
  min-height: 0;
  margin-top: 2px;
}

.p-block-head.is-compact .p-play {
  margin-left: 0;
}

.p-read {
  max-width: var(--p-measure);
  font-size: var(--p-fs-read);
  line-height: 1.55;
  color: #344054;
  text-wrap: pretty;
}

.p-block.is-note .p-read {
  font-size: 17px;
  line-height: 1.5;
}

.p-headline {
  font-size: var(--p-fs-display);
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: #101828;
  text-wrap: pretty;
}

.p-sentence {
  border-radius: 4px;
  /* The padding gives the highlight some air; the negative margin takes the
     same room back, so the gap between sentences stays one space wide. */
  padding: 1px 2px;
  margin: 0 -2px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  /* The highlight moves from sentence to sentence as a soft fade. */
  transition:
    background-color var(--dur-slow) var(--ease-standard),
    box-shadow var(--dur-slow) var(--ease-standard),
    color var(--dur-slow) var(--ease-standard);
}

.p-sentence.is-current {
  background: var(--brand-sentence);
  color: #101828;
  box-shadow: inset 0 -2px 0 var(--brand-highlight-border);
}

.p-steps {
  counter-reset: step;
  max-width: var(--p-measure);
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: var(--p-fs-read);
  line-height: 1.5;
  color: #344054;
}

.p-steps li {
  counter-increment: step;
  display: flex;
  gap: 12px;
  align-items: baseline;
}

.p-steps li::before {
  content: counter(step);
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-primary);
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: translateY(-2px);
}

.p-inline-note {
  animation: dc-rise-in var(--dur-base) var(--ease-emphasized) backwards;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f5f7fa;
  color: #475467;
  font-size: 14px;
}

/* Play control */

.p-play {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px 0 0;
  border-radius: 12px;
  transition: background-color var(--dur-base) var(--ease-standard);
}

.p-play.is-on {
  background: var(--brand-soft);
}

.p-play-button {
  transition:
    background-color var(--dur-base) var(--ease-standard),
    border-color var(--dur-base) var(--ease-standard);
  width: 44px;
  height: 44px;
  flex: none;
  /* A soft tint at rest, so a page of Listen controls stays quiet; the
     solid brand color marks the block that is playing or paused. */
  border: 1px solid var(--brand-soft-track);
  border-radius: 10px;
  background: var(--brand-soft);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* The whole control, label included, is the click target. */
.p-play-button::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 12px;
}

.p-play-button[aria-disabled="true"] {
  opacity: 0.45;
}

.p-play-button:hover:not([aria-disabled="true"]) {
  background: var(--brand-soft-track);
}

.p-play.is-on .p-play-button {
  border-color: var(--brand-primary);
  background: var(--brand-primary);
}

.p-play.is-on .p-play-button:hover:not([aria-disabled="true"]) {
  background: color-mix(in srgb, var(--brand-primary) 85%, white);
}

/* Scale the glyph and tint the background instead of transforming or
   filtering the button: either would make the button the containing block of
   the ::after click target and shrink it to the button. */
.p-play-button:active:not([aria-disabled="true"]) > span {
  transform: scale(0.88);
}

.p-play-button > span {
  animation: dc-fade-in var(--dur-fast) var(--ease-standard);
}

.p-play-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--brand-primary);
  white-space: nowrap;
}

.p-glyph-play {
  width: 0;
  height: 0;
  margin-left: 3px;
  border-style: solid;
  border-width: 7px 0 7px 11px;
  border-color: transparent transparent transparent var(--brand-primary);
}

.p-play.is-on .p-glyph-play {
  border-left-color: var(--brand-on-primary);
}

.p-glyph-pause {
  display: flex;
  gap: 4px;
}

.p-glyph-pause span {
  width: 4px;
  height: 14px;
  border-radius: 1px;
  background: var(--brand-on-primary);
}

.p-spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: var(--brand-on-primary);
  animation: p-spin 0.9s linear infinite;
}

@keyframes p-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Tooth chart */

.p-chart {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.p-chart-labels {
  display: flex;
  justify-content: space-between;
  width: 100%;
  max-width: var(--p-chart-max, 420px);
  font-size: 12px;
  font-weight: 600;
  color: #667085;
}

.p-chart-arch {
  position: relative;
  width: 100%;
  max-width: var(--p-chart-max, 420px);
}

.p-chart.is-compact .p-chart-arch {
  max-width: clamp(248px, 8vw + 154px, 340px);
}

.p-arch {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.p-chart-lower {
  font-size: 12px;
  font-weight: 600;
  color: #667085;
  text-align: center;
}

.p-arch .region {
  fill: none;
  stroke: color-mix(in srgb, var(--brand-highlight) 20%, transparent);
  stroke-width: 46;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.p-arch .tooth .body {
  fill: #ffffff;
  stroke: #d0d5dd;
  stroke-width: 1.5;
  transition: fill var(--dur-base) var(--ease-standard), stroke var(--dur-base) var(--ease-standard);
}

.p-arch .tooth text {
  font-size: 9.5px;
  font-weight: 500;
  fill: #98a2b3;
  font-variant-numeric: tabular-nums;
  user-select: none;
}

.p-chart.is-mixed .p-arch .tooth.is-primary text {
  font-size: 8.5px;
}

.p-arch .tooth.is-planned {
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

/* Invisible touch area, larger than the crown. */
.p-arch .tooth .hit {
  fill: transparent;
  stroke: none;
}

.p-arch .tooth.is-planned .body {
  fill: var(--brand-highlight);
  stroke: var(--brand-highlight-border);
  stroke-width: 2.5;
}

.p-arch .tooth.is-planned text {
  font-size: 12px;
  font-weight: 700;
  fill: #101828;
}

/* Lower incisors are too narrow for the usual number size. */
.p-arch .tooth.is-narrow text:not(.badge-text) {
  font-size: 8.5px;
}

.p-arch .tooth.is-planned.is-narrow text:not(.badge-text) {
  font-size: 10px;
}

.p-arch .tooth .ring {
  fill: none;
  stroke: transparent;
  stroke-width: 2.5;
  transition: stroke var(--dur-base) var(--ease-standard);
}

.p-arch .tooth.is-selected .ring {
  stroke: var(--brand-primary);
}

/* Keyboard focus: a dashed circle, so it reads apart from selection. */
.p-arch .tooth.is-planned:focus-visible .hit {
  stroke: var(--brand-primary);
  stroke-width: 2;
  stroke-dasharray: 4 3;
}

.p-arch .tooth .badge {
  fill: #ffffff;
  stroke: var(--brand-highlight-border);
  stroke-width: 1.5;
}

.p-arch .tooth text.badge-text {
  font-size: 9.5px;
  font-weight: 700;
  fill: #101828;
}

.p-arch .hint {
  font-size: 12px;
  fill: #667085;
}

.p-arch .hint.is-hidden {
  visibility: hidden;
}

.p-chart-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  max-width: 420px;
  font-size: 12px;
  line-height: 1.4;
  color: #475467;
  text-align: center;
}

.p-chart-key {
  position: relative;
  flex: none;
  width: 22px;
  height: 18px;
  border-radius: 6px;
  background: var(--brand-highlight);
  border: 2px solid var(--brand-highlight-border);
}

.p-chart-key-badge {
  position: absolute;
  top: -8px;
  right: -9px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #ffffff;
  border: 1.5px solid var(--brand-highlight-border);
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  color: #101828;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Panel listing a selected tooth's procedures. Placed from Rust through
   the style object, on the inner side of the arch. */
.p-tooth-panel {
  position: absolute;
  z-index: 5;
  width: min(264px, 92%);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px 12px;
  border-radius: 14px;
  border: 1px solid #e4e7ec;
  background: #ffffff;
  box-shadow:
    0 12px 32px rgba(16, 24, 40, 0.16),
    0 2px 6px rgba(16, 24, 40, 0.08);
  animation: p-tooth-panel-in var(--dur-base) var(--ease-emphasized) backwards;
}

/* The panel is centered with a transform, so the entrance keeps it. */
@keyframes p-tooth-panel-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(var(--motion-rise)) scale(var(--motion-scale));
  }
}

.p-tooth-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.p-tooth-panel-head > div {
  padding-top: 4px;
}

.p-tooth-panel-title {
  font-size: 16px;
  font-weight: 700;
  color: #101828;
}

.p-tooth-panel-place {
  font-size: 13px;
  color: #475467;
}

.p-tooth-panel-close {
  transition: background-color var(--dur-base) var(--ease-standard);
  flex: none;
  width: 44px;
  height: 44px;
  margin: -4px -6px 0 0;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #475467;
  font: inherit;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.p-tooth-panel-close:hover {
  background: #f2f4f7;
}

.p-tooth-panel-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.p-tooth-panel-item {
  width: 100%;
  min-height: 48px;
  padding: 7px 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "name go"
    "meta go";
  align-items: center;
  column-gap: 8px;
  text-align: left;
  border-radius: 10px;
  border: 1px solid #e4e7ec;
  background: #ffffff;
  color: #344054;
  font: inherit;
  cursor: pointer;
  transition:
    background-color var(--dur-base) var(--ease-standard),
    border-color var(--dur-base) var(--ease-standard);
}

.p-tooth-panel-item:hover {
  background: var(--brand-soft);
}

.p-tooth-panel-close:focus-visible,
.p-tooth-panel-item:focus-visible {
  outline: none;
  box-shadow: var(--p-focus);
}

.p-tooth-panel-name {
  grid-area: name;
  font-size: 15px;
  font-weight: 600;
  color: #101828;
}

.p-tooth-panel-meta {
  grid-area: meta;
  font-size: 12px;
  color: #475467;
}

.p-tooth-panel-go {
  grid-area: go;
  font-size: 20px;
  color: var(--brand-primary);
}

.p-tooth-panel-empty {
  margin: 0;
  font-size: 14px;
  color: #475467;
}

/* Portrait: the chart panel spans the page, so the chart keeps its full
   size and planned teeth keep touch areas of about 44 px or more. */
@media (max-width: 1100px) {
  .p-chart-panel .p-chart .p-chart-arch,
  .p-chart-panel .p-chart .p-chart-labels {
    max-width: 420px;
  }
}

/* At a glance (2d) */

/* The chart column takes about three sevenths of the width, which is the
   mockup's 460 px at 1180 px, and the chart grows with it. */
.p-glance {
  --p-chart-max: clamp(420px, 18vw + 208px, 660px);
  max-width: var(--p-max);
  margin: 0 auto;
  min-height: 100%;
  display: grid;
  grid-template-columns: minmax(380px, 3fr) minmax(0, 4fr);
  /* Each column keeps its own height, so the share card follows the phase
     cards and the chart starts at the top of its panel. */
  align-items: start;
  gap: clamp(32px, 1.2vw + 18px, 56px);
  padding: var(--p-pad);
}

.p-chart-panel {
  border-radius: 16px;
  background: #f5f7fa;
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.p-glance-main {
  display: flex;
  flex-direction: column;
  gap: var(--p-gap);
  min-width: 0;
  padding-top: 6px;
}

.p-nontooth {
  width: 100%;
  max-width: clamp(400px, 10vw + 282px, 560px);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.p-plain-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.p-list-button {
  transition: background-color var(--dur-base) var(--ease-standard), border-color var(--dur-base) var(--ease-standard);
  width: 100%;
  min-height: 48px;
  padding: 8px 14px;
  border: 1px solid #e4e7ec;
  border-radius: 10px;
  background: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  text-align: left;
}

.p-list-name {
  font-size: 15px;
  font-weight: 600;
  color: #344054;
}

.p-list-meta {
  font-size: 13px;
  color: #475467;
}

.p-phase-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.p-phase-card {
  transition: border-color var(--dur-base) var(--ease-standard), box-shadow var(--dur-base) var(--ease-standard);
  padding: clamp(16px, 0.4vw + 11px, 22px);
  border-radius: 14px;
  background: var(--phase-bg);
  border: 1px solid var(--phase-border);
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: left;
}

.phase-1 {
  --phase-bg: var(--phase-1-bg);
  --phase-border: var(--phase-1-border);
  --phase-ink: var(--phase-1-ink);
}

.phase-2 {
  --phase-bg: var(--phase-2-bg);
  --phase-border: var(--phase-2-border);
  --phase-ink: var(--phase-2-ink);
}

.phase-3 {
  --phase-bg: var(--phase-3-bg);
  --phase-border: var(--phase-3-border);
  --phase-ink: var(--phase-3-ink);
}

.phase-4 {
  --phase-bg: var(--phase-4-bg);
  --phase-border: var(--phase-4-border);
  --phase-ink: var(--phase-4-ink);
}

.p-phase-eyebrow {
  font-size: 12px;
  font-weight: 700;
  color: var(--phase-ink);
}

.p-phase-title {
  font-size: var(--p-fs-card-title);
  line-height: 1.25;
  font-weight: 600;
  color: #101828;
}

/* The foot sits at the bottom, so cards in a row line up whatever the
   length of their titles. */
.p-phase-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 12px;
}

.p-phase-foot .p-mini-button {
  color: var(--phase-ink);
}

.p-phase-count {
  font-size: 13px;
  color: #475467;
}

.p-more {
  justify-content: center;
  align-items: center;
  font-size: 16px;
  font-weight: 600;
  color: var(--phase-ink);
  min-height: 44px;
}

.p-share-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border: 1px solid #e4e7ec;
  border-radius: 14px;
}

.p-share-label {
  font-size: 13px;
  color: #475467;
}

.p-share-figure {
  font-size: var(--p-fs-share);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.p-share-note {
  font-size: 12px;
  color: #667085;
}

.present .unknown {
  color: #475467;
  font-weight: 500;
}

.p-share-figure .unknown,
.p-costs-figure .unknown {
  font-size: 22px;
}

/* Journey */

.p-journey-page {
  max-width: clamp(920px, 30vw + 566px, 1320px);
  gap: var(--p-gap);
}

.p-journey-intro {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.p-journey-note {
  padding: 14px 16px;
  border-radius: 12px;
  background: #f5f7fa;
  color: #475467;
  font-size: 16px;
  line-height: 1.5;
}

.p-journey {
  display: flex;
  flex-direction: column;
}

.p-journey-phase {
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 0 18px;
  padding-bottom: 22px;
}

.p-journey-phase:last-child {
  padding-bottom: 0;
}

/* Connector line from this marker down to the next one. */
.p-journey-phase::before {
  content: "";
  position: absolute;
  left: 21px;
  top: 44px;
  bottom: 0;
  width: 2px;
  background: #e4e7ec;
}

.p-journey-phase:last-child::before {
  display: none;
}

.p-journey-marker {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--phase-bg);
  border: 2px solid var(--phase-ink);
  color: var(--phase-ink);
  font-size: 17px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}

.p-journey-card {
  padding: 16px 18px 18px;
  border-radius: 14px;
  background: var(--phase-bg);
  border: 1px solid var(--phase-border);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 12px;
  align-items: center;
}

.p-journey-card > * {
  grid-column: 1 / -1;
}

.p-journey-card > .p-journey-title {
  grid-column: 1;
  grid-row: 1;
}

.p-journey-title {
  min-height: 44px;
  display: flex;
  align-items: center;
  font-size: var(--p-fs-card-title);
  line-height: 1.25;
  font-weight: 700;
  color: var(--phase-ink);
}

.p-journey-teeth {
  font-weight: 600;
  white-space: pre;
}

/* The play control sits on the title row, so the summary reads straight on. */
.p-journey-card .p-block,
.p-journey-card .p-block-head {
  display: contents;
}

.p-journey-card .p-block-head > *,
.p-journey-card .p-block > * {
  grid-column: 1 / -1;
}

.p-journey-card .p-block-head > .p-play {
  grid-column: 2;
  grid-row: 1;
  margin-left: 0;
}

.p-journey-card .p-read {
  font-size: calc(var(--p-fs-read) - 1px);
  line-height: 1.55;
}

.p-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.p-chip {
  transition:
    border-color var(--dur-base) var(--ease-standard),
    background-color var(--dur-base) var(--ease-standard),
    transform var(--dur-fast) var(--ease-standard);
  min-height: 44px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--phase-border);
  background: #ffffff;
  font-size: 15px;
  font-weight: 600;
  color: var(--phase-ink);
}

.p-journey-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-align: left;
}

.p-journey-chip:hover {
  border-color: var(--phase-ink);
}

.p-journey-chip:active {
  transform: scale(var(--press-scale));
}

.p-chip-arrow {
  transition: transform var(--dur-base) var(--ease-standard);
}

.p-journey-chip:hover .p-chip-arrow {
  transform: translateX(calc(var(--motion-rise) / 2));
}

.p-chip-arrow {
  font-size: 18px;
  line-height: 1;
}

.p-journey-deps {
  margin-left: 62px;
  padding: 14px 18px 16px;
  border-radius: 14px;
  border: 1px solid #e4e7ec;
}

.p-journey-deps .p-block-title {
  font-size: 15px;
  color: #344054;
}

.p-journey-deps .p-read {
  font-size: 17px;
}

@media (max-width: 1100px) {
  .p-journey-deps {
    margin-left: 0;
  }

  .p-journey .p-journey-phase:not(:last-child)::before {
    display: block;
  }
}

/* Procedures (2e) */

.p-procedures {
  min-height: 100%;
  display: grid;
  grid-template-columns: clamp(284px, 12vw + 142px, 400px) minmax(0, 1fr);
}

.p-rail {
  padding: 22px clamp(18px, 0.6vw + 11px, 28px);
  background: #f5f7fa;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: stretch;
}

.p-step-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.p-step {
  transition:
    background-color var(--dur-base) var(--ease-standard),
    border-color var(--dur-base) var(--ease-standard),
    color var(--dur-base) var(--ease-standard),
    transform var(--dur-fast) var(--ease-standard);
  width: 100%;
  min-height: 48px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid #e4e7ec;
  background: #ffffff;
  color: #344054;
  font-size: 15px;
  display: flex;
  gap: 10px;
  align-items: center;
  text-align: left;
}

.p-step-num {
  width: 22px;
  height: 22px;
  flex: none;
  border-radius: 50%;
  background: #f2f4f7;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.p-step:hover:not(.is-current) {
  border-color: #c9d0da;
  background: #fbfcfd;
}

.p-step:active {
  transform: scale(var(--press-scale));
}

.p-step.is-current {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: var(--brand-on-primary);
  font-weight: 600;
}

.p-step.is-current .p-step-num {
  background: rgba(255, 255, 255, 0.18);
}

.p-detail {
  min-width: 0;
}

.p-detail-inner {
  max-width: 860px;
  padding: 22px clamp(20px, 1.6vw + 11px, 48px) 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Narrow and medium widths: one column in the mockup's order (title,
   drawing, text, questions). The wrappers step aside for the layout. */
.p-detail-main,
.p-detail-side {
  display: contents;
}

.p-detail-head {
  order: 0;
}

.p-detail-side .p-illustration {
  order: 1;
}

.p-detail-body {
  order: 2;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.p-detail-side .p-questions {
  order: 3;
}

/* Wide screens: text at reading width on the left; the drawing and the
   questions in a side column that grows and stays in view. */
@media (min-width: 1500px) {
  .p-detail-inner {
    max-width: 1640px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(340px, 22vw, 560px);
    gap: clamp(28px, 2vw, 48px);
    align-items: start;
  }

  .p-detail-main,
  .p-detail-side {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
  }

  .p-detail-side {
    position: sticky;
    top: 22px;
  }

  .p-detail-side .p-illustration-img {
    max-width: 100%;
  }
}

.p-detail-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.p-detail-title {
  font-size: var(--p-fs-detail);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-top: 3px;
}

.p-segmented {
  display: flex;
  gap: 2px;
  padding: 3px;
  flex: none;
  border: 1px solid #e4e7ec;
  border-radius: 10px;
  font-size: 14px;
}

.p-segment {
  height: 34px;
  padding: 0 12px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  color: #475467;
}

.p-segment.is-on {
  background: var(--brand-primary);
  color: var(--brand-on-primary);
  font-weight: 600;
}

button.p-segment {
  border: 0;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

button.p-segment:not(.is-on):hover {
  background: #f2f4f7;
  color: #101828;
}

button.p-segment:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 1px;
}

/* Reading level: the "Aa" header button and its popover (UI_SPEC 5.10). */
.p-level {
  position: relative;
}

.p-level-button {
  height: 44px;
  min-width: 44px;
  padding: 0 10px;
  border: 1px solid #868e9c;
  border-radius: 10px;
  background: #ffffff;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  color: #101828;
  cursor: pointer;
}

.p-level-button[aria-expanded="true"] {
  border-color: var(--brand-primary);
}

.p-level-pop {
  animation: dc-scale-in var(--dur-base) var(--ease-emphasized) backwards;
  transform-origin: top right;
  position: absolute;
  right: 0;
  top: 52px;
  z-index: 10;
  padding: 12px;
  border: 1px solid #e4e7ec;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.12);
}

.p-level-pop[hidden] {
  display: none;
}

.p-level-title {
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #475467;
}

/* A section shown in English because its translation is not ready. */
.p-variant-label {
  margin: 0 0 8px;
  font-size: 13px;
  color: #667085;
}

/* A section being prepared in another language. */
.p-block-pending .skeleton {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.p-sk-line:nth-child(3n + 1) {
  width: 92%;
}

.p-sk-line:nth-child(3n + 2) {
  width: 78%;
}

.p-sk-line:nth-child(3n) {
  width: 64%;
}

.p-variant-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 28px 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff4ed;
  color: #101828;
  font-size: 14px;
}

.p-illustration {
  height: 140px;
  flex: none;
  border-radius: 14px;
  border: 1px solid #e4e7ec;
  background: repeating-linear-gradient(135deg, #f5f7fa 0 12px, #eef1f5 12px 24px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #475467;
}

.p-illustration span {
  padding: 4px 10px;
  border-radius: 8px;
  background: #ffffff;
}

.p-questions {
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid #e4e7ec;
}

.p-question-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: calc(var(--p-fs-read) - 1px);
  color: #344054;
}

.p-question-list li::before {
  content: "\201C";
  color: var(--brand-primary);
  font-weight: 700;
  margin-right: 4px;
}

.p-question-list li::after {
  content: "\201D";
  color: var(--brand-primary);
  font-weight: 700;
  margin-left: 2px;
}

/* Costs */

.p-costs {
  max-width: var(--p-max);
  margin: 0 auto;
  padding: clamp(28px, 1vw + 18px, 44px) clamp(28px, 1.6vw + 21px, 64px) 32px;
  display: flex;
  flex-direction: column;
  gap: clamp(22px, 0.6vw + 15px, 32px);
}

.p-num,
.p-costs .num {
  font-variant-numeric: tabular-nums;
}

.p-costs-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 40px;
}

.p-costs-title {
  font-size: var(--p-fs-title);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.025em;
  max-width: 16em;
}

.p-costs-share {
  text-align: right;
}

.p-costs-share .p-share-label {
  font-size: 14px;
}

.p-costs-figure {
  font-size: var(--p-fs-figure);
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: 6px;
}

.p-cost-summary {
  padding: 18px 20px;
  border-radius: 14px;
  background: #f5f7fa;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.p-bar {
  display: flex;
  height: 18px;
  gap: 3px;
  border-radius: 99px;
  overflow: hidden;
}

.p-bar > div {
  flex: none;
  min-width: 6px;
  transform-origin: left center;
  animation: p-bar-grow var(--dur-slow) var(--ease-emphasized) 80ms backwards;
}

.p-bar > div + div {
  animation-delay: 160ms;
}

@keyframes p-bar-grow {
  from {
    transform: scaleX(0);
  }
}

.p-bar-ins {
  background: var(--brand-insurance);
  box-shadow: inset 0 0 0 1px var(--brand-primary);
}

.p-bar-you {
  background: var(--brand-primary);
}

.p-bar > div:first-child {
  border-radius: 99px 0 0 99px;
}

.p-bar > div:last-child {
  flex: 1;
  border-radius: 0 99px 99px 0;
}

.p-bar > div:only-child {
  border-radius: 99px;
}

.p-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  font-size: 14px;
  color: #475467;
  font-variant-numeric: tabular-nums;
}

.p-legend-item {
  display: flex;
  gap: 8px;
  align-items: center;
}

.p-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.p-swatch.ins {
  background: var(--brand-insurance);
  box-shadow: inset 0 0 0 1px var(--brand-primary);
}

.p-swatch.you {
  background: var(--brand-primary);
}

.p-legend-total {
  margin-left: auto;
  font-weight: 600;
  color: #101828;
}

.p-cost-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
}

.p-cost-grid.is-stacked {
  grid-template-columns: minmax(0, 1fr);
}

.p-cost-table,
.p-cost-total {
  border: 1px solid #e4e7ec;
  border-radius: 14px;
  overflow: hidden;
}

.p-cost-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--phase-bg);
}

.p-cost-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--phase-ink);
}

.p-cost-subtotal {
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
}

.p-costs table {
  width: 100%;
  border-collapse: collapse;
}

.p-costs thead th {
  padding: 9px 10px;
  font-size: 12px;
  line-height: 1.3;
  font-weight: 600;
  color: #475467;
  background: #f5f7fa;
  text-align: left;
  vertical-align: bottom;
}

.p-costs tbody th,
.p-costs tbody td,
.p-costs tfoot th,
.p-costs tfoot td {
  padding: 13px 10px;
  font-size: clamp(16px, 0.16vw + 14px, 18px);
  border-top: 1px solid #f0f2f5;
  text-align: left;
  font-weight: 400;
  vertical-align: top;
}

.p-costs th:first-child,
.p-costs td:first-child {
  padding-left: 18px;
}

.p-costs th:last-child,
.p-costs td:last-child {
  padding-right: 18px;
}

.p-costs .num {
  text-align: right;
  white-space: nowrap;
}

.p-costs thead th.num {
  white-space: normal;
}

.p-costs th.name {
  color: #101828;
}

.p-costs .tooth {
  white-space: nowrap;
  color: #475467;
}

.p-cost-none {
  color: #667085;
}

.p-costs tbody td.fee,
.p-costs tbody td.ins {
  color: #475467;
}

.p-costs tbody td.you {
  font-weight: 600;
}

.p-costs tfoot th,
.p-costs tfoot td {
  border-top: 1px solid #e4e7ec;
  font-weight: 700;
  color: #101828;
}

.p-costs .unknown {
  font-size: 14px;
  font-weight: 500;
  color: #475467;
}

/* The tooth column fits its content and the figure columns share one width,
   which in an automatic table layout acts as a minimum. The procedure name
   takes the rest, so names wrap only when the card is truly narrow, and the
   figures of stacked phase tables line up. */
.p-costs thead th.tooth {
  width: 1%;
}

.p-costs thead th.num {
  width: 80px;
}

/* Narrow cards (a phone, or a portrait tablet with many phases): each row
   becomes the name and tooth on one line and the three figures, each with
   its own label, below. The column headings stay for screen readers. */
.p-cost-table,
.p-cost-total {
  position: relative;
  container-type: inline-size;
}

@container (max-width: 520px) {
  .p-costs thead,
  .p-costs thead tr {
    display: block;
  }

  .p-costs thead th:not(#p-cost-total-title) {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .p-costs thead th#p-cost-total-title {
    display: block;
    width: auto;
    padding: 12px 16px;
  }

  .p-costs table,
  .p-costs tbody,
  .p-costs tfoot {
    display: block;
  }

  .p-costs tbody tr,
  .p-costs tfoot tr {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px 12px;
    padding: 12px 16px;
    border-top: 1px solid #f0f2f5;
  }

  .p-costs tfoot tr {
    border-top-color: #e4e7ec;
  }

  .p-costs tbody th,
  .p-costs tbody td,
  .p-costs tfoot th,
  .p-costs tfoot td,
  .p-costs th:first-child,
  .p-costs td:first-child,
  .p-costs th:last-child,
  .p-costs td:last-child {
    padding: 0;
    border-top: 0;
  }

  .p-costs tbody th.name,
  .p-costs tfoot th.name {
    grid-column: 1 / 3;
  }

  .p-costs tfoot th.name,
  .p-cost-total tbody th.name {
    grid-column: 1 / -1;
  }

  .p-costs td.tooth {
    grid-column: 3;
    text-align: right;
  }

  /* Label on top, figure at the bottom, so figures line up across a row
     even when a label wraps. */
  .p-costs td.num {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: left;
    white-space: normal;
  }

  .p-costs td.num::before {
    content: attr(data-label);
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #475467;
  }
}

.p-costs .p-costs-figure .unknown {
  font-size: 24px;
  font-weight: 600;
}

.p-cost-total thead th.name {
  font-size: 15px;
  font-weight: 700;
  color: #101828;
}

.p-cost-total tbody th,
.p-cost-total tbody td {
  font-size: 17px;
  font-weight: 700;
}

.p-cost-table .p-cost-note {
  padding: 10px 18px 14px;
  border-top: 1px solid #f0f2f5;
}

.p-cost-note {
  font-size: 14px;
  line-height: 1.5;
  color: #475467;
}

.p-cost-callout {
  padding: 12px 16px;
  border-radius: 12px;
  background: #f5f7fa;
  font-size: 15px;
}

.p-disclaimer {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid #e4e7ec;
  font-size: 14px;
  line-height: 1.5;
  color: #475467;
}

.p-disclaimer b {
  color: #101828;
}

.p-info {
  width: 22px;
  height: 22px;
  flex: none;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-primary);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Next steps */

.p-next {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(24px, 2vw, 56px);
  align-items: start;
}

.p-next-col {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.p-question-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.p-question-cards li {
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--brand-soft);
  color: #344054;
  font-size: calc(var(--p-fs-read) - 1px);
}

.p-neutral {
  padding: 14px 16px;
  border-radius: 12px;
  background: #f2f4f7;
  color: #475467;
  font-size: 14px;
}

/* Exit dialog */

.p-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(16, 24, 40, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: dc-fade-in var(--dur-base) var(--ease-standard) backwards;
}

.p-modal-backdrop .p-modal {
  animation: dc-scale-in var(--dur-slow) var(--ease-emphasized) backwards;
}

/* Closing: the dialog plays this before it is removed (see exit.rs). */
.p-modal-backdrop.is-closing {
  animation: dc-fade-out var(--dur-base) var(--ease-exit) both;
  pointer-events: none;
}

.p-modal-backdrop.is-closing .p-modal {
  animation: dc-scale-out var(--dur-base) var(--ease-exit) both;
}

.p-modal {
  width: 380px;
  max-width: 100%;
  padding: 22px;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 12px 32px rgba(16, 24, 40, 0.16);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.p-modal-eyebrow {
  align-self: flex-start;
  padding: 3px 10px;
  border-radius: 99px;
  background: #f2f4f7;
  color: #475467;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.p-modal-title {
  font-size: 20px;
  font-weight: 700;
}

.p-modal-text {
  font-size: 14px;
  color: #475467;
}

.p-modal-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.p-field-label {
  font-size: 14px;
  font-weight: 600;
  color: #344054;
}

.p-input {
  transition: border-color var(--dur-fast) var(--ease-standard);
  height: 52px;
  padding: 0 14px;
  border: 1px solid #868e9c;
  border-radius: 10px;
  font: inherit;
  font-size: 20px;
  letter-spacing: 0.2em;
}

.p-input:focus-visible {
  border-color: var(--brand-primary);
}

.p-modal-error {
  min-height: 20px;
  font-size: 14px;
  color: #b42318;
}

.p-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Portrait iPad and narrower */

@media (max-width: 1100px) {
  .p-header {
    flex-wrap: wrap;
    padding: 10px 20px;
    gap: 10px 16px;
  }

  .p-brand {
    flex: 1;
  }

  .p-tabs {
    order: 3;
    flex: 1 0 100%;
  }

  .p-tabs::before,
  .p-tabs::after {
    display: none;
  }

  .p-tab {
    flex: 1;
    padding: 0 8px;
  }

  .p-glance {
    grid-template-columns: minmax(0, 1fr);
    padding: 20px;
  }

  .p-chart-panel .p-chart-arch {
    max-width: 340px;
  }

  .p-procedures {
    grid-template-columns: minmax(0, 1fr);
  }

  .p-rail {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    gap: 8px 16px;
  }

  .p-rail .p-chart {
    grid-row: 1 / span 2;
  }

  .p-detail-inner {
    padding: 20px;
  }

  .p-detail-head {
    flex-direction: column;
  }

  .p-costs {
    padding: 20px;
  }

  .p-costs-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .p-costs-share {
    text-align: left;
  }

  .p-cost-grid,
  .p-next {
    grid-template-columns: minmax(0, 1fr);
  }

  .p-journey {
    grid-auto-flow: row;
  }

  .p-journey-phase::before {
    display: none;
  }

  .p-page {
    padding: 20px;
  }
}

/* Phones: the five tabs no longer fit across. They keep their full labels
   and scroll sideways, starting from the left edge so the first tab is
   never cut off; the clipped last tab shows there is more. */
@media (max-width: 560px) {
  .p-header {
    padding: 10px 16px;
  }

  .p-tabs {
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: none;
    margin: 0 -16px;
    padding: 0 16px;
    scroll-padding: 0 16px;
  }

  .p-tabs::-webkit-scrollbar {
    display: none;
  }

  .p-tab {
    flex: 1 0 auto;
    padding: 0 12px;
  }

  .p-select {
    padding: 0 32px 0 8px;
    background-position:
      calc(100% - 16px) 50%,
      calc(100% - 11px) 50%;
  }

  .p-done {
    padding: 0 12px;
  }
}

/* Reduced motion: the tokens remove movement; the spinner, bar growth and
   the PIN shake stop. Fades of 150 ms or less remain. */
@media (prefers-reduced-motion: reduce) {
  .p-spinner {
    animation: none;
    border-color: var(--brand-on-primary);
    border-top-color: transparent;
  }

  .p-bar > div {
    animation: none;
  }

  .present * {
    scroll-behavior: auto;
  }
}

.p-glance-main .p-read {
  font-size: calc(var(--p-fs-read) - 1px);
}

/* Illustrations */

.p-illustration {
  height: auto;
  margin: 0;
  padding: 0;
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  border-radius: 14px;
  border: 1px solid #e4e7ec;
  background: #f6f8fb;
  overflow: hidden;
}

.p-illustration-img {
  display: block;
  width: 100%;
  max-width: clamp(320px, 8vw + 226px, 420px);
  height: auto;
  animation: dc-fade-in var(--dur-slow) var(--ease-standard) backwards;
}

.p-illustration-caption {
  align-self: stretch;
  padding: 6px 12px 8px;
  font-size: 12px;
  color: #475467;
  text-align: center;
}

/* Wide screens */

@media (min-width: 1500px) {
  /* Up to four phases read left to right as columns joined by a line. */
  .p-journey:not(:has(> li:nth-child(5))) {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: 0 var(--p-gap);
  }

  .p-journey:not(:has(> li:nth-child(5))) > .p-journey-phase {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 44px 1fr;
    gap: 14px;
    padding-bottom: 0;
  }

  .p-journey:not(:has(> li:nth-child(5))) > .p-journey-phase::before {
    left: 52px;
    right: calc(var(--p-gap) * -1 + 8px);
    top: 21px;
    bottom: auto;
    width: auto;
    height: 2px;
  }

  .p-journey:not(:has(> li:nth-child(5))) ~ .p-journey-deps {
    margin-left: 0;
  }

  .p-journey:not(:has(> li:nth-child(5))) .p-journey-card {
    align-content: start;
    height: 100%;
  }

  .p-journey-page:not(:has(.p-journey > li:nth-child(5))) {
    max-width: var(--p-max);
  }

  .p-cost-grid.is-stacked {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 560px), 1fr));
  }
}

/* Tab changes in Present: the page under the header slides in the
   direction of the tab, while the header itself only cross-fades. */
.vt-tab .p-main {
  view-transition-name: p-main;
}

.vt-detail .p-detail {
  view-transition-name: p-detail;
}

/* `.p-main` is the scroll box under the header and keeps the same size and
   place on every tab, so its group needs no animation (see the root group
   in tokens.css). `.p-detail` keeps its own: it sits inside the scroll box
   and can start a switch scrolled out of place. */
::view-transition-group(p-main) {
  animation: none;
}

::view-transition-old(p-main),
::view-transition-old(p-detail) {
  animation: var(--dur-fast) var(--ease-exit) both dc-vt-out-left;
}

::view-transition-new(p-main),
::view-transition-new(p-detail) {
  animation: var(--dur-slow) var(--ease-emphasized) 40ms both dc-vt-in-left;
}

.vt-back::view-transition-old(p-main),
.vt-back::view-transition-old(p-detail) {
  animation-name: dc-vt-out-right;
}

.vt-back::view-transition-new(p-main),
.vt-back::view-transition-new(p-detail) {
  animation-name: dc-vt-in-right;
}

/* Procedure switches move vertically, like turning to the next step. */
::view-transition-old(p-detail) {
  animation-name: dc-vt-out-up;
}

::view-transition-new(p-detail) {
  animation-name: dc-vt-in-up;
}

.vt-back::view-transition-old(p-detail) {
  animation-name: dc-vt-out-down;
}

.vt-back::view-transition-new(p-detail) {
  animation-name: dc-vt-in-down;
}

/* Without view transitions, the new screen rises in on its own. */
@supports not (view-transition-name: none) {
  .p-main > *,
  .p-detail > * {
    animation: dc-rise-in var(--dur-slow) var(--ease-emphasized) backwards;
  }
}

/* First load: header and At a glance shapes, then the real screen. */
.p-loading {
  display: flex;
  flex-direction: column;
}

.p-loading-header {
  flex: none;
  min-height: 76px;
  padding: 0 var(--p-pad);
  border-bottom: 1px solid #e4e7ec;
  display: flex;
  align-items: center;
  gap: 16px;
}

.p-loading .sk-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

.p-loading .sk-name {
  width: 160px;
  height: 14px;
}

.p-loading .sk-tabs {
  width: min(520px, 40%);
  height: 40px;
  margin-inline: auto;
  border-radius: 12px;
}

.p-loading .sk-tool {
  width: 140px;
  height: 44px;
  border-radius: 10px;
}

.p-loading-body {
  width: 100%;
  flex: 1;
}

.p-loading .sk-panel {
  min-height: 420px;
}

.p-loading .sk-eyebrow {
  width: 180px;
  height: 14px;
}

.p-loading .sk-headline {
  width: 90%;
  height: 38px;
  border-radius: 10px;
}

.p-loading .sk-short {
  width: 60%;
}

.p-loading .sk-block {
  width: 100%;
  height: 120px;
  border-radius: 14px;
}

.present > .p-frame {
  animation: dc-fade-in var(--dur-slow) var(--ease-standard) backwards;
}

@media (max-width: 1100px) {
  .p-loading .sk-tabs {
    display: none;
  }
}

/* An uploaded logo sits on white so any logo colors read on any brand color. */
.p-logo.p-logo-image {
  padding: 3px;
  background: #ffffff;
  border: 1px solid rgba(16, 24, 40, 0.12);
  object-fit: contain;
}
