@font-face {
  font-family: "Montserrat";
  src: url("../palabras-cruzadas/assets/Montserrat-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Montserrat";
  src: url("../palabras-cruzadas/assets/Montserrat-Bold.ttf") format("truetype");
  font-weight: 700 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #172433;
  --muted: #667589;
  --line: #d9e3eb;
  --paper: #ffffff;
  --canvas: #f1f5f8;
  --blue: #235f9f;
  --blue-dark: #173f66;
  --green: #24856b;
  --green-dark: #17624e;
  --orange: #f49a21;
  --cream: #fff7e9;
  --shadow: 0 22px 60px rgba(22, 48, 72, 0.11);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(circle at 5% 0, rgba(244, 154, 33, 0.12), transparent 27rem),
    radial-gradient(circle at 96% 2%, rgba(36, 133, 107, 0.11), transparent 31rem),
    var(--canvas);
  color: var(--ink);
  font-family: "Montserrat", ui-sans-serif, system-ui, sans-serif;
}

a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

:focus-visible {
  outline: 3px solid rgba(35, 95, 159, 0.28);
  outline-offset: 3px;
}

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

.library-page { min-height: 100vh; }

.topbar {
  width: min(1240px, calc(100% - 40px));
  min-height: 76px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin: 0 auto;
}

.brand { display: flex; gap: 11px; align-items: center; }
.brand img {
  width: 45px;
  height: 45px;
  object-fit: contain;
  padding: 5px;
  border: 1px solid rgba(24, 47, 70, 0.09);
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(24, 47, 70, 0.08);
}
.brand strong, .brand small { display: block; }
.brand strong { color: var(--green); font-size: 0.81rem; letter-spacing: 0.02em; text-transform: uppercase; }
.brand small { margin-top: 3px; color: #788596; font-size: 0.7rem; }

.library-nav { display: flex; gap: 5px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.library-nav [hidden] { display: none !important; }
.library-nav > a:not(.nav-button),
.nav-button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #36516d;
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 800;
}
.library-nav > a:not(.nav-button):hover, .nav-button:hover { background: rgba(255, 255, 255, 0.7); }
.nav-button.primary { background: var(--blue); color: #fff; }
.nav-button.primary:hover { background: var(--blue-dark); }
.nav-button.admin { border: 1px solid #e8c98f; background: #fff9ef; color: #7c4a0f; }
.nav-button[data-access-logout] { border: 1px solid #d8e2ea; background: #fff; color: #526479; }
.nav-button[data-access-logout]:hover { border-color: #e2b9b5; background: #fff4f3; color: #9b332c; }
.nav-button[data-access-logout].is-loading { opacity: 0.72; cursor: wait; }

.library-shell { width: min(1240px, calc(100% - 40px)); margin: 0 auto; padding: 0 0 52px; }

.library-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.72fr);
  position: relative;
  overflow: hidden;
  min-height: 480px;
  border: 1px solid rgba(23, 63, 102, 0.13);
  border-radius: 28px;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.99) 0%, rgba(248, 251, 253, 0.98) 56%, rgba(238, 248, 244, 0.96) 100%);
  box-shadow: var(--shadow);
}

.library-hero::before {
  width: 330px;
  height: 330px;
  position: absolute;
  right: -130px;
  top: -170px;
  border-radius: 50%;
  background: rgba(244, 154, 33, 0.1);
  content: "";
}

.library-hero-copy {
  align-self: center;
  padding: 56px 30px 92px 56px;
  position: relative;
  z-index: 2;
}

.library-eyebrow {
  width: max-content;
  max-width: 100%;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 7px 11px;
  border-radius: 999px;
  background: #e8f6f1;
  color: var(--green-dark);
  font-size: 0.67rem;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.library-hero h1 {
  max-width: 780px;
  margin: 17px 0 0;
  color: #15283b;
  font-size: clamp(2.45rem, 5vw, 4.8rem);
  letter-spacing: -0.06em;
  line-height: 0.98;
}

.library-hero-copy > p {
  max-width: 690px;
  margin: 20px 0 0;
  color: #5d6e82;
  font-size: 0.95rem;
  line-height: 1.75;
}

.library-hero-actions { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 25px; }
.hero-primary, .hero-secondary {
  min-height: 45px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 17px;
  border-radius: 11px;
  font-size: 0.75rem;
  font-weight: 900;
}
.hero-primary { background: var(--blue); color: #fff; box-shadow: 0 10px 24px rgba(35, 95, 159, 0.2); }
.hero-primary:hover { background: var(--blue-dark); }
.hero-secondary { border: 1px solid #cfdce7; background: #fff; color: var(--blue-dark); }
.hero-secondary:hover { border-color: #9eb8cf; background: #f9fbfd; }

.hero-status {
  max-width: 610px;
  display: flex;
  gap: 11px;
  align-items: center;
  margin-top: 22px;
  padding: 11px 13px;
  border: 1px solid #ead6b3;
  border-radius: 12px;
  background: var(--cream);
}
.hero-status.is-premium { border-color: #bfe0d3; background: #eef9f5; }
.hero-status-icon {
  width: 32px;
  height: 32px;
  display: grid;
  flex: 0 0 32px;
  place-items: center;
  border-radius: 9px;
  background: var(--orange);
}
.hero-status.is-premium .hero-status-icon { background: var(--green); }
.hero-status-icon i {
  width: 12px;
  height: 9px;
  display: block;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(45deg) translate(-1px, -1px);
}
body[data-premium-state="locked"] .hero-status-icon i {
  width: 9px;
  height: 8px;
  border: 2px solid #fff;
  border-bottom: 0;
  border-radius: 7px 7px 0 0;
  transform: translateY(-1px);
}
.hero-status strong, .hero-status small { display: block; }
.hero-status strong { font-size: 0.75rem; }
.hero-status small { margin-top: 3px; color: #748194; font-size: 0.65rem; line-height: 1.45; }

.library-hero-visual { min-height: 360px; position: relative; align-self: center; }
.visual-glow {
  width: 340px;
  height: 340px;
  position: absolute;
  left: 50%;
  top: 49%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(36, 133, 107, 0.16), rgba(35, 95, 159, 0.04) 56%, transparent 70%);
  transform: translate(-50%, -50%);
}
.preview-sheet {
  width: 170px;
  height: 225px;
  display: block;
  position: absolute;
  left: 50%;
  top: 50%;
  padding: 20px;
  border: 1px solid rgba(24, 47, 70, 0.12);
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 24px 50px rgba(24, 47, 70, 0.16);
}
.preview-sheet span { color: #708095; font-size: 0.52rem; font-weight: 900; letter-spacing: 0.12em; }
.preview-sheet strong { display: block; margin-top: 18px; color: #21384e; font-size: 1rem; line-height: 1.3; }
.preview-one { transform: translate(-108%, -50%) rotate(-10deg); }
.preview-one i { width: 100%; height: 6px; display: block; margin-top: 15px; border-radius: 9px; background: #e5edf4; }
.preview-one i:nth-of-type(2) { width: 78%; }
.preview-one i:nth-of-type(3) { width: 88%; }
.preview-two { z-index: 2; transform: translate(-48%, -58%) rotate(3deg); }
.preview-two strong { margin-top: 30px; color: var(--blue); font-size: 1.22rem; }
.preview-two b { width: 72px; height: 48px; display: grid; place-items: center; margin-top: 17px; border-radius: 10px; background: #eef4fa; color: var(--blue); font-size: 1.3rem; }
.preview-three { transform: translate(12%, -42%) rotate(11deg); }
.preview-three strong { color: var(--green-dark); }
.preview-three small { width: 58px; height: 58px; display: grid; place-items: center; margin-top: 24px; border-radius: 14px; background: #e7f6f0; color: var(--green); font-size: 0.8rem; font-weight: 900; }

.visual-access {
  width: 60px;
  height: 60px;
  display: grid;
  z-index: 4;
  place-items: center;
  position: absolute;
  left: 53%;
  top: 56%;
  border: 6px solid #fff;
  border-radius: 50%;
  background: var(--blue-dark);
  box-shadow: 0 14px 34px rgba(23, 63, 102, 0.29);
}
.visual-access.is-premium { background: var(--green); }
.visual-access i { width: 16px; height: 13px; border: 3px solid #fff; border-bottom: 0; border-radius: 11px 11px 0 0; }
.visual-access.is-premium i { width: 17px; height: 10px; border: 0; border-right: 3px solid #fff; border-bottom: 3px solid #fff; border-radius: 0; transform: rotate(45deg) translate(-2px, -2px); }

.library-trust-row {
  min-height: 72px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  border-top: 1px solid #dbe5ec;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(12px);
}
.library-trust-row > div { display: grid; align-content: center; padding: 0 22px; border-right: 1px solid #e1e8ee; }
.library-trust-row > div:last-child { border-right: 0; }
.library-trust-row strong, .library-trust-row span { display: block; }
.library-trust-row strong { color: #29445f; font-size: 0.85rem; }
.library-trust-row span { margin-top: 3px; color: #7b8998; font-size: 0.6rem; }

.library-scope {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.library-scope article {
  min-width: 0;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 13px;
  align-items: center;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 28px rgba(24, 47, 70, 0.05);
}

.library-scope article > span {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #e8f1fa;
  color: var(--blue);
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.library-scope article:nth-child(2) > span { background: #fff1dc; color: #9a5708; }
.library-scope article:nth-child(3) > span { background: #e7f6f0; color: var(--green-dark); }
.library-scope strong { display: block; color: #29415a; font-size: 0.76rem; }
.library-scope p { margin: 5px 0 0; color: #718096; font-size: 0.63rem; line-height: 1.5; }

.library-discovery {
  scroll-margin-top: 18px;
  margin-top: 22px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.91);
  box-shadow: 0 10px 28px rgba(24, 47, 70, 0.05);
}
.library-search > label { display: block; margin-bottom: 8px; color: #3e5267; font-size: 0.7rem; font-weight: 900; }
.library-search-row { display: grid; grid-template-columns: minmax(0, 1fr) 180px auto; gap: 8px; }
.search-input-wrap { position: relative; }
.search-input-wrap > span {
  width: 14px;
  height: 14px;
  position: absolute;
  left: 15px;
  top: 50%;
  border: 2px solid #8293a4;
  border-radius: 50%;
  transform: translateY(-58%);
}
.search-input-wrap > span::after { width: 6px; height: 2px; position: absolute; right: -5px; bottom: -3px; background: #8293a4; content: ""; transform: rotate(45deg); }
.library-search input, .library-search select {
  width: 100%;
  min-height: 47px;
  border: 1px solid #cddae5;
  border-radius: 11px;
  background: #fff;
  color: #2d4053;
  outline: none;
}
.library-search input { padding: 0 15px 0 43px; }
.library-search select { padding: 0 12px; }
.library-search input:focus, .library-search select:focus { border-color: #7da8cc; box-shadow: 0 0 0 3px rgba(35, 95, 159, 0.1); }
.library-search button {
  min-width: 105px;
  border: 0;
  border-radius: 11px;
  background: var(--blue);
  color: #fff;
  cursor: pointer;
  font-size: 0.73rem;
  font-weight: 900;
}
.library-search button:hover { background: var(--blue-dark); }

.folder-navigation { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 16px; align-items: center; margin-top: 17px; padding-top: 17px; border-top: 1px solid #e3eaf0; }
.folder-navigation > div strong, .folder-navigation > div span { display: block; }
.folder-navigation > div strong { color: #42566b; font-size: 0.67rem; }
.folder-navigation > div span { margin-top: 4px; color: #8a96a3; font-size: 0.58rem; }
.folder-chips { display: flex; gap: 7px; overflow-x: auto; padding: 2px 0 5px; scrollbar-width: thin; }
.folder-chips a {
  min-height: 36px;
  display: inline-flex;
  gap: 7px;
  flex: 0 0 auto;
  align-items: center;
  padding: 0 11px;
  border: 1px solid #d8e2ea;
  border-radius: 999px;
  background: #fff;
  color: #56667a;
  font-size: 0.65rem;
  font-weight: 800;
}
.folder-chips a small { color: #9a7543; font-size: 0.52rem; text-transform: uppercase; }
.folder-chips a > span { min-width: 20px; height: 20px; display: grid; place-items: center; border-radius: 999px; background: #edf2f6; font-size: 0.56rem; }
.folder-chips a.is-active { border-color: #8bc4b0; background: #eaf7f2; color: var(--green-dark); }
.folder-chips a.is-active > span { background: #d6eee5; }

.kicker { margin: 0 0 7px; color: var(--green); font-size: 0.64rem; font-weight: 900; letter-spacing: 0.11em; text-transform: uppercase; }
.library-heading { display: flex; justify-content: space-between; gap: 22px; align-items: flex-end; padding: 34px 3px 17px; }
.library-heading h2 { margin: 0; color: #21364b; font-size: clamp(1.55rem, 3vw, 2.25rem); letter-spacing: -0.04em; }
.library-heading p:not(.kicker) { max-width: 680px; margin: 7px 0 0; color: var(--muted); font-size: 0.75rem; line-height: 1.5; }
.library-heading-meta { display: flex; gap: 8px; align-items: center; }
.library-heading-meta span, .library-heading-meta a { padding: 7px 10px; border-radius: 999px; font-size: 0.62rem; font-weight: 800; }
.library-heading-meta span { background: #e7eff6; color: var(--blue-dark); }
.library-heading-meta a { border: 1px solid #d5dfe7; background: #fff; color: #627286; }

.collection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(225px, 1fr));
  gap: 14px;
}

.collection-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: #fff;
  box-shadow: 0 14px 36px rgba(24, 47, 70, 0.075);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.collection-card:hover {
  border-color: #aec8db;
  box-shadow: 0 22px 48px rgba(24, 47, 70, 0.13);
  transform: translateY(-4px);
}

.collection-cover {
  height: 155px;
  position: relative;
  overflow: hidden;
  background: #eaf2f8;
}

.collection-cover > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.collection-card:hover .collection-cover > img { transform: scale(1.035); }

@media (hover: hover) and (pointer: fine) {
  .collection-card:hover .collection-cover > img {
    object-fit: contain;
    padding: 8px;
    background: #f3f6f8;
    transform: scale(0.96);
  }
}

.collection-generic {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg, #eaf3fb, #f8fbfd 55%, #fff2df);
}

.collection-generic.variant-2 { background: linear-gradient(145deg, #e8f6f1, #f8fcfa 55%, #e8f1fa); }
.collection-generic.variant-3 { background: linear-gradient(145deg, #fff0dc, #fffbf4 52%, #edf4fa); }

.collection-generic::after {
  width: 220px;
  height: 220px;
  position: absolute;
  right: -80px;
  top: -100px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.58);
  content: "";
}

.collection-generic i {
  width: 78px;
  height: 99px;
  position: absolute;
  left: 50%;
  top: 50%;
  border: 1px solid rgba(35, 95, 159, 0.15);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 35px rgba(24, 47, 70, 0.11);
}

.collection-generic i:nth-child(1) { transform: translate(-95%, -53%) rotate(-9deg); }
.collection-generic i:nth-child(2) { z-index: 2; transform: translate(-50%, -58%) rotate(1deg); }
.collection-generic i:nth-child(3) { transform: translate(-5%, -48%) rotate(9deg); }

.collection-generic i::before,
.collection-generic i::after {
  height: 6px;
  position: absolute;
  left: 18px;
  right: 18px;
  border-radius: 999px;
  background: #dce8f1;
  content: "";
}
.collection-generic i::before { top: 26px; }
.collection-generic i::after { top: 42px; right: 30px; }

.collection-generic > span {
  width: 62px;
  height: 43px;
  position: absolute;
  left: 50%;
  bottom: 15px;
  z-index: 3;
  border-radius: 9px;
  background: var(--blue);
  box-shadow: 0 13px 26px rgba(35, 95, 159, 0.25);
  transform: translateX(-50%);
}

.collection-generic.variant-2 > span { background: var(--green); box-shadow: 0 13px 26px rgba(36, 133, 107, 0.25); }
.collection-generic.variant-3 > span { background: #d98219; box-shadow: 0 13px 26px rgba(217, 130, 25, 0.25); }
.collection-generic > span::before { width: 34px; height: 10px; position: absolute; left: 8px; top: -7px; border-radius: 7px 7px 0 0; background: inherit; content: ""; }

.collection-count {
  position: absolute;
  right: 13px;
  bottom: 13px;
  z-index: 4;
  padding: 7px 9px;
  border-radius: 999px;
  background: rgba(23, 40, 58, 0.9);
  color: #fff;
  font-size: 0.57rem;
  font-weight: 900;
}

.collection-body { padding: 15px; }
.collection-body > p { margin: 0; color: var(--green); font-size: 0.57rem; font-weight: 900; letter-spacing: 0.07em; text-transform: uppercase; }
.collection-body h3 { margin: 7px 0 7px; color: #21364b; font-size: 1.08rem; line-height: 1.3; }
.collection-body > span { min-height: 39px; display: block; color: #6b7a8c; font-size: 0.68rem; line-height: 1.5; }
.collection-body > strong { display: flex; justify-content: space-between; align-items: center; margin-top: 15px; padding-top: 13px; border-top: 1px solid #e6edf2; color: var(--blue); font-size: 0.67rem; }
.collection-body > strong b { font-size: 1rem; }

.resource-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.resource-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(24, 47, 70, 0.07);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.resource-card:hover { border-color: #b8ccdc; box-shadow: 0 20px 44px rgba(24, 47, 70, 0.12); transform: translateY(-4px); }
.resource-cover { height: 165px; display: block; position: relative; overflow: hidden; background: linear-gradient(145deg, #eaf3fb, #fff3df); }
.resource-cover > img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.35s ease; }
.resource-card:hover .resource-cover > img { transform: scale(1.03); }

@media (hover: hover) and (pointer: fine) {
  .resource-card.is-image-resource:hover .resource-cover > img {
    object-fit: contain;
    padding: 7px;
    border-radius: 12px;
    background: #f3f6f8;
    transform: scale(0.96);
  }
}
.resource-placeholder { height: 100%; display: grid; place-content: center; gap: 9px; padding: 28px; background: linear-gradient(145deg, #edf5fb, #fff6e8); text-align: center; }
.resource-placeholder > span { width: 61px; height: 61px; display: grid; place-items: center; margin: auto; border-radius: 14px; background: #fff; color: var(--blue); box-shadow: 0 10px 25px rgba(35, 95, 159, 0.12); font-size: 0.72rem; font-weight: 900; }
.resource-placeholder strong { max-width: 260px; color: #29415a; font-size: 0.95rem; line-height: 1.35; }
.resource-placeholder small { color: #8a96a4; font-size: 0.58rem; font-weight: 800; text-transform: uppercase; }
.is-locked .resource-cover > img, .is-locked .resource-placeholder { filter: saturate(0.72) brightness(0.83); }

.file-badge { position: absolute; left: 12px; top: 12px; padding: 6px 8px; border-radius: 7px; background: rgba(255, 255, 255, 0.94); box-shadow: 0 5px 14px rgba(20, 40, 60, 0.12); color: var(--blue-dark); font-size: 0.58rem; font-weight: 900; }
.lock-badge {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  position: absolute;
  right: 11px;
  top: 11px;
  border: 2px solid rgba(255, 255, 255, 0.96);
  border-radius: 13px;
  background: linear-gradient(145deg, rgba(35, 55, 73, 0.98), rgba(18, 38, 55, 0.98));
  box-shadow: 0 10px 24px rgba(13, 31, 47, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.13);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.resource-card:hover .lock-badge {
  transform: translateY(-1px);
  box-shadow: 0 13px 28px rgba(13, 31, 47, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.lock-badge i {
  width: 17px;
  height: 13px;
  display: block;
  position: relative;
  margin-top: 5px;
  border-radius: 3px;
  background: #ffffff;
  box-shadow: 0 1px 1px rgba(8, 27, 43, 0.12);
}
.lock-badge i::before {
  width: 11px;
  height: 11px;
  position: absolute;
  left: 50%;
  bottom: 9px;
  border: 2.5px solid #ffffff;
  border-bottom: 0;
  border-radius: 9px 9px 0 0;
  content: "";
  transform: translateX(-50%);
}
.lock-badge i::after {
  width: 4px;
  height: 6px;
  position: absolute;
  left: 50%;
  top: 4px;
  border-radius: 999px 999px 2px 2px;
  background: #1b3449;
  content: "";
  transform: translateX(-50%);
}
.cover-overlay { position: absolute; left: 12px; bottom: 12px; padding: 7px 10px; border-radius: 999px; background: rgba(23, 33, 43, 0.91); color: #fff; font-size: 0.56rem; font-weight: 900; letter-spacing: 0.06em; text-transform: uppercase; }
.cover-overlay.is-ready { background: rgba(23, 98, 78, 0.92); }

.resource-body { padding: 17px; }
.resource-meta { display: flex; justify-content: space-between; gap: 10px; color: #8290a0; font-size: 0.57rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
.resource-meta a { color: var(--green); }
.resource-meta a:hover { text-decoration: underline; }
.resource-body h3 { margin: 10px 0 7px; color: #21364b; font-size: 1rem; line-height: 1.35; }
.resource-body h3 a:hover { color: var(--blue); }
.resource-body > p { min-height: 58px; display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3; margin: 0; color: #68778a; font-size: 0.7rem; line-height: 1.55; }
.resource-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 11px; }
.resource-tags span { padding: 4px 7px; border-radius: 6px; background: #f0f4f7; color: #667589; font-size: 0.56rem; font-weight: 700; }
.resource-card-footer { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-top: 15px; padding-top: 13px; border-top: 1px solid #e7edf2; }
.resource-card-footer > small { color: #8a96a3; font-size: 0.57rem; font-weight: 700; }
.resource-action { min-height: 37px; display: inline-flex; gap: 9px; align-items: center; justify-content: center; padding: 0 11px; border-radius: 9px; background: var(--green); color: #fff; font-size: 0.66rem; font-weight: 900; }
.is-locked .resource-action { background: var(--blue); }
.resource-action:hover { filter: brightness(0.93); }
.resource-action b { font-size: 0.9rem; }

.library-empty { padding: 65px 25px; border: 1px dashed #bdcedb; border-radius: 20px; background: linear-gradient(145deg, #fff, #f8fbfd); text-align: center; }
.empty-art { height: 68px; display: flex; justify-content: center; align-items: flex-end; margin-bottom: 13px; }
.empty-art i { width: 45px; height: 57px; margin: 0 -5px; border: 1px solid #c9d8e4; border-radius: 7px; background: #fff; box-shadow: 0 9px 20px rgba(23, 48, 72, 0.08); }
.empty-art i:first-child { height: 49px; background: #edf5fb; transform: rotate(-10deg); }
.empty-art i:last-child { height: 49px; background: #eaf7f2; transform: rotate(10deg); }
.library-empty h2 { margin: 0 0 8px; color: #243b51; font-size: 1.35rem; }
.library-empty > p:not(.kicker) { max-width: 570px; margin: auto; color: var(--muted); font-size: 0.75rem; line-height: 1.6; }
.library-empty > a { display: inline-flex; margin-top: 17px; padding: 11px 15px; border-radius: 9px; background: var(--blue); color: #fff; font-size: 0.7rem; font-weight: 900; }

.premium-cta { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 20px; align-items: center; margin-top: 28px; padding: 28px 30px; border-radius: 18px; background: linear-gradient(120deg, #173f66, #235f9f); color: #fff; box-shadow: 0 20px 46px rgba(23, 63, 102, 0.22); }
.premium-cta-mark { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 13px; background: rgba(255, 255, 255, 0.12); color: #8ed5bd; }
.premium-cta .kicker { color: #91d7c0; }
.premium-cta h2 { margin: 0; font-size: 1.35rem; }
.premium-cta p:not(.kicker) { max-width: 720px; margin: 8px 0 0; color: #d8e7f4; font-size: 0.72rem; line-height: 1.55; }
.premium-cta > a { min-height: 43px; display: inline-flex; gap: 9px; align-items: center; padding: 0 15px; border-radius: 10px; background: #fff; color: var(--blue-dark); font-size: 0.7rem; font-weight: 900; }

footer { width: min(1240px, calc(100% - 40px)); display: flex; justify-content: space-between; gap: 25px; margin: 0 auto 28px; padding: 24px 0; border-top: 1px solid #d5e0e8; color: #6b7a8c; font-size: 0.66rem; }
footer strong, footer span { display: block; }
footer strong { color: var(--green); font-size: 0.76rem; }
footer span { margin-top: 4px; }
footer nav { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
footer a:hover { color: var(--blue); }

@media (max-width: 1040px) {
  .library-hero { grid-template-columns: minmax(0, 1fr) 330px; }
  .library-hero-copy { padding-left: 38px; }
}

@media (max-width: 840px) {
  .topbar, .library-shell, footer { width: min(100% - 26px, 1240px); }
  .library-hero { grid-template-columns: 1fr; }
  .library-hero-copy { padding: 42px 34px 100px; }
  .library-hero-visual { display: none; }
  .library-search-row { grid-template-columns: minmax(0, 1fr) 170px; }
  .library-search button { min-height: 44px; grid-column: 1 / -1; }
  .folder-navigation { grid-template-columns: 1fr; }
  .library-scope { grid-template-columns: 1fr; }
  .premium-cta { grid-template-columns: auto 1fr; }
  .premium-cta > a { grid-column: 1 / -1; justify-self: start; }
}

@media (max-width: 640px) {
  .topbar { min-height: 68px; align-items: center; }
  .brand img { width: 41px; height: 41px; }
  .brand small { display: none; }
  .library-nav > a:not(.nav-button) { display: none; }
  .nav-button { min-height: 34px; padding: 0 10px; }
  .library-hero { min-height: 0; border-radius: 20px; }
  .library-hero-copy { padding: 30px 22px 118px; }
  .library-eyebrow { white-space: normal; }
  .library-hero h1 { font-size: clamp(2.25rem, 12vw, 3.1rem); }
  .library-hero-copy > p { font-size: 0.82rem; }
  .library-hero-actions { display: grid; }
  .library-trust-row { grid-template-columns: repeat(2, 1fr); }
  .library-trust-row > div { min-height: 52px; padding: 0 13px; border-bottom: 1px solid #e1e8ee; }
  .library-trust-row strong { font-size: 0.72rem; }
  .library-trust-row span { font-size: 0.53rem; }
  .library-scope { gap: 9px; margin-top: 14px; }
  .library-scope article { padding: 14px; }
  .library-discovery { padding: 15px; border-radius: 15px; }
  .library-search-row { grid-template-columns: 1fr; }
  .library-search button { grid-column: auto; }
  .folder-navigation > div { display: none; }
  .library-heading { align-items: flex-start; flex-direction: column; padding-top: 27px; }
  .library-heading-meta { width: 100%; justify-content: space-between; }
  .resource-grid { grid-template-columns: 1fr; }
  .collection-grid { grid-template-columns: 1fr; }
  .collection-cover { height: 180px; }
  .resource-cover { height: 190px; }
  .premium-cta { grid-template-columns: 1fr; padding: 24px 21px; }
  .premium-cta-mark { display: none; }
  .premium-cta > a { grid-column: auto; justify-self: stretch; justify-content: center; }
  footer { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
