/* 糖足居家护理指南 · 样式系统
   沿用糖足管理小程序 1.0.5 核心视觉 token（styles/tokens.wxss 与 styles/care.wxss），
   四大独立栏目清晰分区，视频教学按场景差异化分类，适配微信手机端与桌面端舒适阅读。 */

:root {
  /* Core clinical palette from tokens.wxss */
  --tz-ink: #17324F;
  --tz-ink-soft: #4A6078;
  --tz-muted: #5F7388;
  --tz-bg: #F6F8FA;
  --tz-surface: #FFFFFF;
  --tz-surface-tint: #F2F5F8;
  --tz-line: #DCE2E8;
  --tz-line-strong: #C5D1DD;

  /* Action & brand accents */
  --tz-brand: #2563A6;
  --tz-brand-deep: #1B4D85;
  --tz-brand-soft: #EEF5FC;
  --tz-brand-line: #BDD4EC;

  /* Warm reading paper accent from tokens.wxss */
  --care-paper: #F7EEE0;
  --care-paper-line: #E5D4BA;
  --care-paper-ink: #6A4924;

  /* Semantic clinical status colors */
  --tz-success: #1D6B4B;
  --tz-success-bg: #EDF7F1;
  --tz-success-line: #BFE0CE;
  --tz-warning: #7E5515;
  --tz-warning-bg: #FFF6E6;
  --tz-warning-line: #EBD3A5;
  --tz-error: #A9323C;
  --tz-error-bg: #FDF1F2;
  --tz-error-line: #E8BEC2;

  /* Mini-program signature silk-sheen primary button */
  --tz-control-fill:
    linear-gradient(121deg, transparent 32%, rgba(183, 231, 255, 0.12) 49%, transparent 64%) padding-box,
    radial-gradient(125% 145% at 93% -70%, #c7eaff, rgba(119, 187, 255, 0.36) 47%, transparent 74%) padding-box,
    linear-gradient(145deg, #2d77c3, #2161ad 34%, #2b64b8 55%, #387dc0 85%, #377ac1) padding-box;
  --tz-control-shadow:
    inset 0 1px 0 rgba(227, 247, 255, 0.42),
    inset 0 -1px 1px rgba(18, 65, 122, 0.24),
    0 2px 6px rgba(36, 79, 125, 0.16);

  /* Elevation & radii */
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --shadow-low: 0 1px 3px rgba(23, 50, 79, 0.05);
  --shadow-raised: 0 8px 22px -12px rgba(23, 50, 79, 0.16);

  /* Typography: single clean sans family + strict 3-size body scale */
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Helvetica Neue", Arial, sans-serif;
  --fs-brand: 1.25rem;    /* 20px */
  --fs-heading: 1.25rem;  /* 20px */
  --fs-body: 1rem;        /* 16px */
  --fs-sm: 0.875rem;      /* 14px */
  --lh-body: 1.72;
  --touch-min: 44px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Elder-friendly font tiers */
html[data-font="large"] {
  --fs-brand: 1.375rem;
  --fs-heading: 1.4375rem;
  --fs-body: 1.1875rem;
  --fs-sm: 1rem;
  --lh-body: 1.78;
}

html[data-font="extra"] {
  --fs-brand: 1.5rem;
  --fs-heading: 1.625rem;
  --fs-body: 1.375rem;
  --fs-sm: 1.125rem;
  --lh-body: 1.82;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--tz-ink);
  background-color: var(--tz-bg);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button,
input {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: var(--tz-brand);
  text-decoration: none;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--tz-brand);
  outline-offset: 2px;
}

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

/* ===== Sticky Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background-color: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--tz-line);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

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

.brand-mark {
  width: 30px;
  height: 34px;
  flex: none;
}

.brand-text {
  min-width: 0;
}

.brand-title {
  margin: 0;
  font-size: var(--fs-brand);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--tz-ink);
}

.brand-dept {
  margin: 1px 0 0;
  font-size: var(--fs-sm);
  color: var(--tz-ink-soft);
  line-height: 1.35;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Connected Segmented Control (Font Size, Guide Filter Mode, Playback Speed) */
.segmented {
  display: inline-flex;
  align-items: stretch;
  padding: 3px;
  border-radius: 12px;
  background-color: var(--tz-surface-tint);
  border: 1px solid var(--tz-line);
  gap: 2px;
}

.segmented-btn {
  min-height: var(--touch-min);
  padding: 8px 12px;
  border: 0;
  border-radius: 9px;
  background-color: transparent;
  color: var(--tz-ink-soft);
  font-size: var(--fs-sm);
  font-weight: 500;
  white-space: nowrap;
  transition: background-color 160ms var(--ease-out), color 160ms var(--ease-out), box-shadow 160ms var(--ease-out);
}

.segmented-btn:hover {
  color: var(--tz-ink);
}

.segmented-btn[aria-pressed="true"],
.segmented-btn[aria-selected="true"] {
  background-color: var(--tz-surface);
  color: var(--tz-brand);
  font-weight: 650;
  box-shadow: 0 1px 3px rgba(23, 50, 79, 0.12), inset 0 0 0 1px var(--tz-brand-line);
}

.emergency-jump {
  min-height: var(--touch-min);
  padding: 8px 14px;
  border-radius: 12px;
  border: 1px solid var(--tz-error-line);
  background-color: var(--tz-error-bg);
  color: var(--tz-error);
  font-size: var(--fs-sm);
  font-weight: 650;
  white-space: nowrap;
  transition: background-color 160ms var(--ease-out), border-color 160ms var(--ease-out);
}

.emergency-jump:hover {
  background-color: #f9e3e5;
  border-color: #d99fa5;
}

/* ===== Main Container ===== */
.app-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 16px 48px;
}

/* ===== Timely Medical Reminder Bar ===== */
.redflag-bar {
  background-color: var(--tz-error-bg);
  border: 1px solid var(--tz-error-line);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  margin-bottom: 16px;
}

.redflag-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.redflag-lead {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex: 1 1 260px;
  min-width: 0;
}

.redflag-icon {
  width: 22px;
  height: 22px;
  flex: none;
  margin-top: 2px;
  color: var(--tz-error);
}

.redflag-text {
  margin: 0;
  font-size: var(--fs-sm);
  line-height: 1.55;
  color: var(--tz-ink);
}

.redflag-text strong {
  color: var(--tz-error);
  font-weight: 700;
}

.redflag-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.redflag-toggle {
  min-height: var(--touch-min);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--tz-error-line);
  background-color: var(--tz-surface);
  color: var(--tz-error);
  font-size: var(--fs-sm);
  font-weight: 600;
  white-space: nowrap;
  transition: background-color 160ms var(--ease-out);
}

