:root {
  --brand: #0b3a49;
  --navy: #0b3a49;
  --deep: #061b26;
  --teal: #0b3a49;
  --mint: #e1f0f4;
  --green: #198754;
  --amber: #b66b00;
  --red: #b93838;
  --blue: #1f6f8d;
  --ink: #102934;
  --muted: #60717a;
  --line: #d7e3e7;
  --paper: #f8fbfc;
  --white: #ffffff;
  --shadow: 0 20px 50px rgba(9, 39, 51, 0.17);
  --radius: 8px;
}

/* ECS Care Capture review prototype */
.capture-tab-button {
  color: var(--navy);
}

.capture-system-bar {
  color: var(--white);
  background: var(--deep);
}

.capture-system-bar .status-icons b {
  background: var(--green);
}

.capture-app-header {
  display: flex;
  min-height: 58px;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 11px 16px;
  color: var(--white);
  background: var(--navy);
}

.capture-app-brand {
  display: flex;
  gap: 10px;
  align-items: center;
}

.capture-app-brand strong {
  padding-right: 10px;
  border-right: 1px solid rgba(255, 255, 255, 0.5);
  font-size: 1.4rem;
  line-height: 1;
}

.capture-app-brand span,
.capture-header-secure span {
  font-size: 0.72rem;
  font-weight: 800;
}

.capture-header-secure {
  display: flex;
  gap: 6px;
  align-items: center;
}

.capture-header-secure i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.14);
}

.capture-tab-button svg {
  padding: 3px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
}

.capture-tab-button.is-active {
  color: var(--white);
  border-color: #082a35;
  background: var(--navy);
}

.capture-tab-button.is-active svg {
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.74);
}

.care-capture-launch-grid {
  display: grid;
  gap: 7px;
  padding: 12px;
}

.care-capture-launch-grid article {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.care-capture-launch-grid article:last-child {
  border-bottom: 0;
}

.care-capture-launch-grid strong {
  color: var(--navy);
  font-size: 0.74rem;
}

.care-capture-launch-grid span {
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.42;
}

.capture-ready,
.capture-recording,
.capture-review,
.capture-receipt {
  display: grid;
  gap: 12px;
  padding: 2px 0 10px;
}

.capture-title,
.capture-review-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  padding: 6px 2px 2px;
}

.capture-title > div,
.capture-review-heading > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.capture-title span,
.capture-review-heading span,
.capture-section-heading span,
.capture-live-transcript span,
.capture-editor > span {
  color: var(--teal);
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.capture-title h3,
.capture-title p,
.capture-review-heading h3 {
  margin: 0;
}

.capture-title h3,
.capture-review-heading h3 {
  color: var(--navy);
  font-size: 1.42rem;
  line-height: 1.08;
}

.capture-title p {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.45;
}

.capture-privacy-banner,
.capture-mode-boundary {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid #b8dce8;
  border-radius: var(--radius);
  background: #edf8fc;
}

.capture-privacy-banner.is-compact {
  margin-top: 2px;
}

.capture-shield {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid #8ecfe4;
  border-radius: 50%;
  color: var(--green);
  background: var(--white);
  font-size: 0.9rem;
  font-weight: 900;
}

.capture-privacy-banner div,
.capture-mode-boundary {
  gap: 4px;
}

.capture-privacy-banner div,
.capture-mode-boundary {
  display: grid;
}

.capture-privacy-banner strong,
.capture-mode-boundary strong {
  color: var(--navy);
  font-size: 0.78rem;
}

.capture-privacy-banner p,
.capture-mode-boundary p {
  margin: 0;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.45;
}

.capture-mode-boundary {
  grid-template-columns: 1fr;
  border-color: var(--line);
  background: var(--paper);
}

.capture-mode-fieldset {
  display: grid;
  gap: 7px;
  min-width: 0;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}

.capture-mode-fieldset legend {
  padding: 0 5px;
  color: var(--navy);
  font-size: 0.74rem;
  font-weight: 900;
}

.capture-mode-option {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 9px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
}

.capture-mode-option.is-selected {
  border-color: #9acbd9;
  background: #f0f8fb;
}

.capture-mode-option input {
  margin: 2px 0 0;
  accent-color: var(--teal);
}

.capture-mode-option span {
  display: grid;
  gap: 3px;
}

.capture-mode-option strong {
  color: var(--navy);
  font-size: 0.76rem;
}

.capture-mode-option small {
  color: var(--muted);
  font-size: 0.64rem;
  line-height: 1.38;
}

.capture-source-section,
.capture-consent-panel,
.capture-live-transcript,
.capture-audio-player,
.capture-classification,
.capture-task-list,
.capture-attestations,
.capture-transcript-details,
.capture-no-note {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}

.capture-source-section {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.capture-section-heading {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: end;
}

.capture-section-heading > div {
  display: grid;
  gap: 2px;
}

.capture-section-heading strong {
  color: var(--navy);
  font-size: 0.82rem;
}

.capture-section-heading > small {
  max-width: 148px;
  color: var(--muted);
  font-size: 0.58rem;
  line-height: 1.32;
  text-align: right;
}

.capture-source-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.capture-source {
  display: grid;
  gap: 5px;
  justify-items: center;
  min-width: 0;
  padding: 9px 5px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: var(--white);
  cursor: pointer;
}

.capture-source.is-selected {
  color: var(--navy);
  border-color: var(--navy);
  background: #edf8fc;
  box-shadow: inset 0 0 0 1px rgba(11, 58, 73, 0.08);
}

.capture-source svg {
  width: 25px;
  height: 25px;
  stroke-width: 1.8;
}

.capture-source span {
  max-width: 100%;
  overflow: hidden;
  font-size: 0.64rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.capture-source small {
  color: var(--green);
  font-size: 0.55rem;
  font-weight: 800;
}

.capture-source-boundary {
  margin: 0;
  color: var(--muted);
  font-size: 0.61rem;
  line-height: 1.42;
}

.capture-consent-panel {
  display: grid;
  gap: 9px;
  padding: 12px;
}

.capture-consent-panel > strong {
  color: var(--navy);
  font-size: 0.78rem;
}

.capture-consent-panel label,
.capture-attestations label {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  cursor: pointer;
}

.capture-consent-panel input,
.capture-attestations input {
  width: 17px;
  height: 17px;
  margin: 1px 0 0;
  accent-color: var(--teal);
}

.capture-consent-panel label span {
  color: var(--ink);
  font-size: 0.68rem;
  line-height: 1.4;
}

.capture-consent-panel > small {
  padding-top: 7px;
  border-top: 1px solid var(--line);
  color: var(--amber);
  font-size: 0.61rem;
  font-weight: 700;
  line-height: 1.4;
}

.capture-error {
  margin: 0;
  padding: 10px;
  border: 1px solid #e4aaaa;
  border-radius: var(--radius);
  color: #842c2c;
  background: #fff4f4;
  font-size: 0.68rem;
  line-height: 1.4;
}

.capture-primary-actions,
.capture-decision-actions {
  display: grid;
  gap: 8px;
}

.capture-record-button {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 2px 10px;
  align-items: center;
  min-height: 68px;
  padding: 10px 13px;
  border: 1px solid #082a35;
  border-radius: var(--radius);
  color: var(--white);
  background: var(--navy);
  text-align: left;
  cursor: pointer;
}

.capture-record-button:disabled,
.capture-decision-actions .primary-action:disabled {
  color: #809099;
  border-color: #c7d3d7;
  background: #e4edf0;
  box-shadow: none;
  cursor: not-allowed;
}

.capture-record-icon {
  display: grid;
  grid-row: 1 / 3;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
}

.capture-record-icon svg {
  width: 20px;
  height: 20px;
  stroke-width: 2;
}

.capture-record-button strong {
  font-size: 0.78rem;
}

.capture-record-button small {
  opacity: 0.82;
  font-size: 0.61rem;
}

.capture-recording {
  justify-items: stretch;
}

.capture-record-orb {
  position: relative;
  display: grid;
  width: 178px;
  height: 178px;
  place-items: center;
  justify-self: center;
  align-content: center;
  gap: 10px;
  margin-top: 4px;
  border: 10px solid var(--white);
  border-radius: 50%;
  color: var(--white);
  background: var(--navy);
  box-shadow: 0 0 0 2px var(--navy), 0 18px 36px rgba(6, 27, 38, 0.2);
}

.capture-record-orb::after {
  content: "";
  position: absolute;
  width: 178px;
  height: 178px;
  border: 2px solid rgba(25, 135, 84, 0.5);
  border-radius: 50%;
  animation: capture-pulse 1.8s ease-out infinite;
}

.capture-record-orb svg {
  width: 54px;
  height: 54px;
  stroke-width: 1.7;
}

.capture-record-orb strong {
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.capture-elapsed {
  justify-self: center;
  color: var(--navy);
  font-size: 2.15rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.capture-waveform {
  display: flex;
  height: 46px;
  align-items: center;
  justify-content: center;
  gap: 3px;
  overflow: hidden;
}

.capture-waveform i {
  width: 3px;
  height: calc(5px + (var(--wave) * 4px));
  border-radius: 4px;
  background: var(--navy);
  animation: capture-wave 1.1s ease-in-out infinite alternate;
  animation-delay: calc(var(--wave) * -90ms);
}

.capture-live-transcript {
  display: grid;
  gap: 6px;
  padding: 12px;
}

.capture-live-transcript p {
  min-height: 38px;
  margin: 0;
  color: var(--ink);
  font-size: 0.72rem;
  line-height: 1.45;
}

.capture-live-transcript small {
  color: var(--muted);
  font-size: 0.59rem;
  line-height: 1.38;
}

.capture-stop-button {
  min-height: 46px;
}

.capture-review-heading {
  justify-content: start;
  align-items: center;
}

.capture-back-button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 0;
  border-radius: var(--radius);
  color: var(--navy);
  background: transparent;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
}

.capture-audio-player {
  display: grid;
  gap: 9px;
  overflow: hidden;
}

.capture-audio-player > div:first-child {
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.capture-audio-player svg {
  width: 22px;
  height: 22px;
  stroke-width: 1.8;
}

.capture-audio-player strong,
.capture-audio-player span {
  color: var(--navy);
  font-size: 0.76rem;
}

.capture-audio-player audio {
  width: calc(100% - 20px);
  height: 34px;
  margin: 0 10px 10px;
}

.capture-synthetic-player {
  display: grid !important;
  grid-template-columns: 30px minmax(0, 1fr) auto !important;
  padding: 0 10px 10px !important;
  border: 0 !important;
}

.capture-synthetic-player button {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: var(--white);
  background: var(--navy);
  cursor: pointer;
}

.capture-synthetic-player i {
  height: 3px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--navy) 0 34%, var(--line) 34% 100%);
}

.capture-synthetic-player small {
  color: var(--muted);
  font-size: 0.58rem;
}

.capture-classification {
  display: grid;
  gap: 0;
  overflow: hidden;
}

.capture-classification article {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  padding: 11px;
  border-bottom: 1px solid var(--line);
}

.capture-classification article:last-child {
  border-bottom: 0;
}

.capture-classification article > span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  font-size: 0.76rem;
  font-weight: 900;
}

.capture-classification article > div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: start;
}

.capture-classification strong {
  font-size: 0.72rem;
}

.capture-classification small {
  color: var(--muted);
  font-size: 0.57rem;
  line-height: 1.3;
  text-align: right;
}

.capture-classification .is-work {
  border-left: 3px solid var(--green);
}

.capture-classification .is-work > span {
  color: var(--white);
  background: var(--green);
}

.capture-classification .is-work strong {
  color: var(--green);
}

.capture-classification .is-muted {
  color: var(--muted);
  background: var(--paper);
}

.capture-classification .is-muted > span {
  color: var(--white);
  background: #91a0a6;
}

.capture-editor {
  display: grid;
  gap: 6px;
}

.capture-editor > span {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--navy);
}

