:root {
  --bg: #07111f;
  --surface: #0b1728;
  --surface-2: #101f34;
  --surface-3: #162942;
  --line: rgba(255,255,255,.09);
  --line-strong: rgba(255,255,255,.16);
  --text: #f4f7fb;
  --muted: #96a6bb;
  --muted-2: #6f8298;
  --accent: #35d6a1;
  --accent-2: #56a8ff;
  --accent-3: #e9be55;
  --danger: #ff7b82;
  --quality: #d995ff;
  --process: #4fc1a6;
  --storage: #6da8ff;
  --utility: #f0bd58;
  --product: #b28bf4;
  --transport: #e98e65;
  --shadow: 0 24px 70px rgba(0,0,0,.28);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --sidebar: 246px;
  --sidebar-compact: 76px;
  --topbar: 86px;
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #eef3f7;
  --surface: #ffffff;
  --surface-2: #f7fafc;
  --surface-3: #eaf1f6;
  --line: rgba(20,44,66,.10);
  --line-strong: rgba(20,44,66,.17);
  --text: #102234;
  --muted: #607286;
  --muted-2: #7a8a9b;
  --shadow: 0 22px 60px rgba(38,64,84,.14);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 80% 8%, rgba(53,214,161,.08), transparent 26rem),
    radial-gradient(circle at 35% 45%, rgba(86,168,255,.05), transparent 30rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  transition: background-color .2s ease, color .2s ease;
}
button, input, select { font: inherit; }
button { color: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
::selection { background: rgba(53,214,161,.25); }

.skip-link {
  position: fixed;
  left: 12px;
  top: 12px;
  transform: translateY(-160%);
  background: var(--accent);
  color: #041411;
  padding: 9px 14px;
  border-radius: 8px;
  z-index: 999;
  font-weight: 800;
}
.skip-link:focus { transform: none; }
.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;
}

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 22px 15px 16px;
  z-index: 80;
  backdrop-filter: blur(16px);
  transition: width .22s ease, transform .22s ease, padding .22s ease;
}
.sidebar-collapse {
  position: absolute;
  top: 28px;
  right: -14px;
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--muted);
  box-shadow: 0 8px 24px rgba(0,0,0,.16);
  z-index: 3;
  transition: transform .22s ease, background .16s ease, color .16s ease;
}
.sidebar-collapse:hover { color: var(--text); background: var(--surface-2); }
.sidebar-collapse span { font-size: 22px; line-height: 1; transform: translateY(-1px); }
.brand {
  height: 56px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 9px;
  margin-bottom: 24px;
}
.brand strong { display: block; font-size: 13px; letter-spacing: .16em; }
.brand small { display: block; color: var(--muted); margin-top: 2px; }
.brand-mark {
  width: 39px;
  height: 39px;
  position: relative;
  border-radius: 13px;
  background: linear-gradient(145deg, rgba(53,214,161,.2), rgba(86,168,255,.15));
  border: 1px solid rgba(53,214,161,.25);
  display: grid;
  place-items: center;
}
.brand-mark span {
  width: 17px;
  height: 17px;
  border: 3px solid var(--accent);
  border-right-color: transparent;
  border-radius: 50%;
}
.brand-mark i {
  position: absolute;
  width: 8px;
  height: 3px;
  border-radius: 999px;
  background: var(--accent);
  transform: translate(7px,-5px) rotate(-35deg);
}
.primary-nav { display: grid; gap: 5px; }
.nav-item {
  width: 100%;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 11px;
  min-height: 44px;
  border-radius: 12px;
  color: var(--muted);
  text-align: left;
  transition: .18s ease;
}
.nav-item:hover { color: var(--text); background: var(--surface-2); }
.nav-item.is-active {
  color: var(--text);
  background: linear-gradient(90deg, rgba(53,214,161,.13), rgba(53,214,161,.04));
  box-shadow: inset 3px 0 0 var(--accent);
}
.nav-icon {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.nav-item.is-active .nav-icon { color: var(--accent); background: rgba(53,214,161,.10); }
.sidebar-footer { margin-top: auto; display: grid; gap: 8px; }
.sidebar-action {
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 12px;
  color: var(--muted);
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
}
.sidebar-action:hover { background: var(--surface-2); color: var(--text); }
.connection-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px 2px;
  color: var(--muted-2);
  font-size: 12px;
}
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(53,214,161,.09); }
.connection-status.is-offline .status-dot { background: var(--danger); box-shadow: 0 0 0 4px rgba(255,123,130,.09); }

.app-main { margin-left: var(--sidebar); min-height: 100vh; transition: margin-left .22s ease; }
.topbar {
  min-height: var(--topbar);
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 15px clamp(22px, 3vw, 48px);
  background: color-mix(in srgb, var(--bg) 83%, transparent);
  border-bottom: 1px solid transparent;
  backdrop-filter: blur(18px);
}
.topbar.is-scrolled { border-bottom-color: var(--line); }
.topbar-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar h1 { margin: 0; font-size: clamp(18px, 2vw, 24px); letter-spacing: -.025em; line-height: 1.1; }
.eyebrow { display: block; color: var(--accent); text-transform: uppercase; letter-spacing: .15em; font-weight: 800; font-size: 10px; margin-bottom: 5px; }
.mobile-menu { display: none; border: 0; background: transparent; font-size: 22px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.global-search {
  width: min(34vw, 420px);
  height: 44px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 0 10px 0 13px;
  background: var(--surface);
  box-shadow: 0 6px 24px rgba(0,0,0,.05);
}
.global-search:focus-within { border-color: rgba(53,214,161,.55); box-shadow: 0 0 0 3px rgba(53,214,161,.08); }
.global-search input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--text); }
.global-search input::placeholder, input::placeholder { color: var(--muted-2); }
.search-icon { color: var(--muted); transform: rotate(-15deg); }
kbd {
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  padding: 1px 6px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 11px;
  font-family: inherit;
  background: var(--surface-2);
}
.icon-button {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  display: grid;
  place-items: center;
  font-weight: 800;
}
.icon-button:hover { border-color: var(--line-strong); background: var(--surface-2); }

