/* Population Education Library — lo-fi wireframes with gentle brand accents */
:root {
  --blue: #0096d6;
  --blue-deep: #0077ad;
  --blue-soft: #e5f6fc;
  --green: #52b043;
  --green-deep: #3f8f34;
  --green-soft: #eaf6e8;
  --ink: #1a1a1a;
  --muted: #5a5a5a;
  --line: #c8c8c8;
  --line-strong: #2a2a2a;
  --fill: #f4f4f4;
  --paper: #ffffff;
  --locked-bg: #f0f0f0;
  --locked-border: #b5b5b5;
}

* { box-sizing: border-box; }
html { font-size: 15px; }
body {
  margin: 0;
  font-family: Lato, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: #e4e4e4;
  line-height: 1.45;
}

.wf-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
  padding: 0.55rem 1rem;
  background: #111;
  color: #eee;
  font-size: 0.78rem;
}
.wf-nav a { color: #bbb; text-decoration: none; }
.wf-nav a:hover, .wf-nav a[aria-current="page"] { color: #fff; }
.wf-nav .label { color: #777; }
.wf-notes-toggle {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid #555;
  background: #1c1c1c;
  color: #ccc;
  padding: 0.3rem 0.6rem;
  font-size: 0.72rem;
  border-radius: 999px;
  cursor: pointer;
}
.wf-notes-toggle:hover { border-color: #888; color: #fff; }
.wf-notes-toggle .dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: #c9a227;
}
body.notes-hidden .footer-note { display: none !important; }
body.notes-hidden .wf-notes-toggle .dot { background: #555; }

.frame-wrap {
  max-width: 1120px;
  margin: 1.1rem auto 2.5rem;
  padding: 0 1rem;
}
.frame-meta {
  margin-bottom: 0.6rem;
  font-size: 0.8rem;
  color: var(--muted);
}
.frame-meta strong { color: var(--ink); }

.app {
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(0,0,0,0.04);
  min-height: 720px;
}

.app-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.brand-block {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.brand-block img {
  height: 40px;
  width: auto;
  display: block;
}

.search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--line);
  padding: 0.5rem 0.7rem;
  background: var(--fill);
  color: var(--muted);
  font-size: 0.88rem;
  border-radius: 2px;
}
.header-links {
  display: flex;
  gap: 0.95rem;
  font-size: 0.88rem;
  font-weight: 700;
}
.header-links a {
  color: var(--ink);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
}
.header-links a:hover { color: var(--blue-deep); }
.header-links a.active {
  color: var(--blue-deep);
  border-bottom-color: var(--blue);
}

.app-body { padding: 1rem 1.15rem 1.6rem; }

h1, h2, h3 { font-weight: 700; letter-spacing: -0.015em; }
h1 { font-size: 1.65rem; margin: 0 0 0.45rem; }
h2 { font-size: 1.05rem; margin: 0 0 0.55rem; }
h3 { font-size: 1rem; margin: 0; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border: 1px solid var(--line-strong);
  background: #fff;
  padding: 0.42rem 0.75rem;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: default;
  text-decoration: none;
  color: inherit;
  border-radius: 2px;
}
.btn-primary {
  background: var(--blue);
  border-color: var(--blue-deep);
  color: #fff;
}
.btn-green {
  background: var(--green);
  border-color: var(--green-deep);
  color: #fff;
}
.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--muted);
  font-weight: 400;
}
.btn-block { width: 100%; }

.chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  padding: 0.22rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 700;
  background: #fff;
  white-space: nowrap;
  border-radius: 999px;
  color: var(--ink);
}
.chip-on {
  background: var(--blue);
  border-color: var(--blue-deep);
  color: #fff;
}
.chip-unlocked-topic {
  background: var(--green-soft);
  border-color: var(--green);
  color: var(--green-deep);
}
.chip-locked {
  border-color: #ccc;
  color: #8a8a8a;
  background: #ececec;
  font-weight: 400;
}
.chip-grade-full {
  background: var(--green);
  border-color: var(--green-deep);
  color: #fff;
}
.chip-grade-partial {
  background: var(--green-soft);
  border-color: var(--green);
  color: var(--green-deep);
}
.chip-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.9rem;
  margin-top: 0.4rem;
  font-size: 0.72rem;
  color: var(--muted);
}
.chip-legend .swatch {
  display: inline-block;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  margin-right: 0.3rem;
  vertical-align: middle;
}
.chip-group {
  border-color: var(--line);
  color: var(--muted);
  background: transparent;
  font-weight: 400;
  border-radius: 2px;
}
.collections-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.65rem;
  margin: 0 0 1rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.8rem;
}
.collections-bar .label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  color: #999;
  margin-right: 0.15rem;
}
.collections-bar a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 400;
  border-bottom: 1px solid transparent;
}
.collections-bar a:hover {
  color: var(--blue-deep);
  border-bottom-color: var(--blue);
}