.redflag-toggle:hover {
  background-color: #fff8f8;
}

.redflag-drawer {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--tz-error-line);
}

.redflag-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.redflag-item {
  background-color: var(--tz-surface);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  border-left: 3px solid var(--tz-error);
}

.redflag-item-title {
  margin: 0 0 4px;
  font-size: var(--fs-body);
  font-weight: 650;
  color: var(--tz-error);
  line-height: 1.4;
}

.redflag-item-detail {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--tz-ink);
  line-height: 1.55;
}

.redflag-guidance {
  margin: 14px 0 0;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background-color: var(--tz-surface);
  border: 1px solid var(--tz-error-line);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--tz-error);
  line-height: 1.6;
}

/* ===== Primary 4-Column Navigation & Guide Filters ===== */
.control-band {
  background-color: var(--tz-surface);
  border: 1px solid var(--tz-line);
  border-radius: var(--radius-lg);
  padding: 14px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-low);
}

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

.nav-tile {
  min-height: 68px;
  padding: 12px 12px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--tz-line);
  background-color: var(--tz-bg);
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background-color 160ms var(--ease-out), border-color 160ms var(--ease-out), box-shadow 160ms var(--ease-out), transform 160ms var(--ease-out);
}

.nav-tile:hover {
  background-color: var(--tz-surface);
  border-color: var(--tz-brand-line);
}

.nav-tile[aria-selected="true"] {
  background-color: var(--tz-brand-soft);
  border-color: var(--tz-brand);
  box-shadow: 0 3px 10px -4px rgba(37, 99, 166, 0.25);
}

