:root {
  --bg: #eef5f7;
  --bg-deep: #dcecf0;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-strong: rgba(255, 255, 255, 0.97);
  --ink: #0b2341;
  --ink-soft: #4f657d;
  --brand-navy: #0b2341;
  --brand-blue: #1f4e79;
  --brand-teal: #59c0d1;
  --brand-teal-deep: #288190;
  --brand-magenta: #aa1b5e;
  --accent: var(--brand-teal);
  --accent-strong: var(--brand-teal-deep);
  --accent-soft: rgba(89, 192, 209, 0.14);
  --line: rgba(11, 35, 65, 0.12);
  --shadow: 0 24px 60px rgba(11, 35, 65, 0.14);
  --radius-lg: 26px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --sticky-header-top: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  /* font-family: 'Work Sans', 'Segoe UI', sans-serif; */
  color: var(--ink);
  background:#59C0D1;
    /* color: #0B2341; */
    /* radial-gradient(circle at top left, rgba(89, 192, 209, 0.34), transparent 28%),
    radial-gradient(circle at top right, rgba(170, 27, 94, 0.14), transparent 22%),
    linear-gradient(180deg, #f7fbfc 0%, var(--bg) 48%, var(--bg-deep) 100%); */
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(11, 35, 65, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(11, 35, 65, 0.025) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.18), transparent 75%);
}

.page-shell {
  position: relative;
  max-width: 1240px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}

.hero,
.collection-panel,
.table-card {
  backdrop-filter: blur(16px);
}

.hero {
  margin-bottom: 24px;
}

.hero-copy,
.collection-panel,
.table-card {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.56);
  box-shadow: var(--shadow);
}

.hero-copy {
  position: relative;
  padding: 24px 32px 26px;
  border-radius: var(--radius-lg);
  color: #ffffff;
  background:#0B2341;
    /* radial-gradient(circle at top right, rgba(89, 192, 209, 0.28), transparent 32%),
    linear-gradient(135deg, #0b2341 0%, #13385f 54%, #1a496f 100%); */
  overflow: hidden;
}

.hero-copy::after {
  content: '';
  position: absolute;
  inset: auto -8% -32% auto;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  /* background: radial-gradient(circle, rgba(89, 192, 209, 0.34) 0%, rgba(89, 192, 209, 0) 70%); */
  pointer-events: none;
}

.hero-top {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
}