/* Collections rail — visually distinct from filter chips: image tiles you browse into, not a narrowing control */
.collections-rail {
  margin: 0 0 1.1rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--line);
}
.collections-rail .filter-label { margin-bottom: 0.5rem; }
.collections-rail-track {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 0.2rem;
}
.collection-tile {
  flex: 0 0 auto;
  width: 9.5rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  background: #fff;
  text-decoration: none;
  color: inherit;
  display: block;
}
.collection-tile .collection-cover {
  height: 4.2rem;
  background: var(--fill);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #aaa;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.collection-tile .collection-name {
  padding: 0.5rem 0.6rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.2;
}
.collection-tile:hover .collection-name { color: var(--blue-deep); }
.collection-tile-more {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.filter-block { margin-bottom: 0.85rem; }
.filter-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 0.35rem;
}
.chip-row { display: flex; flex-wrap: wrap; gap: 0.35rem; }

.section-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 1.15rem 0 0.55rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.3rem;
}
.section-label .tag-unlocked { color: var(--green-deep); }
.section-label .tag-locked { color: #777; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr));
  gap: 0.75rem;
}

.card {
  position: relative;
  border: 1px solid var(--line);
  padding: 0.9rem 0.95rem 1rem;
  background: #fff;
  min-height: 150px;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  border-radius: 3px;
  border-left: 4px solid var(--green);
}
.card-locked {
  background: var(--locked-bg);
  border-left-color: #9a9a9a;
  border-style: solid;
  opacity: 0.95;
}
.card-title {
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-has-actions .card-title {
  padding-right: 9.5rem; /* Bookmark + Add to folder */
}
.card:has(.folder-pop) { z-index: 4; }
.card-ml .card-title {
  padding-right: 1.75rem; /* room for × only */
}
.card-image {
  aspect-ratio: 1 / 1;
  width: calc(100% + 1.9rem);
  margin: -0.9rem -0.95rem 0;
  background: var(--fill);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #aaa;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.card-locked .card-image { background: #e8e8e8; }
/* Detail page hero — same square format as tiles, capped to a sane width in a wide content column */
.detail-hero-image {
  aspect-ratio: 1 / 1;
  width: 14rem;
  max-width: 100%;
  margin: 0 0 0.6rem;
}

/* Resource-type badge — always in the same spot (upper-left of the image) on every tile, every context, no conditional hiding */
.type-badge {
  position: absolute;
  top: 0.45rem;
  left: 0.75rem;
  font-size: 0.64rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #fff;
  background: rgba(20,20,20,0.62);
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
}

/* Bookmark ribbon — replaces the old Bookmark/Add-to-folder hover pair; Add to folder now lives only in Detail/My library */
.bookmark-ribbon {
  position: absolute;
  top: 0;
  right: 0.75rem;
  width: 1.5rem;
  height: 2.1rem;
  background: #fff;
  border: 1px solid var(--green);
  border-top: none;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 0.3rem;
  color: var(--green-deep);
  font-size: 0.72rem;
  cursor: pointer;
}
.bookmark-ribbon.is-saved { background: var(--green); color: #fff; }
.card-has-actions .card-title { padding-right: 2.2rem; }
.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  font-size: 0.7rem;
}
.meta-row span {
  border: 1px solid var(--line);
  padding: 0.12rem 0.4rem;
  background: #fff;
  border-radius: 2px;
  color: var(--muted);
  font-weight: 400;
}
.meta-row .meta-type {
  font-weight: 700;
  color: var(--ink);
  border-color: var(--line-strong);
}
.card-locked .meta-row span { background: #e8e8e8; }
.card-teaser {
  font-size: 0.8rem;
  color: var(--muted);
  flex: 1;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-height: 1.4;
  min-height: 2.8em;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: auto;
}
.hover-actions {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  display: flex;
  gap: 0.25rem;
}
.hover-actions .btn {
  padding: 0.22rem 0.45rem;
  font-size: 0.68rem;
  background: #fff;
  border-color: var(--green);
  color: var(--green-deep);
}
.btn-icon {
  width: 1.55rem;
  height: 1.55rem;
  padding: 0;
  font-size: 1rem;
  line-height: 1;
  font-weight: 400;
  color: var(--muted);
  border-color: var(--line);
  background: #fff;
}
.btn-icon:hover { color: var(--ink); border-color: var(--ink); }
.card-ml .card-actions {
  flex-wrap: nowrap;
}
.card-ml .card-actions .btn { font-size: 0.75rem; }

.note-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--blue-deep);
  background: var(--blue-soft);
  border: 1px solid var(--blue);
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  width: fit-content;
}
.note-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--blue);
}

