/* IceShore Help — shared stylesheet
 * Palette: main #9fa8da / accent #c51162 / header background black
 * Status colors mirror the IceShore app (utils/statusColors.js):
 *   good #3DA58F / warning #E0A23B / critical #CB4A42 / pending #9AA0A6
 * No external dependencies — system font stack only.
 */

:root {
  --ice-main: #9fa8da;
  --ice-main-dark: #7986cb;
  /* Text-only tone: reaches AA (>=4.5:1) on --ice-main-soft.
     --ice-main-dark is reserved for borders/decoration (fails AA as text). */
  --ice-main-text: #5560b0;
  --ice-main-soft: #eef0fa;
  --ice-accent: #c51162;
  --ice-accent-dark: #9d0e50;
  --ice-accent-soft: rgba(197, 17, 98, 0.08);
  --ice-header-bg: #000000;
  --ice-bg: #ffffff;
  --ice-text: #1a1a2e;
  --ice-text-muted: #5a5a6e;
  --ice-border: #e6e8f4;
  --ice-border-strong: #d3d7ee;
  --ice-panel-bg: #f7f8fd;
  --ice-code-bg: #14142a;
  --ice-code-text: #e8eaf6;
  --ice-good: #3da58f;
  --ice-warn: #e0a23b;
  --ice-crit: #cb4a42;
  --ice-pending: #9aa0a6;
  --ice-radius: 12px;
  --ice-radius-sm: 8px;
  --ice-shadow-sm: 0 1px 2px rgba(20, 20, 42, 0.04);
  --ice-shadow: 0 6px 22px rgba(26, 26, 46, 0.06);
  --ice-shadow-lift: 0 12px 30px rgba(26, 26, 46, 0.10);
  --ice-max-width: 880px;
  --ice-shell-width: 1200px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI",
    "Yu Gothic", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ice-text);
  background: var(--ice-bg);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--ice-accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
}

strong {
  font-weight: 700;
  color: var(--ice-text);
}

/* Visually hidden, still announced by screen readers (aria-live region etc.) */
.ice-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Header ---------- */

.ice-header {
  background: var(--ice-header-bg);
  color: #ffffff;
  padding: 0;
  border-bottom: 1px solid rgba(159, 168, 218, 0.18);
}

.ice-header-inner {
  max-width: var(--ice-shell-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 24px;
  gap: 12px 20px;
  flex-wrap: wrap;
}

/* Wordmark: "IceShore" is one unit; "Help" is a quiet suffix. */
.ice-brand {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  color: #ffffff;
  text-decoration: none;
  line-height: 1;
}

.ice-brand:hover {
  text-decoration: none;
  opacity: 0.9;
}

.ice-brand-name {
  font-weight: 700;
  font-size: 19px;
  letter-spacing: 0.01em;
  color: #ffffff;
}

.ice-brand-sub {
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ice-main);
  padding: 2px 7px;
  border: 1px solid rgba(159, 168, 218, 0.45);
  border-radius: 999px;
  line-height: 1.4;
  transform: translateY(-1px);
}

.ice-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-left: auto;
}

.ice-nav a {
  color: #d7d9f0;
  font-size: 14px;
  font-weight: 500;
  padding: 4px 0;
  position: relative;
}

.ice-nav a:hover,
.ice-nav a.active {
  color: #ffffff;
  text-decoration: none;
}

.ice-nav a.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  border-radius: 2px;
  background: var(--ice-main);
}

.ice-lang-switch {
  display: flex;
  gap: 6px;
  font-size: 13px;
  margin-left: auto;
}

/* ---------- Hamburger (mobile only) ---------- */

.ice-hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: -9px 4px -9px -8px;
  padding: 0;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--ice-radius-sm);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.ice-hamburger:hover {
  background: rgba(159, 168, 218, 0.14);
}

.ice-hamburger:focus-visible {
  outline: none;
  border-color: var(--ice-main);
  box-shadow: 0 0 0 3px rgba(159, 168, 218, 0.35);
}