.capture-editor > span small {
  color: var(--muted);
  font-size: 0.58rem;
  text-transform: none;
}

.capture-editor textarea {
  width: 100%;
  min-height: 88px;
  resize: vertical;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--white);
  font-size: 0.7rem;
  line-height: 1.45;
}

.capture-task-list {
  display: grid;
  overflow: hidden;
}

.capture-task-list header {
  display: flex;
  justify-content: space-between;
  padding: 10px;
  border-bottom: 1px solid var(--line);
}

.capture-task-list header strong {
  color: var(--navy);
  font-size: 0.76rem;
}

.capture-task-list header small {
  color: var(--muted);
  font-size: 0.6rem;
}

.capture-task-list article {
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
}

.capture-task-list article:last-child {
  border-bottom: 0;
}

.capture-task-list article > span {
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  border: 1px solid var(--navy);
  border-radius: 50%;
  color: var(--navy);
  font-size: 0.61rem;
  font-weight: 900;
}

.capture-task-list article > div {
  display: grid;
  gap: 2px;
}

.capture-task-list article strong {
  color: var(--ink);
  font-size: 0.68rem;
}

.capture-task-list article small,
.capture-task-list article em {
  color: var(--muted);
  font-size: 0.58rem;
  font-style: normal;
}

.capture-safety-signal {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 9px;
  padding: 11px;
  border: 1px solid #dfa148;
  border-radius: var(--radius);
  color: var(--amber);
  background: #fff9ef;
}

.capture-safety-signal > span {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border: 2px solid currentColor;
  border-radius: 50%;
  font-weight: 900;
}

.capture-safety-signal > div {
  display: grid;
  gap: 3px;
}

.capture-safety-signal strong {
  font-size: 0.74rem;
}

.capture-safety-signal p {
  margin: 0;
  color: var(--ink);
  font-size: 0.64rem;
  line-height: 1.42;
}

.capture-safety-signal button {
  grid-column: 1 / -1;
}

.capture-transcript-details {
  overflow: hidden;
}

.capture-transcript-details summary {
  padding: 11px;
  color: var(--navy);
  font-size: 0.7rem;
  font-weight: 900;
  cursor: pointer;
}

.capture-transcript-details[open] summary {
  border-bottom: 1px solid var(--line);
}

.capture-transcript-details > .capture-editor,
.capture-transcript-details > button,
.capture-segment-list {
  margin: 10px;
}

.capture-segment-list {
  display: grid;
  gap: 6px;
}

.capture-segment-list article {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 7px;
  padding: 8px;
  border-left: 3px solid var(--line);
  background: var(--paper);
}

.capture-segment-list article.is-work {
  border-left-color: var(--green);
}

.capture-segment-list article.is-uncertain {
  border-left-color: var(--amber);
}

