:root {
  --agc-bg: #f3f8f9;
  --agc-surface: #ffffff;
  --agc-text: #12252a;
  --agc-muted: #5f7075;
  --agc-accent: #0a6c7a;
  --agc-accent-strong: #07515c;
  --agc-highlight: #dceff2;
  --agc-border: #d2e3e7;
  --agc-shadow: 0 12px 28px rgba(13, 49, 56, 0.1);
  --agc-radius: 14px;
}

.agc-doc-lib,
.agc-citation-detail {
  font-family: "Segoe UI", "Trebuchet MS", sans-serif;
  color: var(--agc-text);
  background:
    radial-gradient(circle at 100% 0%, rgba(10, 108, 122, 0.12), transparent 38%),
    radial-gradient(circle at 0% 100%, rgba(236, 171, 82, 0.12), transparent 34%),
    var(--agc-bg);
  border-radius: 18px;
  padding: 1.2rem;
  box-shadow: var(--agc-shadow);
}

/* Hide theme-rendered post title and meta on document detail pages */
.agc-single-document .entry-header,
.agc-single-document .entry-meta,
.agc-single-document .post-meta,
.agc-single-document article > header {
  display: none !important;
}

/* Hide theme title + "by | date" that appear before plugin content */
.agc-single-document .entry-content > h1:first-child,
.agc-single-document .entry-content > .entry-content > h1:first-child,
.agc-single-document article > div > h1:first-child,
.agc-single-document article > div > h1:first-child + p {
  display: none !important;
}

.agc-doc-lib__hero,
.agc-citation-detail__hero {
  margin-bottom: 1rem;
}

.agc-doc-lib__eyebrow,
.agc-citation-detail__eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.76rem;
  color: var(--agc-accent);
  font-weight: 700;
}

.agc-doc-lib__title,
.agc-citation-detail__title {
  margin: 0.4rem 0;
  font-size: clamp(1.2rem, 2.1vw, 1.95rem);
  line-height: 1.2;
}

.agc-doc-lib__subtitle {
  margin: 0;
  color: var(--agc-muted);
  max-width: 75ch;
}

.agc-doc-lib__deploy-badge {
  display: inline-block;
  margin: 0.45rem 0 0;
  padding: 0.22rem 0.58rem;
  border: 1px solid var(--agc-border);
  border-radius: 999px;
  background: var(--agc-surface);
  color: var(--agc-accent-strong);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.agc-doc-lib--info {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.agc-doc-lib__info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.agc-doc-lib__info-card {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--agc-border);
  border-radius: var(--agc-radius);
  padding: 1rem 1.05rem;
  box-shadow: 0 10px 22px rgba(13, 49, 56, 0.05);
}

.agc-doc-lib__info-title {
  margin: 0 0 0.8rem;
  font-size: 1.02rem;
  line-height: 1.25;
  color: var(--agc-accent-strong);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.agc-doc-lib__info-list {
  margin: 0;
  padding-left: 1.05rem;
  display: grid;
  gap: 0.55rem;
}

.agc-doc-lib__info-list li {
  color: var(--agc-text);
}

.agc-doc-lib__info-list a {
  color: #124a9a !important;
  text-decoration: none;
}

.agc-doc-lib__info-list a:hover {
  text-decoration: underline;
}

.agc-doc-lib__info-see-all {
  display: inline-flex;
  margin-top: 0.9rem;
  font-weight: 700;
}

.agc-doc-lib__info-actions {
  display: flex;
  justify-content: flex-start;
}

.agc-alpha-nav {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.45rem;
  margin: 0.9rem 0 1rem;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}

.agc-alpha-nav__item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 26px;
  padding: 0 0.35rem;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.74rem;
  border: 1px solid var(--agc-border);
  border-radius: 999px;
  color: #124a9a !important;
  background: #fff;
}

.agc-alpha-nav__item:link,
.agc-alpha-nav__item:visited,
.agc-alpha-nav__item:active {
  color: #124a9a !important;
}

.agc-alpha-nav__item:hover,
.agc-alpha-nav__item.is-active {
  background: var(--agc-accent);
  color: #fff !important;
  border-color: var(--agc-accent);
}

.agc-alpha-nav__item.is-active:link,
.agc-alpha-nav__item.is-active:visited,
.agc-alpha-nav__item.is-active:active,
.agc-alpha-nav__item:hover:link,
.agc-alpha-nav__item:hover:visited,
.agc-alpha-nav__item:hover:active {
  color: #fff !important;
}

.agc-doc-lib__filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  padding: 0.95rem;
  border-radius: var(--agc-radius);
  border: 1px solid var(--agc-border);
  background: rgba(255, 255, 255, 0.88);
}