.hero-actions {
  display: grid;
  width: min(240px, 100%);
  justify-items: stretch;
  gap: 10px;
  padding: 12px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(89, 192, 209, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.hero-actions .hero-badge {
  width: 100%;
}

.eyebrow,
.section-kicker {
  margin: 0 0 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  font-size: 0.78rem;
  color: var(--accent-strong);
}

.hero-copy .eyebrow {
  color: rgba(255, 255, 255, 0.82);
}

h1,
h2,
h3 {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  /* font-family: 'Fraunces', Georgia, serif; */
  line-height: 1.05;
}

h1 {
  font-size: clamp(2.2rem, 4vw, 3.8rem);
  max-width: 12ch;
}

h2 {
  font-size: clamp(1.6rem, 2vw, 2.3rem);
}

.hero-text,
.empty-state p,
.status-message,
.table-summary,
.selection-summary {
  color: var(--ink-soft);
}

.hero-copy h1,
.hero-copy .hero-text {
  position: relative;
  z-index: 1;
}

.hero-copy h1 {
  max-width: 28ch;
}

.hero-break {
  display: block;
}

.hero-text {
  max-width: 60ch;
  margin: 14px 0 0;
  font-size: 1.05rem;
  line-height: 1.7;
}

.hero-copy .hero-text {
  color: rgba(255, 255, 255, 0.86);
}

.brand-logo {
  position: relative;
  z-index: 1;
  display: block;
  width: min(280px, 100%);
  margin-bottom: 18px;
}

.hero-badge {
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid rgba(89, 192, 209, 0.36);
  border-radius: 999px;
  /* background: rgba(89, 192, 209, 0.14); */
  /* color: #ffffff; */
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition:
    transform 160ms ease,
    background 160ms ease,
    border-color 160ms ease;
}

.hero-badge:hover {
  transform: translateY(-1px);
}

.hero-badge[data-active='true'] {
  background: #ffffff;
  border-color: transparent;
  color: var(--brand-navy);
}

.hero-update-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(255, 240, 246, 0.94);
  border: 1px solid rgba(170, 27, 94, 0.42);
  color: var(--brand-magenta);
  font-size: 0.95rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  transition:
    transform 160ms ease,
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.hero-update-link:hover {
  transform: translateY(-1px);
  background: rgba(255, 227, 237, 0.98);
  border-color: rgba(170, 27, 94, 0.52);
  color: var(--brand-magenta);
}

.hero-update-link:focus-visible {
  outline: 2px solid rgba(89, 192, 209, 0.32);
  outline-offset: 2px;
  border-radius: 6px;
}

.library-layout {
  display: grid;
  gap: 24px;
}

.collection-panel,
.table-card {
  border-radius: var(--radius-lg);
  padding: 24px;
}

.collection-panel {
  background: #ffffff;
    /* linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 252, 252, 0.92)),
    var(--surface); */
}

.table-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.table-summary {
  margin: 0;
  font-size: 0.95rem;
}

.collection-header {
  margin-bottom: 16px;
}

.collection-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.collection-card {
  display: grid;
  gap: 10px;
  min-height: 100%;
  padding: 18px 16px 16px;
  border: 1px solid rgba(11, 35, 65, 0.1);
  border-radius: 22px;
  background: #0B2341 /*linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 251, 252, 0.98));*/
  color: var(--brand-navy);
  text-align: left;
  box-shadow: 0 16px 28px rgba(11, 35, 65, 0.08);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.collection-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 5px;
  background: #0B2341;
    /* linear-gradient(90deg, var(--brand-teal) 0%, var(--brand-blue) 62%, var(--brand-magenta) 100%); */
}

.collection-card:hover {
  transform: translateY(-2px);
  border-color: rgba(89, 192, 209, 0.55);
  box-shadow: 0 18px 34px rgba(11, 35, 65, 0.12);
}

.collection-card[data-active='true'] {
  color: #ffffff;
  border-color: rgba(89, 192, 209, 0.34);
  background: #0B2341; /*linear-gradient(180deg, rgba(15, 46, 79, 0.98), rgba(27, 82, 120, 0.98));*/
  box-shadow: 0 22px 36px rgba(11, 35, 65, 0.16);
  outline: 2px solid rgba(89, 192, 209, 0.18);
  outline-offset: 4px;
}

.collection-card-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-magenta);
}

.collection-card-label::before {
  content: '';
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--brand-teal);
  box-shadow: 0 0 0 5px rgba(89, 192, 209, 0.16);
}

.collection-card[data-active='true'] .collection-card-label,
.collection-card[data-active='true'] .collection-card-title,
.collection-card[data-active='true'] .collection-card-intro,
.collection-card[data-active='true'] .collection-card-point {
  color: #ffffff;
}

.collection-card-title {
  font-size: 1rem;
  line-height: 1.18;
}

.collection-card-intro {
  font-size: 0.85rem;
  line-height: 1.42;
  color: var(--ink-soft);
}

.collection-card-points {
  display: grid;
  gap: 7px;
}

.collection-card-point {
  display: grid;
  grid-template-columns: 11px 1fr;
  gap: 8px;
  align-items: start;
  font-size: 0.82rem;
  line-height: 1.38;
  color: var(--ink);
}

.collection-card-point::before {
  content: '';
  width: 6px;
  height: 6px;
  margin-top: 0.34rem;
  border-radius: 50%;
  background: var(--brand-teal);
  box-shadow: 0 0 0 3px rgba(89, 192, 209, 0.16);
}

.collection-card[data-active='true'] .collection-card-point::before {
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.18);
}

.collection-card-cta {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 40px;
  margin-top: auto;
  padding: 0 14px;
  border-radius: 999px;
  background: #0B2341; /*linear-gradient(135deg, var(--brand-blue) 0%, #2a7194 100%);*/
  color: #ffffff;
  font-size: 0.84rem;
  font-weight: 700;
  text-align: center;
  box-shadow: 0 10px 18px rgba(31, 78, 121, 0.16);
}

.collection-card[data-active='true'] .collection-card-cta {
  background: #ffffff;
  color: var(--brand-navy);
  box-shadow: none;
}

.search-shell {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(239, 248, 250, 0.97));
  border: 1px solid rgba(89, 192, 209, 0.24);
  box-shadow: 0 12px 24px rgba(11, 35, 65, 0.08);
}

.search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.search-field {
  display: grid;
  gap: 8px;
}

.search-label {
  color: var(--brand-magenta);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.search-field input {
  width: 100%;
  min-height: 48px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--ink);
  font: inherit;
}

.search-submit {
  min-width: 120px;
}