.capture-segment-list strong {
  color: var(--teal);
  font-size: 0.59rem;
  text-transform: uppercase;
}

.capture-segment-list p {
  margin: 0;
  color: var(--ink);
  font-size: 0.62rem;
  line-height: 1.4;
}

.capture-attestations {
  display: grid;
  gap: 0;
  padding: 0 11px;
}

.capture-attestations label {
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.capture-attestations label:last-child {
  border-bottom: 0;
}

.capture-attestations label > span {
  display: grid;
  gap: 2px;
}

.capture-attestations strong {
  color: var(--navy);
  font-size: 0.69rem;
}

.capture-attestations small {
  color: var(--muted);
  font-size: 0.59rem;
  line-height: 1.35;
}

.capture-no-note {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 10px;
  padding: 12px;
  background: var(--paper);
}

.capture-no-note > span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  color: var(--white);
  background: #91a0a6;
  font-size: 1rem;
  font-weight: 900;
}

.capture-no-note > div {
  display: grid;
  gap: 4px;
}

.capture-no-note strong {
  color: var(--navy);
  font-size: 0.76rem;
}

.capture-no-note p {
  margin: 0;
  color: var(--muted);
  font-size: 0.66rem;
  line-height: 1.42;
}

.capture-audit-foot {
  margin: 0;
  padding: 9px 2px;
  color: var(--muted);
  font-size: 0.58rem;
  line-height: 1.4;
}

.capture-receipt {
  justify-items: stretch;
  align-content: start;
  padding: 22px 4px;
  text-align: center;
}

.capture-receipt-mark {
  display: grid;
  width: 62px;
  height: 62px;
  place-items: center;
  justify-self: center;
  border-radius: 50%;
  color: var(--white);
  background: var(--green);
  font-size: 1.6rem;
  font-weight: 900;
}

.capture-receipt.is-dismissed .capture-receipt-mark {
  background: #91a0a6;
}

.capture-receipt h3,
.capture-receipt > p {
  margin: 0;
}

.capture-receipt h3 {
  color: var(--navy);
  font-size: 1.3rem;
}

.capture-receipt > p {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.45;
}

.capture-receipt dl {
  display: grid;
  margin: 4px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  text-align: left;
}

.capture-receipt dl div {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 9px;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
}

.capture-receipt dl div:last-child {
  border-bottom: 0;
}

.capture-receipt dt {
  color: var(--teal);
  font-size: 0.61rem;
  font-weight: 900;
  text-transform: uppercase;
}

.capture-receipt dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 0.62rem;
}

@keyframes capture-pulse {
  0% {
    transform: scale(0.9);
    opacity: 0.65;
  }
  100% {
    transform: scale(1.18);
    opacity: 0;
  }
}

@keyframes capture-wave {
  from {
    transform: scaleY(0.48);
    opacity: 0.62;
  }
  to {
    transform: scaleY(1);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .capture-record-orb::after,
  .capture-waveform i {
    animation: none;
  }
}

@media (max-width: 380px) {
  .capture-title {
    display: grid;
  }

  .capture-title > .status-pill {
    justify-self: start;
  }

  .capture-source-grid {
    grid-template-columns: 1fr;
  }

  .capture-source {
    grid-template-columns: 28px minmax(0, 1fr) auto;
    justify-items: start;
    text-align: left;
  }

  .capture-source small {
    justify-self: end;
  }

  .capture-classification article > div {
    display: grid;
  }

  .capture-classification small {
    text-align: left;
  }

  .capture-task-list article {
    grid-template-columns: 25px minmax(0, 1fr);
  }

  .capture-task-list article em {
    grid-column: 2;
  }
}

:root[data-theme="dark"] .capture-privacy-banner,
:root[data-theme="dark"] .capture-mode-option.is-selected,
:root[data-theme="dark"] .capture-source.is-selected {
  background: #0d303c;
}

:root[data-theme="dark"] .capture-safety-signal {
  color: #f1b84b;
  background: #2e2719;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .capture-privacy-banner,
  :root:not([data-theme="light"]) .capture-mode-option.is-selected,
  :root:not([data-theme="light"]) .capture-source.is-selected {
    background: #0d303c;
  }

  :root:not([data-theme="light"]) .capture-safety-signal {
    color: #f1b84b;
    background: #2e2719;
  }
}

:root[data-theme="dark"] {
  --brand: #9ed8e8;
  --navy: #eef8fb;
  --deep: #061b26;
  --teal: #9ed8e8;
  --mint: #102f3a;
  --green: #67d89a;
  --amber: #f1b84b;
  --red: #ff8b8b;
  --blue: #8ecfe4;
  --ink: #eef8fb;
  --muted: #aac2c4;
  --line: #264957;
  --paper: #071f28;
  --white: #0b2833;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  color: var(--ink);
  background: #ffffff;
  font-family: Inter, Arial, Helvetica, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #9ed8e8;
    --navy: #eef8f6;
    --deep: #061b26;
    --teal: #9ed8e8;
    --mint: #123b42;
    --green: #67d89a;
    --amber: #f1b84b;
    --red: #ff8b8b;
    --blue: #8ecfe4;
    --ink: #eef8f6;
    --muted: #aac2c4;
    --line: #244b54;
    --paper: #071f28;
    --white: #0d2a34;
    --shadow: 0 20px 50px rgba(0, 0, 0, 0.38);
  }

  :root:not([data-theme="light"]) body {
    background: linear-gradient(180deg, #0b3a49 0%, #061b26 100%);
  }
}

:root[data-theme="dark"] body {
  background: linear-gradient(180deg, #0b3a49 0%, #061b26 100%);
}

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

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

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(217, 166, 46, 0.42);
  outline-offset: 2px;
}

.app-workbench {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(280px, 400px) minmax(0, 1fr);
  gap: 26px;
  align-items: center;
  justify-content: center;
  padding: 28px;
}

.strategy-panel {
  display: grid;
  align-content: center;
  gap: 16px;
  max-width: 380px;
}

.strategy-brand {
  display: grid;
  gap: 10px;
}

.strategy-logo img {
  width: 190px;
  max-width: 100%;
  height: auto;
  display: block;
}

.ecs-logo-mark {
  display: inline-grid;
}

.ecs-logo-mark img {
  grid-area: 1 / 1;
}

.ecs-logo-mark .logo-dark {
  display: none;
}

:root[data-theme="dark"] .ecs-logo-mark .logo-light {
  display: none;
}

:root[data-theme="dark"] .ecs-logo-mark .logo-dark {
  display: block;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ecs-logo-mark .logo-light {
    display: none;
  }

  :root:not([data-theme="light"]) .ecs-logo-mark .logo-dark {
    display: block;
  }
}

.strategy-brand h1 {
  margin: 0;
  color: var(--navy);
  font-size: 2.3rem;
  line-height: 1;
}

.strategy-brand p {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.55;
}

.strategy-stack {
  display: grid;
  gap: 8px;
}

.strategy-stack article {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.82);
}

.strategy-stack article > div {
  display: grid;
  gap: 3px;
}

.strategy-stack strong {
  font-size: 0.82rem;
}

.strategy-stack span {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  color: var(--white);
  background: var(--teal);
  font-weight: 900;
}

