
/* APIS Lab v6.31 — regression-safe layout and unified tool forms.
   This layer deliberately removes the brittle subgrid experiment from v6.30.
   All heading/support alignments use natural document flow plus explicit offsets. */

/* ---------- 1. RESET SUBGRID REGRESSIONS ---------- */
:where(.v5-head,.section6-head,.international6-head,.labx-head,.intel-block-head,.case6-two,.business-first-grid,
       .v624-section-head,.intl-two,.tools-ethic,.tool-explain-grid,.lab-tools-bridge,
       .article-hero-grid,.tool-hero-grid,.tools-hub-grid,.lab-v624-hero-grid,.strategy-hero-grid,.service-hero-grid,
       .page-hero-grid,.strategy-sprint-grid) > div:first-child{
  grid-template-rows:none!important;
  grid-row:auto!important;
  align-content:normal!important;
}
:where(.v5-head,.section6-head,.international6-head,.labx-head,.intel-block-head,.case6-two,.business-first-grid,
       .v624-section-head,.intl-two,.tools-ethic,.tool-explain-grid,.lab-tools-bridge) > div:first-child{
  display:block!important;
}
:where(.article-hero-grid,.tool-hero-grid,.tools-hub-grid,.lab-v624-hero-grid,.strategy-hero-grid,.service-hero-grid,
       .page-hero-grid,.strategy-sprint-grid) > div:first-child{
  display:block!important;
}
:where(.v5-head,.section6-head,.international6-head,.labx-head,.intel-block-head,.case6-two,.business-first-grid,
       .v624-section-head,.intl-two,.tools-ethic,.tool-explain-grid,.lab-tools-bridge,
       .article-hero-grid,.tool-hero-grid,.tools-hub-grid,.lab-v624-hero-grid,.strategy-hero-grid,.service-hero-grid,
       .page-hero-grid,.strategy-sprint-grid) > :nth-child(2){
  grid-row:auto!important;
}

/* ---------- 2. SECTION HEADS: COPY ALIGNS TO HEADING, NOT KICKER ---------- */
.section6-head{align-items:flex-start!important}
.section6-head>div:first-child{min-width:0}
.section6-head>div:first-child>.v6-label{display:block;margin:0 0 14px!important}
.section6-head>div:first-child>h2{margin:0!important}
.section6-head>:nth-child(2){align-self:flex-start!important;margin-top:32px!important}
.section6-head>a.text-link{margin-top:32px!important}

.international6-head,.labx-head,.intel-block-head,.case6-two,.business-first-grid{align-items:start!important}
.international6-head>div:first-child>.v6-label,.labx-head>div:first-child>.v6-label,.case6-two>div:first-child>.v6-label,.business-first-grid>div:first-child>.v6-label{display:block;margin:0 0 14px!important}
.international6-head>div:first-child>h2,.labx-head>div:first-child>h2,.case6-two>div:first-child>h2,.business-first-grid>div:first-child>h2{margin:0!important}
.international6-head>p{margin:32px 0 0!important;align-self:start!important}
.labx-head>p{margin:30px 0 0!important;align-self:start!important}
.intel-block-head>div:first-child>:first-child{display:block;margin:0 0 12px!important}
.intel-block-head>div:first-child>h3{margin:0!important}
.intel-block-head>p{margin:26px 0 0!important;align-self:start!important}
.case6-two>p{margin:38px 0 0!important;align-self:start!important}
.business-first-grid>.business-first-copy{margin-top:32px!important;align-self:start!important}

/* v624 heads with a wrapper in the left column */
.v624-section-head{align-items:start!important}
.v624-section-head>div:first-child{min-width:0}
.v624-section-head>div:first-child>.v6-label{display:block;margin:0 0 12px!important}
.v624-section-head>div:first-child>h2{margin:0!important}
.v624-section-head>div:first-child+ p{margin:30px 0 0!important;align-self:start!important}
.v624-section-head>div:first-child+ a.text-link{margin-top:30px!important;align-self:start!important}

