:root {
  color-scheme: light;
  --bg: #fff;
  --side-bg: #f8f7f4;
  --paper: #fff;
  --ink: #252323;
  --text: #514e50;
  --muted: #69656a;
  --line: #eae7e2;
  --accent: #573bc5;
  --accent-dark: #4530a0;
  --accent-light: #eee9fb;
  --side: 236px;
  --header: 60px;
  font: 15px/1.45 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

* { box-sizing: border-box; }
body, h1, h2, h3, p { margin: 0; }
button, input, select { font: inherit; }
button, a, summary, select { touch-action: manipulation; }
button, summary { cursor: pointer; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
svg { display: block; flex: none; width: 17px; height: 17px; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[tabindex="-1"]:focus { outline: none; }
.skip { position: fixed; z-index: 20; top: 10px; left: 12px; transform: translateY(-200%); padding: 9px 12px; background: var(--paper); border-radius: 6px; }
.skip:focus { transform: none; }

.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 5; display: flex; flex-direction: column; width: var(--side); border-right: 1px solid var(--line); background: var(--side-bg); }
.brand { display: flex; align-items: center; gap: 11px; min-height: 78px; padding: 20px 18px; font-size: 15px; font-weight: 760; letter-spacing: -.25px; }
.brand img { width: 34px; height: 34px; border-radius: 9px; }
.brand small, .sidebar-foot small { display: block; margin-top: 1px; color: var(--muted); font-size: 11px; font-weight: 500; letter-spacing: 0; }
.sidebar-body { flex: 1; overflow: auto; padding: 5px 12px 14px; scrollbar-width: thin; }
.side-label { margin: 8px 9px; color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: 1.15px; }
.nav-item { display: flex; align-items: center; gap: 9px; width: 100%; min-height: 36px; margin: 2px 0; padding: 4px 9px; border: 0; border-radius: 6px; background: transparent; color: #514d54; text-align: left; font-size: 13px; font-weight: 560; }
.nav-item:hover { background: #efede9; color: var(--ink); }
.nav-item.active { background: var(--accent-light); color: var(--accent-dark); font-weight: 700; }
.nav-item svg { width: 16px; height: 16px; }
.nav-count { margin-left: auto; padding: 1px 6px; border-radius: 5px; background: #eeece8; color: inherit; font-size: 11px; }
.topics { margin-top: 15px; padding-top: 12px; border-top: 1px solid var(--line); }
.topic-nav { min-height: 34px; }
.topic-dot { width: 6px; height: 6px; margin: 0 5px; border-radius: 50%; background: #96909a; flex: none; }
.sidebar-foot { display: flex; align-items: center; gap: 8px; margin: 10px 12px 14px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); text-align: left; font-size: 12px; }
.sidebar-foot:hover { border-color: #c8b9f5; }
.foot-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 6px; background: var(--accent-light); color: var(--accent); }
.foot-icon svg, .foot-arrow svg { width: 14px; height: 14px; }
.foot-arrow { margin-left: auto; color: var(--muted); }

.workspace { margin-left: var(--side); }
.topbar { position: sticky; top: 0; z-index: 4; display: flex; align-items: center; gap: 18px; height: var(--header); padding: 0 clamp(22px, 4vw, 64px); border-bottom: 1px solid var(--line); background: var(--paper); }
.crumb { display: flex; align-items: center; gap: 8px; min-width: 0; margin-right: auto; color: var(--muted); font-size: 13px; white-space: nowrap; }
.crumb-home:hover { color: var(--accent); }
.crumb-divider { color: #8c858e; }
.crumb strong { overflow: hidden; color: var(--ink); font-weight: 650; text-overflow: ellipsis; }
.global-search { display: flex; align-items: center; gap: 8px; width: min(39vw, 370px); min-width: 155px; height: 36px; padding: 0 8px 0 10px; border: 1px solid #e7e3de; border-radius: 7px; background: #faf9f7; color: var(--muted); }
.global-search:focus-within { border-color: var(--accent); }
.global-search input { width: 100%; min-width: 0; padding: 0; border: 0; outline: none; background: transparent; color: var(--ink); font-size: 13px; }
.global-search input::placeholder { color: var(--muted); }
kbd { flex: none; width: 19px; border: 1px solid var(--line); border-radius: 4px; background: var(--paper); text-align: center; font: 11px/17px ui-monospace, monospace; }
.top-saved, #menu { display: inline-flex; align-items: center; gap: 6px; padding: 7px 3px; border: 0; border-radius: 5px; background: transparent; color: var(--text); font-size: 12px; font-weight: 670; }
.top-saved:hover, .top-saved.active { color: var(--accent-dark); }
#menu, .backdrop { display: none; }

.content { width: min(100%, 1036px); margin: 0 auto; padding: 37px clamp(24px, 4.2vw, 63px) 0; }
.intro { padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.eyebrow { margin-bottom: 7px; color: var(--accent); font-size: 10px; font-weight: 780; letter-spacing: 1.45px; }
.intro h1, .library-heading h1 { color: var(--ink); font-size: clamp(31px, 4vw, 49px); font-weight: 790; letter-spacing: -.052em; line-height: 1.07; text-wrap: balance; }
.intro-copy { margin-top: 9px; color: var(--text); font-size: 15px; }
.quick-links { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 15px; }
.quick-links button { display: inline-flex; align-items: center; gap: 7px; min-height: 35px; padding: 6px 9px; border: 1px solid #e8e3ed; border-radius: 6px; background: #fbf9ff; color: var(--accent-dark); font-size: 12px; font-weight: 680; }
.quick-links button:hover { border-color: #cbbaf8; background: var(--accent-light); }
.quick-links svg { width: 15px; height: 15px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.section-heading h2 { font-size: 24px; font-weight: 750; letter-spacing: -.72px; line-height: 1.2; }
.section-heading p { margin-top: 5px; color: var(--muted); font-size: 13px; }
.directory-heading { margin: 22px 0 18px; }
.directory-heading .text-link { align-self: flex-end; }
.group-jumps { display: none; }
.text-link { display: inline-flex; align-items: center; gap: 5px; padding: 2px 0; border: 0; background: none; color: var(--accent-dark); text-align: left; font-size: 12px; font-weight: 720; }
.text-link:hover { text-decoration: underline; }
.text-link svg { width: 14px; height: 14px; }
.directory-group { scroll-margin-top: calc(var(--header) + 14px); }
.directory-group + .directory-group { margin-top: 22px; }
.directory-group h3 { margin-bottom: 6px; color: var(--muted); font-size: 11px; font-weight: 790; letter-spacing: 1px; line-height: 1.4; text-transform: uppercase; }
.group-description { margin-bottom: 8px; color: var(--muted); font-size: 12px; }
.topic-list { border: 1px solid var(--line); border-radius: 9px; }
.topic-entry + .topic-entry { border-top: 1px solid var(--line); }
.topic-entry > summary { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 45px; padding: 6px 11px; border-radius: 6px; list-style: none; }
.topic-entry > summary::-webkit-details-marker { display: none; }
.topic-entry > summary:hover { background: #faf8f5; }
.topic-entry[open] > summary { background: #f8f5ff; color: var(--accent-dark); }
.topic-title { font-size: 15px; font-weight: 690; line-height: 1.25; }
.topic-count { color: var(--muted); white-space: nowrap; font-size: 11px; font-variant-numeric: tabular-nums; }
.disclosure { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 5px; background: #f0eeeb; color: #625c65; }
.disclosure svg { width: 14px; height: 14px; }
.topic-entry[open] .disclosure { background: var(--accent-light); color: var(--accent); }
.topic-entry[open] .disclosure svg { transform: rotate(90deg); }
.topic-panel { padding: 11px 12px 11px 46px; }
.topic-description { margin-bottom: 10px; color: var(--muted); font-size: 13px; }
.preview-start { margin: 0 0 8px; padding: 7px 9px; border-left: 2px solid #b6a0ef; background: #faf7fe; color: var(--text); font-size: 12px; }
.preview-start strong { margin-right: 4px; color: var(--accent-dark); }
.preview-filters, .tabs, .filters { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.preview-filters { margin-bottom: 6px; }
.preview-filter, .tab { min-height: 32px; padding: 5px 8px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--text); font-size: 12px; font-weight: 650; white-space: nowrap; }
.preview-filter span { margin-left: 2px; font-size: 10px; font-variant-numeric: tabular-nums; }
.preview-filter:hover, .tab:hover { background: #f7f4fc; color: var(--accent-dark); }
.preview-filter[aria-pressed="true"], .tab.active { border-color: #e8dff9; background: var(--accent-light); color: var(--accent-dark); }
.topic-more { min-height: 33px; margin-top: 4px; }

.back-link { margin-bottom: 12px; }
.library-heading { margin-bottom: 15px; }
.library-heading h1 { font-size: clamp(29px, 3.5vw, 41px); }
.library-total { align-self: center; flex: none; padding: 4px 8px; border: 1px solid #e7e0f4; border-radius: 6px; background: #f7f4fc; color: var(--accent-dark); font-size: 11px; font-weight: 670; }
.controls { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 12px; padding-bottom: 9px; border-bottom: 1px solid var(--line); }
.controls.standalone-controls { justify-content: flex-start; }
.select { position: relative; display: flex; align-items: center; gap: 4px; max-width: 203px; height: 33px; padding: 0 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); color: var(--muted); }
.select:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.select select { appearance: none; width: 100%; min-width: 0; height: 100%; padding: 0 15px 0 2px; border: 0; outline: none; background: transparent; color: var(--ink); font-size: 11.5px; cursor: pointer; }
.select [data-icon] { pointer-events: none; }
.select svg { width: 13px; height: 13px; }
.select-arrow { position: absolute; right: 6px; }
.results-bar { display: flex; justify-content: space-between; align-items: center; min-height: 36px; color: var(--muted); font-size: 12px; }
.results-bar button { padding: 4px 0 4px 8px; border: 0; background: none; color: var(--accent-dark); font-size: 12px; font-weight: 700; }
.resource-list { border-top: 1px solid var(--line); }
.resource-row { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: start; gap: 10px; min-width: 0; padding: 11px 0; border-bottom: 1px solid var(--line); }
.preview-list .resource-row:last-child { border-bottom: 0; }
.tile { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 7px; }
.tile svg { width: 16px; height: 16px; }
.violet { background: #f0eafb; color: var(--accent-dark); }
.blue { background: #eaf1fb; color: #36569d; }
.mint { background: #e5f3eb; color: #16734f; }
.resource-copy { min-width: 0; }
.resource-title, .resource-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 7px; }
.resource-actions { flex-wrap: nowrap; align-self: start; }
.card-title { padding: 0; border: 0; background: none; color: var(--ink); text-align: left; font-size: 14px; font-weight: 730; line-height: 1.3; overflow-wrap: anywhere; }
.card-title:hover { color: var(--accent-dark); text-decoration: underline; }
.resource-row p { margin-top: 2px; color: var(--text); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.resource-meta { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.badge { padding: 2px 5px; border-radius: 4px; background: #f0eeec; color: #59535e; font-size: 10px; font-weight: 660; line-height: 1.3; }
.badge.open { background: #e5f4eb; color: #166649; }
.badge.read { background: #ebf0fc; color: #3556a8; }
.badge.template { background: #f0eafa; color: #5e409c; }
.badge.credit { background: #faf0e2; color: #83541f; }
.card-link { display: inline-flex; align-items: center; gap: 3px; min-height: 28px; padding: 2px 0; border: 0; background: none; color: var(--accent-dark); font-size: 11.5px; font-weight: 710; white-space: nowrap; }
.card-link:hover { text-decoration: underline; }
.card-link svg { width: 13px; height: 13px; }
.save { display: grid; flex: none; place-items: center; width: 31px; height: 31px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--muted); }
.save:hover, .save[aria-pressed="true"] { background: var(--accent-light); color: var(--accent-dark); }
.save[aria-pressed="true"] svg { fill: #d4c6ff; }
.option-tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 5px 0 0; padding: 0; list-style: none; }
.option-tags li { padding: 2px 5px; border-radius: 4px; background: #f4f0fa; color: #5b4a80; font-size: 10px; }
.collection-note, .detail-note { margin: 0 0 13px; padding: 10px 12px; border: 1px solid #e8e0f6; border-radius: 8px; background: #f9f6fd; color: #514867; font-size: 12px; line-height: 1.5; }
.collection-note p, .detail-note p { margin-top: 3px; }
.collection-note details { margin-top: 6px; }
.collection-note summary { color: var(--accent-dark); font-weight: 680; }
.workflow h2 { color: var(--ink); font-size: 15px; }
.workflow-steps ol { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 21px; margin: 7px 0 0; padding-left: 19px; }
.workflow-steps li::marker { color: var(--accent-dark); font-weight: 750; }
.workflow-links { display: flex; flex-wrap: wrap; gap: 0 8px; margin-top: 2px; }
.workflow-links .text-link { min-height: 25px; font-size: 11px; }
.workflow-links svg { width: 12px; height: 12px; }
.workflow-next { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 12px; margin-top: 8px; padding-top: 7px; border-top: 1px solid #e8e0f6; }
.workflow-next .text-link { min-height: 25px; }
.workflow-index-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 9px 11px; border: 0; border-radius: 5px; background: var(--paper); text-align: left; }
.workflow-index-row + .workflow-index-row { border-top: 1px solid var(--line); }
.workflow-index-row:hover { background: #f8f5fd; }
.workflow-index-row strong, .workflow-index-row small { display: block; }
.workflow-index-row strong { font-size: 14px; }
.workflow-index-row small { margin-top: 2px; color: var(--muted); font-size: 12px; }
.workflow-index-row svg { color: var(--accent); }
.workflow-jumps { display: flex; flex-wrap: wrap; gap: 5px; margin: 0 0 13px; }
.workflow-jumps button { display: inline-flex; align-items: center; gap: 4px; min-height: 28px; padding: 4px 7px; border: 0; border-radius: 5px; background: #f5f3f0; color: var(--text); font-size: 11px; font-weight: 650; }
.workflow-jumps button:hover { background: var(--accent-light); color: var(--accent-dark); }
.workflow-jumps svg { width: 11px; height: 11px; }
.empty { padding: 25px 14px; border: 1px dashed #ddd7e9; border-radius: 9px; color: var(--muted); text-align: center; }
.empty .tile { margin: 0 auto 8px; }
.empty h3 { color: var(--ink); }
.empty p { margin: 6px 0 12px; font-size: 13px; }
.more-wrap { display: flex; justify-content: center; margin: 15px 0 0; }
.footer { display: flex; justify-content: space-between; gap: 8px; margin-top: 26px; padding: 14px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.footer span:first-child { color: var(--text); font-weight: 690; }

.primary, .secondary { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 37px; padding: 0 11px; border-radius: 6px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.primary { border: 1px solid var(--accent); background: var(--accent); color: #fff; }
.primary:hover { background: var(--accent-dark); }
.secondary { border: 1px solid #e4deed; background: var(--paper); color: var(--accent-dark); }
.secondary:hover { border-color: #c8b9f5; background: #fbf9ff; }
.primary svg, .secondary svg { width: 14px; height: 14px; }
dialog { width: min(555px, calc(100% - 26px)); max-height: 88vh; padding: 22px; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 70px #2d244434; background: var(--paper); color: var(--ink); overscroll-behavior: contain; }
dialog::backdrop, .backdrop { background: #28233366; }
.close { position: absolute; top: 11px; right: 11px; padding: 6px; border: 0; border-radius: 6px; background: #f4f1f7; color: var(--muted); }
.close:hover { color: var(--accent-dark); }
.detail-heading { margin-top: 9px; padding-right: 15px; font-size: 23px; line-height: 1.16; letter-spacing: -.55px; overflow-wrap: anywhere; }
.detail-meta { margin-top: 6px; color: var(--muted); font-size: 12px; }
.detail-description { margin-top: 12px; color: var(--text); font-size: 14px; line-height: 1.55; }
.detail-note { margin: 12px 0 6px; }
.detail-note small { display: block; margin-top: 6px; color: var(--muted); }
.detail-links, .detail-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.detail-actions { gap: 7px; margin-top: 13px; }
.alternative-list { margin: 12px 0 0; padding: 0; border-top: 1px solid var(--line); list-style: none; }
.alternative-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.alternative-list small { display: block; color: var(--muted); font-size: 11px; }
.about-list { padding-left: 20px; color: var(--text); font-size: 13px; line-height: 1.5; }
.about-list li { margin: 6px 0; }
.prompt-text { padding: 10px; border: 1px solid #e8e0f6; border-radius: 7px; background: #f9f6fd; color: #403653; font: 12px/1.6 ui-monospace, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.toast { position: fixed; z-index: 7; right: 13px; bottom: 13px; padding: 8px 11px; border-radius: 6px; box-shadow: 0 4px 15px #201c2b25; background: #292439; color: #fff; font-size: 12px; }

@media (max-width: 960px) {
  :root { --side: 204px; }
  .content, .topbar { padding-left: 22px; padding-right: 22px; }
}

@media (max-width: 760px) {
  :root { --header: 54px; --side: 236px; }
  .workspace { margin-left: 0; }
  .sidebar { visibility: hidden; transform: translateX(-101%); transition: transform .16s, visibility .16s; }
  .sidebar.open { visibility: visible; transform: none; }
  .backdrop { position: fixed; inset: 0; z-index: 4; display: block; border: 0; }
  #menu { display: inline-flex; margin-right: 2px; }
  .topbar { gap: 9px; }
  .content { padding-top: 22px; }
  .group-jumps { display: flex; flex-wrap: wrap; gap: 5px; margin: -3px 0 13px; }
  .group-jumps a { display: inline-flex; align-items: center; gap: 3px; padding: 4px 6px; border-radius: 5px; background: #f5f3f0; color: var(--text); font-size: 10.5px; font-weight: 650; }
  .group-jumps a:hover { background: var(--accent-light); color: var(--accent-dark); }
  .group-jumps svg { width: 11px; height: 11px; }
}

@media (max-width: 530px) {
  .content, .topbar { padding-left: 13px; padding-right: 13px; }
  .crumb { gap: 3px; }
  .crumb-home, .crumb-divider, .crumb strong, .top-saved > span:last-child, .global-search kbd { display: none; }
  .global-search { flex: 1; width: auto; min-width: 0; }
  .intro { padding-bottom: 15px; }
  .intro-copy { margin-top: 6px; font-size: 13px; }
  .quick-links { gap: 5px; margin-top: 11px; }
  .quick-links button { min-height: 32px; padding: 5px 7px; font-size: 11px; }
  .directory-heading { margin: 17px 0 15px; }
  .section-heading h2 { font-size: 20px; }
  .section-heading p { font-size: 12px; }
  .directory-heading .text-link { flex: none; white-space: nowrap; font-size: 11px; }
  .directory-group + .directory-group { margin-top: 16px; }
  .topic-entry > summary { gap: 7px; min-height: 44px; padding: 6px 8px; }
  .topic-title { font-size: 13px; }
  .topic-panel { padding: 9px 8px; }
  .topic-description { font-size: 12px; }
  .workflow-steps ol { grid-template-columns: 1fr; }
  .resource-row { grid-template-columns: 27px minmax(0, 1fr); gap: 3px 7px; padding: 8px 0; }
  .resource-row .tile { width: 27px; height: 27px; }
  .resource-row .tile svg { width: 14px; height: 14px; }
  .resource-actions { grid-column: 2; }
  .card-title { font-size: 13px; }
  .save { width: 29px; height: 29px; }
}

@media (max-width: 350px) {
  .topic-count span { display: none; }
  .directory-heading { align-items: flex-start; flex-direction: column; gap: 3px; }
  .directory-heading .text-link { align-self: flex-start; }
}

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