/* Search & AI service pages. Extends the service-page rail in gn.css; uses its
   tokens only (--ink, --ink2, --ink3, --line, --ac, --bg2, --fd, --mo). Nothing
   here restyles an existing component. */

/* One explanation cell per rail heading (built by group_rail). The heading
   keeps the rail style even though a div follows it. */
html.gn main .content > h2:has(+ div.gn-col) {
  grid-column: 1; font-size: clamp(19px, 2.1vw, 23px); border-top: 0; padding-top: 3px; margin-bottom: 0;
}
html.gn main .content > .gn-col { grid-column: 2; min-width: 0; }
.gn-col > p { font-size: 17px; line-height: 1.65; color: var(--ink2); margin: 0; max-width: none; }
html.gn .gn-col > * + * { margin-top: 14px; }
@media (max-width: 719px) {
  html.gn main .content > h2:has(+ div.gn-col) { margin-bottom: -14px; }
  html.gn main .content > .gn-col { grid-column: 1; }
}

/* Lists, notes and examples sit in the explanation column beside the rail
   heading, the same column a paragraph takes. */
html.gn main .content > :is(.gn-list, .gn-steps, .gn-note, .gn-ex) { grid-column: 2; margin: 0; }
html.gn main .content > :is(.gn-table, .gn-eng, .gn-paths-wrap, .gn-assess) { grid-column: 1 / -1; }
/* A paragraph, list or note that continues the same subject sits 14px under
   the block before it, not a full section gap. Only on these pages (main.gn-ai),
   so the 929-page rail elsewhere is untouched. */
html.gn main.gn-ai .content > :is(p, .gn-list, .gn-steps, .gn-note, .gn-ex):not(h2 + *) { margin-top: calc(14px - var(--rg)); }
html.gn main.gn-ai .content > .gn-table + p { margin-top: calc(18px - var(--rg)); }
@media (max-width: 719px) {
  html.gn main .content > :is(.gn-list, .gn-steps, .gn-note, .gn-ex) { grid-column: 1; }
  html.gn main.gn-ai .content { --rg: clamp(28px, 7vw, 38px); }
}

.gn-list, .gn-steps { padding: 0; list-style: none; display: grid; gap: 10px; }
.gn-list li, .gn-steps li { font-size: 17px; line-height: 1.6; color: var(--ink2); padding-left: 22px; position: relative; }
.gn-list li::before { content: ""; position: absolute; left: 2px; top: .72em; width: 8px; height: 1px; background: var(--ink); }
.gn-list li b, .gn-steps li b { color: var(--ink); font-weight: 600; }
.gn-steps { counter-reset: gnstep; }
.gn-steps li { counter-increment: gnstep; padding-left: 34px; }
.gn-steps li::before { content: counter(gnstep, decimal-leading-zero); position: absolute; left: 0; top: .2em; font-family: var(--mo); font-size: 12px; color: var(--ink3); }

.gn-note { font-size: 15px; line-height: 1.6; color: var(--ink2); border-left: 2px solid var(--line2); padding: 2px 0 2px 14px; }
.gn-ex { border-top: 1px solid var(--line); padding-top: 14px; }
.gn-ex p { font-size: 17px; line-height: 1.65; color: var(--ink2); margin: 0 0 10px; }
.gn-ex p:last-child { margin-bottom: 0; }
.gn-label { display: inline-block; font-family: var(--mo); font-size: 12px; letter-spacing: .02em; color: var(--ink3); border: 1px solid var(--line2); border-radius: 3px; padding: 1px 6px; margin-bottom: 8px; }

/* Tables: scroll inside themselves on a phone, never the page. */
.gn-table { overflow-x: auto; -webkit-overflow-scrolling: touch; border-top: 1px solid var(--ink); }
.gn-table:focus-visible { outline: 2px solid var(--ac); outline-offset: 2px; }
.gn-table table { width: 100%; min-width: 720px; border-collapse: collapse; font-size: 15px; line-height: 1.5; }
.gn-table caption { text-align: left; font-size: 13px; color: var(--ink3); padding: 10px 0 0; caption-side: bottom; }
.gn-table th, .gn-table td { text-align: left; vertical-align: top; padding: 12px 16px 12px 0; border-bottom: 1px solid var(--line); }
.gn-table thead th { font-size: 13px; font-weight: 600; color: var(--ink3); }
.gn-table tbody th { font-weight: 600; color: var(--ink); width: 18%; }
.gn-table tbody th a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line2); text-underline-offset: 3px; }
.gn-table tbody th a:hover { color: var(--ac); }
.gn-table td { color: var(--ink2); }
.gn-table .gn-label { margin: 4px 0 0; }