main { padding: 10px clamp(22px, 3vw, 48px) 56px; }
.view { display: none; animation: viewIn .24s ease; }
.view.is-active { display: block; }
@keyframes viewIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.hero-panel {
  min-height: 380px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, .95fr);
  gap: 24px;
  align-items: center;
  overflow: hidden;
  position: relative;
  padding: clamp(28px, 4vw, 54px);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(115deg, rgba(53,214,161,.08), transparent 38%),
    linear-gradient(155deg, var(--surface), var(--surface-2));
  box-shadow: var(--shadow);
}
.hero-panel::after {
  content: "";
  position: absolute;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  right: -130px;
  bottom: -180px;
  background: rgba(86,168,255,.10);
  filter: blur(8px);
}
.pill, .panel-badge, .node-badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(53,214,161,.25);
  background: rgba(53,214,161,.08);
  color: var(--accent);
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 800;
  letter-spacing: .04em;
  font-size: 11px;
}
.hero-copy { position: relative; z-index: 2; }
.hero-copy h2 { max-width: 650px; margin: 16px 0 14px; font-size: clamp(34px, 4vw, 61px); line-height: .98; letter-spacing: -.055em; }
.hero-copy p { max-width: 680px; margin: 0; color: var(--muted); font-size: clamp(15px, 1.25vw, 18px); }
.hero-actions { margin-top: 27px; display: flex; gap: 10px; flex-wrap: wrap; }
.button {
  border: 0;
  min-height: 44px;
  padding: 0 17px;
  border-radius: 12px;
  font-weight: 800;
  transition: transform .16s ease, background .16s ease;
}
.button:hover { transform: translateY(-1px); }
.button.primary { background: var(--accent); color: #03130f; box-shadow: 0 10px 30px rgba(53,214,161,.18); }
.button.secondary { background: var(--surface-3); border: 1px solid var(--line); }
.hero-visual { min-height: 300px; position: relative; display: grid; place-items: center; }
.hero-core {
  position: relative;
  z-index: 3;
  width: 142px;
  height: 142px;
  border-radius: 50%;
  display: grid;
  align-content: center;
  text-align: center;
  background: radial-gradient(circle at 30% 25%, rgba(53,214,161,.22), var(--surface));
  border: 1px solid rgba(53,214,161,.30);
  box-shadow: 0 0 0 10px rgba(53,214,161,.03), 0 20px 50px rgba(0,0,0,.2);
}
.core-value { font-size: 37px; line-height: 1; font-weight: 900; letter-spacing: -.05em; }
.hero-core small { margin-top: 7px; color: var(--muted); }
.hero-orbit { position: absolute; border: 1px dashed var(--line-strong); border-radius: 50%; }
.orbit-one { width: 250px; height: 250px; animation: spin 34s linear infinite; }
.orbit-two { width: 330px; height: 330px; opacity: .6; animation: spin 46s linear reverse infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.hero-node {
  position: absolute;
  z-index: 4;
  padding: 7px 10px;
  border-radius: 9px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  box-shadow: 0 8px 22px rgba(0,0,0,.12);
}
.hero-node.n1 { transform: translate(-120px,-110px); }
.hero-node.n2 { transform: translate(130px,-82px); }
.hero-node.n3 { transform: translate(155px,45px); color: var(--accent); }
.hero-node.n4 { transform: translate(70px,125px); color: var(--quality); }
.hero-node.n5 { transform: translate(-105px,120px); color: var(--accent-3); }
.hero-node.n6 { transform: translate(-165px,20px); color: var(--accent-2); }

.metrics-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 16px 0 42px; }
.metric-card { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); padding: 17px; display: flex; align-items: center; gap: 13px; }
.metric-icon { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 12px; background: var(--surface-2); color: var(--accent); font-weight: 900; }
.metric-card strong { font-size: 23px; line-height: 1; letter-spacing: -.04em; display: block; }
.metric-card span { color: var(--muted); font-size: 12px; }
.section-heading, .page-intro { display: flex; justify-content: space-between; align-items: end; gap: 30px; margin: 0 0 18px; }
.section-heading { margin-top: 38px; }
.section-heading.compact { margin-top: 36px; }
.section-heading h2, .page-intro h2 { margin: 0; font-size: clamp(25px, 3vw, 36px); letter-spacing: -.04em; }
.section-heading p, .page-intro > p { margin: 0; max-width: 520px; color: var(--muted); }

