:root {
  --yeti-violet: #5f4b8b;
  --yeti-blue: #007fff;
  --yeti-turquoise: #40e0d0;
  --yeti-silver: #c0c0c0;
  --yeti-white: #ffffff;
  --yeti-black: #333333;
  --yeti-deepblue: #00008b;
  --yeti-charcoal: #36454f;
}

* {
  box-sizing: border-box;
}

body:not(.library-body) {
  margin: 0;
  font-family: "Century Gothic", sans-serif;
  font-weight: normal;
  background-color: var(--yeti-white);
  color: var(--yeti-black);
  min-height: 100vh;
}

.layout {
  width: min(1200px, calc(100vw - 32px));
  margin: 24px auto 48px;
}

.hero,
.panel {
  background: var(--yeti-white);
  border: 1px solid var(--yeti-silver);
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 14px 36px rgba(54, 69, 79, 0.08);
}

.hero {
  display: grid;
  grid-template-columns: 1.8fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
  background:
    linear-gradient(135deg, rgba(95, 75, 139, 0.08), rgba(64, 224, 208, 0.06)),
    var(--yeti-white);
}

.hero-brand {
  margin-bottom: 12px;
}

.hero-yeti {
  display: block;
  width: min(220px, 100%);
  height: auto;
  filter: drop-shadow(0 10px 18px rgba(54, 69, 79, 0.16));
}

.panel {
  margin-bottom: 20px;
}

.eyebrow {
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--yeti-blue);
  margin: 0 0 8px;
}

body:not(.library-body) h1,
body:not(.library-body) h2,
body:not(.library-body) h3,
body:not(.library-body) h4,
body:not(.library-body) h5,
body:not(.library-body) h6 {
  margin: 0;
  font-weight: bold;
  color: var(--yeti-violet);
}

body:not(.library-body) h1 {
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1;
  margin-bottom: 10px;
}

body:not(.library-body) h2 {
  margin-bottom: 6px;
}

.subtle {
  margin: 0;
  color: var(--yeti-charcoal);
  line-height: 1.5;
}

.auth-card,
.candidate-card {
  border: 1px solid var(--yeti-silver);
  background: var(--yeti-white);
  border-radius: 18px;
  padding: 16px;
}

.login-card {
  align-self: center;
  display: grid;
  gap: 12px;
  max-width: 420px;
}

.button {
  appearance: none;
  border: none;
  border-radius: 999px;
  padding: 10px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  font-family: "Century Gothic", sans-serif;
  font-weight: bold;
  font-size: 14px;
  text-decoration: none;
  background-color: var(--yeti-blue);
  color: var(--yeti-white);
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.button.primary {
  background-color: var(--yeti-blue);
  color: var(--yeti-white);
}

.button.ghost {
  background-color: var(--yeti-blue);
  color: var(--yeti-white);
}

.button.danger {
  background-color: var(--yeti-blue);
  color: var(--yeti-white);
}

.button:hover {
  background-color: var(--yeti-turquoise);
  transform: translateY(-1px);
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
  margin-bottom: 16px;
}

.summary-grid,
.config-grid,
.table-list,
.log-list {
  display: grid;
  gap: 14px;
}

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

.summary-card {
  padding: 14px;
  border: 1px solid var(--yeti-silver);
  border-radius: 16px;
  background: var(--yeti-white);
  min-height: 90px;
}

.summary-card strong {
  display: block;
  font-size: 1.6rem;
  margin-top: 8px;
}

.config-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

body:not(.library-body) label {
  display: grid;
  gap: 6px;
  color: var(--yeti-charcoal);
  font-size: 14px;
}

body:not(.library-body) input,
body:not(.library-body) textarea,
body:not(.library-body) select {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--yeti-silver);
  padding: 10px 12px;
  font-family: "Century Gothic", sans-serif;
  color: var(--yeti-black);
  background: var(--yeti-white);
}

body:not(.library-body) input:focus,
body:not(.library-body) textarea:focus,
body:not(.library-body) select:focus {
  outline: 2px solid var(--yeti-turquoise);
  outline-offset: 1px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--yeti-black);
}

