.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

body[data-patient-room] #patientHealthStory {
  display: none !important;
}

.story-hub {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin: 0.9rem 0 1rem;
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 1rem;
  background:
    radial-gradient(circle at 8% 4%, rgba(255, 79, 216, 0.2), transparent 19rem),
    radial-gradient(circle at 92% 4%, rgba(57, 255, 136, 0.16), transparent 20rem),
    linear-gradient(135deg, rgba(168, 85, 247, 0.14), rgba(56, 189, 248, 0.08)),
    rgba(6, 8, 20, 0.84);
  box-shadow:
    0 1rem 3rem rgba(0, 0, 0, 0.28),
    inset 0 0 3rem rgba(56, 189, 248, 0.04),
    0 0 2.2rem rgba(168, 85, 247, 0.1);
  padding: clamp(1rem, 2.4vw, 1.45rem);
}

.story-hub > *:not(.story-glow) {
  position: relative;
  z-index: 1;
}

.story-glow {
  position: absolute;
  z-index: 0;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 44px 44px;
  opacity: 0.28;
  mask-image: linear-gradient(180deg, #000, transparent 78%);
  pointer-events: none;
}

.story-heading,
.story-panel-heading,
.story-search-intro,
.story-record-topline,
.story-dialog-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.story-heading h2,
.story-search-intro h3,
.story-panel-heading h3,
.story-review-card h3,
.story-search-summary h3,
.story-dialog-topline h2 {
  margin: 0;
  color: var(--cream);
}

.story-heading h2 {
  font-size: clamp(1.65rem, 3.5vw, 2.65rem);
  line-height: 1;
  text-shadow:
    0 0 1.6rem rgba(255, 79, 216, 0.3),
    0 0 1.8rem rgba(56, 189, 248, 0.26);
}

.story-heading p:not(.eyebrow),
.story-panel-heading p,
.story-search-intro p:not(.eyebrow),
.story-search-summary p,
.story-empty-state p,
.story-storage-note p,
.story-tool-offer p,
.story-success p {
  margin: 0.4rem 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.story-approved-count,
.story-profile-badge {
  display: inline-flex;
  align-items: center;
  min-height: 2.25rem;
  border: 1px solid rgba(57, 255, 136, 0.4);
  border-radius: 999px;
  background: rgba(57, 255, 136, 0.1);
  color: #dfffea;
  padding: 0.45rem 0.8rem;
  font-size: 0.82rem;
  font-weight: 900;
  white-space: nowrap;
}

.story-search-card {
  position: relative;
  margin-top: 1rem;
  border: 1px solid rgba(255, 79, 216, 0.48);
  border-radius: 0.9rem;
  background:
    radial-gradient(circle at 4% 0%, rgba(255, 79, 216, 0.22), transparent 15rem),
    radial-gradient(circle at 90% 10%, rgba(56, 189, 248, 0.18), transparent 18rem),
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(168, 85, 247, 0.08)),
    rgba(5, 7, 18, 0.82);
  box-shadow:
    inset 0 0 2.5rem rgba(255, 79, 216, 0.045),
    0 0 2rem rgba(255, 79, 216, 0.08);
  padding: clamp(1rem, 2.4vw, 1.35rem);
}

.story-search-intro {
  justify-content: flex-start;
}

.story-companion-spark,
.story-offer-icon,
.story-success > span {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 2.8rem;
  height: 2.8rem;
  border: 1px solid rgba(246, 190, 79, 0.5);
  border-radius: 0.9rem;
  background:
    radial-gradient(circle, rgba(246, 190, 79, 0.28), transparent 70%),
    rgba(20, 17, 30, 0.9);
  color: var(--gold);
  box-shadow: 0 0 1.5rem rgba(246, 190, 79, 0.2);
  font-size: 1.25rem;
  font-weight: 900;
}

.story-search-form {
  margin-top: 1rem;
}

.story-search-boundary {
  margin: 0.8rem 0 0;
  border-left: 3px solid rgba(56, 189, 248, 0.62);
  background: rgba(56, 189, 248, 0.07);
  color: #dcd7e7;
  padding: 0.55rem 0.7rem;
  font-size: 0.86rem;
  line-height: 1.4;
}

.story-search-boundary strong {
  color: #bdf6ff;
}

.story-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 0.65rem;
}

.story-search-row input,
.story-entry-form input,
.story-entry-form textarea,
.story-offer-fields input,
.care-profile-switcher select,
.care-profile-form input {
  width: 100%;
  border: 1px solid rgba(56, 189, 248, 0.34);
  border-radius: 0.7rem;
  background: rgba(0, 0, 0, 0.32);
  color: var(--ink);
  padding: 0.8rem 0.9rem;
}