.macro-flow { display: grid; grid-template-columns: repeat(7, minmax(150px, 1fr)); gap: 16px; overflow-x: auto; padding: 4px 4px 18px; scrollbar-width: thin; }
.macro-card {
  min-width: 160px;
  min-height: 164px;
  position: relative;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 17px;
  padding: 17px;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.macro-card:hover { transform: translateY(-3px); border-color: rgba(53,214,161,.28); background: var(--surface-2); }
.macro-card:not(:last-child)::after {
  content: "";
  position: absolute;
  right: -15px;
  top: 50%;
  width: 14px;
  height: 1px;
  background: var(--line-strong);
}
.macro-number { color: var(--accent); font-size: 10px; font-weight: 900; letter-spacing: .12em; }
.macro-card strong { display: block; margin-top: 12px; font-size: 15px; line-height: 1.2; }
.macro-card p { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.macro-tag { display: inline-block; margin-top: 13px; font-size: 10px; color: var(--muted-2); }

.overview-grid { display: grid; grid-template-columns: 1.7fr 1fr; gap: 15px; margin-top: 12px; }
.panel { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-lg); padding: 22px; }
.panel-header { display: flex; align-items: start; justify-content: space-between; gap: 16px; margin-bottom: 19px; }
.panel-header h3 { margin: 0; font-size: 20px; letter-spacing: -.025em; }
.panel-badge { border-color: var(--line); background: var(--surface-2); color: var(--muted); }
.principles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.principle { padding: 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.principle:last-child { grid-column: span 2; }
.principle strong { display: block; font-size: 13px; }
.principle p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.product-mini-list { display: grid; gap: 8px; }
.product-mini { display: flex; gap: 11px; align-items: center; padding: 11px 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; }
.product-mini i { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 5px rgba(53,214,161,.06); }
.product-mini strong { display: block; font-size: 13px; }
.product-mini span { display: block; color: var(--muted); font-size: 11px; }
.notice-panel { margin-top: 15px; border: 1px solid rgba(240,189,88,.18); background: rgba(240,189,88,.05); border-radius: 16px; padding: 16px 18px; display: flex; gap: 12px; color: var(--muted); }
.notice-icon { width: 28px; height: 28px; flex: 0 0 28px; display: grid; place-items: center; border-radius: 50%; background: rgba(240,189,88,.12); color: var(--accent-3); font-weight: 900; }
.notice-panel strong { color: var(--text); }
.notice-panel p { margin: 3px 0 0; font-size: 12px; }

.map-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 18px; align-items: start; transition: grid-template-columns .22s ease; }
.map-workspace { min-width: 0; }
.area-rail { position: sticky; top: calc(var(--topbar) + 12px); border: 1px solid var(--line); background: var(--surface); border-radius: 18px; padding: 14px; max-height: calc(100vh - var(--topbar) - 30px); overflow-y: auto; overflow-x: hidden; transition: padding .22s ease; }
.area-rail-head { padding: 7px 7px 12px; border-bottom: 1px solid var(--line); margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 56px; }
.area-rail-head strong { font-size: 13px; }
.area-rail-toggle { width: 29px; height: 29px; flex: 0 0 29px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); color: var(--muted); }
.area-rail-toggle:hover { color: var(--text); border-color: var(--line-strong); }
.area-rail-toggle span { font-size: 20px; line-height: 1; transition: transform .22s ease; }
.map-layout.is-area-compact { grid-template-columns: 66px minmax(0, 1fr); }
.map-layout.is-area-compact .area-rail { padding-inline: 8px; }
.map-layout.is-area-compact .area-rail-copy, .map-layout.is-area-compact .area-label { display: none; }
.map-layout.is-area-compact .area-rail-head { justify-content: center; padding-inline: 0; }
.map-layout.is-area-compact .area-rail-toggle span { transform: rotate(180deg); }
.map-layout.is-area-compact .area-button { justify-content: center; padding-inline: 0; }
.area-buttons { display: grid; gap: 5px; }
.area-button { border: 0; background: transparent; color: var(--muted); min-height: 42px; padding: 9px 10px; border-radius: 11px; display: flex; gap: 9px; align-items: center; text-align: left; font-size: 12px; }
.area-button:hover { background: var(--surface-2); color: var(--text); }
.area-button.is-active { color: var(--text); background: rgba(53,214,161,.09); }
.area-button .area-num { width: 24px; height: 24px; flex: 0 0 24px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; font-size: 10px; font-weight: 900; }
.area-button.is-active .area-num { color: var(--accent); border-color: rgba(53,214,161,.25); }
.map-toolbar { display: flex; justify-content: space-between; gap: 20px; align-items: end; margin-bottom: 14px; }
.map-toolbar h2 { margin: 0; font-size: clamp(25px, 3vw, 36px); letter-spacing: -.04em; }
.map-toolbar p { color: var(--muted); max-width: 760px; margin: 6px 0 0; }
.map-controls { display: flex; gap: 6px; flex-wrap: wrap; justify-content: end; }
.chip-button { border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); padding: 7px 10px; font-size: 11px; }
.chip-button:hover, .chip-button.is-active { color: var(--text); border-color: rgba(53,214,161,.26); background: rgba(53,214,161,.08); }
.process-map-shell { border: 1px solid var(--line); border-radius: 20px; overflow: hidden; background: var(--surface); }
.process-map {
  position: relative;
  min-height: 460px;
  height: 560px;
  overflow: auto;
  overscroll-behavior: contain;
  background:
    linear-gradient(rgba(127,153,174,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(127,153,174,.045) 1px, transparent 1px),
    var(--surface);
  background-size: 26px 26px;
  scrollbar-width: thin;
}
.process-map-canvas { position: relative; min-width: 100%; min-height: 100%; }
.process-map svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.map-edge { fill: none; stroke: color-mix(in srgb, var(--muted) 62%, transparent); stroke-width: 1.7; marker-end: url(#arrow); stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.map-arrow-head { fill: color-mix(in srgb, var(--muted) 78%, transparent); }
.map-edge.is-recycle { stroke: var(--accent-2); stroke-dasharray: 7 5; opacity: .68; }
.map-edge.is-utility { stroke: var(--accent-3); stroke-dasharray: 3 5; opacity: .62; }
.process-node {
  position: absolute;
  width: 176px;
  height: 82px;
  transform: translate(-50%,-50%);
  border: 1px solid var(--line-strong);
  border-left: 4px solid var(--node-color, var(--process));
  border-radius: 14px;
  padding: 10px 11px;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  background: color-mix(in srgb, var(--surface) 89%, var(--surface-2) 11%);
  box-shadow: 0 10px 28px rgba(0,0,0,.10);
  transition: transform .15s ease, opacity .15s ease, border-color .15s ease, box-shadow .15s ease;
  z-index: 4;
}
.process-node:hover, .process-node:focus-visible { transform: translate(-50%,-50%) scale(1.03); border-color: var(--node-color); box-shadow: 0 14px 34px rgba(0,0,0,.14); outline: none; z-index: 6; }
.process-node.is-muted { opacity: .18; filter: saturate(.25); }
.process-node small { display: block; color: var(--node-color); text-transform: uppercase; letter-spacing: .11em; font-size: 8px; font-weight: 900; margin-bottom: 4px; }
.process-node strong { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 11px; line-height: 1.28; }
.process-node span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--muted); font-size: 8.5px; margin-top: 4px; line-height: 1.25; }
.map-legend { min-height: 46px; padding: 10px 15px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: 10px; }
.map-legend span { display: flex; align-items: center; gap: 6px; }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--process); }
.legend-dot.storage { background: var(--storage); }
.legend-dot.utility { background: var(--utility); }
.legend-dot.product { background: var(--product); }
.legend-dot.quality { background: var(--quality); }
.legend-dot.transport { background: var(--transport); }
.map-insight-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.map-insight { border: 1px solid var(--line); background: var(--surface); border-radius: 15px; padding: 15px; }
.map-insight strong { display: block; font-size: 12px; }
.map-insight p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }

.training-head { display: flex; justify-content: space-between; gap: 20px; align-items: end; margin-bottom: 18px; }
.training-head h2 { margin: 0; font-size: clamp(27px, 3.4vw, 42px); letter-spacing: -.045em; }
.training-head p { margin: 7px 0 0; color: var(--muted); }
.training-progress-block { width: min(280px, 30vw); color: var(--muted); font-size: 11px; }
.progress-track { height: 6px; background: var(--surface-2); border-radius: 999px; margin-top: 7px; overflow: hidden; border: 1px solid var(--line); }
.progress-track i { display: block; width: 10%; height: 100%; background: var(--accent); border-radius: inherit; transition: width .25s ease; }
.training-body { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 16px; align-items: stretch; }
.training-steps { margin: 0; padding: 12px; list-style: none; border: 1px solid var(--line); background: var(--surface); border-radius: 18px; max-height: calc(100vh - 180px); overflow: auto; }
.training-step-button { width: 100%; border: 0; background: transparent; color: var(--muted); text-align: left; display: grid; grid-template-columns: 31px 1fr; gap: 9px; padding: 8px; border-radius: 11px; align-items: center; }
.training-step-button:hover { background: var(--surface-2); color: var(--text); }
.training-step-button.is-active { background: rgba(53,214,161,.09); color: var(--text); }
.training-index { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line); font-size: 10px; font-weight: 900; }
.training-step-button.is-active .training-index { color: var(--accent); border-color: rgba(53,214,161,.3); }
.training-step-button strong { display: block; font-size: 11px; line-height: 1.25; }
.training-card { min-height: 590px; border: 1px solid var(--line); border-radius: 22px; background: linear-gradient(145deg, var(--surface), var(--surface-2)); padding: clamp(24px, 4vw, 52px); box-shadow: var(--shadow); }
.training-badge { display: inline-flex; min-height: 28px; align-items: center; padding: 0 10px; border-radius: 999px; background: rgba(53,214,161,.08); color: var(--accent); border: 1px solid rgba(53,214,161,.2); font-size: 10px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.training-card h3 { max-width: 770px; margin: 17px 0 10px; font-size: clamp(30px, 4vw, 54px); letter-spacing: -.05em; line-height: 1.02; }
.training-card > p { max-width: 850px; color: var(--muted); font-size: 16px; }
.training-triad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 28px; }
.triad-card { padding: 17px; border: 1px solid var(--line); border-radius: 15px; background: color-mix(in srgb, var(--surface-2) 88%, transparent); }
.triad-card span { color: var(--muted-2); font-size: 9px; letter-spacing: .13em; text-transform: uppercase; font-weight: 900; }
.triad-card strong { display: block; margin-top: 7px; font-size: 13px; }
.triad-card p { margin: 6px 0 0; color: var(--muted); font-size: 11px; }
.training-keypoint { margin-top: 21px; border-left: 3px solid var(--accent); padding: 10px 0 10px 15px; }
.training-keypoint strong { display: block; }
.training-keypoint p { margin: 4px 0 0; color: var(--muted); }
.training-nav { margin-top: 28px; display: flex; justify-content: space-between; gap: 10px; }

.product-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.product-card { border: 1px solid var(--line); border-radius: 18px; background: var(--surface); overflow: hidden; }
.product-card-top { min-height: 105px; padding: 19px; position: relative; background: linear-gradient(140deg, rgba(53,214,161,.08), transparent); border-bottom: 1px solid var(--line); }
.product-card-top::after { content: ""; position: absolute; width: 70px; height: 70px; right: 10px; top: 12px; border-radius: 50%; border: 1px solid var(--line); opacity: .7; }
.product-code { color: var(--accent); font-size: 9px; text-transform: uppercase; letter-spacing: .14em; font-weight: 900; }
.product-card h3 { margin: 6px 0 0; font-size: 20px; }
.product-card-body { padding: 18px; }
.product-card-body p { margin: 0; color: var(--muted); font-size: 12px; min-height: 54px; }
.product-facts { display: grid; gap: 7px; margin-top: 15px; }
.product-fact { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding-top: 7px; font-size: 10px; }
.product-fact span { color: var(--muted-2); }
.recycle-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.recycle-card { border: 1px solid var(--line); border-radius: 15px; background: var(--surface); padding: 15px; }
.recycle-card span { color: var(--accent-2); font-size: 9px; text-transform: uppercase; letter-spacing: .12em; font-weight: 900; }
.recycle-card strong { display: block; font-size: 13px; margin: 6px 0 0; }
.recycle-card p { color: var(--muted); font-size: 11px; margin: 6px 0 0; }