.ice-hamburger-lines,
.ice-hamburger-lines::before,
.ice-hamburger-lines::after {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.15s ease;
}

.ice-hamburger-lines {
  position: relative;
}

.ice-hamburger-lines::before,
.ice-hamburger-lines::after {
  content: "";
  position: absolute;
  left: 0;
}

.ice-hamburger-lines::before {
  top: -7px;
}

.ice-hamburger-lines::after {
  top: 7px;
}

html.nav-open .ice-hamburger-lines {
  background: transparent;
}

html.nav-open .ice-hamburger-lines::before {
  transform: translateY(7px) rotate(45deg);
}

html.nav-open .ice-hamburger-lines::after {
  transform: translateY(-7px) rotate(-45deg);
}

.ice-lang-switch a {
  color: #b8bce6;
  padding: 3px 9px;
  border: 1px solid #3a3a44;
  border-radius: 999px;
  transition: border-color 0.15s, color 0.15s;
}

.ice-lang-switch a:hover {
  text-decoration: none;
  border-color: var(--ice-main);
  color: #ffffff;
}

.ice-lang-switch a.active {
  background: var(--ice-main);
  border-color: var(--ice-main);
  color: #000;
  font-weight: 700;
}

/* ---------- Layout ---------- */

/* Two-column shell: sticky side-nav rail (left) + content (right). */
.ice-layout {
  display: flex;
  align-items: flex-start;
  gap: 48px;
  max-width: var(--ice-shell-width);
  margin: 0 auto;
  padding: 0 24px;
}

.ice-main {
  flex: 1 1 auto;
  min-width: 0; /* let .ice-cmd-block scroll internally instead of the page */
  max-width: var(--ice-max-width);
  margin: 0;
  padding: 40px 0 88px;
}

/* ---------- Side navigation (help-center IA) ---------- */

.ice-sidenav {
  flex: 0 0 236px;
  position: sticky;
  top: 24px;
  align-self: flex-start;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 40px 0;
}

.ice-sidenav-head {
  display: none; /* drawer-only affordance, shown < 900px */
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.ice-sidenav-head-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ice-text-muted);
}

.ice-drawer-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
  color: var(--ice-text-muted);
  background: transparent;
  border: 1px solid var(--ice-border);
  border-radius: var(--ice-radius-sm);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.ice-drawer-close:hover {
  color: var(--ice-accent);
  border-color: var(--ice-border-strong);
  background: var(--ice-panel-bg);
}

.ice-drawer-close:focus-visible {
  outline: none;
  border-color: var(--ice-main);
  box-shadow: 0 0 0 3px rgba(159, 168, 218, 0.3);
}

/* --ice-radius-nav: one deliberate, crisp corner for every pressable row. */
.ice-sidenav {
  --ice-radius-nav: 6px;
}

/* Groups are separated by a hairline + generous space so a section heading
 * never reads as a nav item, even when a group holds a single link. */
.ice-navgroup {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--ice-border);
}

.ice-navgroup:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

/* Section heading: small, spaced, non-interactive. No hover, no fill. */
.ice-navgroup-title {
  margin: 0 0 10px;
  padding: 0 2px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--ice-text-muted);
  cursor: default;
  user-select: none;
}

.ice-navgroup ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Nav item: a clearly pressable row — tall hit area, crisp border on state. */
.ice-navgroup a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 13px;
  border: 1px solid transparent;
  border-radius: var(--ice-radius-nav);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--ice-text);
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.ice-navgroup a:hover {
  background: var(--ice-main-soft);
  border-color: var(--ice-border-strong);
  text-decoration: none;
}

.ice-navgroup a:focus-visible {
  outline: none;
  border-color: var(--ice-main);
  box-shadow: 0 0 0 3px rgba(159, 168, 218, 0.35);
}

/* Active: solid fill, sharp outline, and a crisp left accent bar. */
.ice-navgroup a.active {
  background: var(--ice-main-soft);
  border-color: var(--ice-main);
  color: var(--ice-main-text);
  font-weight: 700;
  box-shadow: inset 3px 0 0 var(--ice-main);
}