.search-field input:focus,
.button:focus {
  outline: 2px solid rgba(89, 192, 209, 0.32);
  outline-offset: 2px;
}

.start-prompt {
  margin-top: 18px;
  padding: 18px 20px;
  border-radius: 20px;
  border: 1px dashed rgba(40, 129, 144, 0.32);
  background: linear-gradient(135deg, rgba(89, 192, 209, 0.12), rgba(255, 255, 255, 0.92));
}

.start-prompt strong,
.start-prompt p {
  margin: 0;
}

.start-prompt p {
  margin-top: 4px;
  color: var(--ink-soft);
}

.inline-library-trigger {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--brand-magenta);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.16em;
}

.inline-library-trigger:hover {
  color: var(--brand-blue);
}

.inline-library-trigger:focus-visible {
  outline: 2px solid rgba(89, 192, 209, 0.32);
  outline-offset: 2px;
  border-radius: 6px;
}

.subcategory-panel {
  margin-top: 18px;
  padding: 20px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(232, 244, 248, 0.98));
  border: 1px solid rgba(89, 192, 209, 0.34);
  box-shadow: 0 16px 32px rgba(11, 35, 65, 0.08);
  scroll-margin-top: 24px;
}

.subcategory-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.section-next-step {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 14px;
  padding: 10px 14px;
  border-radius: 16px;
  border: 1px solid rgba(31, 78, 121, 0.12);
  background: linear-gradient(135deg, rgba(31, 78, 121, 0.08), rgba(89, 192, 209, 0.12));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  color: var(--brand-navy);
}

.section-next-step-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--brand-navy);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.section-next-step-text {
  font-size: 0.95rem;
  font-weight: 700;
}

.subcategory-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(89, 192, 209, 0.22);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(244, 250, 252, 0.92));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.subcategory-card {
  min-height: 52px;
  padding: 0 18px;
  border: 1px solid rgba(11, 35, 65, 0.16);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 250, 251, 0.96));
  box-shadow: 0 6px 16px rgba(11, 35, 65, 0.06);
  color: var(--brand-navy);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.subcategory-card:hover {
  transform: translateY(-1px);
  border-color: rgba(89, 192, 209, 0.52);
  box-shadow: 0 12px 24px rgba(11, 35, 65, 0.08);
}