.agc-doc-lib__filters--index {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.agc-doc-lib__field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.agc-doc-lib__field label {
  font-size: 0.85rem;
  color: var(--agc-muted);
  font-weight: 600;
}

.agc-doc-lib__field input,
.agc-doc-lib__field select {
  width: 100%;
  min-height: 42px;
  border-radius: 10px;
  border: 1px solid var(--agc-border);
  background: #fff;
  padding: 0.55rem 0.65rem;
}

.agc-doc-lib__field input:focus,
.agc-doc-lib__field select:focus {
  outline: 2px solid rgba(10, 108, 122, 0.26);
  outline-offset: 1px;
}

.agc-doc-lib__actions {
  display: flex;
  gap: 0.6rem;
  justify-content: flex-end;
  align-items: center;
}

.agc-doc-lib__btn {
  border-radius: 10px;
  padding: 0.58rem 0.88rem;
  text-decoration: none;
  font-weight: 700;
  border: 1px solid transparent;
  font-size: 0.9rem;
  cursor: pointer;
}

.agc-doc-lib__btn,
.agc-doc-lib__btn:link,
.agc-doc-lib__btn:visited,
.agc-doc-lib__btn:hover,
.agc-doc-lib__btn:active {
  text-decoration: none;
}

.agc-doc-lib__btn--primary {
  background: var(--agc-accent);
  color: #fff !important;
}

.agc-doc-lib__btn--primary:link,
.agc-doc-lib__btn--primary:visited,
.agc-doc-lib__btn--primary:hover,
.agc-doc-lib__btn--primary:active {
  color: #fff !important;
}

.agc-doc-lib__btn--primary:hover {
  background: var(--agc-accent-strong);
}

.agc-doc-lib__btn--ghost {
  background: #fff;
  border-color: var(--agc-border);
  color: #124a9a !important;
}

.agc-doc-lib__btn--ghost:link,
.agc-doc-lib__btn--ghost:visited,
.agc-doc-lib__btn--ghost:hover,
.agc-doc-lib__btn--ghost:active {
  color: #124a9a !important;
}

.agc-doc-lib__results-meta {
  margin: 0.95rem 0 0.6rem;
  font-size: 0.9rem;
  color: var(--agc-muted);
}

.agc-doc-lib__table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--agc-border);
  border-radius: var(--agc-radius);
  background: #fff;
}

.agc-detail-panel .agc-doc-lib__table-wrap {
  overflow-x: hidden;
}

.agc-doc-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.agc-detail-panel .agc-doc-table--detail {
  min-width: 0;
  width: 100%;
  table-layout: fixed;
}

.agc-detail-panel .agc-doc-table--detail th,
.agc-detail-panel .agc-doc-table--detail td {
  word-break: break-word;
  overflow-wrap: anywhere;
}

.agc-doc-table th,
.agc-doc-table td {
  text-align: left;
  padding: 0.75rem;
  border-bottom: 1px solid #ecf1f4;
  vertical-align: top;
  font-size: 0.92rem;
}