.story-search-row input {
  min-height: 3.5rem;
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.085);
  font-size: 1.02rem;
}

.story-search-row input::placeholder,
.story-entry-form input::placeholder,
.story-entry-form textarea::placeholder {
  color: #c9c4d7;
}

.story-mic-button,
.story-search-button,
.story-part-nav button,
.story-panel-heading > button,
.story-empty-state button,
.story-action-row button,
.story-record-actions button,
.story-dialog-topline button {
  min-height: 2.75rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 0.7rem;
  color: var(--ink);
  font-weight: 900;
}

.story-mic-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 3.5rem;
  border-color: rgba(57, 255, 136, 0.48);
  background:
    radial-gradient(circle at 20% 0%, rgba(57, 255, 136, 0.22), transparent 8rem),
    rgba(57, 255, 136, 0.09);
  padding: 0.7rem 0.95rem;
}

.story-mic-button[aria-pressed="true"] {
  border-color: var(--pink);
  background: rgba(255, 79, 216, 0.18);
  box-shadow: 0 0 1.3rem rgba(255, 79, 216, 0.28);
  animation: story-listening-pulse 1.2s ease-in-out infinite;
}

.story-search-button,
.story-action-row button:first-child,
.story-empty-state button,
.story-panel-heading > button {
  border-color: rgba(255, 79, 216, 0.5);
  background:
    linear-gradient(135deg, rgba(255, 79, 216, 0.24), rgba(168, 85, 247, 0.22)),
    rgba(255, 255, 255, 0.07);
  padding: 0.7rem 1rem;
}

.story-voice-status,
.story-dictation-row p {
  margin: 0.55rem 0 0;
  color: var(--green);
  font-size: 0.86rem;
  font-weight: 750;
}

.story-example-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.8rem;
}

.story-example-row button,
.story-text-button {
  min-height: 2.3rem;
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.07);
  color: var(--muted);
  padding: 0.45rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 800;
}

.story-example-row button:hover,
.story-example-row button:focus-visible,
.story-text-button:hover,
.story-text-button:focus-visible {
  border-color: var(--blue);
  color: var(--ink);
}

.story-part-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  margin-top: 1rem;
}

.story-part-nav button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3.35rem;
  background: rgba(255, 255, 255, 0.055);
  padding: 0.65rem;
}

.story-part-nav button[aria-selected="true"] {
  border-color: rgba(57, 255, 136, 0.48);
  background:
    linear-gradient(135deg, rgba(57, 255, 136, 0.13), rgba(56, 189, 248, 0.12)),
    rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 0 1.5rem rgba(57, 255, 136, 0.045);
}

.story-part-panel {
  margin-top: 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 0.85rem;
  background: rgba(255, 255, 255, 0.035);
  padding: clamp(0.9rem, 2.4vw, 1.25rem);
}

.story-loading {
  color: var(--muted);
  text-align: center;
  padding: 1.25rem;
}

.story-type-grid,
.story-method-grid {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.9rem;
}

.story-type-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.story-type-grid button,
.story-method-grid button {
  display: grid;
  align-content: start;
  gap: 0.35rem;
  min-height: 6.3rem;
  border: 1px solid rgba(168, 85, 247, 0.34);
  border-radius: 0.8rem;
  background:
    linear-gradient(135deg, rgba(168, 85, 247, 0.14), rgba(56, 189, 248, 0.07)),
    rgba(255, 255, 255, 0.045);
  color: var(--ink);
  padding: 0.9rem;
  text-align: left;
}

.story-type-grid button:hover,
.story-type-grid button:focus-visible,
.story-method-grid button:hover,
.story-method-grid button:focus-visible {
  border-color: rgba(255, 79, 216, 0.62);
  transform: translateY(-1px);
  box-shadow: 0 0 1.4rem rgba(255, 79, 216, 0.12);
}

.story-type-grid button > span,
.story-method-grid button > span {
  font-size: 1.35rem;
}

.story-method-grid small {
  color: var(--muted);
  line-height: 1.35;
}

.story-entry-form,
.care-profile-form {
  display: grid;
  gap: 0.9rem;
}

.story-entry-form label,
.story-offer-fields label,
.care-profile-switcher label,
.care-profile-form label {
  display: grid;
  gap: 0.38rem;
  color: var(--ink);
  font-weight: 850;
}

.story-entry-form textarea {
  min-height: 7rem;
  resize: vertical;
}