.subcategory-card[data-active='true'] {
  border-color: transparent;
  background: linear-gradient(135deg, var(--brand-blue) 0%, #2a7194 100%);
  color: #ffffff;
}

.arrival-target {
  position: relative;
}

.arrival-target.is-arriving {
  animation: arrival-highlight 1.8s ease-out 1;
}

@keyframes arrival-highlight {
  0% {
    box-shadow: 0 0 0 0 rgba(89, 192, 209, 0), 0 0 0 0 rgba(176, 32, 103, 0);
  }
  20% {
    box-shadow: 0 0 0 8px rgba(89, 192, 209, 0.12), 0 0 0 1px rgba(176, 32, 103, 0.12);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(89, 192, 209, 0), 0 0 0 0 rgba(176, 32, 103, 0);
  }
}

.library-actions {
  display: grid;
  gap: 12px;
}

.action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(11, 35, 65, 0.08);
  transition:
    box-shadow 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.action-bar[data-sticky='true'] {
  box-shadow: 0 18px 34px rgba(11, 35, 65, 0.14);
  border-color: rgba(170, 27, 94, 0.18);
  background: rgba(255, 255, 255, 0.96);
}

.selection-summary {
  font-weight: 600;
  color: var(--brand-navy);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.clear-selection-stack {
  display: grid;
  justify-items: stretch;
  gap: 5px;
  inline-size: 176px;
}

.clear-selection-helper {
  margin: 0;
  color: var(--brand-magenta);
  font-size: 0.72rem;
  line-height: 1.22;
  text-align: center;
}

.clear-selection-helper-line {
  display: block;
}

.button {
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: wait;
  /* opacity: 0.55; */
  transform: none;
}

.button-primary {
  background: #0B2341;
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(31, 78, 121, 0.2);
}

.button-secondary {
  background: var(--brand-navy);
  border-color: transparent;
  color: #ffffff;
}

.button-ghost {
  background: transparent;
  color: var(--ink);
}

.status-panel {
  display: grid;
  gap: 12px;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.64);
  border: 1px solid rgba(25, 51, 45, 0.08);
}

.status-panel[hidden] {
  display: none;
}

.status-message {
  margin: 0;
  font-size: 0.95rem;
}

.status-message[data-tone='error'] {
  color: #9b1c1c;
}

.status-message[data-tone='success'] {
  color: var(--accent-strong);
}

.table-select-toggle {
  margin: -2px 0 16px;
  padding: 12px 16px;
  border: 1px solid rgba(11, 35, 65, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.76);
}

.table-select-label {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  color: var(--brand-navy);
  cursor: pointer;
}

.table-select-label input {
  inline-size: 18px;
  block-size: 18px;
  accent-color: var(--brand-magenta);
}

.table-wrap {
  overflow-x: auto;
}

.library-table {
  width: 100%;
  border-collapse: collapse;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.library-table th,
.library-table td {
  padding: 16px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.library-table thead {
  background: rgba(89, 192, 209, 0.18);
}

.library-table th {
  font-size: 0.88rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--brand-navy);
  background: linear-gradient(180deg, rgba(223, 242, 246, 0.98), rgba(213, 237, 241, 0.98));
  box-shadow: inset 0 -1px 0 rgba(11, 35, 65, 0.08), 0 8px 18px rgba(11, 35, 65, 0.06);
}

.library-table th[aria-sort='ascending'],
.library-table th[aria-sort='descending'] {
  background: linear-gradient(180deg, rgba(206, 237, 242, 0.99), rgba(189, 229, 236, 0.98));
}

.library-sort-shell {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 100%;
  justify-content: space-between;
  gap: 8px;
}

.library-sort-label {
  color: inherit;
}

.library-sort-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid rgba(11, 35, 65, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: inherit;
  cursor: pointer;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}

.library-sort-trigger::before {
  content: '';
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid currentColor;
}

.library-sort-trigger[data-open='true']::before {
  transform: rotate(180deg) translateY(1px);
}

.library-sort-trigger:hover,
.library-sort-trigger[data-open='true'] {
  color: var(--brand-blue);
  border-color: rgba(31, 78, 121, 0.22);
  background: rgba(255, 255, 255, 0.96);
}

.library-sort-trigger[data-active='true'] {
  color: var(--brand-blue);
  background: rgba(89, 192, 209, 0.18);
  border-color: rgba(31, 78, 121, 0.28);
}

.library-sort-trigger:focus-visible,
.library-sort-option:focus-visible {
  outline: 2px solid var(--brand-teal-deep);
  outline-offset: 4px;
  border-radius: 999px;
}

.library-sort-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 20;
  display: grid;
  gap: 6px;
  min-width: 220px;
  padding: 8px;
  border: 1px solid rgba(11, 35, 65, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 32px rgba(11, 35, 65, 0.16);
}

.library-sort-menu[hidden] {
  display: none;
}

.library-sort-primary-options {
  display: grid;
  gap: 6px;
}

.library-sort-filter-options {
  display: grid;
  gap: 6px;
  max-height: 188px;
  margin-top: 2px;
  padding-top: 8px;
  border-top: 1px solid rgba(11, 35, 65, 0.08);
  overflow-y: auto;
}

.library-sort-filter-options:empty {
  display: none;
}

.library-sort-filter-option {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(11, 35, 65, 0.03);
  cursor: pointer;
}

.library-sort-filter-option:hover {
  background: rgba(89, 192, 209, 0.12);
}

.library-sort-filter-checkbox {
  margin: 2px 0 0;
  accent-color: var(--brand-blue);
}

.library-sort-filter-checkbox:focus-visible {
  outline: 2px solid var(--brand-teal-deep);
  outline-offset: 2px;
}

.library-sort-filter-text {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: normal;
  text-transform: none;
  color: var(--brand-navy);
}

.library-sort-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: rgba(11, 35, 65, 0.05);
  color: var(--brand-navy);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}

.library-sort-option:hover {
  background: rgba(89, 192, 209, 0.16);
  color: var(--brand-blue);
}

.library-sort-option[data-active='true'] {
  color: #ffffff;
  background: var(--brand-blue);
}

.library-table tbody tr {
  background: rgba(255, 255, 255, 0.74);
  transition:
    background 160ms ease,
    box-shadow 160ms ease;
}

.library-table tbody tr:nth-child(odd) {
  background: rgba(255, 255, 255, 0.82);
}

.library-table tbody tr:nth-child(even) {
  background: rgba(232, 243, 246, 0.72);
}

.library-table tbody tr:hover {
  background: rgba(89, 192, 209, 0.14);
}

.library-table tbody tr[data-selected='true'] {
  background: rgba(170, 27, 94, 0.08);
}

.title-cell {
  font-weight: 600;
  color: var(--brand-navy);
}

.table-link {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  min-width: 150px;
  padding: 10px 14px;
  border-radius: 16px;
  border: 1px solid transparent;
  font-weight: 600;
  text-decoration: none;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.table-link:hover {
  transform: translateY(-1px);
  text-decoration: none;
}

.table-link-view {
  color: var(--brand-navy);
  background: linear-gradient(135deg, rgba(89, 192, 209, 0.16), rgba(89, 192, 209, 0.08));
  border-color: rgba(89, 192, 209, 0.28);
}

.table-link-download {
  color: #ffffff;
  background: linear-gradient(135deg, var(--brand-magenta) 0%, #c03273 100%);
  box-shadow: 0 12px 20px rgba(170, 27, 94, 0.16);
}

.action-label {
  font-size: 0.94rem;
}

.action-meta {
  font-size: 0.78rem;
  font-weight: 500;
}

.table-link-view .action-meta {
  color: var(--ink-soft);
}

.table-link-download .action-meta {
  color: rgba(255, 255, 255, 0.82);
}

.checkbox-cell input {
  inline-size: 18px;
  block-size: 18px;
  accent-color: var(--brand-magenta);
}

.empty-state {
  margin-top: 16px;
  padding: 24px;
  border: 1px dashed rgba(25, 51, 45, 0.24);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.48);
}

.empty-state h3 {
  margin-bottom: 10px;
}

.print-frame {
  position: fixed;
  width: 0;
  height: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.viewer-shell {
  --viewer-sticky-heading-bottom: 0px;
  position: relative;
  display: grid;
  gap: 18px;
  padding: 24px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.56);
  box-shadow: var(--shadow);
}

.viewer-mobile-controls-bar {
  display: none;
}

.viewer-index-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  justify-self: start;
  width: auto;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(11, 35, 65, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--brand-navy);
  font: inherit;
  font-weight: 700;
  font-size: 0.96rem;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(11, 35, 65, 0.08);
}

.viewer-index-toggle[aria-pressed='true'] {
  background: var(--brand-navy);
  border-color: var(--brand-navy);
  color: #ffffff;
}

.viewer-controls-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  justify-self: end;
  width: auto;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(11, 35, 65, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--brand-navy);
  font: inherit;
  font-weight: 700;
  font-size: 0.96rem;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(11, 35, 65, 0.08);
}