.nav-tile-icon {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 10px;
  background-color: var(--tz-surface);
  border: 1px solid var(--tz-line);
  color: var(--tz-ink-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 160ms var(--ease-out), color 160ms var(--ease-out), border-color 160ms var(--ease-out);
}

.nav-tile-icon svg {
  width: 20px;
  height: 20px;
}

.nav-tile--video .nav-tile-icon {
  background-color: var(--tz-brand-soft);
  border-color: var(--tz-brand-line);
  color: var(--tz-brand);
}

.nav-tile[aria-selected="true"] .nav-tile-icon {
  background-color: var(--tz-brand);
  border-color: var(--tz-brand);
  color: #ffffff;
}

.nav-tile-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-tile-title {
  font-size: var(--fs-body);
  font-weight: 700;
  color: var(--tz-ink);
  line-height: 1.25;
}

.nav-tile[aria-selected="true"] .nav-tile-title {
  color: var(--tz-brand-deep);
}

.nav-tile-desc {
  font-size: 0.8125rem;
  color: var(--tz-ink-soft);
  line-height: 1.35;
}

html[data-font="large"] .nav-tile-desc {
  font-size: 0.9375rem;
}

html[data-font="extra"] .nav-tile-desc {
  font-size: 1.0625rem;
}

.guides-controls {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--tz-line);
}

.search-row {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}

.search-icon {
  position: absolute;
  left: 14px;
  width: 20px;
  height: 20px;
  color: var(--tz-muted);
  pointer-events: none;
}

.redflag-bar,
.guides-workspace,
.reader-panel,
.panel-section,
.video-theater,
#dailyChecklist,
#abiForm {
  scroll-margin-top: 132px;
}

.search-input {
  width: 100%;
  min-height: 48px;
  padding: 10px 60px 10px 44px;
  border-radius: var(--radius-md);
  border: 1px solid var(--tz-line-strong);
  background-color: var(--tz-bg);
  color: var(--tz-ink);
  font-size: var(--fs-body);
  transition: border-color 160ms var(--ease-out), background-color 160ms var(--ease-out);
}

.search-input::placeholder {
  color: var(--tz-muted);
}

.search-input:focus {
  outline: none;
  background-color: var(--tz-surface);
  border-color: var(--tz-brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 166, 0.14);
}

.search-clear {
  position: absolute;
  right: 4px;
  width: auto;
  min-width: var(--touch-min);
  min-height: var(--touch-min);
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background-color: transparent;
  color: var(--tz-ink-soft);
  font-size: var(--fs-sm);
  font-weight: 600;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.search-clear:hover {
  background-color: var(--tz-surface-tint);
  color: var(--tz-ink);
}

.filter-mode-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
}

.mode-switch {
  flex: none;
}

.subfilter-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px 6px;
  flex: 1 1 280px;
}

.subfilter-btn {
  flex: none;
  min-height: var(--touch-min);
  padding: 8px 12px;
  border: 0;
  border-bottom: 2px solid transparent;
  background-color: transparent;
  color: var(--tz-ink-soft);
  font-size: var(--fs-sm);
  font-weight: 500;
  white-space: nowrap;
  transition: color 160ms var(--ease-out), border-color 160ms var(--ease-out);
}

.subfilter-btn:hover {
  color: var(--tz-ink);
}

.subfilter-btn[aria-selected="true"] {
  color: var(--tz-brand);
  font-weight: 700;
  border-bottom-color: var(--tz-brand);
}

.stage-caption {
  margin: 10px 0 0;
  font-size: var(--fs-sm);
  color: var(--tz-ink-soft);
}