.story-file-drop {
  display: grid;
  justify-items: center;
  gap: 0.4rem;
  margin-top: 1rem;
  border: 1px dashed rgba(57, 255, 136, 0.56);
  border-radius: 0.9rem;
  background:
    radial-gradient(circle at 50% 0%, rgba(57, 255, 136, 0.14), transparent 12rem),
    rgba(57, 255, 136, 0.045);
  padding: clamp(1.1rem, 3vw, 1.75rem);
  text-align: center;
}

.story-file-drop > span {
  font-size: 2rem;
}

.story-file-drop small,
.story-file-chip small {
  color: var(--muted);
}

.story-file-drop input {
  width: min(30rem, 100%);
  margin-top: 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 0.65rem;
  background: rgba(0, 0, 0, 0.25);
  color: var(--ink);
  padding: 0.7rem;
}

.story-file-chip {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 0.7rem;
  background: rgba(56, 189, 248, 0.08);
  padding: 0.8rem;
}

.story-file-chip span {
  font-size: 1.45rem;
}

.story-file-chip strong,
.story-file-chip small {
  display: block;
  overflow-wrap: anywhere;
}

.story-dictation-row,
.story-action-row,
.story-record-actions,
.care-profile-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.story-action-row {
  margin-top: 0.25rem;
}

.story-action-row .story-text-button {
  background: rgba(255, 255, 255, 0.035);
}

.story-review-card {
  border: 1px solid rgba(246, 190, 79, 0.34);
  border-radius: 0.8rem;
  background:
    radial-gradient(circle at 0 0, rgba(246, 190, 79, 0.12), transparent 14rem),
    rgba(255, 255, 255, 0.045);
  padding: 1rem;
}

.story-review-list {
  display: grid;
  gap: 0.55rem;
  margin: 0.9rem 0;
}

.story-review-list > div {
  display: grid;
  grid-template-columns: minmax(8.5rem, 0.35fr) minmax(0, 1fr);
  gap: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.6rem 0;
}

