/* AIBC How To Use Worked Example Extension 1.0.0 */

/* Keep the existing How To Use one-column grid from expanding to the
   intrinsic width of wide tables or field lists on narrow screens. */
.guide-page {
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
}

.guide-page > * {
  min-width: 0;
  max-width: 100%;
}

.aibc-worked-study {
  margin-top: 3rem;
  padding-top: 2.5rem;
  border-top: 4px solid var(--teal-600, #0a8f93);
  scroll-margin-top: 6rem;
}

.aibc-worked-study h4,
.aibc-worked-study h5 {
  color: var(--ink, #10233d);
  font-weight: 750;
}

.aibc-worked-study__hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.25rem;
}

.aibc-worked-study__hero h3 {
  margin-top: .35rem;
  font-size: clamp(1.45rem, 2.6vw, 2.15rem);
  line-height: 1.18;
  color: var(--ink, #10233d);
}

.aibc-worked-study__lead {
  max-width: 82ch;
  margin-top: .8rem;
  color: var(--muted, #5f6f7f);
  font-size: 1.02rem;
  line-height: 1.72;
}

.aibc-worked-study__hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .55rem;
  min-width: min(100%, 18rem);
}

.aibc-worked-study__caution,
.aibc-worked-study__question,
.aibc-worked-study__presets,
.aibc-worked-study__toc,
.aibc-model-finding {
  border: 1px solid var(--line, #d7e0e6);
  border-radius: 14px;
  background: var(--surface, #fff);
  box-shadow: var(--shadow, 0 8px 28px #0a233b14);
}

.aibc-worked-study__caution {
  padding: 1rem 1.15rem;
  border-left: 5px solid var(--amber, #a55c08);
  background: var(--amber-bg, #fff4d8);
}

.aibc-worked-study__caution p {
  margin-top: .35rem;
  line-height: 1.65;
}

.aibc-worked-study__question {
  margin-top: 1.25rem;
  padding: 1.15rem 1.25rem;
}

.aibc-worked-study__question blockquote {
  margin: .65rem 0 .85rem;
  padding-left: 1rem;
  border-left: 3px solid var(--teal-600, #0a8f93);
  color: var(--ink, #10233d);
  font-size: clamp(1.08rem, 2vw, 1.3rem);
  font-weight: 680;
  line-height: 1.55;
}

.aibc-worked-study__metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .8rem;
  margin: 1.25rem 0;
}

.aibc-worked-study__metrics article {
  display: grid;
  gap: .2rem;
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--line, #d7e0e6);
  border-radius: 12px;
  background: var(--surface-tint, #f1f7f7);
}

.aibc-worked-study__metrics span {
  color: var(--muted, #5f6f7f);
  font-size: .8rem;
  font-weight: 750;
  letter-spacing: .035em;
  text-transform: uppercase;
}

.aibc-worked-study__metrics strong {
  color: var(--navy-900, #082440);
  font-size: 1.8rem;
  line-height: 1.1;
}

.aibc-worked-study__metrics small {
  color: var(--muted, #5f6f7f);
}

.aibc-worked-study__presets,
.aibc-worked-study__toc {
  margin-top: 1.1rem;
  padding: 1.15rem;
}

.aibc-worked-study__presets > div {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  margin: .75rem 0;
}

.aibc-preset-link,
.aibc-inline-link,
.aibc-copy-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.55rem;
  padding: .62rem .85rem;
  border: 1px solid var(--teal-600, #0a8f93);
  border-radius: 8px;
  color: var(--teal-700, #087b80);
  background: var(--surface, #fff);
  font-weight: 720;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
}

.aibc-preset-link:hover,
.aibc-inline-link:hover,
.aibc-copy-button:hover,
.aibc-preset-link:focus-visible,
.aibc-inline-link:focus-visible,
.aibc-copy-button:focus-visible {
  color: #fff;
  background: var(--teal-700, #087b80);
  outline: 3px solid var(--teal-100, #dff2f2);
  outline-offset: 2px;
}

.aibc-preset-link--primary {
  color: #fff;
  background: var(--teal-700, #087b80);
}

.aibc-inline-link {
  margin-top: .7rem;
}

.aibc-copy-button {
  min-height: 2.3rem;
  padding: .5rem .72rem;
  font-size: .88rem;
}

.aibc-worked-study__toc ol {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .45rem .9rem;
  margin-top: .7rem;
  padding-left: 1.25rem;
  list-style: decimal;
}

.aibc-worked-study__toc a {
  color: var(--teal-700, #087b80);
  font-weight: 650;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.aibc-study-phase {
  margin-top: 1rem;
  border: 1px solid var(--line, #d7e0e6);
  border-radius: 14px;
  background: var(--surface, #fff);
  overflow: clip;
  scroll-margin-top: 6rem;
}

.aibc-study-phase > summary {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1rem 1.1rem;
  color: var(--ink, #10233d);
  background: var(--surface-tint, #f1f7f7);
  font-size: 1.05rem;
  font-weight: 760;
  cursor: pointer;
  list-style: none;
}

.aibc-study-phase > summary::-webkit-details-marker { display: none; }
.aibc-study-phase > summary::after {
  content: '+';
  margin-left: auto;
  color: var(--teal-700, #087b80);
  font-size: 1.4rem;
}
.aibc-study-phase[open] > summary::after { content: '−'; }

.aibc-study-phase > summary span {
  flex: 0 0 auto;
  padding: .3rem .55rem;
  border-radius: 999px;
  color: #fff;
  background: var(--navy-850, #0a2d4d);
  font-size: .72rem;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.aibc-study-phase__body {
  display: grid;
  gap: 1rem;
  padding: 1rem;
}

.aibc-instruction-step {
  padding: 1rem 1.05rem;
  border: 1px solid var(--line, #d7e0e6);
  border-radius: 11px;
  background: var(--surface, #fff);
}

.aibc-instruction-step h4 {
  display: flex;
  align-items: center;
  gap: .65rem;
  margin-bottom: .65rem;
  font-size: 1.05rem;
}

.aibc-instruction-step h4 > span {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  flex: 0 0 2rem;
  border-radius: 50%;
  color: #fff;
  background: var(--teal-700, #087b80);
  font-size: .85rem;
}

.aibc-instruction-step p,
.aibc-instruction-step li,
.aibc-worked-study__footer p {
  color: var(--muted, #5f6f7f);
  line-height: 1.68;
}

.aibc-instruction-step ol,
.aibc-instruction-step ul,
.aibc-exegesis-list {
  margin: .65rem 0 .65rem 1.25rem;
  padding-left: .75rem;
}

.aibc-instruction-step ol { list-style: decimal; }
.aibc-instruction-step ul { list-style: disc; }
.aibc-instruction-step li + li { margin-top: .3rem; }

.aibc-instruction-step code,
.aibc-file-list {
  border-radius: 5px;
  color: var(--navy-900, #082440);
  background: var(--surface-soft, #f6f8f9);
  font-family: var(--font-geist-mono, ui-monospace, monospace);
}

.aibc-instruction-step code {
  padding: .12rem .3rem;
  overflow-wrap: anywhere;
}

.aibc-why {
  margin-top: .7rem;
  padding: .7rem .8rem;
  border-left: 3px solid var(--teal-600, #0a8f93);
  background: var(--teal-50, #eff9f8);
}

.aibc-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line, #d7e0e6);
  border-radius: 10px;
}

.aibc-table-wrap table {
  width: 100%;
  min-width: 42rem;
  border-collapse: collapse;
}

.aibc-table-wrap th,
.aibc-table-wrap td {
  padding: .68rem .75rem;
  border-bottom: 1px solid var(--line, #d7e0e6);
  text-align: left;
  vertical-align: top;
}

.aibc-table-wrap th {
  color: #fff;
  background: var(--navy-850, #0a2d4d);
  font-size: .82rem;
  letter-spacing: .025em;
}

.aibc-table-wrap tbody tr:nth-child(even) { background: var(--surface-soft, #f6f8f9); }
.aibc-table-wrap tbody tr:last-child td { border-bottom: 0; }

.aibc-comparison-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
}

.aibc-comparison-grid > div {
  padding: .85rem;
  border: 1px solid var(--line, #d7e0e6);
  border-radius: 9px;
  background: var(--surface-soft, #f6f8f9);
}

.aibc-comparison-grid h5 { margin-bottom: .35rem; }

.aibc-two-column-list {
  columns: 2;
  column-gap: 2rem;
}

.aibc-model-finding {
  padding: 1rem 1.1rem;
  background: var(--surface-tint, #f1f7f7);
}

.aibc-model-finding p + p { margin-top: .75rem; }

.aibc-file-list {
  max-width: 100%;
  margin: .7rem 0;
  padding: .9rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.55;
}

.aibc-worked-study__footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.2rem;
  padding: 1rem 1.1rem;
  border-top: 1px solid var(--line, #d7e0e6);
}

.aibc-worked-study__footer a {
  flex: 0 0 auto;
  color: var(--teal-700, #087b80);
  font-weight: 700;
  text-decoration: underline;
}

@media (max-width: 1050px) {
  .aibc-worked-study__metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .aibc-worked-study__toc ol { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .aibc-worked-study { margin-top: 2rem; padding-top: 1.7rem; }
  .aibc-worked-study__hero { display: block; }
  .aibc-worked-study__hero-actions { justify-content: flex-start; margin-top: 1rem; min-width: 0; }
  .aibc-worked-study__metrics,
  .aibc-worked-study__toc ol,
  .aibc-comparison-grid { grid-template-columns: 1fr; }
  .aibc-worked-study__presets > div { display: grid; grid-template-columns: 1fr; }
  .aibc-preset-link { width: 100%; }
  .aibc-two-column-list { columns: 1; }
  .aibc-study-phase > summary { align-items: flex-start; }
  .aibc-instruction-step { padding: .85rem; }
  .aibc-worked-study__footer { display: block; }
  .aibc-worked-study__footer a { display: inline-block; margin-top: .75rem; }
}

@media print {
  .aibc-worked-study__hero-actions,
  .aibc-copy-button,
  .aibc-worked-study__presets,
  .aibc-worked-study__toc { display: none !important; }
  .aibc-study-phase { break-inside: avoid; box-shadow: none; }
  .aibc-study-phase:not([open]) > *:not(summary) { display: block; }
  .aibc-worked-study { border-top-color: #000; }
}

/* Strong visual boundary between the general How To Use instructions and the
   completed examples that demonstrate those instructions. */
.aibc-worked-examples-boundary {
  position: relative;
  margin-top: 4rem;
  padding: 2rem clamp(1.1rem, 3vw, 2.25rem);
  border-top: 8px solid var(--navy-850, #0a2d4d);
  border-bottom: 2px solid var(--teal-600, #0a8f93);
  border-radius: 16px;
  background: var(--surface-tint, #f1f7f7);
  box-shadow: var(--shadow, 0 8px 28px #0a233b14);
  scroll-margin-top: 6rem;
}

.aibc-worked-examples-boundary::before {
  content: '';
  position: absolute;
  top: -1.15rem;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--line, #d7e0e6);
}

.aibc-worked-examples-boundary__marker {
  display: inline-flex;
  margin-bottom: 1rem;
  padding: .38rem .7rem;
  border-radius: 999px;
  color: #fff;
  background: var(--navy-850, #0a2d4d);
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.aibc-worked-examples-boundary h2 {
  margin: .35rem 0 .65rem;
  color: var(--ink, #10233d);
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  line-height: 1.15;
}

.aibc-worked-examples-boundary > p {
  max-width: 86ch;
  margin: 0;
  color: var(--muted, #5f6f7f);
  font-size: 1.03rem;
  line-height: 1.72;
}

.aibc-worked-examples-boundary__links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .8rem;
  margin-top: 1.25rem;
}

.aibc-worked-examples-boundary__links a {
  display: grid;
  gap: .22rem;
  min-width: 0;
  padding: .9rem 1rem;
  border: 1px solid var(--teal-600, #0a8f93);
  border-radius: 10px;
  background: var(--surface, #fff);
  color: var(--ink, #10233d);
  text-decoration: none;
}

.aibc-worked-examples-boundary__links a:hover,
.aibc-worked-examples-boundary__links a:focus-visible {
  background: var(--teal-100, #dff2f2);
  outline: 3px solid var(--teal-100, #dff2f2);
  outline-offset: 2px;
}

.aibc-worked-examples-boundary__links strong {
  color: var(--teal-700, #087b80);
  font-size: .78rem;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.aibc-worked-examples-boundary__links span {
  font-weight: 750;
  line-height: 1.35;
}

.aibc-worked-examples-boundary + .aibc-worked-study {
  margin-top: 1.35rem;
}

@media (max-width: 760px) {
  .aibc-worked-examples-boundary {
    margin-top: 3rem;
    padding: 1.25rem 1rem;
  }

  .aibc-worked-examples-boundary__links {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media print {
  .aibc-worked-examples-boundary {
    break-inside: avoid;
    box-shadow: none;
  }
}


.aibc-study-chart {
  margin: 1rem 0 0;
  padding: 1rem;
  border: 1px solid var(--line, #d7e0e6);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfd 100%);
  box-shadow: var(--shadow, 0 8px 28px #0a233b14);
}

.aibc-study-chart img {
  display: block;
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  height: auto;
  border-radius: 10px;
  border: 1px solid #e4eaf0;
}

.aibc-study-chart figcaption,
.aibc-chart-placement-note {
  margin-top: .8rem;
  color: var(--muted, #5f6f7f);
  line-height: 1.65;
}

.aibc-chart-placement-note {
  font-size: .95rem;
}

@media print {
  .aibc-study-chart {
    break-inside: avoid;
    box-shadow: none;
  }
}