.search-video-hint {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background-color: var(--tz-brand-soft);
  border: 1px solid var(--tz-brand-line);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.search-video-label {
  font-size: var(--fs-sm);
  font-weight: 650;
  color: var(--tz-brand-deep);
}

.search-video-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ===== Guides Master-Detail Layout ===== */
.guides-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.guides-list-panel {
  background-color: var(--tz-surface);
  border: 1px solid var(--tz-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-low);
  overflow: hidden;
}

.list-header {
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--tz-line);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.list-heading {
  margin: 0;
  font-size: var(--fs-heading);
  font-weight: 700;
  color: var(--tz-ink);
  line-height: 1.35;
}

.list-count {
  font-size: var(--fs-sm);
  color: var(--tz-muted);
  white-space: nowrap;
}

.article-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.article-list-item + .article-list-item {
  border-top: 1px solid var(--tz-line);
}

.article-row {
  width: 100%;
  text-align: left;
  border: 0;
  background-color: transparent;
  padding: 18px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  transition: background-color 160ms var(--ease-out);
}

.article-row:hover {
  background-color: var(--tz-bg);
}

.article-row[aria-current="true"] {
  background-color: var(--tz-brand-soft);
  box-shadow: inset 3px 0 0 var(--tz-brand);
}

.article-row-main {
  min-width: 0;
  flex: 1;
}

.article-row-title {
  margin: 0 0 6px;
  font-size: var(--fs-body);
  font-weight: 700;
  color: var(--tz-ink);
  line-height: 1.45;
}

.article-row[aria-current="true"] .article-row-title {
  color: var(--tz-brand-deep);
}

.article-row-summary {
  margin: 0 0 8px;
  font-size: var(--fs-sm);
  color: var(--tz-ink-soft);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-row-meta {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--tz-muted);
  line-height: 1.4;
}

.article-row-chevron {
  width: 20px;
  height: 20px;
  flex: none;
  margin-top: 4px;
  color: var(--tz-muted);
}

.empty-state {
  padding: 40px 20px;
  text-align: center;
}

.empty-state-title {
  margin: 0 0 8px;
  font-size: var(--fs-heading);
  color: var(--tz-ink);
}

.empty-state-copy {
  margin: 0 0 16px;
  font-size: var(--fs-body);
  color: var(--tz-ink-soft);
}

/* ===== Article Reader ===== */
.reader-panel {
  background-color: var(--tz-surface);
  border: 1px solid var(--tz-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-low);
  overflow: hidden;
}

.reader-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 18px;
  background-color: var(--tz-bg);
  border-bottom: 1px solid var(--tz-line);
  flex-wrap: wrap;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: var(--touch-min);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--tz-line-strong);
  background-color: var(--tz-surface);
  color: var(--tz-ink);
  font-size: var(--fs-sm);
  font-weight: 600;
  transition: background-color 160ms var(--ease-out);
}

.back-btn:hover {
  background-color: var(--tz-surface-tint);
}

.audio-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex: 1 1 100%;
  min-width: 0;
  max-width: 100%;
  justify-content: flex-start;
}

.speech-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: var(--touch-min);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--tz-brand-line);
  background-color: var(--tz-brand-soft);
  color: var(--tz-brand-deep);
  font-size: var(--fs-sm);
  font-weight: 650;
  white-space: nowrap;
  transition: background-color 160ms var(--ease-out), color 160ms var(--ease-out);
}

.speech-icon {
  width: 18px;
  height: 18px;
  flex: none;
}

.speech-btn[aria-pressed="true"] {
  background-color: var(--tz-brand);
  color: #ffffff;
  border-color: var(--tz-brand);
}

.audio-progress-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 100%;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  flex-wrap: wrap;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background-color: var(--tz-surface);
  border: 1px solid var(--tz-line);
}

.audio-seek {
  flex: 1 1 72px;
  width: 100%;
  min-width: 48px;
  margin: 0;
  accent-color: var(--tz-brand);
  cursor: pointer;
}

.audio-time {
  font-size: 0.8125rem;
  color: var(--tz-ink-soft);
  white-space: nowrap;
  flex: none;
}

.audio-rate-btn {
  min-height: var(--touch-min);
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--tz-line-strong);
  background-color: var(--tz-bg);
  color: var(--tz-ink);
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
  flex: none;
  transition: background-color 160ms var(--ease-out);
}

.audio-rate-btn:hover {
  background-color: var(--tz-brand-soft);
  border-color: var(--tz-brand-line);
  color: var(--tz-brand-deep);
}

.reader-content {
  padding: 24px 20px 30px;
}

.article-title {
  margin: 0 0 10px;
  font-size: calc(var(--fs-heading) + 4px);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: var(--tz-ink);
}

.article-meta-line {
  margin: 0 0 20px;
  font-size: var(--fs-sm);
  color: var(--tz-ink-soft);
  line-height: 1.5;
}

.takeaway-paper {
  background-color: var(--care-paper);
  border: 1px solid var(--care-paper-line);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-bottom: 24px;
}

.takeaway-heading {
  margin: 0 0 10px;
  font-size: var(--fs-body);
  font-weight: 700;
  color: var(--care-paper-ink);
}

.takeaway-list {
  margin: 0;
  padding-left: 20px;
  color: var(--tz-ink);
}

.takeaway-list li {
  margin-bottom: 8px;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
}

.takeaway-list li:last-child {
  margin-bottom: 0;
}

.article-section {
  padding-top: 22px;
  margin-top: 22px;
  border-top: 1px solid var(--tz-line);
}

