/* Keep the homepage controls complete at every supported viewport. */
@media screen {
  html[data-flow-theme] .site-header {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    column-gap: clamp(16px, 3vw, 40px);
    row-gap: 8px;
  }

  html[data-flow-theme] .site-header .brand-lockup {
    grid-column: 1;
    grid-row: 1;
  }

  html[data-flow-theme] .site-header .flow-navigation {
    grid-column: 2;
    grid-row: 1;
    width: auto;
    min-width: 0;
    justify-content: center;
    gap: clamp(16px, 2vw, 32px);
  }

  html[data-flow-theme] .site-header .flow-navigation a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
  }

  html[data-flow-theme] .site-header .header-actions {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    margin-inline-start: 0;
    gap: 8px;
  }

  html[data-flow-theme] .site-header .header-actions .channel-link,
  html[data-flow-theme] .site-header .header-actions .sound-toggle {
    display: inline-flex;
    min-width: 44px;
    min-height: 44px;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
  }

  html[data-flow-theme] .site-header .channel-link:hover {
    color: var(--flow-cyan);
    border-color: var(--flow-cyan);
    background: var(--flow-surface);
  }

  html[data-flow-theme] #aris-smart-tools .smart-tool--beta {
    min-width: 0;
    overflow: visible;
  }

  html[data-flow-theme] #aris-smart-tools .smart-tool__action {
    max-width: 100%;
    min-height: 48px;
    justify-content: center;
    gap: 12px;
    white-space: nowrap;
    line-height: 1.8;
  }

  html[data-flow-theme] #aris-smart-tools .smart-tool__action span {
    min-width: 0;
  }

  html[data-flow-theme] #aris-smart-tools .smart-tool__action b {
    flex: 0 0 auto;
  }
}

@media screen and (max-width: 1000px) {
  html[data-flow-theme] .site-header .header-actions .channel-link,
  html[data-flow-theme] .site-header .header-actions .sound-toggle {
    width: 44px;
    height: 44px;
    padding: 0;
  }

  html[data-flow-theme] .site-header .sound-label,
  html[data-flow-theme] .site-header .channel-link span {
    display: none;
  }

  html[data-flow-theme] .site-header .channel-link::after {
    content: none;
  }

  /* Keep the compass row and guide copy full width on tablets. */
  html[data-flow-theme] .flow-supports {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  html[data-flow-theme] .flow-guide-entry > div,
  html[data-flow-theme] #aris-smart-tools .smart-tool--beta {
    flex: 1 1 auto;
    min-width: 0;
  }
}

@media screen and (max-width: 720px) {
  html[data-flow-theme] .site-header {
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 16px;
  }

  html[data-flow-theme] .site-header .flow-wordmark {
    width: 120px;
    height: 58px;
  }

  html[data-flow-theme] .site-header .header-actions {
    grid-column: 2;
  }

  html[data-flow-theme] .site-header .flow-navigation {
    grid-column: 1 / -1;
    grid-row: 2;
    gap: clamp(18px, 6vw, 32px);
  }
}

@media screen and (max-width: 540px) {
  html[data-flow-theme] .flow-guide-entry,
  html[data-flow-theme] #aris-smart-tools {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 104px;
    align-items: center;
    column-gap: 16px;
    row-gap: 16px;
  }

  html[data-flow-theme] .flow-supports .flow-support-art,
  html[data-flow-theme] .flow-guide-entry .flow-support-art {
    grid-column: 2;
    grid-row: 1;
    width: 104px;
    height: 136px;
  }

  html[data-flow-theme] .flow-guide-entry > div,
  html[data-flow-theme] #aris-smart-tools .smart-tool--beta {
    display: contents;
  }

  html[data-flow-theme] #aris-smart-tools .smart-tool__beta-main {
    grid-column: 1;
    grid-row: 1;
  }

  html[data-flow-theme] #aris-smart-tools .smart-tool__action {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    margin-top: 0;
    padding: 12px 18px;
    font-size: 14px;
  }

  html[data-flow-theme] .flow-guide-entry h2 {
    grid-column: 1;
    grid-row: 1;
    align-self: start;
    margin-bottom: 0;
  }

  html[data-flow-theme] .flow-guide-entry p {
    grid-column: 1;
    grid-row: 2;
    margin: 0;
  }

  html[data-flow-theme] .flow-guide-entry .flow-support-art {
    grid-row: 1 / 3;
  }
}