.viewer-index-toggle[hidden],
.viewer-controls-toggle[hidden] {
  display: none;
}

.viewer-controls-toggle::after {
  content: '';
  width: 9px;
  height: 9px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
  transition: transform 160ms ease;
}

.viewer-controls-toggle[aria-expanded='true']::after {
  transform: rotate(-135deg) translateY(-1px);
}

.viewer-topbar {
  display: grid;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 40;
  padding: 18px 20px;
  border-radius: 22px;
  background: var(--brand-navy);
  color: #ffffff;
}

.viewer-topbar-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.viewer-topbar-logo {
  display: block;
  width: min(220px, 100%);
}

.viewer-contents-logo {
  display: block;
  width: min(220px, 100%);
}

.viewer-topbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: end;
}

.viewer-share-shell {
  display: grid;
  gap: 4px;
  min-width: 0;
  justify-items: center;
  align-content: start;
}

.viewer-share-status {
  margin: 0;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: 0.03em;
  text-align: center;
}

.viewer-share-status[data-tone='error'] {
  color: #ffe1e1;
}

.viewer-share-status[hidden] {
  display: none;
}

.viewer-topbar .button {
  width: auto;
}

.viewer-topbar .button-primary {
  background: var(--brand-magenta);
  box-shadow: none;
}

.viewer-topbar .button-secondary {
  background: #ffffff;
  color: var(--brand-navy);
}

.viewer-topbar .button-ghost {
  border-color: rgba(255, 255, 255, 0.28);
  color: #ffffff;
}

.viewer-floating-controls {
  position: fixed;
  top: var(--viewer-floating-controls-top, 140px);
  right: 24px;
  z-index: 60;
  display: grid;
  justify-items: end;
  gap: 8px;
}

.viewer-floating-button {
  border: 1px solid rgba(11, 35, 65, 0.14);
  background: rgba(255, 255, 255, 0.62);
  color: var(--brand-navy);
  min-height: 42px;
  padding: 0 16px;
  font-size: 0.96rem;
  font-weight: 700;
  box-shadow: 0 12px 24px rgba(11, 35, 65, 0.14);
  backdrop-filter: blur(18px);
}