.detail-layout {
  display: grid;
  grid-template-columns: 1fr 250px;
  gap: 1.25rem;
  align-items: start;
}
@media (max-width: 800px) {
  .detail-layout { grid-template-columns: 1fr; }
}
.overview {
  font-size: 1rem;
  margin: 0 0 0.75rem;
  max-width: 42rem;
  color: #222;
}
.quick-glance {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.9rem;
}
.time-block {
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  background: var(--blue-soft);
  padding: 0.7rem 0.85rem;
  margin-bottom: 1rem;
  max-width: 28rem;
  border-radius: 2px;
}
.time-block .filter-label { color: var(--blue-deep); }
.time-block ul {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.9rem;
}
.sidebar-panel {
  border: 1px solid var(--line);
  background: #fff;
  padding: 0.85rem;
  position: sticky;
  top: 3.2rem;
  border-radius: 3px;
}
.sidebar-panel .stack { display: flex; flex-direction: column; gap: 0.4rem; }
.sidebar-divider {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 0.7rem 0;
}
.content-block {
  border-top: 1px solid var(--line);
  padding: 1rem 0 0.2rem;
  margin-top: 0.7rem;
}
.content-block p, .content-block li { font-size: 0.92rem; }
.extras summary {
  cursor: pointer;
  font-weight: 700;
}
.extras-body {
  margin-top: 0.5rem;
  padding: 0.7rem;
  background: var(--fill);
  border: 1px solid var(--line);
  font-size: 0.88rem;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  margin-top: 0.5rem;
}
@media (max-width: 700px) {
  .related-grid { grid-template-columns: 1fr; }
}
.related-card {
  border: 1px solid var(--line);
  border-left: 3px solid var(--green);
  padding: 0.55rem 0.65rem;
  background: #fff;
  font-size: 0.82rem;
}
.video-box {
  border: 1px dashed var(--line);
  background: var(--fill);
  aspect-ratio: 16 / 9;
  max-width: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.85rem;
}