.candidate-head,
.meta-line,
.metrics,
.flag-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.candidate-head {
  justify-content: space-between;
  align-items: center;
}

.score-pill,
.status-pill,
.tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
}

.score-pill {
  background: var(--yeti-turquoise);
  color: var(--yeti-deepblue);
}

.status-pill {
  background: var(--yeti-silver);
  color: var(--yeti-charcoal);
}

.age-pill {
  background: var(--yeti-silver);
  color: var(--yeti-charcoal);
}

.tag {
  background: var(--yeti-silver);
  color: var(--yeti-charcoal);
}

.tag-link {
  text-decoration: none;
}

.risk .tag {
  background: var(--yeti-silver);
  color: var(--yeti-charcoal);
}

.post-text {
  margin: 12px 0;
  line-height: 1.55;
}

.post-link {
  color: var(--yeti-blue);
}

body:not(.library-body) a {
  color: var(--yeti-blue);
  text-decoration: none;
}

body:not(.library-body) a:hover {
  color: var(--yeti-turquoise);
}

body:not(.library-body) a:visited {
  opacity: 0.8;
}

.drafts,
.approved-reply {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}

.draft-card {
  border: 1px solid var(--yeti-silver);
  border-radius: 14px;
  padding: 12px;
  background: var(--yeti-white);
}

.draft-card h4 {
  margin-bottom: 8px;
}

.log-item {
  border-left: 3px solid var(--yeti-silver);
  padding-left: 12px;
}

#login-error {
  min-height: 40px;
}

hr,
.divider {
  border-color: var(--yeti-silver);
}

body:not(.library-body) nav {
  background-color: var(--yeti-deepblue);
}

body:not(.library-body) footer {
  background-color: var(--yeti-charcoal);
  color: var(--yeti-white);
}

body:not(.library-body) footer a {
  color: var(--yeti-silver);
}

body:not(.library-body) footer a:hover {
  color: var(--yeti-blue);
}

.legal,
.disclaimer {
  font-family: Cambria, serif;
}

.library-body {
  background-color: var(--yeti-white);
}

.library-layout {
  margin-top: 20px;
}

.library-hero {
  align-items: start;
}

.library-hero-copy,
.library-seo-lead,
.library-category-seo,
.library-description,
.library-insight-card p,
.library-guide-list {
  line-height: 1.65;
}

.library-seo-lead,
.library-category-seo {
  margin: 14px 0 0;
  color: var(--yeti-charcoal);
}

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

.library-guide-yeti {
  width: min(180px, 100%);
  margin: 0 auto;
}

.library-guide-list {
  margin: 0;
  padding-left: 18px;
  color: var(--yeti-charcoal);
}

.library-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(140px, 1fr));
  gap: 12px;
}

.library-menu-grid {
  grid-template-columns: repeat(2, minmax(220px, 1fr));
}

.library-menu-card summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  cursor: pointer;
  list-style: none;
  font-weight: bold;
  color: var(--yeti-violet);
}

.library-menu-card summary::-webkit-details-marker {
  display: none;
}

.library-menu-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  max-height: 240px;
  overflow: auto;
  padding-right: 4px;
}

.library-menu-link {
  color: var(--yeti-blue);
  font-size: 14px;
}

.library-category-grid,
.library-card-grid {
  display: grid;
  gap: 16px;
}

.library-category-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.library-card-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.library-category-chip {
  display: grid;
  gap: 6px;
  padding: 16px;
  border: 1px solid var(--yeti-silver);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--yeti-black);
}

.library-category-chip strong {
  color: var(--yeti-violet);
}

.library-category-chip span {
  color: #f7fbff;
  line-height: 1.5;
}

.library-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.library-project-head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
}

.library-project-category {
  margin: 0 0 4px;
  color: var(--yeti-blue);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.library-project-link {
  color: var(--yeti-violet);
}

.library-project-link:hover {
  color: var(--yeti-blue);
}

.library-logo-wrap {
  position: relative;
  width: 66px;
  height: 66px;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(95, 75, 139, 0.12), rgba(64, 224, 208, 0.14));
  overflow: hidden;
}