/* ---------- Drawer overlay (mobile) ---------- */

.ice-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(10, 10, 24, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

html.nav-open .ice-overlay {
  opacity: 1;
  visibility: visible;
}

/* ---------- Breadcrumb (current location, above the hero) ---------- */

.ice-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--ice-text-muted);
  margin-bottom: 14px;
}

.ice-breadcrumb [aria-current="page"] {
  color: var(--ice-text);
  font-weight: 600;
}

.ice-breadcrumb-sep {
  color: var(--ice-border-strong);
}

.ice-hero {
  padding: 20px 0 8px;
}

.ice-hero h1 {
  font-size: clamp(25px, 4vw, 34px);
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin: 0 0 16px;
  color: var(--ice-text);
}

.ice-hero .ice-lead {
  font-size: 16.5px;
  color: var(--ice-text-muted);
}

.ice-lead {
  line-height: 1.8;
}

.ice-eyebrow {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ice-accent);
  background: var(--ice-accent-soft);
  border-radius: 999px;
  padding: 5px 13px;
  margin-bottom: 16px;
}

/* ---------- Cards / sections ---------- */

.ice-section {
  margin: 52px 0;
}

.ice-section h2 {
  font-size: 22px;
  line-height: 1.4;
  letter-spacing: -0.005em;
  margin: 0 0 8px;
  position: relative;
}

.ice-section h2::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 0.18em;
  bottom: 0.18em;
  width: 4px;
  border-radius: 4px;
  background: linear-gradient(var(--ice-main), var(--ice-main-dark));
}

.ice-section-desc {
  color: var(--ice-text-muted);
  margin: 0 0 22px;
}

.ice-card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.ice-card {
  background: var(--ice-bg);
  border: 1px solid var(--ice-border);
  border-radius: var(--ice-radius);
  padding: 20px 22px;
  box-shadow: var(--ice-shadow-sm);
  transition: box-shadow 0.18s ease, border-color 0.18s ease,
    transform 0.18s ease;
}

.ice-card:hover {
  box-shadow: var(--ice-shadow);
  border-color: var(--ice-border-strong);
}

.ice-card h3 {
  margin: 0 0 8px;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ice-text);
}

.ice-card p {
  margin: 0 0 14px;
  color: var(--ice-text-muted);
  font-size: 14px;
}

.ice-card p:last-child {
  margin-bottom: 0;
}

.ice-card > a {
  font-size: 14px;
  font-weight: 600;
}

.ice-card-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ice-main), var(--ice-main-dark));
  color: #000;
  font-weight: 700;
  font-size: 12px;
  margin-right: 9px;
  vertical-align: 1px;
}

/* ---------- KGI axis cards (what-you-can-do) ---------- */

.ice-axis {
  position: relative;
  padding-left: 24px;
}

.ice-axis::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: var(--ice-radius) 0 0 var(--ice-radius);
  background: linear-gradient(var(--ice-main), var(--ice-main-dark));
}

.ice-axis h3 {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 16.5px;
}

.ice-axis-tag {
  display: inline-flex;
  align-items: center;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ice-main-text);
  background: var(--ice-main-soft);
  border: 1px solid rgba(121, 134, 203, 0.28);
  border-radius: 999px;
  padding: 3px 12px;
  white-space: nowrap;
}

.ice-axis .ice-cmd-block {
  margin-top: 4px;
}

/* ---------- Editable placeholder token ---------- */

.ice-ph {
  font-weight: 600;
  color: var(--ice-accent);
  background: var(--ice-accent-soft);
  border-bottom: 1.5px dashed rgba(197, 17, 98, 0.5);
  border-radius: 4px;
  padding: 0 4px;
  white-space: nowrap;
}

/* Inside dark command blocks the token must read on dark. */
.ice-cmd-block .ice-ph {
  color: #f4b8d3;
  background: rgba(197, 17, 98, 0.22);
  border-bottom-color: rgba(244, 184, 211, 0.7);
}