.utility-story { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.utility-card { border: 1px solid var(--line); border-radius: 18px; background: var(--surface); padding: 19px; min-height: 190px; }
.utility-card .utility-icon { width: 37px; height: 37px; border-radius: 11px; display: grid; place-items: center; background: rgba(240,189,88,.09); color: var(--accent-3); font-weight: 900; }
.utility-card h3 { margin: 16px 0 6px; font-size: 17px; }
.utility-card p { margin: 0; color: var(--muted); font-size: 11px; }
.utility-chain { margin-top: 14px; color: var(--muted-2); font-size: 10px; line-height: 1.55; }
.utility-chain b { color: var(--text); font-weight: 700; }
.utility-matrix-wrap { overflow: hidden; }
.utility-matrix { overflow-x: auto; }
.utility-matrix table { width: 100%; min-width: 760px; border-collapse: collapse; font-size: 11px; }
.utility-matrix th, .utility-matrix td { padding: 10px 12px; border-top: 1px solid var(--line); text-align: center; }
.utility-matrix th:first-child, .utility-matrix td:first-child { text-align: left; position: sticky; left: 0; background: var(--surface); }
.utility-matrix th { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.matrix-dot { display: inline-grid; width: 21px; height: 21px; place-items: center; border-radius: 50%; background: rgba(53,214,161,.08); color: var(--accent); border: 1px solid rgba(53,214,161,.16); font-size: 9px; font-weight: 900; }
.matrix-dot.secondary { background: var(--surface-2); color: var(--muted); border-color: var(--line); }

.inventory-intro { align-items: center; }
.inventory-search-wrap { display: flex; gap: 8px; }
.inventory-search-wrap input, .inventory-search-wrap select, .inline-search input {
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  outline: 0;
  padding: 0 12px;
}
.inventory-search-wrap input { width: min(330px, 30vw); }
.inventory-search-wrap select { min-width: 170px; }
.inventory-search-wrap input:focus, .inline-search input:focus { border-color: rgba(53,214,161,.45); }
.inventory-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.inventory-stat { border: 1px solid var(--line); border-radius: 13px; background: var(--surface); padding: 13px 15px; }
.inventory-stat strong { font-size: 19px; display: block; }
.inventory-stat span { color: var(--muted); font-size: 10px; }
.inventory-list { display: grid; gap: 10px; }
.inventory-group { border: 1px solid var(--line); border-radius: 17px; background: var(--surface); overflow: hidden; }
.inventory-group-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.inventory-group-head strong { font-size: 13px; }
.inventory-group-head span { color: var(--muted); font-size: 10px; }
.inventory-items { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); }
.inventory-item { background: var(--surface); padding: 10px 13px; min-height: 50px; }
.inventory-item strong { display: block; font-size: 10px; line-height: 1.3; }
.inventory-item span { display: block; margin-top: 3px; color: var(--muted-2); font-size: 8px; text-transform: uppercase; letter-spacing: .06em; }
.inventory-empty { padding: 42px; text-align: center; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: 15px; }

.inline-search input { width: min(310px, 30vw); }
.glossary-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.glossary-item { border: 1px solid var(--line); background: var(--surface); border-radius: 15px; padding: 16px; }
.glossary-item strong { display: block; font-size: 14px; }
.glossary-item p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.glossary-letter { color: var(--accent); font-size: 9px; font-weight: 900; letter-spacing: .1em; }

.search-popover {
  position: fixed;
  z-index: 140;
  top: 70px;
  right: clamp(70px, 6vw, 100px);
  width: min(520px, calc(100vw - 32px));
  max-height: min(560px, calc(100vh - 100px));
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 17px;
  box-shadow: var(--shadow);
  padding: 9px;
}
.search-results-head { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 10px; padding: 6px 7px 10px; }
.search-result { width: 100%; border: 0; background: transparent; text-align: left; display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 9px; border-radius: 11px; }
.search-result:hover { background: var(--surface-2); }
.search-result-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; background: var(--surface-2); color: var(--accent); font-size: 10px; font-weight: 900; }
.search-result strong { display: block; font-size: 11px; }
.search-result span { display: block; color: var(--muted); font-size: 9px; margin-top: 2px; }
.search-result em { color: var(--muted-2); font-size: 9px; font-style: normal; }
.search-empty { padding: 30px; text-align: center; color: var(--muted); }