.library-logo,
.library-logo-fallback {
  width: 100%;
  height: 100%;
}

.library-logo {
  object-fit: contain;
  background: rgba(255, 255, 255, 0.9);
}

.library-logo-fallback {
  display: none;
  place-items: center;
  font-weight: bold;
  color: var(--yeti-violet);
}

.library-insight-card {
  margin: 0;
}

.library-insight-card p {
  margin: 0;
  color: var(--yeti-charcoal);
}

.library-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: auto;
  padding-top: 4px;
}

.library-primary-link {
  justify-content: center;
  align-self: start;
  width: fit-content;
  min-width: 0;
  max-width: 100%;
  padding: 10px 16px;
}

.library-link-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.library-secondary-link {
  font-size: 14px;
}

.library-login-link {
  margin-top: 14px;
}

.coin-hero {
  align-items: start;
}

.coin-stats-card,
.coin-link-groups {
  display: grid;
  gap: 14px;
}

.coin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.coin-link-groups {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.coin-link-group {
  display: grid;
  gap: 10px;
}

.coin-hero-actions {
  margin-top: 14px;
}

.coin-back-link {
  margin-top: 2px;
}

.library-card .tag,
.coin-hero .tag {
  padding: 6px 12px;
  font-size: 13px;
}

.library-body {
  background:
    radial-gradient(circle at top right, rgba(52, 202, 196, 0.18), transparent 28%),
    radial-gradient(circle at 50% 100%, rgba(95, 75, 139, 0.35), transparent 38%),
    linear-gradient(180deg, #111723 0%, #162234 42%, #121926 100%);
  color: #f3f6fb;
}

.library-body .layout {
  width: min(1440px, calc(100vw - 40px));
  margin: 0 auto 72px;
}

.legacy-library-shell .site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(14, 20, 31, 0.96);
  border-bottom: 1px solid rgba(103, 126, 162, 0.24);
}

.legacy-library-shell .site-header-inner {
  width: min(1440px, calc(100vw - 40px));
  margin: 0 auto;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.legacy-library-shell .site-wordmark {
  color: #f7fbff;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.01em;
}

.legacy-library-shell .site-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.legacy-library-shell .site-nav-link {
  padding: 0;
  color: #d6e0ed;
  transition: color 0.2s ease;
}

.legacy-library-shell .site-nav-link:hover,
.legacy-library-shell .site-nav-link.is-active {
  color: #4da3ff;
}

.library-layout {
  padding-top: 28px;
}

.library-body .hero,
.library-body .panel,
.library-body .auth-card,
.library-body .candidate-card,
.library-body .draft-card,
.library-body .summary-card,
.library-body .library-category-chip {
  background: linear-gradient(180deg, rgba(24, 32, 48, 0.96), rgba(23, 31, 46, 0.92));
  border: 1px solid rgba(101, 122, 154, 0.34);
  box-shadow: 0 18px 44px rgba(4, 10, 20, 0.34);
}

.library-body .hero,
.library-body .panel {
  border-radius: 28px;
}

.library-body h1,
.library-body h2,
.library-body h3,
.library-body h4,
.library-body h5,
.library-body h6,
.library-body .library-project-link,
.library-body .library-category-chip strong,
.library-body .library-menu-card summary {
  color: #f7fbff;
}

.library-body .subtle,
.library-body .library-seo-lead,
.library-body .library-category-seo,
.library-body .library-description,
.library-body .library-insight-card p,
.library-body .library-guide-list,
.library-body .coin-link-group .subtle {
  color: #d5deec;
}

.library-body .eyebrow,
.library-body .library-project-category {
  color: #4da3ff;
}

.library-body main a,
.library-body .post-link,
.library-body .library-menu-link {
  color: #4de8ff;
}

.library-body main a:hover,
.library-body .post-link:hover,
.library-body .library-menu-link:hover {
  color: #84fff3;
}

.library-body .tag,
.library-body .status-pill,
.library-body .age-pill {
  background: rgba(214, 222, 236, 0.18);
  color: #dfe8f6;
}

.library-body .tag-link:hover {
  background: rgba(77, 232, 255, 0.18);
}

.library-body .button.primary,
.library-body .button.ghost,
.library-body .button.danger {
  background: #007fff;
  color: #ffffff !important;
  border: none;
  box-shadow: none;
}

.library-body .button:hover {
  background: #006fe0;
  color: #ffffff !important;
  box-shadow: none;
}

.library-body .cmc-nav-toggle {
  display: none;
}

@media (max-width: 820px) {
  .library-body .cmc-nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
    font: inherit;
    cursor: pointer;
  }

  .library-body .cmc-nav-toggle:hover,
  .library-body .cmc-nav-toggle:focus-visible {
    background: rgba(0, 127, 255, 0.22);
    border-color: rgba(0, 127, 255, 0.65);
    outline: none;
  }
}

.library-body .library-logo-wrap {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(77, 232, 255, 0.08));
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.library-body .library-logo {
  background: rgba(247, 251, 255, 0.98);
}

.library-body .summary-card strong {
  color: #f7fbff;
}

.glossary-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.glossary-card p {
  margin: 10px 0 0;
  line-height: 1.6;
  color: #d5deec;
}

.glossary-term {
  position: relative;
  color: #4da3ff;
  text-decoration: none;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 0.2em;
}

.glossary-term strong {
  font-weight: 700;
}

.glossary-term::after {
  content: attr(data-definition);
  position: absolute;
  left: 0;
  bottom: calc(100% + 10px);
  min-width: 220px;
  max-width: 320px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(10, 17, 29, 0.96);
  border: 1px solid rgba(95, 225, 255, 0.26);
  color: #f4fbff;
  font-size: 13px;
  line-height: 1.5;
  box-shadow: 0 16px 36px rgba(1, 5, 14, 0.35);
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 12;
}

.glossary-term:hover::after,
.glossary-term:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.glossary-term:hover,
.glossary-term:focus-visible {
  color: #79bbff;
}

.legacy-library-shell .site-footer-links {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.legacy-library-shell .site-promo-strip {
  margin: 42px 0 28px;
}

.legacy-library-shell .site-promo-strip-inner {
  min-height: 120px;
  border: 1px dashed rgba(103, 126, 162, 0.28);
  border-radius: 18px;
  display: grid;
  place-items: center;
  color: #9db0c9;
  background: rgba(17, 24, 36, 0.5);
}

.legacy-library-shell .site-footer-live {
  padding: 18px 0 36px;
  border-top: 1px solid rgba(101, 122, 154, 0.18);
}

.legacy-library-shell .site-footer-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(160px, 1fr));
  gap: 42px 28px;
}