/* ---------- AI-understanding legend ---------- */

.ice-legend {
  list-style: none;
  margin: 0 0 20px;
  padding: 18px 20px;
  background: var(--ice-panel-bg);
  border: 1px solid var(--ice-border);
  border-radius: var(--ice-radius);
  display: grid;
  gap: 12px;
}

.ice-legend li {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  font-size: 14.5px;
  color: var(--ice-text-muted);
  line-height: 1.6;
}

.ice-legend li strong {
  color: var(--ice-text);
}

.ice-state {
  flex: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-top: 6px;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.03);
}

.ice-state-good {
  background: var(--ice-good);
  box-shadow: 0 0 0 3px rgba(61, 165, 143, 0.16);
}

.ice-state-warn {
  background: var(--ice-warn);
  box-shadow: 0 0 0 3px rgba(224, 162, 59, 0.16);
}

.ice-state-crit {
  background: var(--ice-crit);
  box-shadow: 0 0 0 3px rgba(203, 74, 66, 0.16);
}

/* ---------- Supplementary note ---------- */

.ice-note {
  font-size: 14px;
  color: var(--ice-text-muted);
  background: var(--ice-main-soft);
  border-left: 3px solid var(--ice-main);
  border-radius: 0 var(--ice-radius-sm) var(--ice-radius-sm) 0;
  padding: 14px 18px;
  margin: 0;
}

/* ---------- Buttons ---------- */

.ice-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--ice-accent);
  color: #fff;
  border: none;
  border-radius: var(--ice-radius-sm);
  padding: 11px 20px;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(197, 17, 98, 0.22);
  transition: background 0.15s, box-shadow 0.15s, transform 0.12s;
}

.ice-btn:hover {
  background: var(--ice-accent-dark);
  text-decoration: none;
  color: #fff;
  box-shadow: 0 6px 18px rgba(197, 17, 98, 0.28);
  transform: translateY(-1px);
}

.ice-btn.secondary {
  background: var(--ice-main);
  color: #000;
  box-shadow: 0 4px 14px rgba(159, 168, 218, 0.3);
}

.ice-btn.secondary:hover {
  background: var(--ice-main-dark);
  color: #000;
  box-shadow: 0 6px 18px rgba(121, 134, 203, 0.34);
}

.ice-btn.ghost {
  background: transparent;
  color: var(--ice-accent);
  border: 1px solid var(--ice-accent);
  box-shadow: none;
}

.ice-btn.ghost:hover {
  background: var(--ice-accent-soft);
  color: var(--ice-accent);
  box-shadow: none;
}

.ice-btn:disabled {
  opacity: 0.6;
  cursor: default;
  box-shadow: none;
  transform: none;
}

.ice-btn-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 34px 0;
}

/* ---------- Connect page: AI selector ---------- */

.ai-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
}

.ai-selector button {
  border: 1px solid var(--ice-border-strong);
  background: #fff;
  color: var(--ice-text);
  min-height: 44px;
  padding: 12px 18px;
  border-radius: var(--ice-radius-sm);
  font-size: 14px;
  cursor: pointer;
  font-weight: 600;
  transition: border-color 0.15s, color 0.15s, background 0.15s,
    box-shadow 0.15s;
}

.ai-selector button:hover {
  border-color: var(--ice-main);
  box-shadow: var(--ice-shadow-sm);
}

.ai-selector button.active {
  background: var(--ice-header-bg);
  border-color: var(--ice-header-bg);
  color: var(--ice-main);
}

.ice-field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin: 24px 0 7px;
  color: var(--ice-text);
}