.article-section:first-of-type {
  padding-top: 0;
  margin-top: 0;
  border-top: 0;
}

.section-heading {
  margin: 0 0 12px;
  font-size: var(--fs-heading);
  font-weight: 700;
  line-height: 1.4;
  color: var(--tz-ink);
}

.prose-p {
  margin: 0 0 14px;
  max-width: 62ch;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--tz-ink);
}

.prose-p:last-child {
  margin-bottom: 0;
}

.prose-list {
  margin: 0 0 16px;
  padding-left: 22px;
  max-width: 62ch;
}

.prose-list li {
  margin-bottom: 10px;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--tz-ink);
}

.prose-list li:last-child {
  margin-bottom: 0;
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 16px 0 18px;
  padding: 16px;
  background-color: var(--tz-bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--tz-line);
}

.stat-value {
  margin: 0 0 4px;
  font-size: calc(var(--fs-heading) + 2px);
  font-weight: 750;
  color: var(--tz-brand);
  line-height: 1.2;
}

.stat-label {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--tz-ink-soft);
  line-height: 1.45;
}

/* Callouts */
.callout {
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin: 16px 0;
  border-left: 4px solid var(--tz-brand);
  background-color: var(--tz-brand-soft);
}

.callout--warning {
  background-color: var(--tz-warning-bg);
  border-left-color: var(--tz-warning);
}

.callout--danger {
  background-color: var(--tz-error-bg);
  border-left-color: var(--tz-error);
}

.callout-title {
  margin: 0 0 6px;
  font-size: var(--fs-body);
  font-weight: 700;
  color: var(--tz-ink);
}

.callout--warning .callout-title {
  color: var(--tz-warning);
}

.callout--danger .callout-title {
  color: var(--tz-error);
}

.callout-body {
  margin: 0;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--tz-ink);
}

.callout-action {
  margin-top: 12px;
}

.flow-list {
  list-style: none;
  margin: 16px 0 20px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.flow-step {
  padding: 14px 16px;
  background-color: var(--tz-bg);
  border-left: 4px solid var(--tz-brand);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.flow-phase {
  margin: 0 0 4px;
  font-size: var(--fs-body);
  font-weight: 700;
  color: var(--tz-brand-deep);
}

.flow-detail {
  margin: 0;
  font-size: var(--fs-body);
  color: var(--tz-ink);
  line-height: var(--lh-body);
}

.table-wrap {
  margin: 16px 0 18px;
  overflow-x: auto;
  border: 1px solid var(--tz-line);
  border-radius: var(--radius-md);
}

.clinical-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
  line-height: 1.6;
  background-color: var(--tz-surface);
}

.clinical-table caption {
  text-align: left;
  padding: 12px 14px;
  font-weight: 700;
  font-size: var(--fs-body);
  color: var(--tz-ink);
  background-color: var(--tz-bg);
  border-bottom: 1px solid var(--tz-line);
}

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

.clinical-table th {
  font-weight: 700;
  color: var(--tz-ink);
  background-color: var(--tz-surface-tint);
  white-space: nowrap;
}

.clinical-table tr:last-child td {
  border-bottom: 0;
}

.figure-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin: 18px 0 8px;
}

.clinical-figure {
  margin: 0;
  background-color: var(--tz-bg);
  border: 1px solid var(--tz-line);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.figure-trigger {
  display: block;
  width: 100%;
  padding: 10px;
  border: 0;
  background-color: #ffffff;
}

.figure-trigger img {
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  margin: 0 auto;
}

.clinical-figure figcaption {
  padding: 10px 14px;
  font-size: var(--fs-sm);
  color: var(--tz-ink-soft);
  line-height: 1.5;
  border-top: 1px solid var(--tz-line);
}

.references-box {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--tz-line);
}

.references-box summary {
  min-height: var(--touch-min);
  display: flex;
  align-items: center;
  font-size: var(--fs-sm);
  font-weight: 650;
  color: var(--tz-brand);
  cursor: pointer;
}

.references-list {
  margin: 10px 0 0;
  padding-left: 20px;
  font-size: var(--fs-sm);
  color: var(--tz-ink-soft);
  line-height: 1.65;
}

.references-list li {
  margin-bottom: 6px;
}

.reader-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-top: 1px solid var(--tz-line);
  background-color: var(--tz-bg);
  flex-wrap: wrap;
}