.ml-layout {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 1rem;
  align-items: start;
}
@media (max-width: 750px) {
  .ml-layout { grid-template-columns: 1fr; }
}
.ml-nav {
  border: 1px solid var(--line);
  background: #fff;
  padding: 0.55rem;
  border-radius: 3px;
}
.ml-nav ul { list-style: none; margin: 0; padding: 0; }
.ml-nav li { margin: 0 0 0.15rem; }
.ml-nav a {
  display: block;
  padding: 0.45rem 0.55rem;
  color: inherit;
  text-decoration: none;
  font-size: 0.88rem;
  border-radius: 2px;
}
.ml-nav a:hover { background: var(--fill); }
.ml-nav a.active {
  background: var(--green-soft);
  color: var(--green-deep);
  font-weight: 700;
}
.ml-nav .sub { margin-left: 0.35rem; font-size: 0.82rem; color: var(--muted); }
.ml-nav .sub a { font-weight: 400; }
.ml-nav .folder-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.2rem;
}
.ml-nav .folder-row a { flex: 1; }
.ml-nav .folder-row .btn-icon {
  width: 1.35rem;
  height: 1.35rem;
  font-size: 0.9rem;
  flex-shrink: 0;
  margin-right: 0.35rem;
}

.note-block {
  border: 1px solid var(--line);
  background: var(--fill);
  padding: 0.7rem 0.75rem;
  border-radius: 2px;
  margin-top: 0.7rem;
}
.note-block .note-text {
  font-size: 0.85rem;
  margin: 0 0 0.6rem;
  color: #333;
}

.empty-state {
  border: 1px dashed var(--line);
  background: var(--fill);
  padding: 1.5rem;
  text-align: center;
  border-radius: 3px;
}
.empty-state p {
  margin: 0 0 0.85rem;
  color: var(--muted);
}
.suggest-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  margin-top: 1rem;
  text-align: left;
}
@media (max-width: 700px) {
  .suggest-row { grid-template-columns: 1fr; }
}

.back-link {
  font-size: 0.82rem;
  color: var(--blue-deep);
  text-decoration: none;
  font-weight: 700;
}
.back-link:hover { text-decoration: underline; }

.see-more {
  font-size: 0.82rem;
  color: var(--blue-deep);
  font-weight: 700;
  text-decoration: none;
}
.see-more:hover { text-decoration: underline; }

/* Wireframe annotation — explains function/behavior, NOT real UI copy.
   Styled deliberately unlike any real content block so it can't be mistaken
   for something to carry into hi-fi design. */