.strategy-stack small {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

.phone-shell {
  justify-self: center;
  width: min(100%, 420px);
  min-height: 820px;
  padding: 12px;
  border: 1px solid #b6c8c4;
  border-radius: 34px;
  background: #0b3a49;
  box-shadow: var(--shadow);
}

.phone-screen {
  position: relative;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  width: 100%;
  max-width: 100%;
  height: 796px;
  overflow: hidden;
  border-radius: 24px;
  background: var(--paper);
}

.phone-screen.is-auth-screen {
  grid-template-rows: minmax(0, 1fr);
  background: #ffffff;
}

.phone-screen > * {
  min-width: 0;
}

.system-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 34px;
  padding: 8px 16px 4px;
  color: var(--navy);
  font-size: 0.72rem;
  font-weight: 900;
}

.status-icons {
  display: inline-flex;
  gap: 5px;
  align-items: center;
}

.status-icons i {
  display: block;
  width: 16px;
  height: 8px;
  border: 1px solid currentColor;
  border-radius: 3px;
}

.status-icons b {
  display: block;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--green);
}

.app-header {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 8px 14px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--white);
}

.app-title-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.header-logo img {
  display: block;
  width: 56px;
  height: 48px;
  object-fit: contain;
}

.app-title-row h2,
.app-title-row p {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-title-row h2 {
  color: var(--navy);
  font-size: 1.02rem;
}

.app-title-row p {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
}

.icon-button,
.tab-button {
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--navy);
  background: var(--white);
  cursor: pointer;
}

.icon-button {
  width: 42px;
  height: 42px;
  font-size: 1.2rem;
  font-weight: 900;
}

.header-actions {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  justify-content: end;
  min-width: max-content;
}

.header-actions .icon-button svg {
  width: 18px;
  height: 18px;
}

.auth-screen {
  --navy: #0b3a49;
  --teal: #0b3a49;
  --ink: #102934;
  --muted: #60717a;
  --line: #d7e3e7;
  --white: #ffffff;
  --red: #b93838;
  min-height: 100%;
  display: grid;
  align-content: center;
  gap: 16px;
  padding: 28px 22px;
  background: #ffffff;
}

.auth-logo-wrap {
  display: grid;
  justify-items: center;
}

.auth-logo img {
  display: block;
  width: min(196px, 54vw);
  height: auto;
  filter: none;
}

.auth-copy {
  display: grid;
  gap: 7px;
  text-align: center;
}

.auth-copy h1 {
  max-width: 320px;
  margin: 0 auto;
  color: var(--navy);
  font-size: clamp(1.45rem, 6vw, 1.9rem);
  line-height: 1.04;
  letter-spacing: 0;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.auth-copy p,
.auth-footnote {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.auth-form,
.auth-assurance {
  display: grid;
  gap: 10px;
}

.auth-form label,
.preference-field {
  display: grid;
  gap: 6px;
}

.auth-form label span,
.preference-field span {
  color: var(--navy);
  font-size: 0.76rem;
  font-weight: 900;
}

.auth-form input,
.preference-field select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--white);
  padding: 10px 12px;
  font-size: 0.88rem;
  font-weight: 800;
}

.auth-submit {
  width: 100%;
}

.auth-secondary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}

.auth-error {
  padding: 10px 12px;
  border: 1px solid #f1c2c2;
  border-radius: var(--radius);
  color: var(--red);
  background: #fff5f5;
  font-size: 0.78rem;
  font-weight: 900;
}

.auth-assurance article {
  display: grid;
  gap: 4px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}

.auth-assurance strong {
  color: var(--navy);
  font-size: 0.82rem;
}

.auth-assurance span {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

.auth-footnote {
  text-align: center;
}

.auth-footnote a {
  color: var(--teal);
  font-weight: 900;
  margin-left: 8px;
}

.role-switcher {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
}

.role-switcher button {
  min-width: 0;
  min-height: 36px;
  padding: 6px 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: #f8fbfa;
  font-size: 0.64rem;
  font-weight: 900;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-switcher button.is-active {
  color: var(--white);
  border-color: var(--teal);
  background: var(--teal);
}

.security-ribbon {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  min-width: 0;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  background: #edf7f4;
}

.security-ribbon span {
  min-width: 0;
  overflow: hidden;
  padding: 6px 8px;
  border-radius: 999px;
  color: var(--teal);
  background: var(--white);
  font-size: 0.6rem;
  font-weight: 900;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-content {
  min-height: 0;
  min-width: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px;
  scrollbar-width: thin;
}

.screen-stack {
  display: grid;
  gap: 10px;
  padding-bottom: 8px;
}

.screen-stack > * {
  min-width: 0;
}

.devotion-card,
.voice-card,
.ai-intake-banner {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}

.devotion-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 0;
}

.devotion-card.is-complete {
  border-left-color: var(--green);
}

.devotion-video {
  position: relative;
  width: 100%;
  min-height: 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 0;
  color: var(--white);
  background: #092733 url("assets/sermons/faithful-service.jpg") center / cover;
  background-position: center;
  background-size: cover;
}

.devotion-video iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.devotion-video button {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.84);
  border-radius: 50%;
  color: var(--navy);
  background: rgba(255, 255, 255, 0.92);
  font-size: 0.68rem;
  font-weight: 900;
  cursor: pointer;
}

.devotion-video span {
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.42);
  font-size: 0.62rem;
  font-weight: 900;
}

.devotion-copy {
  display: grid;
  gap: 6px;
  align-content: start;
  min-width: 0;
  padding: 14px;
}

.devotion-copy > span,
.voice-card header span,
.ai-intake-banner strong {
  color: var(--teal);
  font-size: 0.62rem;
  font-weight: 900;
  text-transform: uppercase;
}

.devotion-copy h3,
.devotion-copy p,
.devotion-copy small {
  margin: 0;
}

.devotion-copy h3 {
  color: var(--navy);
  font-size: 0.95rem;
}

.devotion-copy p,
.devotion-copy small {
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.35;
}

.devotion-detail-grid,
.reflection-composer {
  grid-column: 1 / -1;
}

.devotion-publication-gate {
  display: grid;
  gap: 8px;
  margin: 8px 0;
  padding: 12px;
  border: 1px solid #d89a4a;
  border-radius: 7px;
  background: #fff7e8;
}

.devotion-publication-gate > span {
  color: #8a5200;
  font-size: 0.62rem;
  font-weight: 900;
  text-transform: uppercase;
}

.devotion-publication-gate > strong {
  color: var(--navy);
  font-size: 0.82rem;
}

.devotion-publication-gate > small {
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.35;
}

.devotion-publication-gate.is-approved {
  border-color: #70bda0;
  background: #edf8f2;
}

.devotion-publication-gate.is-approved > span {
  color: var(--green);
}

.devotion-theology-study {
  display: grid;
  gap: 10px;
  margin: 10px 0;
  padding-top: 12px;
  border-top: 2px solid var(--line);
}

.devotion-theology-study > header,
.devotion-theology-study > article,
.devotion-theology-study > details {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: var(--paper);
}

.devotion-theology-study > header {
  display: grid;
  gap: 4px;
  border-color: #8cc7bb;
  background: var(--mint);
}