.pager-btn {
  min-height: var(--touch-min);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--tz-line-strong);
  background-color: var(--tz-surface);
  color: var(--tz-brand-deep);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-align: left;
  transition: background-color 160ms var(--ease-out);
}

.pager-btn:hover {
  background-color: var(--tz-brand-soft);
}

/* ===== Dedicated Video Teaching Column ===== */
.panel-section {
  background-color: var(--tz-surface);
  border: 1px solid var(--tz-line);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-low);
}

.panel-title {
  margin: 0 0 8px;
  font-size: var(--fs-heading);
  font-weight: 700;
  color: var(--tz-ink);
}

.panel-intro {
  margin: 0 0 20px;
  font-size: var(--fs-body);
  color: var(--tz-ink-soft);
  max-width: 70ch;
}

/* 3 distinct visual chooser cards at top of Video Teaching column */
.video-chooser-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.video-choice-card {
  width: 100%;
  padding: 0;
  border: 2px solid var(--tz-line);
  border-radius: var(--radius-md);
  background-color: var(--tz-surface);
  overflow: hidden;
  text-align: left;
  display: flex;
  flex-direction: column;
  transition: border-color 160ms var(--ease-out), box-shadow 160ms var(--ease-out), transform 160ms var(--ease-out);
}

.video-choice-card:hover {
  border-color: var(--tz-brand-line);
  box-shadow: var(--shadow-raised);
}

.video-choice-card[aria-current="true"] {
  border-color: var(--tz-brand);
  box-shadow: 0 6px 20px -10px rgba(37, 99, 166, 0.34);
  background-color: #fbfdff;
}

.video-choice-card--amber[aria-current="true"] {
  border-color: var(--tz-warning);
  box-shadow: 0 6px 20px -10px rgba(126, 85, 21, 0.28);
  background-color: #fffdf8;
}

.video-choice-card--green[aria-current="true"] {
  border-color: var(--tz-success);
  box-shadow: 0 6px 20px -10px rgba(29, 107, 75, 0.28);
  background-color: #fafdfb;
}

.choice-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: #102135;
  border-bottom: 1px solid var(--tz-line);
  overflow: hidden;
}

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

.thumb-play-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background-color: rgba(23, 50, 79, 0.8);
  border: 2px solid rgba(255, 255, 255, 0.9);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 160ms var(--ease-out), transform 160ms var(--ease-out);
}

.video-choice-card:hover .thumb-play-badge {
  background-color: var(--tz-brand);
  transform: translate(-50%, -50%) scale(1.06);
}

.play-glyph {
  width: 18px;
  height: 18px;
  margin-left: 2px;
}

.thumb-duration {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 3px 8px;
  border-radius: 6px;
  background-color: rgba(16, 33, 53, 0.84);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
}

.choice-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.choice-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.video-cat-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: var(--fs-sm);
  font-weight: 700;
  line-height: 1.3;
}

.video-cat-tag--blue {
  background-color: var(--tz-brand-soft);
  color: var(--tz-brand-deep);
  border: 1px solid var(--tz-brand-line);
}

.video-cat-tag--amber {
  background-color: var(--tz-warning-bg);
  color: var(--tz-warning);
  border: 1px solid var(--tz-warning-line);
}

.video-cat-tag--green {
  background-color: var(--tz-success-bg);
  color: var(--tz-success);
  border: 1px solid var(--tz-success-line);
}

.choice-playing-badge {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--tz-brand);
}

.video-choice-card--amber .choice-playing-badge {
  color: var(--tz-warning);
}

.video-choice-card--green .choice-playing-badge {
  color: var(--tz-success);
}

.choice-title {
  margin: 0 0 8px;
  font-size: var(--fs-heading);
  font-weight: 700;
  color: var(--tz-ink);
  line-height: 1.38;
}

.choice-audience {
  margin: 0 0 12px;
  font-size: var(--fs-sm);
  color: var(--tz-ink-soft);
  line-height: 1.55;
}

.choice-footer-line {
  margin: auto 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--tz-line);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--tz-muted);
}

/* Cinema Theater: Player + Side-by-side Steps */
.video-theater {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  padding-top: 22px;
  border-top: 1px solid var(--tz-line);
  align-items: start;
}

.video-player-card {
  min-width: 0;
}