.footer-note {
  margin: 0.75rem 0 0;
  padding: 0.4rem 0.6rem 0.4rem 0.55rem;
  font-size: 0.72rem;
  font-style: italic;
  color: #8a6d1a;
  background: #fdf6e3;
  border-left: 2px dashed #c9a227;
}
.footer-note::before {
  content: "WIREFRAME NOTE — ";
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.footer-note a { color: #8a6d1a; }

/* Light chrome — pre-auth surfaces (login, unlock, checkout) */
.app-header-light {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.app-header-light .tagline {
  font-size: 0.78rem;
  color: var(--muted);
}
.app-header-light .back-out {
  font-size: 0.78rem;
  color: var(--muted);
  text-decoration: none;
}
.app-header-light .back-out:hover { color: var(--blue-deep); }

.narrow-col { max-width: 26rem; margin: 0 auto; }

.form-field { margin-bottom: 0.75rem; }
.form-field label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 0.3rem;
}
.form-input {
  border: 1px solid var(--line);
  background: #fff;
  padding: 0.55rem 0.65rem;
  font-size: 0.9rem;
  color: var(--muted);
  border-radius: 2px;
}
.form-row { display: flex; gap: 0.6rem; }
.form-row .form-field { flex: 1; }

.claim-link {
  display: inline-block;
  margin-top: 0.6rem;
  font-size: 0.85rem;
  color: var(--blue-deep);
  text-decoration: none;
  font-weight: 700;
}
.claim-link:hover { text-decoration: underline; }

.state-panel {
  border: 1px dashed var(--line);
  padding: 1rem 1.1rem;
  margin: 1.2rem 0;
  border-radius: 3px;
  background: var(--fill);
}
.state-panel .state-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: #888;
  margin-bottom: 0.6rem;
}

.context-banner {
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  background: var(--blue-soft);
  padding: 0.6rem 0.85rem;
  margin-bottom: 1.1rem;
  border-radius: 2px;
  font-size: 0.88rem;
}
.context-banner strong { color: var(--blue-deep); }

.bundle-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}
@media (max-width: 800px) {
  .bundle-grid { grid-template-columns: 1fr; }
}
.bundle-option {
  border: 1px solid var(--line);
  padding: 0.9rem 0.95rem;
  border-radius: 3px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.bundle-option .bundle-name { font-weight: 700; font-size: 0.92rem; }
.bundle-option .bundle-price { font-size: 1.3rem; font-weight: 700; color: var(--blue-deep); }
.bundle-option .bundle-desc { font-size: 0.78rem; color: var(--muted); flex: 1; }
.bundle-option-recommended {
  border-color: var(--blue-deep);
  border-width: 2px;
  box-shadow: 0 0 0 1px var(--blue-deep) inset;
}
.bundle-badge {
  display: inline-flex;
  width: fit-content;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #fff;
  background: var(--blue-deep);
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
}
.bundle-badge-muted {
  color: var(--muted);
  background: var(--fill);
  border: 1px solid var(--line);
}
.bundle-nudge {
  border: 1px solid var(--green);
  background: var(--green-soft);
  color: var(--green-deep);
  padding: 0.6rem 0.85rem;
  border-radius: 2px;
  font-size: 0.82rem;
  margin-bottom: 1.1rem;
}

.checkout-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 1.3rem;
  align-items: start;
}
@media (max-width: 800px) {
  .checkout-layout { grid-template-columns: 1fr; }
}
.step-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: var(--muted);
  margin: 0 0 0.5rem;
}
.step-label .step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: 0.65rem;
}
.summary-box {
  border: 1px solid var(--line);
  background: #fff;
  padding: 0.9rem;
  border-radius: 3px;
  position: sticky;
  top: 3.2rem;
}
.summary-box .filter-label { margin-bottom: 0.5rem; }
.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  padding: 0.3rem 0;
}
.summary-total {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  font-size: 0.95rem;
  border-top: 1px solid var(--line);
  margin-top: 0.4rem;
  padding-top: 0.5rem;
}
.confirm-box {
  border: 1px solid var(--green);
  border-left: 4px solid var(--green);
  background: var(--green-soft);
  padding: 1.1rem 1.2rem;
  border-radius: 3px;
  max-width: 30rem;
}
.confirm-box h2 { color: var(--green-deep); }

/* Results toolbar — My Units / Only show Saved sit here, not in the filter stack or inside Sort */
.toolbar-extra {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-right: 0.75rem;
  padding-right: 0.75rem;
  border-right: 1px solid var(--line);
}
.toolbar-extra .chip { font-size: 0.72rem; }
.toolbar-check {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--muted);
}
.toolbar-check input { margin: 0; }

/* AP course sub-filter — nested under Subject, only present when Grade = 9-12 */
.subject-ap-group {
  margin-top: 0.4rem;
  padding-top: 0.4rem;
  border-top: 1px dashed var(--line);
}
.subject-ap-group .filter-label { font-size: 0.64rem; color: #999; margin-bottom: 0.3rem; }
.chip-ap {
  border-style: dashed;
  border-color: var(--line-strong);
  color: var(--ink);
  background: #fff;
}
.chip-ap.chip-active-filter {
  border-style: solid;
}
/* Marks a chip as the active filter selection, layered over its ownership/state color */
.chip-active-filter {
  box-shadow: 0 0 0 2px var(--blue-deep);
}
/* Marks a filter chip as temporarily unavailable given the current selection (e.g. non-9-12 grades when an AP subject alone is active) */
.chip-disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* Sort control */
.sort-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.sort-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 5;
  min-width: 13rem;
  border: 1px solid var(--line-strong);
  background: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  border-radius: 2px;
  padding: 0.25rem 0;
}
.sort-menu button,
.sort-menu .sort-opt {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 0.4rem 0.75rem;
  font: inherit;
  font-size: 0.8rem;
  cursor: default;
  color: var(--ink);
}
.sort-opt-on {
  font-weight: 700;
  background: var(--blue-soft);
  color: var(--blue-deep);
}
.sort-opt-note {
  display: block;
  font-size: 0.68rem;
  font-weight: 400;
  color: var(--muted);
}