.devotion-theology-study > header span,
.devotion-hebrew-study > span {
  color: var(--teal);
  font-size: 0.62rem;
  font-weight: 950;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.devotion-theology-study > header strong {
  font-size: 0.9rem;
}

.devotion-theology-study h4 {
  margin: 0 0 7px;
  color: var(--navy);
  font-size: 0.8rem;
}

.devotion-theology-study p,
.devotion-theology-study li,
.devotion-theology-study small {
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.55;
}

.devotion-theology-study p {
  margin: 7px 0 0;
}

.devotion-theology-study ul,
.devotion-theology-study ol {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 19px;
}

.devotion-hebrew-study > strong {
  display: block;
  margin-top: 8px;
  color: var(--navy);
  font-size: 2rem;
}

.devotion-study-prayer blockquote {
  margin: 0;
  padding: 10px;
  border-left: 3px solid var(--amber);
  color: var(--ink);
  background: var(--white);
  font-size: 0.73rem;
  line-height: 1.55;
}

.devotion-study-reference {
  display: inline-block;
  margin: 0 4px 5px 0;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--navy);
  background: var(--white);
  font-size: 0.65rem;
  font-weight: 850;
}

.devotion-theology-study summary {
  cursor: pointer;
  color: var(--navy);
  font-size: 0.7rem;
  font-weight: 900;
}

.devotion-main-scripture,
.devotion-full-scripture-section,
.devotion-sermon-companion,
.devotion-related-preaching,
.devotion-review-actions {
  display: grid;
  grid-column: 1 / -1;
  gap: 10px;
  padding: 14px;
}

.devotion-main-scripture,
.devotion-full-scripture-section {
  margin-top: 8px;
  padding: 12px 0;
}

.devotion-main-scripture > h4,
.devotion-full-scripture-section > h4,
.devotion-sermon-companion > h4 {
  margin: 0;
  color: var(--navy);
  font-size: 0.9rem;
}

.devotion-scripture-passage {
  padding: 13px;
  border: 1px solid #d7cda9;
  border-radius: 7px;
  background: #fffdf7;
}

.devotion-scripture-passage > header {
  display: flex;
  gap: 8px;
  align-items: baseline;
  justify-content: space-between;
}

.devotion-scripture-passage > header strong { color: var(--navy); font-size: 0.8rem; }
.devotion-scripture-passage > header span { color: var(--teal); font-size: 0.62rem; font-weight: 900; }
.devotion-scripture-passage > p { margin: 9px 0 0; color: #29363b; font-size: 0.78rem; line-height: 1.7; }
.devotion-scripture-verse { display: inline; }
.devotion-scripture-verse sup { margin-right: 3px; color: var(--teal); font-size: 0.58rem; font-weight: 900; }
.devotion-scripture-unavailable { color: #8b3f24 !important; font-weight: 750; }

.devotion-hebrew-collection {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid #8cc7bb;
  border-radius: 7px;
  background: #f0faf6;
}

.devotion-hebrew-collection > header { display: grid; gap: 4px; }
.devotion-hebrew-collection > header span { color: var(--teal); font-size: 0.62rem; font-weight: 950; text-transform: uppercase; }
.devotion-hebrew-collection > header strong { color: var(--navy); font-size: 0.9rem; }
.devotion-hebrew-collection > header p { margin: 0; }
.devotion-hebrew-study { padding: 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--white); }

.devotion-history-story {
  padding: 14px !important;
  border-color: #d7c278 !important;
  background: #fffbea !important;
}
.devotion-history-story > span { color: #7a6014; font-size: 0.62rem; font-weight: 950; text-transform: uppercase; }
.devotion-history-story h4 { margin-top: 8px; }
.devotion-history-story h4 small { font-weight: 600; }
.devotion-history-story blockquote { margin: 10px 0; padding: 10px; border-left: 3px solid var(--amber); background: #fff; font-size: 0.74rem; line-height: 1.55; }
.devotion-history-story a,
.devotion-related-preaching a { color: var(--teal); font-size: 0.7rem; font-weight: 850; }

.devotion-sermon-companion {
  background: #eef7f5;
  border-top: 3px solid var(--teal);
  border-bottom: 3px solid var(--teal);
}
.devotion-sermon-companion > header { display: grid; gap: 5px; }
.devotion-sermon-companion > header span { color: var(--teal); font-size: 0.62rem; font-weight: 950; text-transform: uppercase; }
.devotion-sermon-companion > header strong { color: var(--navy); font-size: 1rem; }
.devotion-sermon-companion p { margin: 0; color: var(--muted); font-size: 0.76rem; line-height: 1.6; }
.devotion-sermon-scripture-note { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--white); }
.devotion-sermon-scripture-note > header { display: flex; gap: 10px; align-items: baseline; }
.devotion-sermon-scripture-note time,
.devotion-teaching-points time { color: var(--teal); font-size: 0.7rem; font-weight: 950; }
.devotion-sermon-scripture-note > header strong { color: var(--navy); font-size: 0.82rem; }
.devotion-teaching-points { display: grid; gap: 8px; }
.devotion-teaching-points article { display: grid; grid-template-columns: 48px 1fr; gap: 8px; padding: 10px; border-left: 3px solid var(--teal); background: var(--white); }

.devotion-related-preaching > header { display: grid; gap: 5px; }
.devotion-related-preaching > header span { color: var(--teal); font-size: 0.62rem; font-weight: 950; text-transform: uppercase; }
.devotion-related-preaching > header strong { color: var(--navy); font-size: 1rem; }
.devotion-related-preaching > header p,
.devotion-related-preaching article p { margin: 0; color: var(--muted); font-size: 0.72rem; line-height: 1.5; }
.devotion-related-preaching > div { display: grid; gap: 12px; }
.devotion-related-preaching article { overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: var(--white); }
.devotion-related-preaching article h4,
.devotion-related-preaching article p,
.devotion-related-preaching article > a { margin: 9px 11px; }
.devotion-related-video { width: 100%; aspect-ratio: 16 / 9; background: #071f29; }
.devotion-related-video iframe { display: block; width: 100%; height: 100%; border: 0; }

.devotion-review-actions { border-top: 2px solid var(--line); background: var(--paper); }

@media (min-width: 760px) {
  .devotion-hebrew-collection,
  .devotion-related-preaching > div { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .devotion-hebrew-collection > header,
  .devotion-related-preaching > header { grid-column: 1 / -1; }
}

.devotion-awaiting-approval {
  padding: 18px;
  border-left-color: var(--amber);
  background: #fff9ef;
}

.devotion-awaiting-approval .devotion-copy {
  padding: 0;
}

:root[data-theme="dark"] .devotion-publication-gate,
:root[data-theme="dark"] .devotion-awaiting-approval {
  border-color: #b17b34;
  background: #2e2719;
}

:root[data-theme="dark"] .devotion-publication-gate > span {
  color: #f4bf74;
}

:root[data-theme="dark"] .devotion-publication-gate.is-approved {
  border-color: #5eb894;
  background: #123329;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .devotion-publication-gate,
  :root:not([data-theme="light"]) .devotion-awaiting-approval {
    border-color: #b17b34;
    background: #2e2719;
  }

  :root:not([data-theme="light"]) .devotion-publication-gate > span {
    color: #f4bf74;
  }

  :root:not([data-theme="light"]) .devotion-publication-gate.is-approved {
    border-color: #5eb894;
    background: #123329;
  }
}

.devotion-detail-grid,
.document-grid,
.client-brief-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
}

.devotion-detail-grid article,
.document-grid article,
.client-brief-grid article,
.route-stops article,
.note-history article,
.staff-reflections article {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}

.devotion-detail-grid span,
.document-grid span,
.client-brief-grid span,
.note-history span,
.reflection-composer > span,
.route-stops span {
  color: var(--teal);
  font-size: 0.62rem;
  font-weight: 900;
  text-transform: uppercase;
}

.devotion-detail-grid strong,
.document-grid strong,
.client-brief-grid strong,
.route-stops strong,
.note-history strong,
.staff-reflections strong {
  color: var(--navy);
  font-size: 0.8rem;
}

.devotion-detail-grid p,
.document-grid p,
.client-brief-grid p,
.route-stops p,
.note-history p,
.staff-reflections p {
  margin: 0;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.38;
}

.reflection-composer {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line);
}

.reflection-composer textarea {
  width: 100%;
  min-height: 76px;
  resize: vertical;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--white);
  font-size: 0.76rem;
  line-height: 1.4;
}

.staff-reflections,
.note-history {
  display: grid;
  gap: 7px;
}

.summary-strip,
.cms-document-list {
  display: grid;
  gap: 8px;
  padding: 12px;
}

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

.role-summary-strip {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.summary-strip article,
.cms-document-list article {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}

.summary-strip article {
  display: grid;
  gap: 5px;
  padding: 10px;
}

.cms-document-list article {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
  padding: 10px;
}

.summary-strip span,
.cms-note-composer span,
.cms-document-list p {
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.38;
}

.summary-strip span,
.cms-note-composer span {
  color: var(--teal);
  font-weight: 900;
  text-transform: uppercase;
}

.summary-strip strong,
.cms-document-list strong {
  color: var(--navy);
  font-size: 0.82rem;
}

.summary-strip p,
.cms-document-list p {
  margin: 0;
}

.cms-note-composer {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.cms-note-composer label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.cms-note-composer select,
.cms-note-composer textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--white);
}

.cms-note-composer select {
  min-height: 42px;
  padding: 8px 10px;
  font-size: 0.78rem;
  font-weight: 800;
}

.cms-note-composer textarea {
  min-height: 104px;
  resize: vertical;
  padding: 10px;
  font-size: 0.78rem;
  line-height: 1.42;
}

.card-action-row {
  padding: 0 12px 12px;
}

.cms-note-history {
  padding: 0 12px 12px;
}

.inline-link {
  color: var(--teal);
  font-size: 0.7rem;
  font-weight: 900;
  text-decoration: none;
}

.hero-card,
.app-card,
.action-card,
.timeline-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}