.agc-doc-table thead th {
  background: #f8fcfd;
  color: #214850;
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.agc-doc-table tbody tr:hover {
  background: #f8fcfd;
}

.agc-citation-text {
  color: #124a9a;
  font-weight: 700;
}

.agc-doc-table a,
.agc-citation-detail a:not(.agc-doc-lib__btn):not(.agc-doc-lib__pagination a),
.agc-doc-lib a:not(.agc-doc-lib__btn):not(.agc-alpha-nav__item):not(.agc-doc-lib__pagination a) {
  color: #124a9a !important;
}

.agc-doc-table a:visited,
.agc-citation-detail a:not(.agc-doc-lib__btn):not(.agc-doc-lib__pagination a):visited,
.agc-doc-lib a:not(.agc-doc-lib__btn):not(.agc-alpha-nav__item):not(.agc-doc-lib__pagination a):visited {
  color: #124a9a !important;
}

.agc-doc-table a:hover,
.agc-citation-detail a:not(.agc-doc-lib__btn):not(.agc-doc-lib__pagination a):hover,
.agc-doc-lib a:not(.agc-doc-lib__btn):not(.agc-alpha-nav__item):not(.agc-doc-lib__pagination a):hover {
  text-decoration: underline !important;
}

.agc-detail-panel a:not(.agc-doc-lib__btn),
.agc-sl-detail-panel a:not(.agc-doc-lib__btn) {
  text-decoration: none !important;
}

.agc-detail-panel a:not(.agc-doc-lib__btn):hover,
.agc-sl-detail-panel a:not(.agc-doc-lib__btn):hover {
  text-decoration: underline !important;
}

.agc-ref-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.agc-ref-list__link,
.agc-ref-list__text {
  display: inline-flex;
  align-items: center;
  font-weight: inherit;
  font-size: 0.92rem;
}

.agc-ref-list__link {
  color: #124a9a;
  text-decoration: none;
}

.agc-ref-list__link:hover {
  text-decoration: underline;
}

.agc-multi-dates {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.agc-multi-dates__item {
  display: block;
}

.agc-lang-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: #eaf1ff;
  color: #2f4f88;
  font-size: 0.74rem;
  font-weight: 700;
}

.agc-chip {
  display: inline-flex;
  align-items: center;
  margin-left: 0.5rem;
  background: var(--agc-highlight);
  color: #0d5661;
  border-radius: 999px;
  padding: 0.18rem 0.5rem;
  font-size: 0.74rem;
  font-weight: 700;
}

.agc-chip--muted {
  background: #eef4f8;
  color: #496273;
}

.agc-chip--meta {
  margin-left: 0;
  font-size: clamp(1rem, 1.6vw, 1.35rem);
  padding: 0.25rem 0.7rem;
}

.agc-doc-lib__pagination ul {
  margin: 0.95rem 0 0;
  padding: 0;
  list-style: none !important;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.agc-doc-lib__pagination ul li {
  list-style: none !important;
  list-style-type: none !important;
  margin: 0;
  padding: 0;
}

.agc-doc-lib__pagination a,
.agc-doc-lib__pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  border-radius: 9px;
  border: 1px solid var(--agc-border);
  background: #fff;
  text-decoration: none;
  color: #22474f;
}

.agc-doc-lib__pagination .current {
  background: var(--agc-accent);
  color: #fff;
  border-color: var(--agc-accent);
}

.agc-doc-lib__empty {
  background: #fff;
  border: 1px dashed var(--agc-border);
  border-radius: var(--agc-radius);
  padding: 1rem;
}

.agc-citation-detail__meta,
.agc-citation-detail__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.6rem;
}

.agc-detail-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}

.agc-detail-tabs__tab {
  border: 1px solid var(--agc-border);
  background: #fff;
  color: #23464d;
  border-radius: 999px;
  padding: 0.48rem 0.78rem;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
}

.agc-detail-tabs__tab.is-active {
  background: var(--agc-accent);
  color: #fff;
  border-color: var(--agc-accent);
}

.agc-detail-panel {
  display: none;
}

.agc-detail-panel.is-active {
  display: block;
}

.agc-sl-highlight {
  margin-bottom: 0.9rem;
  border: 1px solid var(--agc-border);
  border-radius: var(--agc-radius);
  background: #fff;
  padding: 0.9rem;
}

.agc-sl-detail-card {
  margin-top: 0.8rem;
}