.theater-player-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  overflow: hidden;
  background-color: #102135;
  box-shadow: var(--shadow-raised);
}

.theater-video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background-color: #102135;
}

.theater-head {
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.theater-tag-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
}

.theater-duration-text {
  font-size: var(--fs-sm);
  color: var(--tz-ink-soft);
}

.theater-title {
  margin: 0;
  font-size: calc(var(--fs-heading) + 2px);
  font-weight: 700;
  color: var(--tz-ink);
  line-height: 1.35;
  letter-spacing: -0.015em;
}

.speed-control-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.speed-label {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--tz-ink-soft);
  white-space: nowrap;
}

.speed-segmented .segmented-btn {
  padding: 6px 12px;
}

.theater-caution {
  margin: 16px 0 0;
}

.video-notes-card {
  background-color: var(--tz-bg);
  border: 1px solid var(--tz-line);
  border-radius: var(--radius-md);
  padding: 18px 20px;
}

.theater-steps-heading {
  margin: 0 0 8px;
  font-size: var(--fs-heading);
  font-weight: 700;
  color: var(--tz-ink);
}

.theater-summary {
  margin: 0 0 14px;
  font-size: var(--fs-sm);
  color: var(--tz-ink-soft);
  line-height: 1.65;
}

.theater-steps {
  margin: 0 0 18px;
  padding-left: 22px;
}

.theater-steps li {
  margin-bottom: 10px;
  font-size: var(--fs-body);
  color: var(--tz-ink);
  line-height: var(--lh-body);
}

.theater-steps li:last-child {
  margin-bottom: 0;
}

.theater-notes-footer {
  padding-top: 14px;
  border-top: 1px solid var(--tz-line);
}

.link-btn {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch-min);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--tz-brand-line);
  background-color: var(--tz-brand-soft);
  color: var(--tz-brand-deep);
  font-size: var(--fs-sm);
  font-weight: 650;
  text-align: left;
  transition: background-color 160ms var(--ease-out);
}

.link-btn:hover {
  background-color: #dfeefb;
}

/* ===== Tools & Booklet Section ===== */
.tools-stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.checklist-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.checklist-row {
  padding: 16px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.checklist-row + .checklist-row {
  border-top: 1px solid var(--tz-line);
}

.checklist-info {
  flex: 1 1 260px;
  min-width: 0;
}

.checklist-title {
  margin: 0 0 4px;
  font-size: var(--fs-body);
  font-weight: 700;
  color: var(--tz-ink);
}

.checklist-prompt {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--tz-ink-soft);
  line-height: 1.55;
}

.checklist-choice .segmented-btn[data-choice="ok"][aria-pressed="true"] {
  background-color: var(--tz-success-bg);
  color: var(--tz-success);
  box-shadow: inset 0 0 0 1px var(--tz-success-line);
}

.checklist-choice .segmented-btn[data-choice="flag"][aria-pressed="true"] {
  background-color: var(--tz-error-bg);
  color: var(--tz-error);
  box-shadow: inset 0 0 0 1px var(--tz-error-line);
}

.tool-result {
  margin-top: 16px;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  background-color: var(--tz-bg);
  border: 1px solid var(--tz-line);
}

.tool-result--ok {
  background-color: var(--tz-success-bg);
  border-color: var(--tz-success-line);
  color: var(--tz-success);
}

.tool-result--warn {
  background-color: var(--tz-warning-bg);
  border-color: var(--tz-warning-line);
  color: var(--tz-warning);
}

.tool-result--danger {
  background-color: var(--tz-error-bg);
  border-color: var(--tz-error-line);
  color: var(--tz-error);
}

.tool-result-title {
  margin: 0 0 6px;
  font-size: var(--fs-body);
  font-weight: 700;
}

.tool-result-copy {
  margin: 0;
  font-size: var(--fs-body);
  color: var(--tz-ink);
  line-height: 1.6;
}

.abi-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  align-items: end;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--tz-ink);
}

.field-input {
  min-height: 48px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--tz-line-strong);
  background-color: var(--tz-bg);
  color: var(--tz-ink);
  font-size: var(--fs-body);
}

.field-input:focus {
  outline: none;
  background-color: var(--tz-surface);
  border-color: var(--tz-brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 166, 0.14);
}