.hero-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  color: #ffffff;
  background: linear-gradient(135deg, #0b3a49, #0b3a49);
}

.hero-card.ai-hero {
  background:
    radial-gradient(circle at 84% 14%, rgba(255, 216, 120, 0.24), transparent 34%),
    linear-gradient(135deg, #0b3a49, #0b3a49);
}

.hero-card span,
.hero-card small {
  color: #d9edf3;
}

.hero-card span,
.app-card > header span,
.timeline-card span,
.scan-result span {
  font-size: 0.62rem;
  font-weight: 900;
  text-transform: uppercase;
}

.hero-card h3,
.hero-card p {
  margin: 0;
}

.hero-card h3 {
  color: #ffffff;
  font-size: 1.44rem;
  line-height: 1.05;
}

.hero-card p {
  color: #e7f3f0;
  font-size: 0.82rem;
  line-height: 1.45;
}

.hero-actions,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.primary-action,
.secondary-action,
.danger-action,
.quiet-action {
  min-height: 40px;
  padding: 9px 12px;
  border-radius: var(--radius);
  font-size: 0.78rem;
  font-weight: 900;
  cursor: pointer;
}

.primary-action {
  border: 1px solid #082a35;
  color: var(--white);
  background: var(--teal);
}

.secondary-action {
  border: 1px solid var(--line);
  color: var(--navy);
  background: var(--white);
}

.desktop-mode-button {
  min-height: 40px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--navy);
  background: var(--white);
  font-size: 0.72rem;
  font-weight: 900;
  cursor: pointer;
}

.desktop-mode-button.is-header {
  min-width: 82px;
}

.link-button {
  display: inline-grid;
  place-items: center;
  text-decoration: none;
}

.danger-action {
  border: 1px solid #e6b8b8;
  color: var(--red);
  background: #fff5f5;
}

.quiet-action {
  border: 0;
  color: var(--teal);
  background: transparent;
}

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

.stat-card {
  display: grid;
  gap: 3px;
  min-height: 72px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.1);
}

.stat-card strong {
  min-width: 0;
  overflow: hidden;
  font-size: 0.92rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-card {
  overflow: hidden;
}

.app-card > header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.app-card > header > div {
  min-width: 0;
}

.app-card > header h3,
.app-card > header p {
  margin: 0;
}

.app-card > header h3 {
  color: var(--navy);
  font-size: 0.98rem;
}

.app-card > header p {
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.35;
}

.status-pill {
  flex: 0 0 auto;
  min-width: 0;
  max-width: 100%;
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--teal);
  background: var(--mint);
  font-size: 0.62rem;
  font-weight: 900;
  text-align: center;
  overflow-wrap: anywhere;
}

.status-pill.is-amber {
  color: var(--amber);
  background: #fff4da;
}

.status-pill.is-red {
  color: var(--red);
  background: #fff0f0;
}

.status-pill.is-green {
  color: var(--green);
  background: #e9f8ef;
}

.status-pill.is-blue {
  color: var(--blue);
  background: #e7f4f9;
}

.metric-card {
  position: relative;
  align-content: start;
}

.metric-card.is-red,
.task-card.is-red {
  border-left: 5px solid var(--red);
}

.metric-card.is-amber,
.task-card.is-amber {
  border-left: 5px solid var(--amber);
}

.metric-card.is-green,
.task-card.is-green {
  border-left: 5px solid var(--green);
}

.metric-card .status-pill {
  width: fit-content;
  margin-top: 2px;
}

.metric-card .metric-trend {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 950;
  line-height: 1.3;
}

.metric-card .metric-trend.is-green {
  color: var(--green);
}

.metric-card .metric-trend.is-red {
  color: var(--red);
}

.metric-card .metric-trend.is-amber {
  color: var(--amber);
}

.traffic-summary-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px 0;
}

.traffic-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--teal);
  background: var(--white);
  font-size: 0.64rem;
  font-weight: 900;
}

.traffic-dot::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: currentColor;
}

.traffic-dot.is-red {
  color: var(--red);
}

.traffic-dot.is-amber {
  color: var(--amber);
}

.traffic-dot.is-green {
  color: var(--green);
}

.task-card {
  align-content: start;
}

.task-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
}

.task-card-head div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.task-card-head span {
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 900;
  text-transform: uppercase;
}

.card-body,
.list-stack {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.action-card,
.timeline-card,
.scan-result {
  display: grid;
  gap: 6px;
  padding: 11px;
}

.action-card strong,
.timeline-card strong,
.scan-result strong {
  color: var(--navy);
  font-size: 0.86rem;
}

.action-card p,
.timeline-card p,
.scan-result p {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.42;
}

.timeline-card {
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: start;
}

.instruction-button {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: inherit;
  background: var(--white);
  text-align: left;
  cursor: pointer;
}

.workflow-jump-nav {
  position: sticky;
  top: 0;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
}

.workflow-jump-nav button {
  min-width: 0;
  min-height: 38px;
  padding: 6px 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--navy);
  background: var(--white);
  font-size: 0.62rem;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.notification-group {
  display: grid;
  gap: 7px;
}

.notification-group h4 {
  margin: 0;
  color: var(--navy);
  font-size: 0.84rem;
}

.notification-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: inherit;
  background: var(--white);
  text-align: left;
  cursor: pointer;
}