.agc-sl-detail-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.7rem 0 0.85rem;
}

.agc-sl-detail-tabs__tab {
  border: 1px solid var(--agc-border);
  background: #fff;
  color: #23464d;
  border-radius: 999px;
  padding: 0.38rem 0.72rem;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.agc-sl-detail-tabs__tab.is-active {
  background: var(--agc-accent);
  color: #fff;
  border-color: var(--agc-accent);
}

.agc-sl-detail-panel {
  display: none;
  background: #fff;
  border: 1px solid var(--agc-border);
  border-radius: 12px;
  padding: 0.8rem;
}

.agc-sl-detail-panel.is-active {
  display: block;
}

.agc-sl-detail-panel .agc-doc-lib__table-wrap {
  overflow-x: hidden;
}

.agc-sl-detail-panel .agc-doc-table--detail {
  min-width: 0;
  width: 100%;
  table-layout: fixed;
}

.agc-sl-detail-panel .agc-doc-table--detail th,
.agc-sl-detail-panel .agc-doc-table--detail td {
  word-break: break-word;
  overflow-wrap: anywhere;
}

.agc-detail-panel#agc-panel-amendments .agc-doc-table--detail th:nth-child(1),
.agc-detail-panel#agc-panel-amendments .agc-doc-table--detail td:nth-child(1) {
  width: 50%;
}

.agc-detail-panel#agc-panel-amendments .agc-doc-table--detail th:nth-child(2),
.agc-detail-panel#agc-panel-amendments .agc-doc-table--detail td:nth-child(2) {
  width: 25%;
}

.agc-detail-panel#agc-panel-amendments .agc-doc-table--detail th:nth-child(3),
.agc-detail-panel#agc-panel-amendments .agc-doc-table--detail td:nth-child(3) {
  width: 25%;
}

.agc-detail-panel#agc-panel-sl .agc-doc-lib__table-wrap {
  overflow-x: hidden;
}

.agc-detail-panel#agc-panel-sl .agc-doc-table--detail {
  min-width: 0;
  width: 100%;
  table-layout: fixed;
}

.agc-detail-panel#agc-panel-sl .agc-doc-table--detail th:nth-child(1),
.agc-detail-panel#agc-panel-sl .agc-doc-table--detail td:nth-child(1) {
  width: 50%;
}

.agc-detail-panel#agc-panel-sl .agc-doc-table--detail th:nth-child(2),
.agc-detail-panel#agc-panel-sl .agc-doc-table--detail td:nth-child(2) {
  width: 25%;
}

.agc-detail-panel#agc-panel-sl .agc-doc-table--detail th:nth-child(3),
.agc-detail-panel#agc-panel-sl .agc-doc-table--detail td:nth-child(3) {
  width: 25%;
}

.agc-detail-panel#agc-panel-sl .agc-doc-table--detail th,
.agc-detail-panel#agc-panel-sl .agc-doc-table--detail td {
  word-break: break-word;
  overflow-wrap: anywhere;
}

.agc-sl-amendment-list {
  margin: 0;
  padding-left: 1.1rem;
}

.agc-sl-amendment-list__item {
  margin: 0.35rem 0;
}

.agc-sl-highlight h3 {
  margin: 0 0 0.45rem;
  font-size: 1.02rem;
}

.agc-sl-highlight p {
  margin: 0 0 0.45rem;
  color: #38535b;
}

@media (max-width: 880px) {
  .agc-doc-lib__filters--index {
    grid-template-columns: 1fr;
  }

  .agc-doc-lib__info-grid {
    grid-template-columns: 1fr;
  }

  .agc-doc-lib__actions {
    justify-content: stretch;
  }

  .agc-doc-lib__btn {
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 640px) {
  .agc-doc-lib,
  .agc-citation-detail {
    padding: 0.9rem;
    border-radius: 12px;
  }

  .agc-alpha-nav__item {
    min-width: 24px;
    height: 24px;
    font-size: 0.68rem;
    padding: 0 0.25rem;
  }
}