/* Problem paths: four ruled entries, the same pattern as .features. */
.gn-paths { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0 26px; padding: 0; margin: 0; list-style: none; }
.gn-paths li { border-top: 1px solid var(--line); }
.gn-paths a { display: block; padding: 14px 0 20px; color: inherit; text-decoration: none; }
.gn-paths a:hover strong, .gn-paths a:focus-visible strong { color: var(--ac); }
.gn-paths strong { display: block; font-family: var(--fd); font-weight: 500; font-size: 20px; line-height: 1.25; color: var(--ink); margin-bottom: 6px; }
.gn-paths span { display: block; font-size: 14px; line-height: 1.55; color: var(--ink2); }
.gn-paths em { display: block; font-style: normal; font-size: 13px; color: var(--ink3); margin-top: 8px; }
.gn-paths-more { margin: 18px 0 0; font-size: 15px; }
.gn-paths-more a { color: var(--ink); font-weight: 600; text-underline-offset: 3px; }

/* Engagement formats: one ruled row each, name in the rail, detail beside it. */
.gn-eng { display: grid; }
.gn-eng article { display: grid; grid-template-columns: minmax(0, 200px) minmax(0, 1fr); column-gap: 40px; border-top: 1px solid var(--ink); padding: 18px 0 30px; }
.gn-eng h3 { font-family: var(--fd); font-size: 22px; font-weight: 500; line-height: 1.2; margin: 0 0 8px; }
.gn-eng-h p { font-size: 14px; line-height: 1.55; color: var(--ink2); margin: 0; }
.gn-eng dl { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 30px; }
.gn-eng dt { font-size: 13px; font-weight: 600; color: var(--ink); }
.gn-eng dd { margin: 3px 0 0; font-size: 15px; line-height: 1.55; color: var(--ink2); }
@media (max-width: 719px) {
  .gn-eng article { grid-template-columns: minmax(0, 1fr); row-gap: 14px; }
  .gn-eng dl { grid-template-columns: minmax(0, 1fr); }
}

/* Assessment request. */
.gn-assess { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 34px; border-top: 1px solid var(--ink); padding-top: 22px; }
@media (max-width: 859px) { .gn-assess { grid-template-columns: minmax(0, 1fr); } }
.gn-form { display: grid; gap: 16px; }
.gn-af { display: grid; gap: 6px; }
.gn-af label { font-size: 14px; font-weight: 600; color: var(--ink); }
.gn-af label span { font-weight: 400; color: var(--ink3); }
.gn-af :is(input, select, textarea) {
  font: inherit; font-size: 16px; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line2); border-radius: 6px; padding: 11px 12px; min-height: 46px; width: 100%;
}
.gn-af textarea { min-height: 96px; resize: vertical; }
.gn-af :is(input, select, textarea):focus { outline: 2px solid var(--ac); outline-offset: 1px; border-color: transparent; }
.gn-af [aria-invalid="true"] { border-color: var(--bad); }
.gn-err { font-size: 14px; color: var(--bad); margin: 0; }
.gn-err:empty { display: none; }
.gn-hint { font-size: 13px; color: var(--ink3); margin: 0; }
.gn-send {
  justify-self: start; font: inherit; font-size: 16px; font-weight: 600; color: #fff; background: var(--ink);
  border: 1px solid var(--ink); border-radius: 8px; padding: 13px 20px; min-height: 48px; cursor: pointer;
}
.gn-send:hover { opacity: .9; }
.gn-send:focus-visible { outline: 2px solid var(--ac); outline-offset: 3px; }
.gn-send[disabled] { opacity: .6; cursor: progress; }
.gn-next h3 { font-family: var(--fd); font-size: 20px; font-weight: 500; margin: 0 0 10px; }
.gn-next .gn-steps li { font-size: 15px; }
.gn-next p { font-size: 14px; line-height: 1.55; color: var(--ink2); margin: 14px 0 0; }
.gn-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Homepage problem section. */
html.gn .gn-ai-paths .gn-paths { margin-top: 22px; }

@media (prefers-reduced-motion: reduce) { .gn-paths a, .gn-send { transition: none; } }