.ice-text-input {
  width: 100%;
  max-width: 320px;
  padding: 10px 12px;
  border: 1px solid var(--ice-border-strong);
  border-radius: var(--ice-radius-sm);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.ice-text-input:focus {
  outline: none;
  border-color: var(--ice-main);
  box-shadow: 0 0 0 3px rgba(159, 168, 218, 0.3);
}

.ice-step {
  margin: 32px 0;
  padding-top: 30px;
  border-top: 1px solid var(--ice-border);
}

.ice-step:first-of-type {
  border-top: none;
  padding-top: 0;
}

.ice-step-title {
  display: flex;
  align-items: center;
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 12px;
}

.ice-cmd-label {
  font-size: 14px;
  color: var(--ice-text-muted);
  margin: 16px 0 8px;
}

.ice-cmd-block {
  background: var(--ice-code-bg);
  color: var(--ice-code-text);
  border-radius: var(--ice-radius-sm);
  padding: 15px 17px;
  overflow-x: auto;
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.ice-cmd-block code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

.ice-setup-note {
  font-size: 14px;
  color: var(--ice-text-muted);
  margin: 18px 0 8px;
}

.ice-copy-btn {
  background: var(--ice-main);
  color: #000;
  border: none;
  border-radius: var(--ice-radius-sm);
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  max-width: 320px;
  transition: background 0.15s, box-shadow 0.15s;
}

.ice-copy-btn:hover {
  background: var(--ice-main-dark);
  box-shadow: 0 4px 14px rgba(159, 168, 218, 0.3);
}

.ice-copy-btn.copied {
  background: var(--ice-accent);
  color: #fff;
}

.manage-cta {
  display: inline-block;
  margin-top: 44px;
  padding: 12px 22px;
  background: #fff;
  border: 1.5px solid var(--ice-accent);
  color: var(--ice-accent);
  border-radius: var(--ice-radius-sm);
  font-weight: 700;
  font-size: 14px;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.manage-cta:hover {
  background: var(--ice-accent);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(197, 17, 98, 0.24);
}

/* ---------- Footer ---------- */

.ice-footer {
  border-top: 1px solid var(--ice-border);
  padding: 28px 20px 44px;
  text-align: center;
  color: var(--ice-text-muted);
  font-size: 13px;
}

.ice-footer a {
  color: var(--ice-text-muted);
  text-decoration: underline;
}

.ice-footer a:hover {
  color: var(--ice-accent);
}

.ice-footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-bottom: 14px;
}

.ice-footer-links a {
  color: var(--ice-text-muted);
  text-decoration: none;
  font-weight: 600;
}

.ice-footer-links a:hover {
  color: var(--ice-accent);
  text-decoration: underline;
}


/* ---------- External guide links ---------- */

.ice-guide-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 14px 0 0;
}

.ice-guide-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--ice-border);
  border-radius: var(--ice-radius-sm);
  padding: 13px 17px;
  font-weight: 600;
  color: var(--ice-text);
  background: var(--ice-bg);
  box-shadow: var(--ice-shadow-sm);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.ice-guide-link:hover {
  border-color: var(--ice-main);
  text-decoration: none;
  background: var(--ice-panel-bg);
  box-shadow: var(--ice-shadow);
}

.ice-guide-link::after {
  content: "↗";
  margin-left: auto;
  color: var(--ice-text-muted);
}

/* ---------- Diagrams (how-it-works) ---------- */

.ice-figure {
  margin: 0;
  padding: 18px;
  background: var(--ice-panel-bg);
  border: 1px solid var(--ice-border);
  border-radius: var(--ice-radius);
}

.ice-figcaption {
  margin-top: 14px;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--ice-text-muted);
}

.ice-figcaption strong {
  color: var(--ice-text);
}

/* Diagram nodes (shared by both figures) */
.ice-node {
  background: #fff;
  border: 1px solid var(--ice-border-strong);
  border-radius: var(--ice-radius-sm);
  padding: 14px 16px;
  text-align: center;
  box-shadow: var(--ice-shadow-sm);
}

.ice-node strong {
  display: block;
  font-size: 15px;
  line-height: 1.4;
  color: var(--ice-text);
}

.ice-node-sub {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ice-text-muted);
}

.ice-node-tag {
  display: inline-block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ice-main-text);
}

