/* Resources workspace and public read-only knowledge view */
.free-resource-cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin:18px 0}
.free-resource-card{position:relative;border:1px solid #173a493b;border-radius:13px;background:#bfe7f6;color:#123d53;text-align:left;min-height:164px;padding:22px;display:flex;flex-direction:column;align-items:flex-start;gap:12px;font-family:Montserrat,Arial,sans-serif;cursor:pointer}
.free-resource-card:nth-child(2){background:#f4a347}
.free-resource-card strong{font-size:22px;line-height:1.25}.free-resource-card small{font-size:13px}
.free-resource-card .free-resource-arrow{position:absolute;right:20px;top:19px;font-size:22px}
.free-resource-card.active{outline:2px solid #173a49;outline-offset:-2px}
.free-resource-symbol{display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;color:#103d55}
.free-resource-symbol svg{display:block}
.free-resource-hero{background:#f4a347;border-radius:14px;padding:24px 30px;color:#123d53}
.free-resource-hero h1{font:600 clamp(30px,4vw,48px)/1.18 Georgia,serif;margin:8px 0}
.free-resource-hero p{font-size:15px;margin:0}
.free-resource-content{background:#bfe7f6;border-radius:12px;padding:clamp(18px,3vw,30px);color:#123d53;min-width:0}
.free-resource-toolbar{display:flex;gap:14px;align-items:center;justify-content:space-between;flex-wrap:wrap;margin-bottom:14px}
.free-resource-toolbar h2{font:600 30px/1.2 Georgia,serif;margin:0}
.free-resource-button,.free-resource-actions button{background:#f4a347;border:1px solid #123d53;border-radius:7px;color:#123d53;padding:10px 15px;font-weight:700;cursor:pointer}
.free-resource-list{display:grid;gap:13px}
.free-resource-article{background:#effaff;border:1px solid #96cee7;border-radius:9px;padding:18px}
.free-resource-article h3{margin:8px 0;font:600 22px Georgia,serif}.free-resource-article time{display:block;font-size:12px;margin-bottom:12px}
.free-resource-article-detail{margin:12px 0;padding:20px;border:1px solid #123d53;border-radius:10px;background:#f5fbff}
.free-resource-copy{white-space:pre-wrap;line-height:1.7}
.free-local-knowledge{margin-top:26px;background:#bfe7f6;border:1px solid #173a4928;border-radius:15px;padding:clamp(18px,3vw,36px)}
.free-local-knowledge-heading h2{font:600 clamp(30px,4vw,44px)/1.2 Georgia,serif;margin:0 0 8px}
.free-local-knowledge-heading p{font-size:14px;margin:0 0 18px}
.free-local-knowledge-content{padding:0}
.free-resource-wiki-intro p{font-size:14px;line-height:1.7}
.free-resource-search{width:100%;padding:14px;margin:15px 0;border:1px solid #8dbad0;border-radius:8px;background:#effaff;font:14px Montserrat,Arial,sans-serif}
.free-wiki-category-tabs{display:flex;gap:10px;flex-wrap:wrap;margin:15px 0}
.free-wiki-tab{background:#e7f6fd;border:1px solid #9acbdc;border-radius:8px;padding:11px 18px;color:#123d53;font-weight:700;cursor:pointer}
.free-wiki-tab[aria-pressed=true]{background:#f4a347;border-color:#16445b}
.free-wiki-results{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr));gap:10px;max-height:340px;overflow:auto;padding:3px;margin-bottom:20px}
.free-wiki-entry{text-align:left;padding:14px;border:1px solid #82b8cd;border-radius:8px;background:#effaff;color:#123d53;font-weight:600;cursor:pointer}
.free-wiki-entry:hover,.free-wiki-entry[aria-pressed=true]{background:#f4a347}
.free-wiki-inline-article{background:#f5fbff;border:1px solid #9acbdc;border-radius:12px;padding:clamp(18px,3vw,30px);max-height:660px;overflow:auto}
.free-wiki-inline-article h3{font:600 28px Georgia,serif;margin:0 0 18px}
.free-wiki-inline-article h4{font:600 19px Georgia,serif;margin:24px 0 12px}
.free-wiki-inline-article p,.free-wiki-inline-article li{font:14px/1.8 Montserrat,Arial,sans-serif;margin:0 0 15px}
.free-wiki-local-title{margin:28px 0 16px}
.free-resources-readonly-gate{background:#96cee7!important;min-height:0!important;padding:clamp(16px,3vw,35px)!important;color:#123d53}
.free-resource-overlay{position:fixed;inset:0;background:#102c3b99;display:flex;align-items:center;justify-content:center;padding:20px;z-index:1500}
.free-resource-editor{background:#d7f0fa;border-radius:12px;padding:24px;max-width:700px;max-height:90vh;overflow:auto;width:100%;display:grid;gap:16px}
.free-resource-editor-head{display:flex;justify-content:space-between;align-items:center}
.free-resource-field{display:grid;gap:7px}.free-resource-field input,.free-resource-field select,.free-resource-field textarea{padding:10px;border:1px solid #8dbad0;border-radius:5px;background:#fff}
.free-resource-actions{display:flex;gap:10px}
@media(max-width:640px){.free-resource-cards{grid-template-columns:1fr}.free-wiki-results{grid-template-columns:1fr;max-height:260px}}


/* Resources uses the chapter's primary tabs, not the legacy two-sidebar app shell. */
body.workspace-app[data-workspace-view="resources"] .workspace-layout{
 display:block!important;
 height:calc(100dvh - 65px);
 min-height:calc(100dvh - 65px);
 overflow:auto;
 background:#96cee7;
}
body.workspace-app[data-workspace-view="resources"] .workspace-rail,
body.workspace-app[data-workspace-view="resources"] .workspace-sidebar,
body.workspace-app[data-workspace-view="resources"] #workspace-backdrop,
body.workspace-app[data-workspace-view="resources"] #workspace-sections,
body.workspace-app[data-workspace-view="resources"] .mobile-workspace-nav,
body.workspace-app[data-workspace-view="resources"] .projects-mobile-sidebar-bar{display:none!important}
body.workspace-app[data-workspace-view="resources"] .workspace-main{
 display:block!important;
 width:100%!important;max-width:none!important;
 height:auto!important;min-height:calc(100dvh - 65px);
 overflow:visible!important;margin:0!important;
 background:#96cee7;
}
body.workspace-app[data-workspace-view="resources"] .workspace-topbar{
 display:none!important;
}
body.workspace-app[data-workspace-view="resources"] #space-records{
 width:100%!important;max-width:none!important;
 padding:20px clamp(18px,3.6vw,62px) 70px!important;
}
body.workspace-app[data-workspace-view="resources"] .free-resources-readonly-gate{
 width:100%;max-width:none;margin:0;padding:22px clamp(18px,3.6vw,62px) 70px!important;
}
body.workspace-app[data-workspace-view="resources"] #space-app{
 width:100%;max-width:none;
}
body.workspace-app[data-workspace-view="resources"] .chapter-primary-tabs{
 position:sticky;top:0;z-index:60;
}
body.workspace-app[data-workspace-view="resources"] .free-resource-hero{
 padding:clamp(26px,4vw,54px);
}
body.workspace-app[data-workspace-view="resources"] .free-resource-cards{
 gap:20px;
}
@media(max-width:760px){
 body.workspace-app[data-workspace-view="resources"] .workspace-layout{height:auto;min-height:calc(100dvh - 65px)}
 body.workspace-app[data-workspace-view="resources"] #space-records{padding:16px 16px 55px!important}
 body.workspace-app[data-workspace-view="resources"] .free-resources-readonly-gate{padding:16px 16px 55px!important}
}


/* Ensure chapter navigation stays visible in the read-only Resources experience. */
.workspace-app[data-workspace-view="resources"] .free-resources-guest-tabs{
 display:grid!important;
 grid-template-columns:repeat(4,minmax(0,1fr))!important;
 width:100%;
 position:sticky!important;
 top:0;
 z-index:70;
 background:#f4a34f;
 padding:18px clamp(18px,3.6vw,62px) 12px;
 gap:12px;
 box-shadow:0 2px 0 #173a4933;
}
.workspace-app[data-workspace-view="resources"] .free-resources-guest-tabs a{
 display:flex!important;min-width:0;align-items:center;justify-content:center;
 min-height:56px;text-align:center;white-space:nowrap;
 font:800 14px/1.4 Montserrat,Arial,sans-serif;
 color:#173a49;background:#96cee7;border:1px solid #173a49;text-decoration:none;
}
.workspace-app[data-workspace-view="resources"] .free-resources-guest-tabs a[aria-current="page"]{
 background:#f4a34f;box-shadow:inset 0 -5px 0 #173a49;
}
@media(max-width:760px){
 .workspace-app[data-workspace-view="resources"] .free-resources-guest-tabs{
  padding:12px 12px 10px;gap:6px;
 }
 .workspace-app[data-workspace-view="resources"] .free-resources-guest-tabs a{
  min-height:48px;padding:8px 3px;font-size:clamp(10px,2.6vw,12px);
 }
}


/* Update cards: neutral blue until selected, then FREE orange. */
.free-resource-cards .free-resource-card,
.free-resource-cards .free-resource-card:nth-child(2){
 background:#bfe7f6;
 border-color:#173a493b;
 color:#123d53;
 outline:none;
 box-shadow:none;
}
.free-resource-cards .free-resource-card.active,
.free-resource-cards .free-resource-card.active:nth-child(2){
 background:#f4a347;
 border-color:#173a49;
 box-shadow:inset 0 0 0 1px #173a49;
}
.free-resource-cards .free-resource-card:focus-visible{
 outline:3px solid #173a49;
 outline-offset:3px;
}

/* Initial state is never a selected update. Guard also covers older cached bundles. */
.free-resource-cards[data-selected="none"] .free-resource-card,
.free-resource-cards[data-selected="none"] .free-resource-card.active{
 background:#bfe7f6!important;
 border-color:#173a493b!important;
 box-shadow:none!important;
}
.free-resource-cards[data-selected="chapter"] .free-resource-card[data-section="chapter"],
.free-resource-cards[data-selected="global"] .free-resource-card[data-section="global"]{
 background:#f4a347!important;
 border-color:#173a49!important;
}
.free-resource-cards[data-selected="chapter"] .free-resource-card[data-section="global"],
.free-resource-cards[data-selected="global"] .free-resource-card[data-section="chapter"]{
 background:#bfe7f6!important;
 box-shadow:none!important;
}