.primary-cta {
  min-height: 48px;
  padding: 10px 22px;
  border: 0;
  border-radius: 999px;
  background: var(--tz-control-fill);
  color: #ffffff;
  font-size: var(--fs-body);
  font-weight: 650;
  box-shadow: var(--tz-control-shadow);
  transition: transform 140ms var(--ease-out), opacity 140ms var(--ease-out);
}

.primary-cta:hover {
  opacity: 0.95;
}

.primary-cta:active {
  transform: scale(0.985);
}

/* Booklet Gallery */
.booklet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.booklet-tile {
  padding: 0;
  border: 1px solid var(--tz-line);
  border-radius: var(--radius-md);
  background-color: var(--tz-surface);
  overflow: hidden;
  text-align: left;
  transition: border-color 160ms var(--ease-out), transform 160ms var(--ease-out);
}

.booklet-tile:hover {
  border-color: var(--tz-brand);
  transform: translateY(-2px);
}

.booklet-tile img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-bottom: 1px solid var(--tz-line);
}

.booklet-caption {
  padding: 10px 12px;
  font-size: var(--fs-sm);
  color: var(--tz-ink);
  font-weight: 550;
  line-height: 1.45;
}

/* ===== Footer ===== */
.site-footer {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--tz-line);
  color: var(--tz-ink-soft);
  font-size: var(--fs-sm);
  line-height: 1.65;
}

.footer-disclaimer {
  margin: 0 0 10px;
  max-width: 72ch;
}

.footer-dept {
  margin: 0;
  color: var(--tz-muted);
}

/* ===== Lightbox Modal ===== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background-color: rgba(16, 33, 53, 0.88);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.lightbox-bar {
  width: 100%;
  max-width: 1040px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  color: #ffffff;
}

.lightbox-title {
  margin: 0;
  font-size: var(--fs-body);
  font-weight: 600;
}

.lightbox-close {
  min-width: var(--touch-min);
  min-height: var(--touch-min);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.35);
  background-color: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-size: var(--fs-sm);
  font-weight: 600;
}

.lightbox-stage {
  max-width: 1040px;
  max-height: 76vh;
  overflow: auto;
  border-radius: var(--radius-md);
  background-color: #ffffff;
  padding: 8px;
}

.lightbox-stage img {
  max-height: 72vh;
  width: auto;
  margin: 0 auto;
}

.lightbox-nav {
  margin-top: 12px;
  display: flex;
  gap: 12px;
}

/* ===== Search Highlight ===== */
mark.hl {
  background-color: #fff0b3;
  color: var(--tz-ink);
  padding: 0 2px;
  border-radius: 3px;
}

/* ===== Responsive Breakpoints ===== */
@media (max-width: 959px) {
  .guides-workspace[data-mobile-view="list"] .reader-panel {
    display: none;
  }

  .guides-workspace[data-mobile-view="detail"] .guides-list-panel {
    display: none;
  }

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

@media (min-width: 720px) {
  .primary-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
  }

  .video-chooser-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
  }

  .video-choice-card:hover {
    transform: translateY(-2px);
  }
}

@media (min-width: 960px) {
  .redflag-bar,
  .guides-workspace,
  .reader-panel,
  .panel-section,
  .video-theater,
  #dailyChecklist,
  #abiForm {
    scroll-margin-top: 96px;
  }

  .header-inner {
    flex-wrap: nowrap;
    padding: 12px 24px;
  }

  .app-shell {
    padding: 20px 24px 64px;
  }

  .control-band {
    padding: 16px 18px;
  }

  .guides-workspace {
    grid-template-columns: 360px minmax(0, 1fr);
    gap: 24px;
  }

  .guides-list-panel {
    position: sticky;
    top: 84px;
    max-height: calc(100vh - 104px);
    display: flex;
    flex-direction: column;
  }

  .article-list {
    overflow-y: auto;
  }

  .back-btn {
    display: none;
  }

  .audio-bar {
    flex: 1 1 auto;
    justify-content: flex-end;
  }

  .audio-progress-wrap {
    flex: 1 1 240px;
    width: auto;
    max-width: 400px;
    flex-wrap: nowrap;
  }

  .reader-content {
    padding: 30px 36px 36px;
  }

  .videos-shell {
    padding: 24px 26px 28px;
  }

  .video-theater {
    grid-template-columns: minmax(0, 1.38fr) minmax(320px, 0.92fr);
    gap: 24px;
  }

  .video-notes-card {
    position: sticky;
    top: 84px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
