/* App palette derived from the Florence mark: petrol, muted turquoise, ivory.
   Content categories use quiet tonal variations, not unrelated signal colours.
   Amber is reserved for warnings; error styling remains untouched. */
body.application {
  --florence-ink: #183b43;
  --florence-petrol: #205c68;
  --florence-petrol-deep: #174752;
  --florence-teal: #367c82;
  --florence-turquoise: #589ca2;
  --florence-mist: #edf6f6;
  --florence-tint: #dcecee;
  --florence-line: #b7d2d5;
  --florence-muted: #526e75;
  --ink: var(--florence-ink);
  --blue: var(--florence-petrol);
  --teal: var(--florence-teal);
  --muted: var(--florence-muted);
  --pale: var(--florence-mist);
  --line: #d4e2e5;
  --bg: #f4f7f8;
  --green: #e5f1ef;
  --amber: #fff4e3;
  --foundation-bg: #edf6f6;
  --foundation-line: #9fc4c8;
  --foundation-ink: #245e66;
  --carelit-bg: #eaf2f5;
  --carelit-line: #9ebfc9;
  --carelit-ink: #205564;
  --international-bg: #f0f5f7;
  --international-line: #afc5ce;
  --international-ink: #345968;
  --learning-bg: #f2f6f6;
  --learning-line: #b1c9cc;
  --learning-ink: #345c64;
  color: var(--ink);
  background: var(--bg);
}

/* Shared controls and feedback: contrast and text labels carry meaning. */
.application .primary,
.application .portal-search button {
  background: var(--florence-petrol);
  border-color: var(--florence-petrol);
  color: #fff;
}
.application .primary:hover,
.application .portal-search button:hover,
.application .app-header form[role=search] button:hover {
  background: var(--florence-petrol-deep);
}
.application :is(button, a, input, select, textarea, summary):focus-visible {
  outline: 3px solid var(--florence-petrol);
  outline-offset: 3px;
}
.application .app-corpus-badge { border-color: var(--florence-turquoise); color: var(--florence-petrol); }
.application .app-corpus-badge strong { color: var(--florence-petrol); }
.application :is(.tag.green, .success, .reading-fresh, .quiz-feedback:not(.wrong)) {
  background: var(--green);
  color: var(--foundation-ink);
  border-color: var(--foundation-line);
}
.application :is(.warning, .reading-pending, .quiz-feedback.wrong, .tag.draft) {
  background: var(--amber);
  color: #79521d;
  border-color: #c59146;
}

/* The fixed orientation header stays calm; the selected tab is unmistakable. */
.application .course-location-header {
  background: #f1f7f7;
  border-color: var(--florence-line);
  box-shadow: 0 5px 16px #183b4310;
}
.application :is(.course-breadcrumbs, .course-goal) { color: var(--florence-muted); }
.application :is(.course-breadcrumbs a, .course-curriculum, .course-history button) { color: var(--florence-petrol); }
.application .course-history button { border-color: var(--florence-line); }
.application .course-tab { color: var(--florence-petrol); }
.application .course-tab:hover { background: var(--florence-tint); }
.application .course-tabs .course-tab.is-current {
  background: var(--florence-petrol);
  color: #fff;
  border-color: var(--florence-petrol);
  border-bottom-color: var(--florence-petrol-deep);
}
.application :is(.course-literature-tabs, .course-chapter-tabs, .course-header-pager) { border-top-color: var(--florence-line); }
.application .course-chapter-page { background: var(--foundation-bg); border-color: var(--foundation-line); }
.application .navigator-current { background: var(--foundation-bg); border-color: var(--foundation-line); }
.application .navigator-tree .tree-leaf.active { background: var(--florence-tint); color: var(--foundation-ink); }