.viewer-fullscreen-toggle {
  min-width: 0;
  white-space: nowrap;
}

.viewer-fullscreen-size-shell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--brand-navy);
}

.viewer-fullscreen-size-shell[hidden] {
  display: none;
}

.viewer-fullscreen-size-label {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: none;
  white-space: nowrap;
}

.viewer-fullscreen-size-select {
  min-height: 32px;
  padding: 0 8px;
  border: 1px solid rgba(11, 35, 65, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--brand-navy);
  font: inherit;
  font-weight: 700;
}

.viewer-fullscreen-toggle[aria-pressed='true'] {
  background: rgba(11, 35, 65, 0.82);
  border-color: rgba(11, 35, 65, 0.3);
  color: #ffffff;
}

.viewer-search-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px 16px;
  align-items: end;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.viewer-search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(4, auto);
  gap: 10px;
  align-items: end;
}

.viewer-search-field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.viewer-search-label {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.viewer-search-field input {
  width: 100%;
  min-height: 46px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.98);
  color: var(--ink);
  font: inherit;
}

.viewer-search-field input::placeholder {
  color: rgba(11, 35, 65, 0.58);
}

.viewer-search-status {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.92rem;
  font-weight: 600;
  text-align: right;
}
.viewer-layout-shell {
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.viewer-contents-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  border-radius: 22px;
  background: var(--brand-navy);
  color: #ffffff;
  align-self: start;
  position: sticky;
  top: calc(var(--viewer-sticky-heading-bottom, 0px) + 18px);
  max-height: calc(100vh - var(--viewer-sticky-heading-bottom, 0px) - 36px);
  overflow: hidden;
}

.viewer-contents-brand {
  display: grid;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.viewer-contents-kicker {
  margin: 0;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.78);
}

.viewer-contents-scroll-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 12px;
  gap: 10px;
  min-height: 0;
  align-items: stretch;
}

.viewer-contents {
  display: grid;
  gap: 8px;
  align-content: start;
  min-height: 0;
  max-height: var(--viewer-contents-max-height, none);
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  scrollbar-width: none;
}

.viewer-contents::-webkit-scrollbar {
  display: none;
}

.viewer-contents-scrollbar {
  position: relative;
  width: 12px;
  min-height: 100%;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.viewer-contents-scrollbar-thumb {
  position: absolute;
  inset: 0 0 auto;
  width: 100%;
  min-height: 44px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow:
    0 2px 10px rgba(11, 35, 65, 0.34),
    inset 0 0 0 1px rgba(11, 35, 65, 0.08);
  cursor: grab;
  touch-action: none;
}

.viewer-contents-heading {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.viewer-contents-link {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  text-align: left;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}

.viewer-contents-link:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.24);
}

.viewer-contents-link[data-active='true'] {
  background: #ffffff;
  border-color: transparent;
  color: var(--brand-navy);
}

.viewer-warning {
  margin: 0;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(170, 27, 94, 0.18);
  background: rgba(170, 27, 94, 0.08);
  color: var(--brand-navy);
  font-weight: 600;
}

.viewer-document-shell {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 18px;
  min-height: 420px;
  padding: 20px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(11, 35, 65, 0.08);
  align-self: start;
  position: sticky;
  top: calc(var(--viewer-sticky-heading-bottom, 0px) + 18px);
  max-height: calc(100vh - var(--viewer-sticky-heading-bottom, 0px) - 36px);
  overflow: hidden;
}

.viewer-document-toolbar {
  display: flex;
  align-items: center;
}

.viewer-document-toolbar[hidden] {
  display: none;
}

.viewer-document-toolbar[data-sticky='true'] {
  position: sticky;
  top: 10px;
  z-index: 6;
}

.viewer-mobile-search-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 10px;
  align-items: center;
  width: 100%;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid rgba(11, 35, 65, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 18px rgba(11, 35, 65, 0.1);
}

.viewer-mobile-search-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.viewer-mobile-search-status {
  margin: 0;
  color: var(--brand-navy);
  font-size: 0.88rem;
  font-weight: 700;
}

.viewer-mobile-search-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.viewer-mobile-search-button {
  width: auto;
  min-width: 0;
  min-height: 34px;
  padding: 0 10px;
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: none;
}

.viewer-shell:fullscreen {
  min-height: 100vh;
  padding: 18px;
  border-radius: 0;
  background: #eef5f7;
  overflow: auto;
}