.notification-row div {
  display: grid;
  gap: 4px;
}

.notification-row strong {
  color: var(--navy);
  font-size: 0.82rem;
}

.notification-row span {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

.timeline-card i {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  color: var(--white);
  background: var(--teal);
  font-style: normal;
  font-weight: 900;
}

.data-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.data-row:last-child {
  border-bottom: 0;
}

.data-row strong {
  color: var(--navy);
  font-size: 0.8rem;
}

.data-row div {
  display: grid;
  gap: 3px;
}

.data-row span {
  color: var(--muted);
  font-size: 0.7rem;
}

.scan-frame {
  position: relative;
  min-height: 180px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid #bfd8d4;
  border-radius: var(--radius);
  color: var(--white);
  background:
    linear-gradient(135deg, rgba(9, 39, 51, 0.86), rgba(13, 107, 103, 0.82)),
    url("assets/campaign/cms-customer-record.png") center / cover;
}

.scan-frame::before,
.scan-frame::after {
  content: "";
  position: absolute;
  inset: 20px;
  border: 2px solid rgba(255, 255, 255, 0.75);
  border-radius: var(--radius);
}

.scan-frame::after {
  inset: 42px 30px;
  border-color: rgba(255, 216, 120, 0.85);
}

.scan-frame strong {
  position: relative;
  z-index: 1;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.32);
  font-size: 0.78rem;
}

.scan-result {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}

.ai-intake-banner {
  display: grid;
  gap: 5px;
  padding: 11px;
  border-left: 5px solid var(--teal);
  background: var(--white);
}

.ai-intake-banner p {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.4;
}

.voice-card {
  overflow: hidden;
}

.voice-card header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.voice-card h3,
.voice-card p {
  margin: 0;
}

.voice-card h3 {
  color: var(--navy);
  font-size: 0.98rem;
}

.voice-card header p {
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.35;
}

.voice-panel {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 12px;
}

.mic-orb {
  position: relative;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal), var(--navy));
  box-shadow: inset 0 0 0 7px rgba(255, 255, 255, 0.28);
}

.mic-orb::before {
  content: "";
  position: absolute;
  left: 20px;
  top: 13px;
  width: 14px;
  height: 22px;
  border-radius: 9px;
  background: var(--white);
}

.mic-orb::after {
  content: "";
  position: absolute;
  left: 17px;
  top: 36px;
  width: 20px;
  height: 8px;
  border-bottom: 3px solid var(--white);
  border-radius: 0 0 14px 14px;
}

.voice-panel p {
  margin: 0;
  color: var(--ink);
  font-size: 0.78rem;
  line-height: 1.42;
}

.voice-card .button-row {
  padding: 0 12px 12px;
}

.ai-action-card {
  background: var(--white);
}

.ai-automation-card {
  border-color: #b7ded8;
}

.compact-list {
  padding-inline: 0;
}

.map-preview {
  position: relative;
  display: grid;
  gap: 6px;
  min-height: 132px;
  align-content: end;
  overflow: hidden;
  padding: 14px;
  border: 1px solid #b8d8d2;
  border-radius: var(--radius);
  color: var(--white);
  background:
    linear-gradient(135deg, rgba(9, 39, 51, 0.86), rgba(13, 107, 103, 0.7)),
    url("assets/campaign/e-port-field-workflow.png") center / cover;
}

.map-preview strong,
.map-preview p {
  position: relative;
  z-index: 1;
  margin: 0;
}

.map-preview strong {
  font-size: 1rem;
}

.map-preview p {
  color: #e8f5f2;
  font-size: 0.72rem;
  line-height: 1.4;
}

.map-pin {
  position: absolute;
  right: 24px;
  top: 22px;
  width: 34px;
  height: 34px;
  border: 8px solid rgba(255, 216, 120, 0.95);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: var(--white);
  box-shadow: 0 0 0 8px rgba(255, 216, 120, 0.16);
}

.route-stops {
  display: grid;
  gap: 7px;
}

.extraction-grid {
  display: grid;
  gap: 7px;
}

.extract-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}

.extract-row span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
}