/* Textbook pages, chapter lists and learning exercises use the same family. */
.application .textbook-introduction { border-top-color: var(--florence-teal); }
.application .textbook-introduction :is(.course-foundation-goal, .course-foundation-transfer) {
  background: var(--florence-tint);
  border-color: var(--foundation-line);
}
.application .textbook-introduction .course-chapter-path button {
  background: #f9fcfc;
  border-color: var(--foundation-line);
  color: var(--foundation-ink);
}
.application .textbook-introduction .course-chapter-path button:hover { background: var(--florence-tint); }
.application .textbook-introduction .course-chapter-path button>span:first-child { background: var(--florence-tint); }
.application :is(.book-toc-tools, .book-toc-group>summary) { background: var(--foundation-bg); border-color: var(--foundation-line); color: var(--foundation-ink); }
.application :is(.book-toc-group, .book-reader-nav, .book-toc-group li+li) { border-color: var(--florence-line); }
.application :is(.book-toc-group>summary small, .book-reader-nav small) { color: var(--florence-muted); }
.application .book-toc-number { background: var(--florence-tint); }
.application .florence-book-icon { background: linear-gradient(145deg,#edf6f6,#dcecee); border-color: var(--florence-line); color: var(--florence-teal); }
.application .textbook-library-grid>a { border-top-color: var(--florence-teal); }
.application .case-solution { background: var(--foundation-bg); border-color: var(--foundation-line); }
.application .case-solution summary { color: var(--foundation-ink); }

/* Both literature access paths stay distinct by name, not yellow vs. blue. */
.application .source-ref {
  background: var(--domain-bg,var(--carelit-bg))!important;
  color: var(--domain-ink,var(--carelit-ink))!important;
  border-color: var(--domain-line,var(--carelit-line))!important;
}
.application .source-ref:hover,
.application .source-ref:focus-visible { background: var(--florence-tint)!important; border-color: var(--florence-petrol)!important; }
.application .source-preview-placeholder,
.application #articleDetailModal .source-preview-placeholder[data-provider=carelit] {
  background: var(--carelit-bg)!important; color: var(--carelit-ink)!important; border-color: var(--carelit-line)!important;
}
.application .source-preview-placeholder[data-provider=euvimed],
.application #articleDetailModal .source-preview-placeholder[data-provider=euvimed] {
  background: var(--international-bg)!important; color: var(--international-ink)!important; border-color: var(--international-line)!important;
}
.application #articleDetailModal {
  --dm-blue: var(--florence-petrol);
  --dm-sky: var(--florence-teal);
  --dm-ink: var(--florence-ink);
  --dm-muted: var(--florence-muted);
  --dm-line: var(--florence-line);
  --dm-soft: var(--florence-mist);
  --dm-bg: var(--bg);
}
.application #articleDetailModal[data-learning-domain=international] {
  --dm-bg: var(--international-bg);
  --dm-line: var(--international-line);
}
.application #articleDetailModal[data-learning-domain=international] .ff-detail-shell { background: var(--international-bg)!important; }
.application .portal-home-sources [data-tone=foundations],
.application .portal-shortcut[data-tone=foundations] .portal-shortcut-icon {
  background: var(--foundation-bg); color: var(--foundation-ink); border-color: var(--foundation-line);
}
.application .portal-home-sources [data-tone=carelit] { background: var(--carelit-bg); color: var(--carelit-ink); border-color: var(--carelit-line); }
.application .portal-home-sources [data-tone=international] { background: var(--international-bg); color: var(--international-ink); border-color: var(--international-line); }
.application .portal-shortcut[data-tone=personal] .portal-shortcut-icon { background: var(--learning-bg); color: var(--learning-ink); }
.application .portal-shortcut-icon { background: var(--carelit-bg); color: var(--carelit-ink); }
.application :is(.portal-home-hero, .hero, .room-hero) { background: linear-gradient(115deg,#183b43,#286572); }
.application :is(.book-hero, .room-banner) { background: linear-gradient(120deg,#eaf3f5,#f2f8f7); }
.application .book-navigation a[aria-current=page] { background: var(--florence-petrol); }
.application .learning-link-box { background: var(--florence-mist); border-color: var(--florence-line); border-left-color: var(--florence-teal); }
.application .learning-link-box .learning-link-heading { color: var(--florence-petrol); }
.application .learning-link-icon { background: var(--florence-tint); color: var(--florence-petrol); }

@media (forced-colors: active) {
  .application .course-tabs .course-tab.is-current { border: 2px solid Highlight; border-bottom-width: 4px; }
}
@media print {
  .application .course-location-header { background: white; border: 0; box-shadow: none; }
}