/* v624/direct heads: exact two-row grid, no subgrid */
.v624-section-head:has(>.v6-label:first-child + h2),
.decision6-intro,.home-intl-bridge-head{
  display:grid!important;
  grid-template-rows:auto auto!important;
  row-gap:12px!important;
  align-items:start!important;
}
.v624-section-head:has(>.v6-label:first-child + h2)>.v6-label,
.decision6-intro>.v6-label,.home-intl-bridge-head>.v6-label{
  grid-column:1!important;grid-row:1!important;display:block!important;margin:0!important;
}
.v624-section-head:has(>.v6-label:first-child + h2)>h2,
.decision6-intro>.v6-label+h2,.home-intl-bridge-head>.v6-label+h2{
  grid-column:1!important;grid-row:2!important;margin:0!important;align-self:start!important;
}
.v624-section-head:has(>.v6-label:first-child + h2)>p,
.decision6-intro>.v6-label+h2+p,.home-intl-bridge-head>.v6-label+h2+p{
  grid-column:2!important;grid-row:2!important;margin:0!important;align-self:start!important;
}

/* Explanatory two-column blocks */
.intl-two,.tools-ethic,.tool-explain-grid,.lab-tools-bridge{align-items:start!important}
.intl-two>div:first-child>.v6-label,.tools-ethic>div:first-child>.v6-label,.tool-explain-grid>div:first-child>.v6-label,.lab-tools-bridge>div:first-child>.v6-label{display:block;margin:0 0 12px!important}
.intl-two>div:first-child>h2,.tools-ethic>div:first-child>h2,.tool-explain-grid>div:first-child>h2,.lab-tools-bridge>div:first-child>h2{margin:0!important}
.intl-two>.prose-lg,.tools-ethic>div:nth-child(2),.tool-explain-grid>div:nth-child(2){margin-top:30px!important;align-self:start!important}
.lab-tools-bridge>div:first-child>p{display:block!important;margin:22px 0 0!important;max-width:60ch!important;line-height:1.68!important}
.lab-tools-bridge>.lab-tool-links{margin-top:30px!important;align-self:start!important}

/* ---------- 3. HERO SIDE PANELS ---------- */
.article-hero-grid,.tool-hero-grid,.tools-hub-grid,.lab-v624-hero-grid,.strategy-hero-grid,.service-hero-grid,.page-hero-grid,.strategy-sprint-grid{align-items:start!important}
.article-hero-grid>div:first-child>.v6-label,.tool-hero-grid>div:first-child>.v6-label,.tools-hub-grid>div:first-child>.v6-label,.lab-v624-hero-grid>div:first-child>.v6-label,
.strategy-hero-grid>div:first-child>.v6-label,.strategy-sprint-grid>div:first-child>.v6-label{display:block;margin:0 0 14px!important}
.article-hero-grid>div:first-child>h1,.tool-hero-grid>div:first-child>h1,.tools-hub-grid>div:first-child>h1,.lab-v624-hero-grid>div:first-child>h1,
.strategy-hero-grid>div:first-child>h1{margin:0 0 24px!important}
.article-hero-grid>div:first-child>p,.tool-hero-grid>div:first-child>p,.tools-hub-grid>div:first-child>p,.lab-v624-hero-grid>div:first-child>p,
.strategy-hero-grid>div:first-child>p{margin:0!important}
.article-hero-grid>.article-meta-v624,.tool-hero-grid>.tool-method-card,.tools-hub-grid>.tools-standard,.lab-v624-hero-grid>.lab-editorial-principles{grid-column:2!important;grid-row:auto!important;margin-top:31px!important;align-self:start!important}
.strategy-hero-grid>.strategy-side{grid-column:2!important;grid-row:auto!important;margin-top:34px!important;align-self:start!important}
.service-hero-grid>div:first-child>.v5-kicker{display:block;margin:0 0 14px!important}
.service-hero-grid>div:first-child>h1{margin:0 0 22px!important}
.service-hero-grid>div:first-child>.v5-lede{margin:0!important}
.service-hero-grid>.service-signal{grid-column:2!important;grid-row:auto!important;margin-top:30px!important;align-self:start!important}
.strategy-sprint-grid>div:first-child>h2{margin:0 0 22px!important}
.strategy-sprint-grid>div:first-child>p{margin:0!important}
.strategy-sprint-grid>.strategy-sprint-output{grid-column:2!important;grid-row:auto!important;margin-top:31px!important;align-self:start!important}