.extract-row strong {
  min-width: 0;
  overflow: hidden;
  font-size: 0.74rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.devotion-member-app {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 124px;
  gap: 18px;
  align-items: center;
  margin: 18px 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.devotion-member-app > div { display: grid; gap: 8px; }
.devotion-member-app span { color: var(--teal); font-size: 0.72rem; font-weight: 900; letter-spacing: 0.045em; text-transform: uppercase; }
.devotion-member-app h4, .devotion-member-app p { margin: 0; }
.devotion-member-app p { color: var(--muted); line-height: 1.5; }
.devotion-member-app a { width: fit-content; text-decoration: none; }
.devotion-member-app-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.devotion-member-app img { width: 124px; height: 124px; padding: 7px; background: #fff; border: 1px solid var(--line); border-radius: 8px; }

@media (max-width: 520px) {
  .devotion-member-app { grid-template-columns: 1fr; }
  .devotion-member-app img { width: 156px; height: 156px; }
}

.mobile-insights-screen {
  gap: 12px;
}

.insights-hero {
  display: grid;
  gap: 7px;
  padding: 16px;
  color: #ffffff;
  border-radius: var(--radius);
  background: #0b3a49;
}

.insights-hero > span {
  color: #b9dce5;
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.insights-hero h3,
.insights-hero p {
  margin: 0;
}

.insights-hero h3 {
  font-size: 1.2rem;
  line-height: 1.15;
}

.insights-hero p {
  color: #e3f1f4;
  font-size: 0.74rem;
  line-height: 1.48;
}

.insights-hero .secondary-action {
  width: fit-content;
  margin-top: 3px;
  color: #0b3a49;
  border-color: #ffffff;
  background: #ffffff;
}

.insights-classification {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  color: #ffffff;
  border: 1px solid #0b3a49;
  border-radius: var(--radius);
  background: #0b3a49;
}

.insights-classification.is-synthetic {
  color: #4a3300;
  border-color: #d29a31;
  background: #fff2c9;
}

.insights-classification strong {
  font-size: 0.78rem;
  line-height: 1.35;
}

.insights-classification span {
  color: inherit;
  font-size: 0.64rem;
  font-weight: 800;
  line-height: 1.4;
}

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

.insights-metric {
  display: grid;
  min-width: 0;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}

.insights-metric > span {
  color: var(--teal);
  font-size: 0.6rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.insights-metric > strong {
  color: var(--navy);
  font-size: 1.3rem;
  line-height: 1;
}

.insights-metric h3,
.insights-metric p {
  margin: 0;
}

.insights-metric h3 {
  font-size: 0.76rem;
  line-height: 1.25;
}

.insights-metric p {
  color: var(--muted);
  font-size: 0.64rem;
  line-height: 1.4;
}

.insights-metric .status-pill {
  justify-self: start;
  margin-top: 3px;
}

.insights-state.is-unavailable {
  border-left: 4px solid var(--red);
}

.insights-boundary {
  margin: 0;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.45;
}

.insights-exceptions .list-stack {
  padding: 0 12px 12px;
}

.insights-assurance dl {
  display: grid;
  gap: 0;
  margin: 0;
}

.insights-assurance dl > div {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}

.insights-assurance dt,
.insights-assurance dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 0.65rem;
  line-height: 1.4;
}

.insights-assurance dt {
  color: var(--muted);
  font-weight: 900;
}

.insights-assurance ul {
  display: grid;
  gap: 5px;
  margin: 12px 0 0;
  padding-left: 17px;
  color: var(--muted);
  font-size: 0.64rem;
  line-height: 1.45;
}

.tabbar {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 8px 8px 10px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}

.tab-button {
  min-width: 0;
  min-height: 48px;
  gap: 3px;
  padding: 4px 2px;
  color: var(--muted);
  font-size: 0.6rem;
  font-weight: 900;
  overflow: hidden;
}

.tab-button span {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tab-button.ai-tab-button {
  color: var(--white);
  border-color: #082a35;
  background: linear-gradient(135deg, var(--navy), var(--teal));
}

.tab-button.ai-tab-button.is-active {
  color: var(--white);
  border-color: #082a35;
  background:
    radial-gradient(circle at 74% 18%, rgba(255, 216, 120, 0.34), transparent 34%),
    linear-gradient(135deg, var(--navy), var(--teal));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.tab-button.ai-tab-button svg {
  color: #ffe08a;
}

.tab-button svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.4;
}

.tab-button.is-active {
  color: var(--teal);
  border-color: #b9ded8;
  background: #f0faf7;
}

#ecs-mobile-toast {
  position: fixed;
  left: 50%;
  bottom: calc(78px + env(safe-area-inset-bottom));
  z-index: 50;
  max-width: min(360px, calc(100vw - 24px));
  transform: translate(-50%, 120px);
  padding: 12px 14px;
  border-radius: var(--radius);
  color: var(--white);
  background: rgba(9, 39, 51, 0.95);
  box-shadow: var(--shadow);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.35;
  opacity: 0;
  transition: transform 160ms ease, opacity 160ms ease;
}

#ecs-mobile-toast.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

@media (max-width: 900px) {
  .app-workbench {
    grid-template-columns: 1fr;
    gap: 14px;
    align-items: start;
    padding: 14px;
  }

  .strategy-panel {
    order: 2;
    max-width: none;
  }

  .strategy-brand h1 {
    font-size: 1.45rem;
  }

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

  .phone-shell {
    min-height: 0;
  }
}

@media (min-width: 521px) and (max-width: 699px) {
  body {
    background: var(--paper);
  }

  .app-workbench {
    display: block;
    width: 100%;
    max-width: 100vw;
    min-height: 100vh;
    overflow-x: hidden;
    padding: 0;
  }

  .strategy-panel {
    display: none;
  }

  .phone-shell {
    width: 100%;
    max-width: 100vw;
    min-height: 100vh;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: var(--paper);
    box-shadow: none;
  }

  .phone-screen {
    width: 100%;
    max-width: 100vw;
    min-height: 100vh;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
  }

  .app-content {
    padding: 14px;
  }

  .screen-stack {
    max-width: 640px;
    margin: 0 auto;
  }

  .summary-strip {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 700px) and (max-width: 1280px) {
  body {
    background: var(--paper);
  }

  .app-workbench {
    display: block;
    min-height: 100vh;
    padding: 0;
  }

  .strategy-panel {
    display: none;
  }

  .phone-shell {
    width: 100%;
    max-width: none;
    min-height: 100vh;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: var(--paper);
    box-shadow: none;
  }

  .phone-screen {
    min-height: 100vh;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
  }

  .app-header,
  .security-ribbon,
  .tabbar {
    padding-inline: 18px;
  }

  .app-content {
    padding: 16px 18px 18px;
  }

  .screen-stack {
    width: min(100%, 1180px);
    max-width: none;
    margin: 0 auto;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
    gap: 14px;
  }

  .screen-stack > .hero-card,
  .screen-stack > .devotion-card,
  .screen-stack > .ai-intake-banner,
  .screen-stack > .scan-frame,
  .screen-stack > .customer-cms-portal,
  .screen-stack > .customer-note-card,
  .screen-stack > .role-summary-card,
  .screen-stack > .staff-outstanding-work-card,
  .screen-stack > .workflow-jump-nav {
    grid-column: 1 / -1;
  }

  .workflow-jump-nav {
    position: static;
    align-self: start;
    grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  }

  .workflow-jump-nav button {
    display: grid;
    min-height: 48px;
    place-items: center;
    white-space: normal;
  }

  .customer-note-card .cms-note-composer {
    grid-template-columns: minmax(220px, 0.65fr) minmax(0, 1.35fr);
  }

  .customer-note-card .button-row {
    grid-column: 1 / -1;
  }

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

  .role-summary-strip {
    grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
  }

  .staff-outstanding-work-card .list-stack {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }

  .document-grid,
  .client-brief-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  body {
    background: var(--paper);
  }

  .app-workbench {
    display: block;
    min-height: 100vh;
    padding: 0;
  }

  .strategy-panel {
    display: none;
  }

  .desktop-mode-button.is-header {
    display: none;
  }

  .phone-shell {
    width: 100%;
    min-height: 100vh;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: var(--paper);
    box-shadow: none;
  }

  .phone-screen {
    min-height: 100vh;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
  }

  .role-switcher button {
    min-height: 34px;
    padding-inline: 2px;
    font-size: clamp(0.46rem, 1.55vw, 0.56rem);
  }

  .app-header {
    padding-inline: 10px;
    max-width: 100vw;
  }

  .app-title-row {
    grid-template-columns: 46px minmax(0, 1fr) 34px;
    gap: 7px;
  }

  .app-title-row > div:not(.header-actions) {
    min-width: 0;
  }

  .header-logo img {
    width: 46px;
    height: 42px;
  }

  .icon-button {
    width: 34px;
    height: 38px;
  }

  .header-actions {
    min-width: 34px;
  }

  .header-actions .icon-button:first-of-type {
    display: none;
  }

  .role-switcher {
    gap: 4px;
  }

  .security-ribbon,
  .tabbar {
    width: 100%;
    max-width: 100vw;
    padding-inline: 8px;
  }

  .tabbar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 20;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 3px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
  }

  .tab-button {
    min-height: 46px;
    padding-inline: 0;
    font-size: clamp(0.46rem, 1.55vw, 0.54rem);
  }

  .tab-button svg {
    width: 16px;
    height: 16px;
  }

  .security-ribbon {
    grid-template-columns: 1fr 1fr;
  }

  .security-ribbon span:last-child {
    grid-column: 1 / -1;
  }

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

  .app-card > header {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .app-card > header .status-pill {
    justify-self: start;
    max-width: 104px;
    white-space: normal;
  }

  .app-content {
    padding-bottom: 76px;
  }

  .extract-row {
    grid-template-columns: 1fr;
  }

  .data-row {
    grid-template-columns: minmax(0, 1fr) minmax(76px, 38%);
    gap: 7px;
  }

  .data-row > .status-pill,
  .cms-document-list .status-pill {
    max-width: 128px;
    white-space: normal;
  }

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

  .devotion-video {
    min-height: 144px;
  }

  .devotion-detail-grid,
  .document-grid,
  .client-brief-grid,
  .summary-strip {
    grid-template-columns: 1fr;
  }

  .cms-document-list article {
    display: grid;
  }
}
