:root {
  --blue: #376ea0;
  --blue-dark: #24557f;
  --sky: #87d1e3;
  --green: #9aca20;
  --lime: #bed702;
  --yellow: #fcc401;
  --ink: #494754;
  --copy: #666668;
  --muted: #85858b;
  --line: #e5e6e2;
  --paper: #fffef3;
  --mist: #f6f7f6;
  --white: #fff;
  --sidebar: #173b59;
  --shadow: 0 16px 46px rgba(48, 61, 72, .09);
  --shadow-small: 0 8px 24px rgba(48, 61, 72, .07);
  --radius: 20px;
  --radius-small: 12px;
  --sidebar-width: 278px;
  --topbar-height: 78px;
  --font: "Open Sans", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--mist);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid rgba(190, 215, 2, .55);
  outline-offset: 3px;
}
.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;
}
.skip-link {
  position: fixed;
  z-index: 200;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--lime);
  color: var(--sidebar);
  font-weight: 800;
  transform: translateY(-150%);
}
.skip-link:focus { transform: none; }

/* Shell */
.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  z-index: 50;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  padding: 28px 18px 22px;
  overflow-y: auto;
  background: var(--sidebar);
  color: white;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 10px 30px;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
}
.sidebar-brand strong { display: block; font-size: 19px; letter-spacing: -.03em; }
.sidebar-brand small {
  display: block;
  margin-top: 1px;
  color: #a9bdcc;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.brand-symbol { position: relative; width: 35px; height: 42px; flex: none; }
.brand-symbol i {
  position: absolute;
  left: 8px;
  width: 22px;
  height: 12px;
  border-radius: 100% 0 100% 0;
  transform: rotate(-16deg);
}
.brand-symbol i:nth-child(1) { top: 1px; background: var(--lime); }
.brand-symbol i:nth-child(2) { top: 14px; left: 5px; background: var(--green); }
.brand-symbol i:nth-child(3) { top: 27px; left: 2px; background: var(--sky); }
.workspace-nav { display: grid; gap: 5px; padding-top: 26px; }
.nav-label {
  margin: 0 12px 9px;
  color: #7895aa;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .15em;
  text-transform: uppercase;
}
.nav-item {
  width: 100%;
  min-height: 49px;
  display: grid;
  grid-template-columns: 29px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: #c4d2dc;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: background .16s ease, color .16s ease;
}
.nav-item:hover { background: rgba(255, 255, 255, .07); color: white; }
.nav-item.is-active { background: white; color: var(--sidebar); }
.nav-icon {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, .08);
  font-family: var(--mono);
  font-size: 14px;
}
.nav-item.is-active .nav-icon { background: #eef5db; color: #5e7900; }
.nav-count {
  min-width: 23px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .09);
  color: #a9bdcc;
  font: 700 10px/1.5 var(--mono);
  text-align: center;
}
.nav-item.is-active .nav-count { background: #edf0f2; color: #6e7880; }
.sidebar-foot {
  margin-top: auto;
  padding: 18px 12px 0;
  border-top: 1px solid rgba(255, 255, 255, .12);
}
.sidebar-foot strong { display: block; margin-top: 7px; font-size: 12px; }
.sidebar-foot > span:last-child { display: block; margin-top: 3px; color: #819caf; font-size: 10px; }
.source-status { color: #b8c7d2; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.source-status i { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 4px rgba(190, 215, 2, .12); }

.workspace { margin-left: var(--sidebar-width); min-width: 0; }
.topbar {
  position: sticky;
  z-index: 40;
  top: 0;
  min-height: var(--topbar-height);
  display: grid;
  grid-template-columns: minmax(180px, .75fr) minmax(320px, 1.3fr) auto;
  align-items: center;
  gap: 28px;
  padding: 12px clamp(24px, 4vw, 54px);
  border-bottom: 1px solid rgba(73, 71, 84, .1);
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(16px);
}
.topbar-title span { display: block; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.topbar-title strong { display: block; margin-top: 2px; font-size: 15px; letter-spacing: -.015em; }
.global-search-wrap { position: relative; display: flex; align-items: center; }
.global-search-wrap > span { position: absolute; z-index: 1; left: 16px; color: #75808a; font-size: 20px; }
.global-search-wrap input {
  width: 100%;
  height: 46px;
  padding: 0 50px 0 46px;
  border: 1px solid #dfe3e5;
  border-radius: 12px;
  background: #f7f8f7;
  color: var(--ink);
  font-size: 13px;
}
.global-search-wrap input:focus { border-color: var(--sky); background: white; box-shadow: 0 0 0 4px rgba(135, 209, 227, .18); outline: 0; }
.global-search-wrap kbd {
  position: absolute;
  right: 11px;
  min-width: 25px;
  padding: 3px 7px;
  border: 1px solid #d5d9db;
  border-radius: 6px;
  background: white;
  color: #81888e;
  font: 700 10px/1.4 var(--mono);
  text-align: center;
}
.source-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 16px;
  border: 1px solid #dfe3e5;
  border-radius: 999px;
  background: white;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}
.source-link:hover { border-color: var(--green); }
.source-link b { color: var(--blue); font-size: 16px; }
.mobile-menu { display: none; }

main { padding: 44px clamp(24px, 4vw, 58px) 90px; }
.view { display: none; max-width: 1500px; margin: 0 auto; animation: view-in .22s ease; }
.view.is-active { display: block; }
@keyframes view-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

/* Shared */
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #6f8708;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.kicker::before { content: ""; width: 14px; height: 2px; background: var(--lime); }
.kicker-light { color: #dce6eb; }
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  box-shadow: var(--shadow-small);
}
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 30px; margin-bottom: 26px; }
.panel-heading h2 { margin: 8px 0 0; font-size: clamp(24px, 2.2vw, 34px); line-height: 1.12; letter-spacing: -.04em; }
.text-button { min-height: 42px; padding: 0; border: 0; background: transparent; color: var(--blue); font-size: 12px; font-weight: 800; cursor: pointer; }
.text-button:hover { color: var(--blue-dark); }
.button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.button-lime { background: var(--lime); color: #263c23; }
.button-lime:hover { background: #cae20a; }
.button-ghost { border-color: rgba(255, 255, 255, .28); background: transparent; color: white; }
.button-ghost:hover { background: rgba(255, 255, 255, .08); }
.view-header {
  min-height: 160px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 36px;
}
.view-header > div:first-child { max-width: 820px; }
.view-header h1 { margin: 12px 0 10px; font-size: clamp(42px, 5vw, 68px); line-height: .98; letter-spacing: -.06em; }
.view-header p { max-width: 760px; margin: 0; color: var(--copy); font-size: 16px; }
.view-header-meta { min-width: 150px; padding: 18px 20px; border-left: 3px solid var(--lime); }
.view-header-meta strong { display: block; color: var(--blue); font-size: 34px; line-height: 1; letter-spacing: -.05em; }
.view-header-meta span { display: block; margin-top: 6px; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.toolbar {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 18px 0;
}
.segmented { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: #eef0ef; }
.segmented button { min-height: 38px; padding: 0 15px; border: 0; border-radius: 9px; background: transparent; color: #74777b; font-size: 11px; font-weight: 800; cursor: pointer; }
.segmented button.is-active { background: white; color: var(--ink); box-shadow: 0 2px 8px rgba(45, 54, 60, .08); }
.local-search { position: relative; min-width: min(340px, 100%); display: flex; align-items: center; }
.local-search > span { position: absolute; left: 14px; color: #879096; font-size: 18px; }
.local-search input {
  width: 100%;
  height: 44px;
  padding: 0 14px 0 42px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: white;
  color: var(--ink);
  font-size: 12px;
}
.local-search input:focus { border-color: var(--sky); outline: 0; box-shadow: 0 0 0 4px rgba(135, 209, 227, .17); }
.empty-state { padding: 54px 20px; color: var(--muted); text-align: center; }
.badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 5px 9px;
  border-radius: 999px;
  background: #eef3e2;
  color: #5f7404;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.badge-blue { background: #e9f3f7; color: var(--blue); }
.badge-grey { background: #eff0ef; color: #73777a; }

/* Overview */
.overview-hero {
  position: relative;
  min-height: 510px;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr);
  align-items: center;
  gap: 60px;
  padding: clamp(46px, 6vw, 82px);
  overflow: hidden;
  border-radius: 30px;
  background: var(--sidebar);
  color: white;
}
.overview-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .16;
  background-image: linear-gradient(rgba(255,255,255,.13) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.13) 1px, transparent 1px);
  background-size: 52px 52px;
}
.overview-copy { position: relative; z-index: 1; }
.overview-copy h1 { max-width: 800px; margin: 18px 0 22px; font-size: clamp(48px, 5.6vw, 78px); font-weight: 750; line-height: .99; letter-spacing: -.065em; }
.overview-copy h1 em { color: var(--lime); font-style: normal; }
.overview-copy > p { max-width: 700px; margin: 0; color: #c7d6df; font-size: clamp(16px, 1.6vw, 20px); line-height: 1.6; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 11px; margin-top: 32px; }
.hero-orbit { position: relative; min-height: 340px; }
.orbit { position: absolute; border: 1px solid rgba(255, 255, 255, .2); border-radius: 50%; }
.orbit::before, .orbit::after { content: ""; position: absolute; width: 13px; height: 13px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 6px rgba(190, 215, 2, .1); }
.orbit-one { inset: 15px; }
.orbit-one::before { top: 15%; left: 2%; }
.orbit-one::after { right: 10%; bottom: 9%; background: var(--sky); box-shadow: 0 0 0 6px rgba(135, 209, 227, .1); }
.orbit-two { inset: 68px; border-color: rgba(255, 255, 255, .12); }
.orbit-two::before { top: -6px; right: 28%; background: var(--yellow); }
.orbit-two::after { bottom: 6%; left: 5%; }
.orbit-core {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 154px;
  height: 154px;
  display: grid;
  place-content: center;
  padding: 20px;
  border-radius: 50% 8% 50% 50%;
  background: var(--lime);
  color: var(--sidebar);
  text-align: center;
  transform: translate(-50%, -50%) rotate(8deg);
}
.orbit-core b, .orbit-core small { transform: rotate(-8deg); }
.orbit-core b { font-size: 52px; line-height: .9; letter-spacing: -.06em; }
.orbit-core small { margin-top: 7px; font-size: 9px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 18px 0 34px; }
.stat-card { min-height: 132px; padding: 23px; border: 1px solid var(--line); border-radius: 16px; background: white; }
.stat-card:nth-child(2) { border-top: 3px solid var(--sky); }
.stat-card:nth-child(3) { border-top: 3px solid var(--lime); }
.stat-card:nth-child(4) { border-top: 3px solid var(--yellow); }
.stat-card strong { display: block; font-size: 34px; line-height: 1; letter-spacing: -.05em; }
.stat-card span { display: block; margin-top: 9px; color: var(--copy); font-size: 12px; font-weight: 700; }
.stat-card small { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; }
.overview-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .55fr); gap: 22px; }
.panel-large, .source-order, .template-snapshot { padding: 30px; }
.ia-preview { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.preview-branch { min-height: 155px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: #fafbf9; }
.preview-branch:nth-child(3n + 1) { border-top: 3px solid var(--lime); }
.preview-branch:nth-child(3n + 2) { border-top: 3px solid var(--sky); }
.preview-branch:nth-child(3n + 3) { border-top: 3px solid var(--yellow); }
.preview-branch strong { font-size: 14px; }
.preview-branch ul { margin: 12px 0 0; padding: 0; list-style: none; }
.preview-branch li { margin-top: 6px; color: var(--copy); font-size: 11px; }
.preview-branch li::before { content: "↳"; margin-right: 6px; color: var(--green); }
.preview-branch small { display: block; margin-top: 10px; color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.source-order { position: relative; overflow: hidden; background: var(--paper); }
.source-order::after { content: ""; position: absolute; right: -44px; bottom: -40px; width: 125px; height: 105px; border-radius: 100% 0 100% 100%; background: var(--lime); opacity: .28; transform: rotate(-15deg); }
.source-order h2 { margin: 12px 0 30px; font-size: 30px; line-height: 1.12; letter-spacing: -.04em; }
.source-order ol { position: relative; z-index: 1; margin: 0; padding: 0; list-style: none; }
.source-order li { display: grid; grid-template-columns: 38px 1fr; gap: 12px; padding: 18px 0; border-top: 1px solid #e2e4d9; }
.source-order li > span { color: var(--blue); font: 800 11px/1.5 var(--mono); }
.source-order strong { font-size: 13px; }
.source-order p { margin: 5px 0 0; color: var(--copy); font-size: 11px; }
.template-snapshot { margin-top: 22px; }
.template-preview-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.template-preview-card { position: relative; min-height: 155px; padding: 20px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: white; cursor: pointer; }
.template-preview-card:hover { border-color: var(--sky); box-shadow: var(--shadow-small); transform: translateY(-2px); }
.template-preview-card::after { content: attr(data-count); position: absolute; right: -6px; bottom: -19px; color: #eef0ec; font-size: 78px; font-weight: 900; line-height: 1; letter-spacing: -.08em; }
.template-preview-card strong { position: relative; z-index: 1; display: block; max-width: 170px; font-size: 14px; }
.template-preview-card span { position: relative; z-index: 1; display: block; margin-top: 9px; color: var(--muted); font-size: 10px; }
.template-preview-card b { position: absolute; z-index: 1; bottom: 18px; left: 20px; color: var(--blue); font-size: 16px; }

/* IA */
.comparison-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.comparison-card { padding: 18px 20px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.comparison-card.is-current { border-color: rgba(55, 110, 160, .32); box-shadow: inset 0 3px 0 var(--blue); }
.comparison-card span { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.comparison-card strong { display: block; margin-top: 5px; font-size: 25px; line-height: 1; }
.comparison-card small { display: block; margin-top: 6px; color: var(--copy); font-size: 10px; }
.ia-browser { overflow: hidden; box-shadow: none; }
.ia-browser-head, .ia-row {
  display: grid;
  grid-template-columns: minmax(300px, 1.4fr) minmax(150px, .65fr) 86px;
  align-items: center;
  gap: 20px;
}
.ia-browser-head { min-height: 43px; padding: 0 20px; border-bottom: 1px solid var(--line); background: #f7f8f7; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.ia-row { position: relative; width: 100%; min-height: 59px; padding: 8px 20px; border: 0; border-bottom: 1px solid #eceeeb; background: white; text-align: left; cursor: pointer; }
.ia-row:hover { background: #fbfcf8; }
.ia-row:last-child { border-bottom: 0; }
.ia-row-section { min-height: 47px; grid-template-columns: 1fr; background: var(--sidebar); color: white; cursor: default; }
.ia-row-section:hover { background: var(--sidebar); }
.ia-name { position: relative; display: flex; align-items: center; gap: 10px; min-width: 0; padding-left: calc((var(--level) - 1) * 26px); }
.ia-name::before { content: ""; width: 8px; height: 8px; flex: none; border: 2px solid #b7c2c8; border-radius: 50%; background: white; }
.ia-row[data-level="1"] .ia-name::before { border-color: var(--lime); background: var(--lime); }
.ia-row[data-level="2"] .ia-name::before { border-color: var(--sky); }
.ia-row[data-level="3"] .ia-name::before, .ia-row[data-level="4"] .ia-name::before { width: 6px; height: 6px; border-width: 1px; }
.ia-name-text { min-width: 0; }
.ia-name-text strong { display: block; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.ia-name-text small { display: block; margin-top: 2px; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.ia-template { min-width: 0; overflow: hidden; color: var(--copy); font-size: 10px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.ia-source { color: var(--muted); font: 700 9px/1.4 var(--mono); }

/* Templates */
.template-workspace { display: grid; grid-template-columns: 310px minmax(0, 1fr); gap: 20px; align-items: start; }
.template-index { position: sticky; top: calc(var(--topbar-height) + 18px); max-height: calc(100vh - var(--topbar-height) - 38px); padding: 14px; overflow-y: auto; box-shadow: none; }
.template-index .local-search { min-width: 0; margin-bottom: 10px; }
#template-list { display: grid; gap: 4px; }
.template-index-button {
  width: 100%;
  min-height: 54px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.template-index-button:hover { background: #f4f6f3; }
.template-index-button.is-active { background: var(--sidebar); color: white; }
.template-index-button strong { display: block; font-size: 11px; }
.template-index-button span { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; }
.template-index-button.is-active span { color: #b2c7d6; }
.template-index-button b { min-width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; background: #eef0ed; color: var(--copy); font: 800 9px/1 var(--mono); }
.template-index-button.is-active b { background: var(--lime); color: var(--sidebar); }
.template-detail { min-height: 660px; padding: clamp(24px, 4vw, 46px); box-shadow: none; }
.template-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 30px; padding-bottom: 30px; border-bottom: 1px solid var(--line); }
.template-detail-head h2 { max-width: 720px; margin: 12px 0 8px; font-size: clamp(32px, 4vw, 52px); line-height: 1.02; letter-spacing: -.055em; white-space: pre-line; }
.template-detail-head p { margin: 0; color: var(--copy); font-size: 12px; }
.template-count-disc { width: 90px; height: 90px; flex: none; display: grid; place-content: center; border-radius: 50% 8% 50% 50%; background: var(--lime); color: var(--sidebar); text-align: center; transform: rotate(7deg); }
.template-count-disc strong, .template-count-disc small { transform: rotate(-7deg); }
.template-count-disc strong { font-size: 31px; line-height: 1; }
.template-count-disc small { font-size: 8px; font-weight: 900; text-transform: uppercase; letter-spacing: .07em; }
.page-assignments { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; padding: 20px 0; }
.page-assignments > span { margin-right: 5px; color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.assignment-chip { padding: 5px 9px; border-radius: 999px; background: #edf4f7; color: var(--blue); font-size: 9px; font-weight: 700; }
.module-sequence { position: relative; margin-top: 10px; }
.module-sequence::before { content: ""; position: absolute; left: 20px; top: 28px; bottom: 28px; width: 1px; background: #dfe5d2; }
.module-card { position: relative; display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 18px; padding: 14px 0; }
.module-order { position: relative; z-index: 1; width: 42px; height: 42px; display: grid; place-items: center; border: 6px solid white; border-radius: 50%; background: var(--lime); color: var(--sidebar); font: 900 10px/1 var(--mono); }
.module-content { padding: 2px 0 18px; border-bottom: 1px solid var(--line); }
.module-card:last-child .module-content { border-bottom: 0; }
.module-content h3 { margin: 0 0 8px; font-size: 17px; letter-spacing: -.025em; }
.module-copy { margin: 0; color: var(--copy); font-size: 12px; white-space: pre-line; }
.module-note { margin-top: 12px; padding: 11px 13px; border-left: 3px solid var(--sky); background: #f3f8fa; color: #5e6f79; font-size: 10px; white-space: pre-line; }

/* Brand */
.content-tabs { margin-bottom: 24px; }
.brand-brief-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 22px; }
.brand-brief-card { min-height: 190px; padding: 24px; border-radius: 18px; background: var(--sidebar); color: white; }
.brand-brief-card:nth-child(2) { background: var(--paper); color: var(--ink); border: 1px solid #ecebdd; }
.brand-brief-card:nth-child(3) { background: var(--blue); }
.brand-brief-card span { color: var(--lime); font-size: 9px; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; }
.brand-brief-card:nth-child(2) span { color: #6d8109; }
.brand-brief-card strong { display: block; margin-top: 20px; font-size: 20px; line-height: 1.3; letter-spacing: -.035em; }
.brand-sections { display: grid; gap: 12px; }
.brand-group { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: white; }
.brand-group > summary { min-height: 65px; display: flex; align-items: center; gap: 14px; padding: 12px 20px; list-style: none; cursor: pointer; }
.brand-group > summary::-webkit-details-marker { display: none; }
.brand-group > summary::after { content: "+"; margin-left: auto; color: var(--blue); font-size: 20px; }
.brand-group[open] > summary::after { content: "−"; }
.brand-group[open] > summary { border-bottom: 1px solid var(--line); background: #fafbf9; }
.brand-group summary b { font-size: 13px; }
.brand-group summary span { min-width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: #eef4dd; color: #687b09; font: 900 9px/1 var(--mono); }
.brand-group-body { padding: 4px 20px 18px; }
.brand-question { display: grid; grid-template-columns: minmax(180px, .34fr) minmax(0, .66fr); gap: 30px; padding: 20px 0; border-bottom: 1px solid #eceeeb; }
.brand-question:last-child { border-bottom: 0; }
.brand-question h3 { margin: 0; font-size: 12px; }
.brand-answer { color: var(--copy); font-size: 12px; white-space: pre-line; }
.brand-answer p { margin: 0; }
.brand-notes { margin-top: 12px; padding: 12px; border-radius: 10px; background: #f1f6f8; color: #627680; font-size: 10px; white-space: pre-line; }
.design-tree { overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: white; }
.design-row { display: grid; grid-template-columns: minmax(240px, .5fr) minmax(0, .5fr) 90px; gap: 20px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.design-row:last-child { border-bottom: 0; }
.design-label { padding-left: calc((var(--depth) - 1) * 24px); font-size: 12px; font-weight: 700; }
.design-row[data-depth="1"] { background: var(--sidebar); color: white; }
.design-row[data-depth="1"] .design-label { font-size: 15px; }
.design-notes { color: var(--copy); font-size: 11px; white-space: pre-line; }
.design-row[data-depth="1"] .design-notes { color: #bfd0dc; }
.design-source { color: var(--muted); font: 700 9px/1.4 var(--mono); }
.positioning-empty { padding: 54px; border: 1px dashed #cfd4d4; border-radius: 18px; background: white; text-align: center; }
.positioning-empty strong { display: block; font-size: 21px; }
.positioning-empty p { max-width: 560px; margin: 10px auto 0; color: var(--copy); font-size: 12px; }
.positioning-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 22px; }
.positioning-item { padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: #fafbf9; }
.positioning-item strong { font-size: 12px; }
.positioning-item p { margin: 8px 0 0; color: var(--muted); font-size: 11px; }

/* Style guide */
.style-guide-hero {
  min-height: 350px;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, .9fr);
  align-items: center;
  gap: 50px;
  padding: clamp(30px, 5vw, 58px);
  overflow: hidden;
  background: var(--paper);
}
.style-guide-hero h2 { margin: 14px 0 16px; font-size: clamp(36px, 4.6vw, 62px); line-height: 1; letter-spacing: -.06em; }
.style-guide-hero p { max-width: 670px; margin: 0; color: var(--copy); }
.style-source-link {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 26px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--blue);
  color: white;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}
.style-source-link:hover { background: var(--blue-dark); }
.guide-rule-card {
  position: relative;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 30px;
  overflow: hidden;
  border-radius: 10px 70px 10px 70px;
  background: var(--sidebar);
  color: white;
}
.guide-rule-card::after { content: "Aa"; position: absolute; right: -12px; bottom: -33px; color: rgba(255,255,255,.06); font-size: 128px; font-weight: 900; letter-spacing: -.1em; }
.guide-rule-card span { position: relative; z-index: 1; color: var(--lime); font-size: 9px; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; }
.guide-rule-card strong { position: relative; z-index: 1; display: block; margin: 20px 0; font-size: 17px; line-height: 1.45; }
.guide-rule-item + .guide-rule-item { margin-top: 18px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.14); }
.guide-rule-item strong { margin: 10px 0 0; }
.guide-rule-card small { position: relative; z-index: 1; color: #a9bdca; font-size: 9px; text-transform: uppercase; letter-spacing: .07em; }
.guide-section { margin-top: 20px; padding: clamp(24px, 4vw, 42px); box-shadow: none; }
.guide-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 40px; margin-bottom: 30px; }
.guide-section-head > div:first-child { min-width: 250px; }
.layout-guide .guide-section-head > div:first-child { min-width: 330px; }
.guide-section-head h2 { margin: 9px 0 0; font-size: clamp(30px, 3.8vw, 48px); line-height: 1; letter-spacing: -.05em; }
.guide-section-head > p { max-width: 560px; margin: 4px 0 0; color: var(--copy); font-size: 12px; }
.container-diagram { padding: clamp(14px, 2.5vw, 26px); border-radius: 18px; background: #eef3df; }
.container-shell { min-height: 250px; display: flex; flex-direction: column; padding: 20px; border: 2px solid var(--green); border-radius: 13px; background: var(--blue); }
.container-label { display: flex; align-items: center; gap: 10px; color: white; }
.container-label > span { width: 30px; height: 30px; display: grid; place-items: center; flex: none; border-radius: 50%; background: var(--lime); color: var(--sidebar); font: 900 9px/1 var(--mono); }
.container-label strong { font-size: 11px; }
.container-label small { margin-left: auto; color: rgba(255,255,255,.72); font-size: 9px; }
.container-inner { width: min(76%, 820px); min-height: 145px; display: flex; flex-direction: column; justify-content: space-between; align-self: center; margin-top: 22px; padding: 17px; border: 2px dashed var(--yellow); border-radius: 10px; background: white; }
.container-inner .container-label { color: var(--ink); }
.container-inner .container-label > span { background: var(--yellow); }
.container-inner .container-label small { color: var(--muted); }
.container-content-lines { display: grid; grid-template-columns: 1.5fr 1fr .6fr; gap: 8px; margin-top: 24px; }
.container-content-lines i { height: 34px; border-radius: 6px; background: #e6e9e8; }
.layout-layer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.layout-layer-card { display: grid; grid-template-columns: 42px 1fr; gap: 14px; padding: 19px; border: 1px solid var(--line); border-radius: 13px; }
.layout-layer-card > span { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: var(--sidebar); color: white; font: 900 10px/1 var(--mono); }
.layout-layer-card strong, .layout-layer-card small { display: block; }
.layout-layer-card strong { font-size: 12px; }
.layout-layer-card small { margin-top: 3px; color: var(--blue); font-size: 9px; font-weight: 800; }
.layout-layer-card p { margin: 9px 0 0; color: var(--copy); font-size: 10px; }
.layout-mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.layout-mode-card { display: grid; grid-template-columns: 125px 1fr; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; }
.layout-mode-card > div:last-child { padding: 19px; }
.layout-mode-card > div > span, .layout-implementation span { color: var(--blue); font-size: 8px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.layout-mode-card h3 { margin: 7px 0 8px; font-size: 15px; line-height: 1.2; }
.layout-mode-card p, .layout-implementation p { margin: 0; color: var(--copy); font-size: 10px; }
.layout-mode-card code { display: inline-block; margin-top: 12px; padding: 5px 7px; border-radius: 5px; background: #f1f3f2; color: var(--blue); font-size: 8px; }
.layout-mode-preview { position: relative; display: grid; place-items: center; background: var(--blue); }
.layout-mode-preview span { width: 55%; height: 52%; border: 2px dashed var(--yellow); border-radius: 4px; background: white; }
.layout-mode-preview.is-fluid span { width: 100%; height: 100%; border: 8px solid var(--blue); border-radius: 0; background: var(--sky); }
.layout-implementation { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.layout-implementation article { padding: 18px 20px; border-radius: 12px; background: #eef5f8; }
.layout-implementation p { margin-top: 8px; }
.layout-implementation .layout-warning { background: #fff7d6; }
.layout-warning span { color: #866b00; }
.colour-groups { display: grid; gap: 14px; }
.colour-group { display: grid; grid-template-columns: minmax(190px, .3fr) minmax(0, .7fr); align-items: center; gap: 24px; padding: 19px 0; border-top: 1px solid var(--line); }
.colour-group-title strong { font-size: 13px; }
.colour-group-title p { max-width: 280px; margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.swatch-row { display: grid; grid-template-columns: repeat(6, minmax(64px, 1fr)); gap: 9px; }
.colour-swatch { min-width: 0; padding: 6px; border: 1px solid var(--line); border-radius: 11px; background: white; cursor: pointer; }
.colour-swatch:hover { border-color: var(--sky); box-shadow: var(--shadow-small); }
.colour-swatch > span { display: block; width: 100%; aspect-ratio: 1.4; border: 1px solid rgba(73,71,84,.08); border-radius: 7px; background: var(--swatch); }
.colour-swatch code { display: block; margin-top: 7px; color: var(--copy); font: 700 8px/1.4 var(--mono); }
.typography-guide { overflow: hidden; }
.font-weights { display: grid; grid-template-columns: auto repeat(3, auto); gap: 5px 13px; align-items: baseline; color: var(--copy); font-size: 10px; }
.font-weights span { color: var(--muted); font-size: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; }
.font-weights b:nth-of-type(2), .font-weights b:nth-of-type(4) { font-weight: 600; }
.font-weights b:nth-of-type(3), .font-weights b:nth-of-type(5) { font-weight: 800; }
.type-scale { border: 1px solid var(--line); border-radius: 15px; overflow: hidden; }
.type-scale-head, .type-scale-row { display: grid; grid-template-columns: minmax(260px, 1.5fr) minmax(130px, .5fr) minmax(130px, .5fr); align-items: center; }
.type-scale-head { min-height: 39px; background: #f4f6f4; color: var(--muted); font-size: 8px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.type-scale-head span, .type-scale-row > div { padding: 9px 18px; }
.type-scale-row { min-height: 80px; border-top: 1px solid var(--line); }
.type-scale-row > div:first-child { display: flex; align-items: center; gap: 15px; }
.type-scale-row > div:first-child > span { width: 30px; height: 30px; display: grid; place-items: center; flex: none; border-radius: 50%; background: #eef3df; color: #647806; font: 900 9px/1 var(--mono); }
.type-scale-row > div:first-child strong { line-height: 1; letter-spacing: -.045em; }
.type-scale-row:nth-child(2) > div:first-child strong { font-size: 34px; }
.type-scale-row:nth-child(3) > div:first-child strong { font-size: 28px; }
.type-scale-row:nth-child(4) > div:first-child strong { font-size: 23px; }
.type-scale-row:nth-child(5) > div:first-child strong { font-size: 19px; }
.type-scale-row:nth-child(6) > div:first-child strong { font-size: 15px; }
.type-scale-row > div:not(:first-child) b { display: block; color: var(--blue); font-size: 18px; }
.type-scale-row > div:not(:first-child) small { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; }
.body-scale { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; }
.body-scale > div { padding: 21px; border-radius: 14px; background: #f7f8f7; }
.guide-mini-label { display: block; margin-bottom: 15px; color: var(--muted); font-size: 8px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }
.body-scale p { display: flex; align-items: baseline; gap: 12px; margin: 10px 0 0; }
.body-scale p code { width: 25px; color: var(--blue); font-size: 9px; }
.body-scale p strong { color: var(--ink); font-size: 11px; }
.body-scale p span, .body-scale p { color: var(--copy); }
.guide-two-column { display: grid; grid-template-columns: 1.15fr .85fr; gap: 20px; }
.spacing-guide h2, .icon-guide h2 { margin: 12px 0 12px; font-size: 31px; line-height: 1.08; letter-spacing: -.045em; }
.spacing-visual { margin-top: 25px; padding: 18px; border-radius: 14px; background: #f7f8f7; }
.spacing-block { min-height: 55px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; background: white; color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.spacing-gap { position: relative; height: 90px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; color: var(--blue); }
.spacing-gap::before, .spacing-gap::after { content: ""; height: 1px; background: var(--sky); }
.spacing-gap i { position: absolute; left: 50%; top: 13px; bottom: 13px; width: 1px; border-left: 1px dashed var(--green); }
.spacing-gap strong { position: relative; z-index: 1; padding: 5px 8px; border-radius: 999px; background: var(--lime); color: var(--sidebar); font-size: 11px; }
.spacing-gap span { position: absolute; bottom: 11px; left: 50%; color: var(--muted); font-size: 8px; transform: translateX(-50%); white-space: nowrap; }
.spacing-note { margin: 18px 0 0; color: var(--copy); font-size: 11px; }
.spacing-note strong { color: var(--blue); font-size: 20px; }
.icon-guide { position: relative; overflow: hidden; background: var(--sidebar); color: white; }
.icon-guide p { max-width: 420px; color: #b8cbd7; font-size: 12px; }
.icon-guide a { display: inline-block; margin-top: 24px; color: var(--lime); font-size: 11px; font-weight: 800; }
.icon-samples { display: flex; gap: 11px; margin-top: 26px; }
.icon-samples span { width: 46px; height: 46px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.17); border-radius: 50%; color: white; font-size: 20px; }
.icon-samples span:nth-child(2) { background: var(--yellow); color: var(--sidebar); }
.icon-samples span:nth-child(3) { background: var(--green); color: white; }
.icon-samples span:nth-child(4) { background: var(--sky); color: var(--sidebar); }
.component-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 20px; }
.component-card { padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: #fafbf9; }
.component-card-head { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.component-card-head strong { font-size: 14px; }
.component-card-head span { color: var(--muted); font-size: 9px; }
.button-demo-row { min-height: 78px; display: grid; grid-template-columns: 76px 1fr 1fr; align-items: center; gap: 10px; border-top: 1px solid var(--line); }
.button-demo-row > span { color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.guide-button { min-height: 46px; padding: 0 25px; border-radius: 999px; font-size: 13px; font-weight: 700; cursor: pointer; }
.guide-button-primary { border: 1px solid var(--lime); background: var(--lime); color: var(--sidebar); }
.guide-button-primary.is-active { background: #a8bf00; }
.guide-button-secondary { border: 1px solid var(--green); background: transparent; color: #668800; }
.guide-button-secondary.is-active { background: var(--green); color: white; }
.component-specs { display: flex; gap: 8px; margin: 18px 0 0; }
.component-specs div { min-width: 100px; padding: 10px; border-radius: 9px; background: white; }
.component-specs dt { color: var(--muted); font-size: 8px; text-transform: uppercase; }
.component-specs dd { margin: 3px 0 0; color: var(--blue); font-size: 14px; font-weight: 800; }
.field-demo-card { display: grid; gap: 13px; }
.guide-field { display: grid; grid-template-columns: 72px minmax(0, 1fr); align-items: start; gap: 11px; }
.guide-field > span { padding-top: 10px; color: var(--muted); font-size: 9px; font-weight: 800; }
.guide-field input, .guide-field textarea { width: 100%; min-height: 39px; padding: 7px 2px; border: 0; border-bottom: 1px solid #cdd2d3; border-radius: 0; background: transparent; color: var(--ink); font-size: 11px; resize: vertical; }
.guide-field textarea { min-height: 74px; }
.guide-field input:focus, .guide-field textarea:focus { border-color: var(--blue); outline: 0; }
.guide-field small { grid-column: 2; margin-top: -9px; color: #d84a4a; font-size: 8px; }
.guide-field.is-error input { border-color: #e56767; }
.guide-principles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 11px; margin-top: 20px; }
.guide-principles article { min-height: 150px; padding: 20px; border: 1px solid var(--line); border-radius: 15px; background: white; }
.guide-principles span { color: var(--blue); font: 900 9px/1 var(--mono); }
.guide-principles p { margin: 20px 0 0; color: var(--copy); font-size: 11px; }

/* Integrations */
.integration-primary { display: grid; grid-template-columns: minmax(0, .7fr) minmax(300px, .3fr); gap: 20px; margin-bottom: 22px; }
.integration-card { min-height: 260px; display: flex; flex-direction: column; justify-content: space-between; padding: 32px; overflow: hidden; background: var(--sidebar); color: white; }
.integration-card h2 { margin: 13px 0 10px; font-size: 38px; letter-spacing: -.05em; }
.integration-card p { max-width: 660px; margin: 0; color: #c5d4dd; }
.integration-card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 35px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.14); color: #a9bdca; font-size: 10px; }
.integration-side { padding: 28px; background: var(--paper); }
.integration-side strong { display: block; font-size: 28px; line-height: 1; }
.integration-side span { display: block; margin-top: 8px; color: var(--copy); font-size: 11px; }
.row-gap { margin-top: auto; padding-top: 28px; color: #7a860e; font: 800 10px/1.5 var(--mono); }
.integration-rows { padding: 10px 24px; box-shadow: none; }
.integration-row { display: grid; grid-template-columns: 64px minmax(160px, .4fr) minmax(0, .6fr); gap: 20px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.integration-row:last-child { border-bottom: 0; }
.integration-row code { color: var(--muted); font-size: 10px; }
.integration-row strong { font-size: 12px; }
.integration-row span { color: var(--copy); font-size: 11px; white-space: pre-line; }

/* Workbook */
.workbook-toolbar { justify-content: flex-start; }
.select-field { display: grid; gap: 5px; }
.select-field span { color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.select-field select { min-width: min(360px, 100%); height: 44px; padding: 0 38px 0 13px; border: 1px solid var(--line); border-radius: 11px; background: white; color: var(--ink); font-size: 12px; font-weight: 700; }
.workbook-toolbar .local-search { margin-top: 16px; }
.sheet-metric { margin: 16px 0 0 auto; text-align: right; }
.sheet-metric strong { display: block; color: var(--blue); font-size: 22px; line-height: 1; }
.sheet-metric span { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .06em; }
.raw-table-wrap { width: 100%; overflow: auto; box-shadow: none; }
.raw-table { width: 100%; min-width: 760px; border-collapse: collapse; table-layout: fixed; }
.raw-table th { position: sticky; z-index: 2; top: 0; height: 44px; padding: 0 12px; border-bottom: 1px solid var(--line); background: #f5f7f6; color: var(--muted); font-size: 9px; text-align: left; text-transform: uppercase; letter-spacing: .08em; }
.raw-table th:first-child { width: 68px; }
.raw-table td { vertical-align: top; padding: 12px; border-right: 1px solid #eff0ed; border-bottom: 1px solid #eff0ed; color: var(--copy); font-size: 10px; }
.raw-table td:first-child { background: #fafbf9; color: var(--muted); font: 700 9px/1.5 var(--mono); }
.raw-table tr:last-child td { border-bottom: 0; }
.raw-table td:last-child { border-right: 0; }
.cell-content { max-height: 72px; overflow: hidden; white-space: pre-line; cursor: pointer; }
.cell-content.is-expanded { max-height: none; }
.cell-content:hover { color: var(--ink); }

/* Search */
.search-results {
  position: absolute;
  z-index: 80;
  top: calc(100% + 9px);
  left: 0;
  right: 0;
  max-height: min(520px, calc(100vh - 110px));
  padding: 8px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: white;
  box-shadow: 0 24px 70px rgba(32, 44, 51, .2);
}
.search-result {
  width: 100%;
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border: 0;
  border-radius: 10px;
  background: white;
  text-align: left;
  cursor: pointer;
}
.search-result:hover { background: #f4f7f4; }
.search-result > span { color: var(--blue); font: 800 9px/1.5 var(--mono); text-transform: uppercase; }
.search-result strong { display: block; font-size: 11px; }
.search-result small { display: -webkit-box; margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 9px; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.search-empty { padding: 22px; color: var(--muted); font-size: 12px; text-align: center; }

/* Drawer */
.detail-drawer {
  position: fixed;
  z-index: 110;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(480px, 100%);
  padding: 58px 34px 40px;
  overflow-y: auto;
  background: white;
  box-shadow: -24px 0 70px rgba(26, 42, 52, .18);
  transform: translateX(105%);
  transition: transform .24s ease;
}
.detail-drawer.is-open { transform: none; }
.drawer-close { position: absolute; top: 18px; right: 22px; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%; background: white; font-size: 25px; cursor: pointer; }
.drawer-scrim, .sidebar-scrim { position: fixed; z-index: 100; inset: 0; background: rgba(18, 35, 47, .48); }
.drawer-kicker { color: var(--blue); font: 800 9px/1.5 var(--mono); text-transform: uppercase; letter-spacing: .1em; }
.detail-drawer h2 { margin: 14px 0 10px; font-size: 38px; line-height: 1.04; letter-spacing: -.055em; }
.drawer-path { color: var(--muted); font-size: 10px; }
.drawer-meta { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 28px 0; }
.drawer-meta div { min-height: 80px; padding: 14px; border-radius: 12px; background: #f5f7f5; }
.drawer-meta span { display: block; color: var(--muted); font-size: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; }
.drawer-meta strong { display: block; margin-top: 7px; font-size: 11px; }
.drawer-notes { padding: 18px; border-left: 3px solid var(--lime); background: var(--paper); color: var(--copy); font-size: 12px; white-space: pre-line; }
.drawer-notes strong { display: block; margin-bottom: 8px; color: var(--ink); }

.toast { position: fixed; z-index: 160; right: 20px; bottom: 20px; padding: 12px 16px; border-radius: 10px; background: var(--sidebar); color: white; box-shadow: var(--shadow); font-size: 12px; opacity: 0; transform: translateY(10px); pointer-events: none; transition: .2s ease; }
.toast.is-visible { opacity: 1; transform: none; }

/* Responsive */
@media (max-width: 1180px) {
  .topbar { grid-template-columns: minmax(150px, .55fr) minmax(280px, 1fr) auto; gap: 18px; }
  .source-link span { display: none; }
  .source-link { width: 44px; padding: 0; }
  .overview-hero { grid-template-columns: 1fr minmax(250px, .45fr); gap: 20px; }
  .overview-grid { grid-template-columns: 1fr; }
  .ia-preview { grid-template-columns: repeat(3, 1fr); }
  .template-preview-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 980px) {
  :root { --sidebar-width: 260px; }
  .sidebar { transform: translateX(-105%); transition: transform .22s ease; }
  .sidebar.is-open { transform: none; }
  .sidebar-scrim { z-index: 45; }
  .workspace { margin-left: 0; }
  .topbar { grid-template-columns: 44px minmax(150px, .55fr) minmax(260px, 1fr) auto; padding-inline: 20px; }
  .mobile-menu { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 11px; background: white; cursor: pointer; }
  .overview-hero { min-height: 500px; grid-template-columns: 1fr; }
  .hero-orbit { display: none; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .template-preview-grid { grid-template-columns: repeat(2, 1fr); }
  .template-workspace { grid-template-columns: 260px minmax(0, 1fr); }
  .brand-brief-grid { grid-template-columns: 1fr; }
  .swatch-row { grid-template-columns: repeat(3, 1fr); }
  .guide-principles { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  :root { --topbar-height: 66px; }
  .topbar { min-height: var(--topbar-height); grid-template-columns: 42px minmax(0, 1fr) 42px; gap: 10px; padding: 10px 14px; }
  .global-search-wrap { grid-column: 1 / -1; order: 2; display: flex; }
  .source-link { grid-column: 3; }
  .topbar-title { min-width: 0; }
  .topbar-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  main { padding: 24px 14px 70px; }
  .overview-hero { min-height: 480px; padding: 42px 24px; border-radius: 22px; }
  .overview-copy h1 { font-size: clamp(42px, 13vw, 62px); }
  .overview-copy > p { font-size: 16px; }
  .hero-actions { align-items: stretch; flex-direction: column; }
  .hero-actions .button { width: 100%; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 10px; }
  .stat-card { min-height: 115px; padding: 18px; }
  .stat-card strong { font-size: 29px; }
  .panel-large, .source-order, .template-snapshot { padding: 22px; }
  .panel-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
  .ia-preview { grid-template-columns: 1fr; }
  .template-preview-grid { grid-template-columns: 1fr 1fr; }
  .view-header { min-height: auto; align-items: flex-start; flex-direction: column; gap: 16px; margin: 22px 0 28px; }
  .view-header h1 { font-size: clamp(40px, 12vw, 58px); }
  .view-header-meta { padding-block: 8px; }
  .comparison-strip { grid-template-columns: 1fr; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .segmented { width: 100%; overflow-x: auto; }
  .segmented button { flex: 1 0 auto; }
  .local-search { min-width: 0; width: 100%; }
  .ia-browser-head { display: none; }
  .ia-row { grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding-inline: 14px; }
  .ia-row-section { grid-template-columns: 1fr; }
  .ia-template { max-width: 130px; }
  .ia-source { display: none; }
  .ia-name { padding-left: calc((var(--level) - 1) * 14px); }
  .template-workspace { grid-template-columns: 1fr; }
  .template-index { position: static; max-height: none; }
  #template-list { display: flex; overflow-x: auto; padding-bottom: 4px; }
  .template-index-button { min-width: 210px; }
  .template-detail { min-height: 0; padding: 24px 20px; }
  .template-detail-head { flex-direction: column; }
  .template-count-disc { width: 70px; height: 70px; }
  .brand-question { grid-template-columns: 1fr; gap: 10px; }
  .style-guide-hero { grid-template-columns: 1fr; gap: 28px; }
  .guide-section-head { flex-direction: column; gap: 12px; }
  .layout-guide .guide-section-head > div:first-child { min-width: 0; }
  .colour-group { grid-template-columns: 1fr; }
  .type-scale-head, .type-scale-row { grid-template-columns: minmax(150px, 1fr) 95px 95px; }
  .type-scale-head span, .type-scale-row > div { padding-inline: 10px; }
  .type-scale-row > div:first-child strong { font-size: 14px !important; }
  .body-scale, .guide-two-column, .component-grid, .layout-layer-grid, .layout-mode-grid, .layout-implementation { grid-template-columns: 1fr; }
  .layout-mode-preview { min-height: 130px; }
  .guide-principles { grid-template-columns: 1fr 1fr; }
  .design-row { grid-template-columns: minmax(0, 1fr) 64px; }
  .design-notes { grid-column: 1 / -1; }
  .positioning-list { grid-template-columns: 1fr; }
  .integration-primary { grid-template-columns: 1fr; }
  .integration-card { min-height: 230px; padding: 24px; }
  .integration-row { grid-template-columns: 50px minmax(0, 1fr); }
  .integration-row span { grid-column: 2; }
  .workbook-toolbar .local-search { margin-top: 0; }
  .select-field select { min-width: 100%; width: 100%; }
  .sheet-metric { margin: 0; text-align: left; }
}

@media (max-width: 460px) {
  .stat-grid { grid-template-columns: 1fr; }
  .template-preview-grid { grid-template-columns: 1fr; }
  .template-preview-card { min-height: 135px; }
  .source-order h2 { font-size: 27px; }
  .ia-template { display: none; }
  .ia-row { grid-template-columns: 1fr; }
  .module-card { grid-template-columns: 36px minmax(0, 1fr); gap: 12px; }
  .module-order { width: 36px; height: 36px; }
  .module-sequence::before { left: 17px; }
  .detail-drawer { padding: 58px 20px 30px; }
  .drawer-meta { grid-template-columns: 1fr; }
  .swatch-row { grid-template-columns: repeat(2, 1fr); }
  .type-scale-head, .type-scale-row { grid-template-columns: minmax(120px, 1fr) 74px 74px; }
  .type-scale-row > div:not(:first-child) b { font-size: 14px; }
  .type-scale-row > div:not(:first-child) small { font-size: 7px; }
  .guide-principles { grid-template-columns: 1fr; }
  .container-shell { min-height: 220px; padding: 14px; }
  .container-label { align-items: flex-start; flex-wrap: wrap; }
  .container-label small { width: 100%; margin: 0 0 0 40px; }
  .container-inner { width: 92%; min-height: 125px; padding: 13px; }
  .container-content-lines { grid-template-columns: 1fr 1fr; }
  .container-content-lines i:last-child { display: none; }
  .layout-mode-card { grid-template-columns: 1fr; }
  .button-demo-row { grid-template-columns: 1fr 1fr; padding: 13px 0; }
  .button-demo-row > span { grid-column: 1 / -1; }
}

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