.swg-glossary-index{margin:1.5rem 0;display:grid;gap:1rem}
.swg-toolbar{display:flex;gap:.75rem;align-items:center;flex-wrap:wrap;position:sticky;top:0;background:#fff;z-index:2;padding:.5rem 0}
.swg-glossary-search input{
  width:min(520px,100%);padding:.65rem .9rem;border:1px solid #e5e7eb;border-radius:.6rem;
  font-size:16px;outline:none;transition:border-color .2s, box-shadow .2s;
}
.swg-glossary-search input:focus{border-color:#6366f1;box-shadow:0 0 0 3px rgba(99,102,241,.15)}
.swg-az{display:flex;flex-wrap:wrap;gap:.35rem;align-items:center}
.swg-az__link{
  display:inline-block;padding:.28rem .55rem;border:1px solid #e5e7eb;border-radius:.5rem;
  text-decoration:none;line-height:1;font-weight:500;color:#111;transition:all .15s ease;
}
.swg-az__link:hover{transform:translateY(-1px);box-shadow:0 1px 8px rgba(0,0,0,.05)}
.swg-az__link.is-active{background:#111;color:#fff;border-color:#111}
.swg-list{
  list-style:none;margin:0;padding:0;display:grid;gap:.6rem;
  grid-template-columns:repeat(auto-fill,minmax(280px,1fr));
}
.swg-list li{
  background:#fff;border:1px solid #e5e7eb;border-radius:.8rem;padding:.9rem .95rem;transition:box-shadow .15s, border-color .15s;
}
.swg-list li:hover{box-shadow:0 4px 16px rgba(0,0,0,.06);border-color:#d1d5db}
.swg-list a{font-weight:600;text-decoration:none}
.swg-short-def{color:#4b5563}
.swg-list-short{color:#4b5563;font-weight:400}
.swg-glossary-link{text-decoration:underline}
.swg-glossary-index.is-loading{opacity:.55;pointer-events:none;transition:opacity .2s ease}
.swg-back .button{display:inline-block;padding:.45rem .75rem;border:1px solid #e5e7eb;border-radius:.55rem;text-decoration:none;background:#fff}
.swg-back .button:hover{box-shadow:0 3px 10px rgba(0,0,0,.06)}

.swg-az__link:first-child{font-weight:600}

.swg-glossary-content h2,.swg-glossary-content h3{margin-top:1.5rem;margin-bottom:.75rem;font-weight:600}
.swg-glossary-content ul{list-style:disc;padding-left:1.5rem;margin-bottom:1.25rem}
.swg-glossary-content p{margin-bottom:1rem}

.swg-loadmore-wrap{display:flex;justify-content:center;margin-top:1rem}
.swg-loadmore{padding:.6rem 1rem;border:1px solid #e5e7eb;border-radius:.6rem;background:#fff;cursor:pointer}
.swg-loadmore:hover{box-shadow:0 3px 10px rgba(0,0,0,.06)}
.swg-toc{border:1px solid #e5e7eb;border-radius:.8rem;padding:.9rem;margin:1rem 0;background:#fafafa}
.swg-toc h2{margin:0 0 .5rem;font-size:1rem}
.swg-toc ol{margin:0;padding-left:1.25rem}
.swg-toc a{text-decoration:none}

.swg-count{margin-left:auto;color:#4b5563}


/* Spinner */
.swg-spinner{width:32px;height:32px;border:3px solid #e5e7eb;border-top-color:#6366f1;border-radius:50%;animation:swgspin 1s linear infinite;margin:1rem auto}
@keyframes swgspin{to{transform:rotate(360deg)}}


/* --- 1.3.7 Layout / Container --- */
.swg-wrap{max-width:1180px;margin:0 auto;padding:24px 20px}
@media (max-width:1024px){.swg-wrap{padding:20px 16px}}
@media (max-width:640px){.swg-wrap{padding:16px 14px}}

.swg-header{margin-bottom:16px}
.swg-tools{display:flex;flex-wrap:wrap;gap:10px 8px;align-items:center;margin-bottom:14px}
.swg-search{flex:1 1 320px;min-width:260px}
.swg-count{margin-left:auto;color:#6b7280;font-size:.95rem}

/* --- A–Z chips --- */
.swg-az{display:flex;flex-wrap:wrap;gap:6px;margin:12px 0 6px}
.swg-az__link{display:inline-flex;align-items:center;justify-content:center;min-width:34px;height:34px;padding:0 10px;border:1px solid #e5e7eb;border-radius:10px;background:#fff;color:#111827;text-decoration:none;line-height:1;font-weight:500;transition:box-shadow .2s,background-color .2s,border-color .2s}
.swg-az__link:hover{box-shadow:0 2px 10px rgba(0,0,0,.06)}
.swg-az__link.is-active{background:#111827;color:#fff;border-color:#111827}

/* --- List grid --- */
.swg-list{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;padding-top:8px}
@media (max-width:1024px){.swg-list{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}}
@media (max-width:640px){.swg-list{grid-template-columns:1fr;gap:8px}}
.swg-list li{list-style:none}
.swg-list li a{display:block;border:1px solid #e5e7eb;border-radius:12px;background:#fff;padding:12px 14px;text-decoration:none;color:#111827;font-weight:600;transition:box-shadow .2s,border-color .2s,transform .06s}
.swg-list li a:hover{box-shadow:0 4px 14px rgba(0,0,0,.06);border-color:#d1d5db}
.swg-list li a:active{transform:translateY(1px)}

/* --- Pagination centered --- */
.swg-pagination{margin-top:1.5rem;display:flex;justify-content:center;flex-wrap:wrap;gap:1rem;align-items:center}
.swg-pagination a.page-numbers,
.swg-pagination span.page-numbers,
.swg-pagination > a,
.swg-pagination > span{display:inline-flex;align-items:center;justify-content:center;min-width:36px;height:36px;padding:.4rem .75rem;margin:0 !important;border:1px solid #e5e7eb;border-radius:.5rem;text-decoration:none;font-size:.8125rem;line-height:1;color:#374151;background:#fff;transition:all .15s;white-space:nowrap}
.swg-pagination .page-numbers.current,
.swg-pagination span.page-numbers.current,
.swg-pagination span.current{background:#111827 !important;color:#fff !important;border-color:#111827 !important;font-weight:500}
.swg-pagination a.page-numbers:hover,
.swg-pagination > a:hover{box-shadow:0 2px 8px rgba(0,0,0,.08);border-color:#d1d5db;background:#f9fafb}
.swg-pagination .page-numbers.dots,
.swg-pagination span.dots{background:transparent !important;border:none !important;cursor:default;min-width:auto;padding:.4rem .4rem;color:#6b7280}
@media (max-width:640px){
  .swg-pagination{gap:.75rem}
  .swg-pagination a.page-numbers,
  .swg-pagination span.page-numbers,
  .swg-pagination > a,
  .swg-pagination > span{min-width:32px;height:32px;padding:.3rem .6rem;font-size:.75rem}
}

/* --- Spinner --- */
.swg-spinner{width:32px;height:32px;border:3px solid #e5e7eb;border-top-color:#6b7280;border-radius:50%;animation:swgspin 1s linear infinite;margin:12px auto}
@keyframes swgspin{to{transform:rotate(360deg)}}

/* --- Focus states (WCAG) --- */
.swg-az__link:focus-visible,.swg-list li a:focus-visible{outline:3px solid #a5b4fc;outline-offset:2px}


/* --- 1.3.8 Container enforcement --- */
body .swg-archive .swg-wrap,
body .single-glossary_term .swg-wrap,
body.post-type-archive-glossary_term .swg-wrap {
  max-width: 1180px !important;
  margin: 0 auto !important;
  padding: 24px 20px;
  box-sizing: border-box;
}
@media (max-width: 1024px){
  body .swg-archive .swg-wrap,
  body .single-glossary_term .swg-wrap,
  body.post-type-archive-glossary_term .swg-wrap { padding: 20px 16px; }
}
@media (max-width: 640px){
  body .swg-archive .swg-wrap,
  body .single-glossary_term .swg-wrap,
  body.post-type-archive-glossary_term .swg-wrap { padding: 16px 14px; }
}


/* --- 1.3.9 Stronger container fallback --- */
body.post-type-archive-glossary_term .swg-wrap,
body.single-glossary_term .swg-wrap,
body .swg-archive .swg-wrap {
  max-width: 1180px !important;
  width: auto !important;
  margin-left: auto !important;
  margin-right: auto !important;
}


/* --- 1.4.0 Container double wrapper --- */
body .swg-archive .swg-wrap { width: 100% !important; }
body .swg-archive .swg-wrap .swg-container { max-width:1180px !important; margin:0 auto !important; padding:24px 20px !important; box-sizing:border-box !important; }
@media (max-width:1024px){ body .swg-archive .swg-wrap .swg-container { padding:20px 16px !important; } }
@media (max-width:640px){ body .swg-archive .swg-wrap .swg-container { padding:16px 14px !important; } }

/* --- Breadcrumbs SEO --- */
.swg-breadcrumbs{margin-bottom:1rem;padding:.5rem 0;font-size:.75rem}
.swg-breadcrumbs__list{list-style:none;margin:0;padding:0;display:flex;flex-wrap:nowrap;align-items:center;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;scrollbar-width:thin;scrollbar-color:#d1d5db transparent}
.swg-breadcrumbs__list::-webkit-scrollbar{height:2px}
.swg-breadcrumbs__list::-webkit-scrollbar-track{background:transparent}
.swg-breadcrumbs__list::-webkit-scrollbar-thumb{background:#d1d5db;border-radius:2px}
.swg-breadcrumbs__item{display:inline-flex;align-items:center;flex-shrink:0;white-space:nowrap;line-height:1.4}
.swg-breadcrumbs__item:not(:last-child)::after{content:"›";margin:0 .4rem;color:#9ca3af;font-size:.9em;font-weight:400;flex-shrink:0}
.swg-breadcrumbs__link{color:#4b5563;text-decoration:none;transition:color .15s;display:inline-block;white-space:nowrap}
.swg-breadcrumbs__link:hover{color:#111;text-decoration:underline}
.swg-breadcrumbs__link:focus{outline:2px solid #6366f1;outline-offset:2px;border-radius:2px}
.swg-breadcrumbs__current{color:#111;font-weight:500;display:inline-block;white-space:nowrap;max-width:200px;overflow:hidden;text-overflow:ellipsis}
@media (max-width:768px){
  .swg-breadcrumbs{font-size:.7rem;margin-bottom:.875rem;padding:.4rem 0}
  .swg-breadcrumbs__item:not(:last-child)::after{margin:0 .35rem;font-size:.85em}
  .swg-breadcrumbs__current{max-width:150px}
}
@media (max-width:480px){
  .swg-breadcrumbs{font-size:.65rem;margin-bottom:.75rem;padding:.35rem 0}
  .swg-breadcrumbs__item:not(:last-child)::after{margin:0 .3rem;font-size:.8em}
  .swg-breadcrumbs__current{max-width:120px}
}

/* --- Related Terms Section (Internal Linking SEO) --- */
.swg-related{margin-top:2rem;padding:1.5rem;background:#f9fafb;border:1px solid #e5e7eb;border-radius:.8rem}
.swg-related h2{margin:0 0 1rem;font-size:1.25rem;font-weight:600;color:#111827}
.swg-related__list{list-style:none;margin:0;padding:0;display:grid;gap:.75rem}
.swg-related__item{margin:0}
.swg-related__link{display:block;padding:.75rem 1rem;background:#fff;border:1px solid #e5e7eb;border-radius:.5rem;text-decoration:none;color:#111827;font-weight:500;transition:all .2s;line-height:1.5}
.swg-related__link:hover{background:#f3f4f6;border-color:#d1d5db;box-shadow:0 2px 8px rgba(0,0,0,.05);transform:translateX(2px)}
.swg-related__link:focus{outline:3px solid #a5b4fc;outline-offset:2px}
.swg-related__short{display:block;margin-top:.25rem;font-size:.875rem;font-weight:400;color:#6b7280;font-style:italic}
@media (max-width:640px){
  .swg-related{padding:1rem}
  .swg-related h2{font-size:1.125rem}
  .swg-related__link{padding:.6rem .85rem;font-size:.95rem}
}

/* --- Priority Links (from pages/posts/products) --- */
.swg-priority-link{text-decoration:underline;color:#2563eb}
.swg-priority-link:hover{color:#1d4ed8;text-decoration:none}
.swg-priority-link--page{color:#059669}
.swg-priority-link--post{color:#dc2626}
.swg-priority-link--product{color:#ea580c}