.legacy-library-shell .site-footer-column h3 {
  color: #f7fbff;
  margin-bottom: 8px;
}

.legacy-library-shell .site-footer-column .site-footer-links a {
  color: #39eeff;
  font-size: 0.97rem;
}

.legacy-library-shell .site-footer-disclaimer,
.legacy-library-shell .site-footer-bottom p {
  color: #d5deec;
}

.legacy-library-shell .site-footer-disclaimer {
  margin: 34px 0 28px;
}

.legacy-library-shell .site-footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-top: 8px;
  border-top: 1px solid rgba(101, 122, 154, 0.12);
}

.scroll-top-button {
  position: fixed;
  right: 24px;
  bottom: 20px;
  width: 54px;
  height: 54px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 24px;
  background: rgba(28, 167, 172, 0.9);
  color: #ffffff;
  box-shadow: 0 16px 32px rgba(2, 8, 20, 0.3);
}

.scroll-top-button:hover {
  background: rgba(77, 232, 255, 0.92);
  color: #0f1826;
}

@media (max-width: 860px) {
  .layout {
    width: min(100vw - 20px, 1000px);
  }

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

  .panel-head {
    flex-direction: column;
  }

  .library-stats {
    width: 100%;
  }

  .legacy-library-shell .site-header-inner,
  .library-body .layout {
    width: min(100vw - 20px, 1000px);
  }

  .legacy-library-shell .site-header-inner,
  .legacy-library-shell .site-footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }

  .legacy-library-shell .site-footer-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
}