/* Folder picker popover */
.folder-anchor { position: relative; display: inline-block; }
.folder-pop {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 8;
  width: 15.5rem;
  border: 1px solid var(--line-strong);
  background: #fff;
  box-shadow: 0 4px 14px rgba(0,0,0,0.1);
  border-radius: 3px;
  padding: 0.65rem 0.7rem 0.75rem;
}
[data-folder].is-open .folder-pop { display: block; }
.sidebar-panel .folder-pop {
  position: relative;
  top: 0;
  right: auto;
  width: 100%;
  margin-top: 0.35rem;
  box-shadow: none;
}
.folder-pop .filter-label { margin-bottom: 0.45rem; }
.folder-check {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  padding: 0.28rem 0;
  cursor: default;
}
.folder-check input { margin: 0; }
.folder-new {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--line);
}
.folder-new .form-input {
  flex: 1;
  padding: 0.35rem 0.45rem;
  font-size: 0.78rem;
}
.folder-new .btn { padding: 0.32rem 0.5rem; font-size: 0.72rem; }

/* Type-specific middle blocks */
.book-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
}
.book-tile {
  border: 1px solid var(--line);
  padding: 0.55rem 0.65rem;
  background: #fff;
  font-size: 0.82rem;
}
.book-tile .muted { font-size: 0.72rem; color: var(--muted); }
.transcript-box {
  border: 1px solid var(--line);
  background: var(--fill);
  padding: 0.7rem 0.8rem;
  font-size: 0.85rem;
  color: var(--muted);
  max-height: 8rem;
  overflow: hidden;
}
.embed-box {
  border: 1px dashed var(--line);
  background: var(--fill);
  min-height: 10rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.85rem;
}
.type-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 1rem;
}
.woo-list {
  border: 1px solid var(--line);
  background: #fff;
  max-width: 22rem;
  padding: 0;
  list-style: none;
  margin: 0;
}
.woo-list li {
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}
.woo-list li:last-child { border-bottom: 0; }
.woo-list li.active {
  background: var(--fill);
  font-weight: 700;
}
.woo-hello {
  font-size: 1.15rem;
  margin: 0 0 0.45rem;
}
.woo-intro {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0 0 1.1rem;
  max-width: 36rem;
}
.woo-intro a { color: var(--blue-deep); font-weight: 700; text-decoration: none; }
.order-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin-bottom: 1.1rem;
}
.order-table th,
.order-table td {
  text-align: left;
  padding: 0.5rem 0.55rem;
  border-bottom: 1px solid var(--line);
}
.order-table th {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.addr-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
@media (max-width: 700px) {
  .addr-grid { grid-template-columns: 1fr; }
}
.addr-box {
  border: 1px solid var(--line);
  padding: 0.75rem 0.85rem;
  font-size: 0.85rem;
  border-radius: 2px;
}
.addr-box .filter-label { margin-bottom: 0.4rem; }
.addr-box p { margin: 0; color: var(--muted); }

/* Combined Save to My Library + folders control (Detail sidebar) */
.save-anchor { display: block; margin-bottom: 0.4rem; }
.save-anchor > .btn { text-align: left; }
.sidebar-panel .save-anchor .folder-pop { position: relative; top: 0; right: auto; width: 100%; box-shadow: none; margin-top: 0.35rem; }
.folder-unsave { display: block; margin-top: 0.6rem; padding-top: 0.5rem; border-top: 1px solid var(--line); font-size: 0.78rem; color: var(--muted); text-decoration: underline; }

/* Library: two separate entry modes */
.group-heading { font-size: 0.95rem; font-weight: 700; margin: 0.2rem 0 0.15rem; color: var(--ink); }
summary.group-heading { cursor: pointer; margin: 0; }
.quick-select-group .extras-body { margin-top: 0.65rem; padding: 0; background: transparent; border: 0; }
.group-sub { font-size: 0.78rem; color: var(--muted); margin: 0 0 0.6rem; }
.entry-group { border: 1px solid var(--line); border-radius: 3px; padding: 0.75rem 0.85rem 0.4rem; margin-bottom: 1rem; background: #fff; }

/* Quick Select boxes — My Bookshelf / Browse all, same visual weight as Collections / My Units */
.quick-box-row { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 0.8rem; }
.quick-box {
  flex: 1 1 10rem;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0.75rem 0.85rem;
  background: #fff;
  text-decoration: none;
  color: inherit;
  display: block;
}
.quick-box:hover { border-color: var(--blue-deep); }
.quick-box .quick-box-title { font-weight: 700; font-size: 0.88rem; }
.quick-box .quick-box-sub { font-size: 0.74rem; color: var(--muted); margin-top: 0.15rem; }

/* Header "How It Works" link */
.header-help {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.3rem 0.65rem;
  background: transparent;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
.header-help:hover { color: var(--blue-deep); border-color: var(--blue-deep); }

/* Generic modal overlay — welcome tour, locked-tile excerpt popup */
.wf-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 20, 20, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1.5rem;
}
.wf-overlay[hidden] { display: none; }
.wf-modal {
  background: #fff;
  border-radius: 6px;
  max-width: 30rem;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 1.5rem;
  position: relative;
  box-shadow: 0 10px 40px rgba(0,0,0,0.25);
}
.wf-modal-close {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  width: 1.8rem;
  height: 1.8rem;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 50%;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
}
.wf-modal-close:hover { color: var(--ink); border-color: var(--ink); }
.wf-modal h2 { margin-right: 1.5rem; }
.wf-modal .tour-step { margin-bottom: 0.9rem; }
.wf-modal .tour-step .filter-label { margin-bottom: 0.2rem; }
.excerpt-image { aspect-ratio: 16/9; width: 100%; margin-bottom: 0.75rem; }

/* Outside Resource List — plain grouped text list, replacing the tile grid */
.resource-list-group { margin-bottom: 1rem; }
.resource-list-heading { font-size: 0.82rem; font-weight: 700; color: var(--muted); margin: 0 0 0.35rem; }
.resource-text-list { margin: 0; padding-left: 1.2rem; font-size: 0.9rem; }
.resource-text-list li { margin-bottom: 0.3rem; }

/* Login column layout replacing Featured teaser tiles */
.login-columns {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2.5rem;
  align-items: center;
  max-width: 48rem;
  margin: 0 auto;
}
@media (max-width: 700px) {
  .login-columns { grid-template-columns: 1fr; }
}
.login-about .logo-placeholder {
  width: 5.5rem;
  height: 5.5rem;
  border: 1px dashed var(--line);
  background: var(--fill);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #aaa;
  font-size: 0.68rem;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  border-radius: 4px;
}
.login-about .by-line {
  font-size: 0.8rem;
  color: var(--blue-deep);
  font-weight: 700;
  text-decoration: none;
  display: inline-block;
  margin-bottom: 0.6rem;
}
.login-about p { color: var(--muted); font-size: 0.9rem; }

/* Note-saved confirmation message */
.confirm-inline {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--green-deep);
  background: var(--green-soft);
  border: 1px solid var(--green);
  padding: 0.4rem 0.6rem;
  border-radius: 2px;
  margin-top: 0.5rem;
}

/* My Bookshelf — folder tiles as the default landing content */
.folder-tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: 0.75rem; }
.folder-tile {
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0.9rem 1rem;
  background: #fff;
  text-decoration: none;
  color: inherit;
  display: block;
}
.folder-tile:hover { border-color: var(--blue-deep); }
.folder-tile .folder-tile-name { font-weight: 700; font-size: 0.92rem; }
.folder-tile .folder-tile-count { font-size: 0.74rem; color: var(--muted); margin-top: 0.2rem; }
.folder-tile-new { border-style: dashed; color: var(--muted); display: flex; align-items: center; justify-content: center; font-weight: 700; }
.folder-tile-unassigned { background: var(--fill); border-style: dashed; }
.folder-tile-unassigned .folder-tile-name { color: var(--muted); }