.viewer-shell:fullscreen .viewer-topbar {
  top: 0;
}

.viewer-shell:fullscreen .viewer-document-shell {
  overflow: visible;
}

.viewer-shell:fullscreen .viewer-status,
.viewer-shell:fullscreen .viewer-pages {
  width: min(100%, 1280px);
  margin: 0 auto;
}

.viewer-shell:fullscreen .viewer-pages {
  justify-items: stretch;
  overflow-x: auto;
  overscroll-behavior: contain;
  touch-action: manipulation;
}

.viewer-shell:fullscreen .viewer-page-card {
  width: var(--viewer-fullscreen-page-width, 100%);
  max-width: none;
}

.viewer-shell[data-viewer-page-width-mode='wide']:fullscreen .viewer-pages {
  justify-items: start;
}

.viewer-shell[data-viewer-page-width-mode='wide']:fullscreen .viewer-page-annotation-layer,
.viewer-shell[data-viewer-page-width-mode='wide']:fullscreen .viewer-page-annotation-link {
  pointer-events: none;
}

.viewer-shell:fullscreen .viewer-page-surface {
  width: 100%;
  max-width: none;
}

.viewer-shell:fullscreen .viewer-page-canvas {
  width: 100%;
  max-width: none;
}

.viewer-status {
  margin: 0;
  min-height: 0;
  color: var(--ink-soft);
  font-weight: 600;
}

.viewer-pages {
  display: grid;
  gap: 18px;
  min-height: 0;
  overflow-y: auto;
  overflow-x: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
}

.viewer-page-card {
  padding: 16px;
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 16px 28px rgba(11, 35, 65, 0.08);
  scroll-margin-top: var(--viewer-page-scroll-margin-top, 24px);
}

.viewer-page-surface {
  position: relative;
  width: min(100%, var(--viewer-page-intrinsic-width, 100%));
  max-width: 100%;
  margin: 0 auto;
}

.viewer-page-canvas {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}

.viewer-page-annotation-layer {
  position: absolute;
  inset: 0;
}

.viewer-page-search-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.viewer-page-search-highlight {
  position: absolute;
  border-radius: 6px;
  background: rgba(89, 192, 209, 0.28);
  box-shadow: inset 0 0 0 1px rgba(31, 78, 121, 0.24);
}

.viewer-page-search-highlight[data-active='true'] {
  background: rgba(170, 27, 94, 0.3);
  box-shadow: inset 0 0 0 2px rgba(170, 27, 94, 0.42);
}

.viewer-page-annotation-link {
  position: absolute;
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: transparent;
  text-decoration: none;
}

.viewer-page-annotation-link:hover,
.viewer-page-annotation-link:focus-visible {
  outline: 2px solid var(--brand-magenta);
  outline-offset: 1px;
  background: rgba(89, 192, 209, 0.18);
}
code {
  font-family: Consolas, 'Courier New', monospace;
}