.story-review-list dt {
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.story-review-list dd {
  margin: 0;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.story-success,
.story-empty-state {
  display: grid;
  justify-items: center;
  gap: 0.35rem;
  padding: clamp(1rem, 3vw, 1.6rem);
  text-align: center;
}

.story-success > strong,
.story-empty-state > strong {
  color: var(--cream);
  font-size: 1.1rem;
}

.story-empty-state > span {
  color: var(--gold);
  font-size: 1.7rem;
  text-shadow: 0 0 1rem rgba(246, 190, 79, 0.32);
}

.story-timeline-list {
  position: relative;
  display: grid;
  gap: 0.75rem;
  margin: 1rem 0 0;
  padding: 0 0 0 1.15rem;
  list-style: none;
}

.story-timeline-list::before {
  content: "";
  position: absolute;
  top: 0.5rem;
  bottom: 0.5rem;
  left: 0.26rem;
  width: 2px;
  background: linear-gradient(var(--pink), var(--blue), var(--green));
  box-shadow: 0 0 0.8rem rgba(56, 189, 248, 0.32);
}

.story-timeline-list li {
  position: relative;
}

.story-record-card {
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 0.8rem;
  background:
    linear-gradient(135deg, rgba(168, 85, 247, 0.09), rgba(56, 189, 248, 0.055)),
    rgba(5, 7, 18, 0.64);
  padding: 0.9rem;
}

.story-timeline-dot {
  position: absolute;
  top: 1rem;
  left: -1.31rem;
  width: 0.68rem;
  height: 0.68rem;
  border: 2px solid #101421;
  border-radius: 50%;
  background: var(--pink);
  box-shadow: 0 0 0.8rem rgba(255, 79, 216, 0.55);
}

.story-record-topline {
  align-items: center;
}

.story-record-topline time,
.story-record-topline span {
  color: var(--blue);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.story-record-topline span {
  color: var(--green);
  text-align: right;
}

.story-record-card h4 {
  margin: 0.5rem 0 0;
  color: var(--cream);
  font-size: 1.05rem;
}

.story-record-note,
.story-record-source {
  margin: 0.45rem 0 0;
  color: var(--muted);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.story-record-source {
  font-size: 0.87rem;
}

.story-record-source strong {
  color: var(--gold);
}

.story-record-actions {
  margin-top: 0.75rem;
}

.story-record-actions button {
  min-height: 2.35rem;
  border-color: rgba(56, 189, 248, 0.28);
  background: rgba(56, 189, 248, 0.08);
  padding: 0.45rem 0.7rem;
  font-size: 0.82rem;
}

.story-record-actions .story-remove-button {
  border-color: rgba(255, 255, 255, 0.12);
  background: transparent;
  color: #c9c4d7;
}

.story-result-group + .story-result-group {
  margin-top: 1rem;
}

.story-result-group > h4 {
  margin: 0 0 0.55rem;
  color: var(--gold);
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.story-result-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.story-search-summary {
  margin-bottom: 0.85rem;
}

.story-storage-note {
  margin-top: 0.8rem;
  border: 1px solid rgba(246, 190, 79, 0.25);
  border-radius: 0.7rem;
  background: rgba(246, 190, 79, 0.055);
  padding: 0.8rem;
}

.story-storage-note strong {
  color: var(--gold);
}

.story-storage-note p {
  font-size: 0.84rem;
}

.story-tool-offer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.85rem;
  margin-top: 1rem;
  border: 1px solid rgba(57, 255, 136, 0.46);
  border-radius: 0.9rem;
  background:
    radial-gradient(circle at 0 0, rgba(57, 255, 136, 0.17), transparent 15rem),
    radial-gradient(circle at 100% 0, rgba(255, 79, 216, 0.14), transparent 16rem),
    rgba(7, 10, 20, 0.92);
  box-shadow: 0 0 2rem rgba(57, 255, 136, 0.1);
  padding: 1rem;
}

.story-offer-copy h3 {
  margin: 0;
  color: var(--cream);
  font-size: 1.35rem;
}

.story-offer-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(10rem, 0.45fr);
  gap: 0.65rem;
  margin-top: 0.85rem;
}

.story-profile-badge {
  width: fit-content;
  margin-top: 0.65rem !important;
}

.story-form-error {
  margin: 0.65rem 0 0;
  color: #ffb5df;
  font-weight: 800;
}

.care-profile-switcher {
  display: grid;
  grid-template-columns: minmax(13rem, 0.65fr) minmax(0, 1fr);
  align-items: end;
  gap: 0.75rem 1rem;
  margin-top: 0.9rem;
  border: 1px solid rgba(56, 189, 248, 0.26);
  border-radius: 0.8rem;
  background: rgba(56, 189, 248, 0.055);
  padding: 0.85rem;
}

.care-profile-switcher select {
  min-height: 2.75rem;
}

.care-profile-form,
.care-profile-separation {
  grid-column: 1 / -1;
}

.care-profile-separation {
  margin: 0;
  color: var(--green);
  font-size: 0.84rem;
  font-weight: 750;
  line-height: 1.4;
}

.story-original-dialog {
  width: min(44rem, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  overflow: auto;
  border: 1px solid rgba(56, 189, 248, 0.42);
  border-radius: 0.9rem;
  background:
    radial-gradient(circle at 10% 0, rgba(255, 79, 216, 0.18), transparent 18rem),
    linear-gradient(180deg, #17172b, #0f1421);
  color: var(--ink);
  box-shadow: 0 2rem 5rem rgba(0, 0, 0, 0.65);
  padding: 1rem;
}

.story-original-dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
}

.story-dialog-topline button {
  width: 2.6rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  font-size: 1.25rem;
}

.story-original-dialog pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.7rem;
  background: rgba(0, 0, 0, 0.25);
  color: var(--cream);
  padding: 0.85rem;
  font: inherit;
  line-height: 1.5;
}

@keyframes story-listening-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.025); }
}

@media (max-width: 760px) {
  .story-heading,
  .story-panel-heading,
  .story-dialog-topline {
    align-items: stretch;
    flex-direction: column;
  }

  .story-approved-count {
    width: fit-content;
  }

  .story-search-row,
  .story-part-nav,
  .story-type-grid,
  .story-method-grid,
  .story-result-list,
  .story-offer-fields,
  .care-profile-switcher {
    grid-template-columns: 1fr;
  }

  .story-search-row .story-mic-button,
  .story-search-row .story-search-button {
    width: 100%;
  }

  .story-part-nav button {
    justify-content: flex-start;
    min-height: 3rem;
  }

  .story-review-list > div {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  .story-tool-offer {
    grid-template-columns: 1fr;
  }

  .story-record-topline {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.25rem;
  }

  .story-record-topline span {
    text-align: left;
  }

  .care-profile-form,
  .care-profile-separation {
    grid-column: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .story-mic-button[aria-pressed="true"] {
    animation: none;
  }

  .story-type-grid button,
  .story-method-grid button {
    transition: none;
  }
}