.drawer-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.34); z-index: 150; backdrop-filter: blur(2px); }
.detail-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(470px, 94vw);
  z-index: 160;
  transform: translateX(102%);
  background: var(--surface);
  border-left: 1px solid var(--line-strong);
  box-shadow: -30px 0 90px rgba(0,0,0,.28);
  transition: transform .22s ease;
  display: flex;
  flex-direction: column;
}
.detail-drawer.is-open { transform: none; }
.drawer-head { min-height: 96px; padding: 22px; display: flex; justify-content: space-between; align-items: start; gap: 14px; border-bottom: 1px solid var(--line); }
.drawer-type { color: var(--accent); font-size: 9px; text-transform: uppercase; letter-spacing: .14em; font-weight: 900; }
.drawer-head h2 { margin: 5px 0 0; font-size: 24px; letter-spacing: -.035em; }
.drawer-body { padding: 22px; overflow-y: auto; }
.drawer-summary { color: var(--muted); margin: 0 0 20px; }
.drawer-section { margin-top: 20px; }
.drawer-section h3 { margin: 0 0 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .11em; color: var(--muted-2); }
.drawer-section p { color: var(--muted); font-size: 12px; }
.token-list { display: flex; flex-wrap: wrap; gap: 6px; }
.token { padding: 6px 8px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.attention-box { border: 1px solid rgba(240,189,88,.18); border-left: 3px solid var(--accent-3); border-radius: 11px; padding: 12px; background: rgba(240,189,88,.05); color: var(--muted); font-size: 11px; }
.source-box { border-top: 1px solid var(--line); margin-top: 22px; padding-top: 14px; color: var(--muted-2); font-size: 9px; }

.help-dialog { width: min(720px, calc(100vw - 30px)); border: 1px solid var(--line-strong); border-radius: 20px; padding: 0; background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.help-dialog::backdrop { background: rgba(0,0,0,.5); backdrop-filter: blur(3px); }
.dialog-head { display: flex; justify-content: space-between; gap: 12px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { margin: 0; }
.dialog-content { padding: 22px; }
.help-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.help-grid > div { padding: 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 13px; }
.help-grid strong { font-size: 12px; }
.help-grid p { color: var(--muted); margin: 5px 0 0; font-size: 11px; }

.toast { position: fixed; z-index: 220; left: 50%; bottom: 24px; transform: translateX(-50%); max-width: calc(100vw - 32px); background: #07111f; color: #fff; border: 1px solid rgba(255,255,255,.14); border-radius: 12px; padding: 10px 14px; box-shadow: var(--shadow); font-size: 11px; }

@media (min-width: 961px) {
  body.sidebar-compact { --sidebar: var(--sidebar-compact); }
  body.sidebar-compact .sidebar { padding-inline: 10px; }
  body.sidebar-compact .brand { justify-content: center; padding-inline: 0; }
  body.sidebar-compact .brand-copy,
  body.sidebar-compact .nav-item > span:last-child,
  body.sidebar-compact .sidebar-action > span:last-child,
  body.sidebar-compact .connection-status > span:last-child { display: none; }
  body.sidebar-compact .nav-item,
  body.sidebar-compact .sidebar-action,
  body.sidebar-compact .connection-status { justify-content: center; padding-inline: 0; }
  body.sidebar-compact .nav-item.is-active { box-shadow: inset 0 0 0 1px rgba(53,214,161,.14); }
  body.sidebar-compact .sidebar-collapse span { transform: rotate(180deg) translateY(1px); }
}

@media (max-width: 1180px) {
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .product-cards { grid-template-columns: repeat(2, 1fr); }
  .recycle-grid { grid-template-columns: repeat(2, 1fr); }
  .inventory-items { grid-template-columns: repeat(3, 1fr); }
  .utility-story { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 960px) {
  :root { --sidebar: 0px; }
  .sidebar { width: 248px; transform: translateX(-103%); transition: transform .22s ease; box-shadow: var(--shadow); }
  .sidebar.is-open { transform: none; }
  .app-main { margin-left: 0; }
  .mobile-menu { display: block; }
  .topbar { padding-inline: 18px; }
  main { padding-inline: 18px; }
  .hero-panel { grid-template-columns: 1fr; min-height: auto; }
  .hero-visual { display: none; }
  .map-layout, .map-layout.is-area-compact { grid-template-columns: 1fr; }
  .area-rail, .map-layout.is-area-compact .area-rail { position: static; max-height: none; overflow: visible; padding: 10px; }
  .area-buttons { display: flex; overflow-x: auto; padding-bottom: 5px; }
  .area-button, .map-layout.is-area-compact .area-button { min-width: max-content; justify-content: flex-start; padding-inline: 10px; }
  .area-rail-head { display: none; }
  .map-layout.is-area-compact .area-label { display: inline; }
  .sidebar-collapse { display: none; }
  .map-toolbar { align-items: start; flex-direction: column; }
  .map-controls { justify-content: start; }
  .training-body { grid-template-columns: 1fr; }
  .training-steps { display: flex; max-height: none; overflow-x: auto; gap: 3px; }
  .training-steps li { min-width: 170px; }
  .training-head { align-items: start; flex-direction: column; }
  .training-progress-block { width: 100%; }
  .overview-grid { grid-template-columns: 1fr; }
  .principle:last-child { grid-column: auto; }
  .principles { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .topbar { min-height: 72px; }
  .topbar-title .eyebrow { display: none; }
  .topbar h1 { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 42vw; }
  .global-search { width: 44px; padding: 0; justify-content: center; }
  .global-search input, .global-search kbd { display: none; }
  .global-search.is-mobile-open { position: fixed; left: 12px; right: 12px; top: 12px; width: auto; z-index: 200; padding: 0 10px 0 13px; }
  .global-search.is-mobile-open input { display: block; }
  .global-search.is-mobile-open kbd { display: inline; }
  .hero-panel { padding: 26px 20px; border-radius: 20px; }
  .hero-copy h2 { font-size: 38px; }
  .hero-actions .button { width: 100%; }
  .metrics-grid { grid-template-columns: 1fr 1fr; }
  .metric-card { padding: 13px; }
  .metric-icon { display: none; }
  .section-heading, .page-intro { align-items: start; flex-direction: column; gap: 8px; }
  .macro-flow { grid-template-columns: repeat(7, 200px); }
  .product-cards, .utility-story, .glossary-list { grid-template-columns: 1fr; }
  .recycle-grid { grid-template-columns: 1fr 1fr; }
  .training-triad { grid-template-columns: 1fr; }
  .training-card { min-height: 520px; padding: 25px 20px; }
  .map-insight-grid { grid-template-columns: 1fr; }
  .inventory-intro { align-items: stretch; }
  .inventory-search-wrap { flex-direction: column; width: 100%; }
  .inventory-search-wrap input, .inventory-search-wrap select, .inline-search, .inline-search input { width: 100%; }
  .inventory-stats { grid-template-columns: 1fr; }
  .inventory-items { grid-template-columns: repeat(2, 1fr); }
  .help-grid { grid-template-columns: 1fr; }
  .search-popover { top: 65px; right: 16px; }
}

@media (max-width: 470px) {
  main { padding-inline: 12px; }
  .topbar { padding-inline: 11px; }
  .metrics-grid { grid-template-columns: 1fr; }
  .recycle-grid, .inventory-items { grid-template-columns: 1fr; }
  .hero-copy h2 { font-size: 33px; }
  .process-map { min-height: 470px; max-height: 68vh; }
  .process-map-canvas { min-height: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

@media print {
  .sidebar, .topbar, .map-controls, .hero-actions, .search-popover, .detail-drawer, .drawer-backdrop, .toast { display: none !important; }
  .app-main { margin: 0; }
  body { background: #fff; color: #111; }
  main { padding: 0; }
  .view { display: block !important; break-after: page; }
  .hero-panel, .panel, .process-map-shell, .product-card, .utility-card, .inventory-group, .glossary-item { box-shadow: none; background: #fff; border-color: #ccc; color: #111; }
}

/* ===== v1.2 — fluxo integrado, conteúdo técnico e referências ===== */
.primary-nav { min-height: 0; overflow-y: auto; scrollbar-width: thin; padding-right: 2px; }
.compact-button { min-height: 36px; padding: 0 12px; font-size: 11px; }

.integrated-intro { margin-bottom: 14px; }
.master-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 15px;
  margin-bottom: 10px;
}
.master-legend { display: flex; flex-wrap: wrap; gap: 10px 16px; color: var(--muted); font-size: 10px; }
.master-legend span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.zoom-controls { display: flex; align-items: center; gap: 7px; flex: 0 0 auto; }
.zoom-controls .icon-button { width: 36px; height: 36px; font-size: 18px; }
.zoom-label { width: 44px; text-align: right; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }

.master-flow-shell {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 20px 50px rgba(0,0,0,.08);
}
.master-flow-scroll {
  width: 100%;
  height: min(72vh, 790px);
  min-height: 570px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  background:
    linear-gradient(rgba(127,153,174,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(127,153,174,.045) 1px, transparent 1px),
    var(--surface);
  background-size: 26px 26px;
}
.master-flow-scroll:focus-visible { outline: 2px solid color-mix(in srgb, var(--accent) 65%, transparent); outline-offset: -3px; }
.master-flow-sizer { position: relative; min-width: 100%; min-height: 100%; transition: width .18s ease, height .18s ease; }
.master-flow-canvas {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  transition: transform .18s ease;
}
.master-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 1; }
.master-edge { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; opacity: .78; }
.master-edge.main { stroke: color-mix(in srgb, var(--muted) 86%, transparent); }
.master-edge.product, .master-edge.coproduct { stroke: color-mix(in srgb, var(--product) 82%, transparent); }
.master-edge.utility { stroke: color-mix(in srgb, var(--utility) 75%, transparent); stroke-dasharray: 7 6; opacity: .66; }
.master-edge.recycle { stroke: color-mix(in srgb, var(--accent-2) 78%, transparent); stroke-dasharray: 4 6; opacity: .7; }
#masterArrowMain path { fill: var(--muted); }
#masterArrowUtility path { fill: var(--utility); }
#masterArrowRecycle path { fill: var(--accent-2); }
.master-edge-label {
  fill: var(--muted-2);
  font: 700 10px Inter, ui-sans-serif, sans-serif;
  text-anchor: middle;
  paint-order: stroke;
  stroke: var(--surface);
  stroke-width: 5px;
  stroke-linejoin: round;
}
.master-node {
  position: absolute;
  transform: translate(-50%,-50%);
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: left;
  overflow: hidden;
  padding: 11px 12px;
  border: 1px solid var(--line-strong);
  border-left: 4px solid var(--process);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 91%, var(--surface-2) 9%);
  box-shadow: 0 11px 30px rgba(0,0,0,.12);
  transition: box-shadow .15s ease, border-color .15s ease, translate .15s ease;
}
.master-node:hover, .master-node:focus-visible { z-index: 6; outline: none; box-shadow: 0 16px 38px rgba(0,0,0,.18); translate: 0 -2px; }
.master-node small { font-size: 8px; line-height: 1; letter-spacing: .12em; font-weight: 900; text-transform: uppercase; color: var(--process); margin-bottom: 5px; }
.master-node strong { font-size: 12px; line-height: 1.22; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.master-node span { color: var(--muted); font-size: 8.7px; line-height: 1.25; margin-top: 4px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.master-node.kind-quality { border-left-color: var(--quality); }
.master-node.kind-quality small { color: var(--quality); }
.master-node.kind-transport { border-left-color: var(--transport); }
.master-node.kind-transport small { color: var(--transport); }
.master-node.kind-storage { border-left-color: var(--storage); }
.master-node.kind-storage small { color: var(--storage); }
.master-node.kind-product { border-left-color: var(--product); }
.master-node.kind-product small { color: var(--product); }
.master-node.kind-utility { border-left-color: var(--utility); }
.master-node.kind-utility small { color: var(--utility); }
.master-zone-label {
  position: absolute;
  z-index: 0;
  left: 34px;
  color: var(--muted-2);
  font-size: 11px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: .16em;
  pointer-events: none;
}
.zone-main { top: 74px; }
.zone-products { top: 604px; }
.zone-utilities { top: 940px; }
.master-zone-label::after { content: ''; display: inline-block; width: 125px; height: 1px; vertical-align: middle; margin-left: 12px; background: var(--line-strong); }
.integrated-notes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.integrated-note { padding: 16px; }
.integrated-note h3 { margin: 4px 0 0; font-size: 14px; }
.integrated-note p { margin: 7px 0 0; color: var(--muted); font-size: 11px; }

.process-detail { margin-top: 12px; }
.technical-detail { padding: clamp(18px, 2.4vw, 28px); }
.technical-heading { display: flex; align-items: start; justify-content: space-between; gap: 20px; margin-bottom: 12px; }
.technical-heading h3 { margin: 2px 0 0; font-size: clamp(22px, 2.5vw, 31px); letter-spacing: -.035em; }
.technical-source-badge { flex: 0 0 auto; border: 1px solid rgba(53,214,161,.20); background: rgba(53,214,161,.07); color: var(--accent); border-radius: 999px; padding: 6px 10px; font-size: 9px; font-weight: 900; text-transform: uppercase; letter-spacing: .09em; }
.technical-overview { max-width: 1050px; margin: 0 0 18px; color: var(--muted); font-size: 13px; }
.technical-grid { display: grid; grid-template-columns: minmax(0,1.45fr) minmax(220px,.75fr); gap: 10px; }
.technical-card { border: 1px solid var(--line); border-radius: 15px; background: var(--surface-2); padding: 16px; min-width: 0; }
.technical-card-wide { grid-row: span 2; }
.technical-card h4 { margin: 0 0 10px; font-size: 12px; }
.technical-card p { margin: 0; color: var(--muted); font-size: 11px; }
.technical-card ul { margin: 0; padding-left: 17px; color: var(--muted); font-size: 11px; }
.technical-card li + li { margin-top: 6px; }
.technical-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.technical-step { display: grid; grid-template-columns: 31px minmax(0,1fr); gap: 10px; align-items: start; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: color-mix(in srgb, var(--surface) 70%, transparent); }
.technical-step > span { width: 31px; height: 31px; border: 1px solid rgba(53,214,161,.22); color: var(--accent); background: rgba(53,214,161,.06); display: grid; place-items: center; border-radius: 9px; font-size: 9px; font-weight: 900; }
.technical-step p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.technical-ref-title { margin-top: 17px !important; }
.reference-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.reference-chip { max-width: 100%; border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 10px; padding: 7px 9px; font-size: 9.5px; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reference-chip:hover, .reference-chip:focus-visible { color: var(--text); border-color: rgba(53,214,161,.3); outline: none; }
.reference-chip span { display: inline-grid; place-items: center; min-width: 24px; height: 20px; padding: 0 5px; margin-right: 6px; color: var(--accent); background: rgba(53,214,161,.08); border-radius: 6px; font-weight: 900; }
.technical-disclaimer { margin-top: 10px; padding: 11px 13px; border-radius: 12px; border: 1px solid rgba(240,189,88,.16); background: rgba(240,189,88,.045); color: var(--muted); font-size: 10.5px; }
.technical-disclaimer strong { color: var(--accent-3); }

.reference-controls { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; padding: 13px; }
.reference-controls .inline-search { flex: 1; }
.reference-controls .inline-search input { width: 100%; }
.reference-controls select { min-width: 225px; height: 42px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); color: var(--text); padding: 0 35px 0 12px; }
.reference-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 11px; }
.reference-card { position: relative; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); padding: 18px; transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease; }
.reference-card:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.reference-card.is-highlighted { border-color: rgba(53,214,161,.55); box-shadow: 0 0 0 4px rgba(53,214,161,.07); }
.reference-card-head { display: grid; grid-template-columns: 38px minmax(0,1fr); gap: 11px; align-items: start; }
.reference-id { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; border: 1px solid rgba(53,214,161,.22); background: rgba(53,214,161,.07); color: var(--accent); font-size: 10px; font-weight: 900; }
.reference-card h3 { margin: 3px 0 0; font-size: 15px; line-height: 1.3; }
.reference-meta { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0 8px 49px; }
.reference-meta span { border: 1px solid var(--line); background: var(--surface-2); border-radius: 999px; padding: 4px 8px; color: var(--muted); font-size: 9px; }
.reference-card > p { color: var(--muted); font-size: 11px; margin: 7px 0; }
.reference-card .reference-authors { color: var(--text); font-weight: 650; }
.reference-note { margin-top: 10px; padding: 9px 10px; border-left: 2px solid var(--accent-3); background: rgba(240,189,88,.04); color: var(--muted); font-size: 10px; }
.reference-link, .reference-internal { display: inline-flex; align-items: center; gap: 5px; margin-top: 12px; font-size: 10px; font-weight: 800; }
.reference-link { color: var(--accent); text-decoration: none; }
.reference-link:hover { text-decoration: underline; }
.reference-internal { color: var(--muted-2); }

@media (max-width: 1100px) {
  .technical-grid { grid-template-columns: 1fr; }
  .technical-card-wide { grid-row: auto; }
  .reference-list { grid-template-columns: 1fr; }
  .integrated-notes { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .master-toolbar { align-items: flex-start; flex-direction: column; }
  .zoom-controls { width: 100%; }
  .zoom-controls .compact-button { flex: 1; }
  .master-flow-scroll { min-height: 520px; height: 65vh; }
  .technical-heading { flex-direction: column; gap: 8px; }
  .technical-source-badge { align-self: flex-start; }
  .reference-controls { flex-direction: column; align-items: stretch; }
  .reference-controls select { width: 100%; min-width: 0; }
  .reference-meta { margin-left: 0; }
}

@media print {
  .master-toolbar, .reference-controls { display: none !important; }
  .master-flow-scroll { height: auto; min-height: 0; overflow: visible; }
  .master-flow-sizer { transform: scale(.45); transform-origin: top left; }
}

/* v1.2 — aprofundamento técnico e bibliografia */
.technical-principle {
  background: linear-gradient(135deg, rgba(53, 210, 154, .08), rgba(255,255,255,.72));
  border-color: rgba(53, 210, 154, .22);
}
[data-theme="dark"] .technical-principle {
  background: linear-gradient(135deg, rgba(53, 210, 154, .10), rgba(14, 26, 39, .82));
}
.reference-bibliography {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}
.reference-bibliography strong {
  display: block;
  margin-bottom: 5px;
  font-size: .76rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--accent);
}
.reference-bibliography p { margin: 0; line-height: 1.55; }