@media (max-width: 1080px) {
  .collection-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .action-bar,
  .table-header {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-copy,
  .collection-panel,
  .table-card {
    padding: 22px;
  }

  .button-row {
    width: 100%;
  }

  .clear-selection-stack {
    width: 100%;
  }

  .button {
    width: 100%;
  }

  .subcategory-header {
    flex-direction: column;
    align-items: stretch;
  }

  .section-next-step {
    display: flex;
    width: 100%;
  }

  .viewer-layout-shell {
    grid-template-columns: 1fr;
  }

  .viewer-contents-shell {
    position: static;
  }

  .viewer-search-shell {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .viewer-search-status {
    text-align: left;
  }

  .viewer-contents-shell {
    position: static;
  }
}

@media (max-width: 760px) {
  .page-shell {
    padding: 18px 14px 36px;
  }

  .hero-break {
    display: inline;
  }

  .hero-top {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions {
    justify-items: stretch;
  }

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

  .search-form {
    grid-template-columns: 1fr;
  }

  .search-submit {
    width: 100%;
  }

  .library-table thead {
    display: none;
  }

  .library-table,
  .library-table tbody,
  .library-table tr {
    display: block;
    width: 100%;
  }

  .library-table tr {
    position: relative;
    margin-bottom: 14px;
    border: 1px solid rgba(170, 27, 94, 0.24);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.84);
    box-shadow: 0 14px 28px rgba(11, 35, 65, 0.08);
  }

  .library-table tr[data-selected='true'] {
    border-color: rgba(170, 27, 94, 0.3);
    box-shadow: 0 16px 30px rgba(170, 27, 94, 0.12);
  }

  .library-table td {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    width: 100%;
    padding: 12px 14px;
  }

  .library-table td[data-label='Title'] {
    grid-template-columns: 1fr;
    gap: 8px;
    min-width: 0;
    padding: 16px 14px 14px 58px;
    overflow-wrap: anywhere;
  }

  .library-table td[data-label='Title']::before,
  .library-table td[data-label='View']::before,
  .library-table td[data-label='Download']::before {
    display: none;
  }

  .checkbox-cell {
    position: absolute;
    top: 12px;
    left: 14px;
    right: auto;
    z-index: 1;
    width: auto;
    padding: 0;
    border-bottom: 0;
    background: transparent;
  }

  .checkbox-cell::before {
    display: none;
  }

  .checkbox-cell input {
    inline-size: 22px;
    block-size: 22px;
  }

  .library-table td[data-label='Category'],
  .library-table td[data-label='Subcategory'] {
    display: none;
  }

  .library-table td[data-label='View'],
  .library-table td[data-label='Download'] {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .library-table td::before {
    content: attr(data-label);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent-strong);
  }

  .table-link {
    min-width: 0;
    width: 100%;
    padding: 12px 16px;
  }

  .library-actions[data-sticky='true'] {
    position: sticky;
    top: 10px;
    z-index: 30;
  }

  .status-panel {
    display: none;
  }

  .clear-selection-helper {
    display: none;
  }

  .viewer-shell {
    padding: 18px;
  }

  .viewer-shell:fullscreen {
    padding: 8px;
  }

  .viewer-shell[data-mobile-controls='collapsed'] {
    gap: 6px;
  }

  .viewer-index-toggle {
    display: inline-flex;
  }

  .viewer-controls-toggle {
    display: inline-flex;
  }

  .viewer-mobile-controls-bar {
    display: grid;
    position: sticky;
    top: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    align-items: stretch;
    justify-content: stretch;
    z-index: 42;
  }

  .viewer-index-toggle,
  .viewer-controls-toggle {
    width: 100%;
    min-width: 0;
    justify-content: center;
    text-align: center;
  }

  .viewer-contents-shell {
    display: none;
  }

  .viewer-shell[data-mobile-controls='collapsed'][data-mobile-contents='collapsed'] .viewer-topbar {
    display: none;
  }

  .viewer-shell[data-mobile-controls='collapsed'][data-mobile-contents='expanded'] .viewer-topbar {
    display: none;
  }

  .viewer-shell[data-mobile-controls='collapsed'][data-mobile-contents='expanded'] .viewer-contents-shell {
    display: grid;
    max-height: calc(100vh - 140px);
  }

  .viewer-shell[data-mobile-controls='collapsed'][data-mobile-contents='expanded'] .viewer-contents {
    overflow-y: auto;
  }

  .viewer-shell[data-mobile-controls='expanded'] .viewer-warning,
  .viewer-shell[data-mobile-controls='expanded'] .viewer-document-shell,
  .viewer-shell[data-mobile-controls='expanded'] .viewer-floating-controls {
    display: none;
  }

  .viewer-topbar {
    padding: 18px;
  }

  .viewer-topbar-main {
    flex-direction: column;
    align-items: stretch;
  }

  .viewer-topbar-actions {
    justify-content: stretch;
  }

  .viewer-topbar .button {
    width: 100%;
  }

  .viewer-floating-controls {
    position: static;
    top: auto;
    right: auto;
    left: auto;
    z-index: auto;
    width: 100%;
    margin-top: 10px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    justify-content: stretch;
    gap: 10px;
  }

  .viewer-floating-button {
    width: 100%;
    min-height: 40px;
    padding: 0 14px;
    justify-content: center;
    text-align: center;
  }

  .viewer-fullscreen-size-shell {
    width: 100%;
    min-height: 40px;
    padding: 0 10px;
    gap: 6px;
    justify-content: space-between;
  }

  .viewer-fullscreen-size-label {
    font-size: 0.72rem;
    letter-spacing: 0.02em;
  }

  .viewer-fullscreen-size-select {
    min-height: 28px;
    padding: 0 8px;
  }

  .viewer-search-form {
    grid-template-columns: 1fr 1fr;
  }

  .viewer-shell:fullscreen .viewer-page-card {
    padding: 10px;
  }

  .viewer-search-field {
    grid-column: 1 / -1;
  }

  .viewer-search-form .button {
    width: 100%;
  }

  .viewer-document-toolbar .button {
    width: auto;
  }
}