/* ---------- 4. CASE / LARGE LABEL+TITLE RHYTHM ---------- */
.case6-moves .section6-head,.case6-gallery .section6-head{margin-bottom:42px!important}
.case6-moves .section6-head>div:first-child>.v6-label,.case6-gallery .section6-head>div:first-child>.v6-label{margin-bottom:16px!important}
.case-detail-title>.v5-kicker{display:block!important;margin:0 0 14px!important}
.case-detail-title>h1{margin:0 0 24px!important}
.case-detail-title>.v5-lede{margin:0!important}

/* ---------- 5. TOOL WORKBENCH — ONE CONSISTENT FORM SYSTEM ---------- */
.tool-workbench{padding:30px!important;border:1px solid #d5cec2!important;border-radius:28px!important;background:#f7f3eb!important;overflow:hidden}
.tool-workbench label{color:#4e4a43!important;font-size:12px!important;font-weight:700!important;line-height:1.3!important}
.tool-workbench :where(input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select,textarea){
  width:100%!important;min-width:0!important;min-height:46px!important;padding:11px 13px!important;border:1px solid #c9c1b5!important;border-radius:12px!important;background:#fff!important;color:#151515!important;font:inherit!important;font-size:14px!important;line-height:1.35!important;outline:none!important;box-shadow:none!important;
}
.tool-workbench textarea{min-height:150px!important;resize:vertical!important}
.tool-workbench :where(input,select,textarea):focus{border-color:#757067!important;box-shadow:0 0 0 3px rgba(17,17,17,.06)!important}
.tool-workbench .form-help{display:block;margin-top:7px!important;line-height:1.5!important;color:#777168!important}
.tool-workbench :where(.v6-btn,button){min-height:54px!important;padding:0 24px!important;border-radius:999px!important;font-size:15px!important;font-weight:800!important;line-height:1.2!important}
.result-actions{display:flex!important;flex-wrap:wrap!important;gap:12px!important;margin-top:22px!important}

/* Explanatory strip: keep prose inline instead of turning text nodes into grid rows. */
.market-instructions{display:block!important;padding:20px 22px!important;margin:0 0 22px!important;border-radius:18px!important;background:#111!important;color:#f4f1e8!important;font-size:15px!important;line-height:1.75!important}
.market-instructions>b{display:inline!important;margin:0 .18em 0 0!important;color:#fff!important;font-size:15px!important;text-transform:none!important;letter-spacing:0!important}

/* Hypothesis tool: spacious professional cards instead of seven tiny browser fields in one line. */
.hypothesis-grid-v625{display:grid!important;gap:14px!important}
.hypothesis-row-v625{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:14px 16px!important;align-items:start!important;padding:20px!important;border:1px solid #d5cec3!important;border-radius:20px!important;background:#fff!important}
.hypothesis-row-v625>label{display:flex!important;flex-direction:column!important;gap:8px!important;margin:0!important}
.hypothesis-row-v625>label:first-child{grid-column:1/-1!important}
.hypothesis-row-v625 input,.hypothesis-row-v625 select{margin:0!important}

/* Common grid forms */
.tool-form{gap:16px!important}
.tool-form label,.weights-grid label,.funnel-input-grid label,.readiness-row label{gap:8px!important}
.weights-grid{gap:10px!important;margin-bottom:22px!important}
.funnel-input-grid{gap:14px!important}
.readiness-rows{gap:12px!important}
.readiness-row{padding:20px!important;border-radius:18px!important;background:#fff!important;gap:16px!important}
.readiness-row>div>b{display:block!important;margin:0 0 7px!important;font-size:16px!important}
.readiness-row>div>p{margin:0!important;line-height:1.5!important}

/* Compact tables are still part of the same visual system. */
.table-scroll{max-width:100%!important;overflow:auto!important;border-radius:16px!important;border:1px solid #d7d0c5!important;background:#fff!important}
.pro-market-table,.channel-table,.result-table{margin:0!important;border:0!important}
.pro-market-table th,.channel-table th,.result-table th{padding:12px 10px!important;font-size:11px!important;line-height:1.25!important;background:#ebe6dc!important}
.pro-market-table td,.channel-table td,.result-table td{padding:10px!important;vertical-align:middle!important}
.pro-market-table input,.channel-table input{min-height:40px!important;padding:8px 10px!important;border-radius:10px!important}

/* Content analyzer */
.file-drop{border-radius:20px!important;background:#eee8dd!important}
.file-drop>span{line-height:1.2!important}
.content-columns>.tool-notice{border-radius:20px!important}

/* ---------- 6. CARDS / INDEX GRID CONSISTENCY ---------- */
.pro-tool-grid>a{display:flex;flex-direction:column;min-height:290px;padding:30px;border:1px solid var(--v624-line);border-radius:28px;color:inherit;text-decoration:none;transition:.2s;background:transparent;min-width:0}
.pro-tool-grid>a:hover{background:#111;color:#f5f3ec;transform:translateY(-3px)}
.pro-tool-grid>a>span{display:block;margin:0 0 16px;font-size:11px;text-transform:uppercase;letter-spacing:.08em;color:var(--v624-muted)}
.pro-tool-grid>a>h3{display:block;margin:18px 0 14px;font-size:31px;line-height:1.05;letter-spacing:-.025em}
.pro-tool-grid>a>p{display:block;margin:0;line-height:1.58;color:var(--v624-muted)}
.pro-tool-grid>a>b{display:block;margin-top:auto;padding-top:20px}
.pro-tool-grid>a:hover>p{color:#bbb7ae}

/* ---------- 7. CHART / CARD SAFETY ---------- */
.analysis-panel{overflow:hidden!important}
.bubble-chart{display:block!important;margin-top:8px!important}
.analysis-panel .panel-head+ .bubble-chart{margin-top:8px!important}

/* ---------- 8. RESPONSIVE ---------- */
@media(max-width:1180px){
  .article-hero-grid>.article-meta-v624,.tool-hero-grid>.tool-method-card,.tools-hub-grid>.tools-standard,.lab-v624-hero-grid>.lab-editorial-principles,
  .strategy-hero-grid>.strategy-side,.service-hero-grid>.service-signal,.strategy-sprint-grid>.strategy-sprint-output{grid-column:auto!important;margin-top:0!important}
}
@media(max-width:1000px){
  .v624-section-head:has(>.v6-label:first-child + h2),.decision6-intro,.home-intl-bridge-head{grid-template-columns:1fr!important;grid-template-rows:auto!important;gap:12px!important}
  .v624-section-head:has(>.v6-label:first-child + h2)>.v6-label,.v624-section-head:has(>.v6-label:first-child + h2)>h2,.v624-section-head:has(>.v6-label:first-child + h2)>p,
  .decision6-intro>.v6-label,.decision6-intro>.v6-label+h2,.decision6-intro>.v6-label+h2+p,
  .home-intl-bridge-head>.v6-label,.home-intl-bridge-head>.v6-label+h2,.home-intl-bridge-head>.v6-label+h2+p{grid-column:1!important;grid-row:auto!important;margin:0!important}
  .hypothesis-row-v625{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}
@media(max-width:900px){
  .section6-head>:nth-child(2),.international6-head>p,.labx-head>p,.intel-block-head>p,.case6-two>p,.business-first-grid>.business-first-copy,
  .v624-section-head>div:first-child+p,.v624-section-head>div:first-child+a.text-link,.intl-two>.prose-lg,.tools-ethic>div:nth-child(2),.tool-explain-grid>div:nth-child(2),.lab-tools-bridge>.lab-tool-links{margin-top:0!important}
  .tool-workbench{padding:24px!important}
  .readiness-row{grid-template-columns:1fr 130px 150px!important}
}
@media(max-width:700px){
  .hypothesis-row-v625{grid-template-columns:1fr!important}
  .hypothesis-row-v625>label:first-child{grid-column:auto!important}
  .result-actions{flex-direction:column!important}
  .result-actions :where(.v6-btn,button){width:100%!important}
  .readiness-row{grid-template-columns:1fr!important}
}
@media(max-width:640px){
  .tool-workbench{padding:20px!important;border-radius:22px!important}
  .pro-tool-grid>a{min-height:0;padding:24px;border-radius:22px}
  .pro-tool-grid>a>h3{font-size:27px}
}