.ice-node-list {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--ice-text-muted);
}

.ice-node--ai {
  background: var(--ice-code-bg);
  border-color: var(--ice-code-bg);
}
.ice-node--ai strong {
  color: #fff;
}
.ice-node--ai .ice-node-sub {
  color: var(--ice-main);
}
.ice-node--pillar {
  border-color: var(--ice-main);
}
.ice-node--start {
  border-color: var(--ice-accent);
}
.ice-node--start .ice-node-tag {
  color: var(--ice-accent);
}
.ice-node--ice {
  border-color: var(--ice-main);
}

/* Diagram 1: MCP and the web service converge on the AI in the centre.
   Vertical at every width: MCP (top) -> down-arrow -> AI -> up-arrow -> Web. */
.ice-pillars {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}
.ice-pillars > .ice-node {
  width: 100%;
  max-width: 320px;
}
.ice-converge-arrow {
  width: 0;
  height: 0;
  margin: 10px 0;
  align-self: center;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
}
.ice-converge-arrow--down {
  border-top: 11px solid var(--ice-main);
}
.ice-converge-arrow--up {
  border-bottom: 11px solid var(--ice-main);
}

/* Diagram 2: L->R flow on desktop */
.ice-flow {
  display: flex;
  align-items: stretch;
  list-style: none;
  margin: 0;
  padding: 0;
}
.ice-flow-step {
  flex: 1;
  display: flex;
}
.ice-flow-step > .ice-node {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.ice-flow-sep {
  flex: 0 0 auto;
  align-self: center;
  width: 0;
  height: 0;
  margin: 0 8px;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 10px solid var(--ice-main);
}

/* Narrow screens: both diagrams reflow to a top->bottom stack, no scroll */
@media (max-width: 700px) {
  .ice-flow {
    flex-direction: column;
  }
  .ice-flow-step {
    width: 100%;
  }
  .ice-flow-sep {
    align-self: center;
    margin: 8px 0;
    border-top: 10px solid var(--ice-main);
    border-bottom: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
  }
}

/* ---------- Responsive ---------- */

@media (min-width: 640px) {
  .ice-card-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ===== Below 900px: side-nav becomes a slide-in drawer ===== */
@media (max-width: 899px) {
  /* Stack the shell so content spans the full width. */
  .ice-layout {
    flex-direction: column;
    gap: 0;
  }

  /* When JS is active the rail is a fixed drawer, hidden off-canvas. */
  html.js .ice-hamburger {
    display: inline-flex;
  }

  html.js .ice-sidenav {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 50;
    flex: none;
    width: min(82vw, 300px);
    max-height: none;
    padding: 20px 16px 32px;
    background: var(--ice-bg);
    border-right: 1px solid var(--ice-border);
    box-shadow: var(--ice-shadow-lift);
    transform: translateX(-100%);
    transition: transform 0.24s ease;
    overscroll-behavior: contain;
  }

  html.js .ice-sidenav .ice-sidenav-head {
    display: flex;
  }

  html.js.nav-open .ice-sidenav {
    transform: translateX(0);
  }

  /* No JS: keep the nav visible and usable, stacked above content. */
  html.no-js .ice-sidenav {
    position: static;
    width: 100%;
    max-height: none;
    padding: 24px 0 8px;
  }
}

/* ===== 900px and up: rail is always shown; drawer chrome is inert ===== */
@media (min-width: 900px) {
  .ice-hamburger {
    display: none !important;
  }
  .ice-overlay {
    display: none;
  }
  .ice-sidenav {
    transform: none;
  }
  .ice-sidenav-head {
    display: none !important;
  }
}

@media (max-width: 480px) {
  .ice-header-inner {
    padding: 12px 18px;
  }
  .ice-layout {
    padding: 0 18px;
  }
  .ice-main {
    padding: 32px 0 72px;
  }
  .ice-section {
    margin: 42px 0;
  }
  .ai-selector button {
    flex: 1 1 45%;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
