:root {
  --primary: #0b2d6b;
  --secondary: #2f6bff;
  --accent: #3fb9ff;
  --canvas: #f8fafd;
  --paper: #ffffff;
  --paper-strong: #ffffff;
  --ink: #172033;
  --muted: #64708a;
  --line: #e5eaf3;
  --line-strong: #d6deea;
  --success: #0a8f5c;
  --success-bg: #e9f8f1;
  --danger: #d84b4b;
  --danger-bg: #fff0f0;
  --warning: #bb7a00;
  --shadow: 0 18px 50px rgba(11, 45, 107, 0.12);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --sidebar-width: 292px;
  --right-width: 292px;
  --scrollbar-size: 10px;
  --scrollbar-track: rgba(229, 234, 243, 0.55);
  --scrollbar-thumb: rgba(47, 107, 255, 0.38);
  --scrollbar-thumb-hover: rgba(47, 107, 255, 0.62);
  --scrollbar-thumb-active: linear-gradient(180deg, #2f6bff, #3fb9ff);
  font-family: Inter, Pretendard, SUIT, "Noto Sans KR", "Apple SD Gothic Neo", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

:root[data-theme='dark'] {
  --canvas: #111827;
  --paper: #151f31;
  --paper-strong: #0f1727;
  --ink: #edf4ff;
  --muted: #9aa8bd;
  --line: #24324a;
  --line-strong: #33445f;
  --success-bg: rgba(10, 143, 92, 0.16);
  --danger-bg: rgba(216, 75, 75, 0.16);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  --scrollbar-track: rgba(36, 50, 74, 0.65);
  --scrollbar-thumb: rgba(63, 185, 255, 0.32);
  --scrollbar-thumb-hover: rgba(63, 185, 255, 0.55);
  --scrollbar-thumb-active: linear-gradient(180deg, #3fb9ff, #2f6bff);
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  background: var(--canvas);
  color: var(--ink);
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr) var(--right-width);
  width: 100vw;
  height: 100vh;
  background: var(--canvas);
}

.sidebar,
.right-panel {
  min-height: 100vh;
  background: var(--paper-strong);
  border-color: var(--line);
  overflow: auto;
  z-index: 30;
}

.sidebar {
  border-right: 1px solid var(--line);
  padding: 18px 14px;
}

a.brand { text-decoration: none; color: inherit; }

.sidebar-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.sidebar-head .brand {
  flex: 1;
  min-width: 0;
}

.sidebar-head #close-sidebar {
  margin-top: 8px;
  flex: 0 0 auto;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 8px 8px 18px;
}

.brand img {
  width: 38px;
  height: 38px;
  border-radius: 12px;
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 15px;
  letter-spacing: -0.02em;
}

.brand span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.search-box {
  display: grid;
  gap: 6px;
  padding: 0 8px 14px;
}

.search-box span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.search-box input {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--canvas);
  color: var(--ink);
  outline: none;
}

.search-box input:focus {
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(47, 107, 255, 0.16);
}

.story-tree {
  display: grid;
  gap: 14px;
  padding-bottom: 56px;
}

.story-group {
  display: grid;
  gap: 8px;
}

.group-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 6px 8px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

.group-label small {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--canvas);
  color: var(--muted);
}

.group-items {
  display: grid;
  gap: 4px;
}

.story-item {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 8px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.story-item:hover {
  background: var(--canvas);
}

.story-item.active {
  background: rgba(47, 107, 255, 0.1);
  color: var(--secondary);
}

.story-dot {
  width: 7px;
  height: 7px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--line-strong);
}

.story-item.active .story-dot {
  background: var(--secondary);
}

.story-item strong,
.story-item small {
  display: block;
}

.story-item strong {
  font-size: 13px;
  line-height: 1.35;
}

.story-item small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.sidebar-footer {
  position: sticky;
  bottom: 0;
  margin: 18px -14px -18px;
  padding: 12px 22px;
  background: var(--paper-strong);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.sidebar-footer a {
  color: var(--secondary);
  font-weight: 700;
  text-decoration: none;
}

.sidebar-footer a:hover {
  text-decoration: underline;
}

.main-panel {
  display: grid;
  grid-template-rows: 57px minmax(0, 1fr);
  min-width: 0;
  height: 100vh;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 14px;
  align-items: center;
  padding: 0 16px;
  background: var(--paper-strong);
  border-bottom: 1px solid var(--line);
}

.topbar-left {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.breadcrumb {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.breadcrumb strong {
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
}

.tabs {
  display: flex;
  align-items: center;
  height: 36px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--canvas);
}

.tab {
  min-width: 78px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.tab.active {
  background: var(--paper);
  color: var(--secondary);
  box-shadow: 0 4px 18px rgba(12, 30, 65, 0.1);
}

.topbar-actions {
  display: flex;
  gap: 8px;
}

.icon-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--paper);
  color: var(--ink);
}

.canvas-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  height: 46px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: var(--canvas);
}

.toolbar-group {
  display: flex;
  gap: 6px;
}

.viewport-button {
  height: 30px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.viewport-button.active {
  border-color: rgba(47, 107, 255, 0.35);
  background: rgba(47, 107, 255, 0.12);
  color: var(--secondary);
}

.toolbar-meta {
  display: flex;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.canvas-stage {
  height: calc(100vh - 103px);
  padding: 26px;
  overflow: auto;
  background: radial-gradient(circle at top left, rgba(63, 185, 255, 0.16), transparent 30%), var(--canvas);
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

.canvas-stage::-webkit-scrollbar {
  width: var(--scrollbar-size);
  height: var(--scrollbar-size);
}

.canvas-stage::-webkit-scrollbar-track {
  margin: 10px 4px;
  background: var(--scrollbar-track);
  border-radius: 999px;
}

.canvas-stage::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  background-clip: padding-box;
  border: 2px solid transparent;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(47, 107, 255, 0.12);
}

.canvas-stage::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
  background-clip: padding-box;
  border: 2px solid transparent;
}

.canvas-stage::-webkit-scrollbar-thumb:active {
  background: var(--scrollbar-thumb-active);
  background-clip: padding-box;
  border: 2px solid transparent;
}

.canvas-stage::-webkit-scrollbar-corner {
  background: transparent;
}

.sidebar,
.right-panel,
.toolbar-group {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) transparent;
}

.sidebar::-webkit-scrollbar,
.right-panel::-webkit-scrollbar,
.toolbar-group::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.sidebar::-webkit-scrollbar-track,
.right-panel::-webkit-scrollbar-track,
.toolbar-group::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb,
.right-panel::-webkit-scrollbar-thumb,
.toolbar-group::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  background-clip: padding-box;
  border: 2px solid transparent;
  border-radius: 999px;
}

.sidebar::-webkit-scrollbar-thumb:hover,
.right-panel::-webkit-scrollbar-thumb:hover,
.toolbar-group::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
  background-clip: padding-box;
  border: 2px solid transparent;
}

.preview-frame {
  min-height: 100%;
  margin: 0 auto;
  transition: width 0.18s ease;
}

.hero-card,
.doc-card,
.docs-view,
.source-view {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.hero-card {
  min-height: 650px;
  padding: clamp(26px, 5vw, 64px);
  overflow: hidden;
  position: relative;
}

.hero-card::after {
  content: '';
  position: absolute;
  right: -120px;
  top: -120px;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(47, 107, 255, 0.18), rgba(63, 185, 255, 0.08));
  pointer-events: none;
}

.eyebrow,
.section-heading > span,
.docs-header > span,
.source-header > span {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(47, 107, 255, 0.11);
  color: var(--secondary);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.02em;
}

.hero-card h1 {
  max-width: 760px;
  margin: 18px 0 16px;
  color: var(--ink);
  font-size: clamp(30px, 5vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.055em;
}

.hero-card p,
.section-heading p,
.docs-header p,
.source-header p {
  max-width: 860px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
  word-break: keep-all;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 18px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--canvas);
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 38px 0;
}

.metric-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(248, 250, 253, 0.92), rgba(248, 250, 253, 0.62));
}

:root[data-theme='dark'] .metric-card {
  background: rgba(255, 255, 255, 0.04);
}

.metric-card span,
.model-card-head span,
.roadmap-card span,
.party-card span,
.panel-section h2 {
  color: var(--secondary);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.metric-card strong {
  display: block;
  margin-top: 9px;
  font-size: 18px;
  line-height: 1.45;
  word-break: keep-all;
}

.flow {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 12px;
  align-items: center;
  margin-top: 24px;
  margin-bottom: 28px;
  line-height: 1.5;
}

.flow-node {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid rgba(47, 107, 255, 0.23);
  border-radius: 999px;
  background: rgba(47, 107, 255, 0.08);
  line-height: 1.45;
}

.flow-index {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--secondary);
  color: white;
  font-size: 11px;
  font-weight: 900;
}

.flow-node strong {
  font-size: 13px;
  line-height: 1.45;
  white-space: nowrap;
}

.flow-arrow {
  color: var(--muted);
  font-weight: 900;
}

.doc-card {
  min-height: 650px;
  padding: clamp(22px, 4vw, 42px);
}

.section-heading {
  display: grid;
  gap: 12px;
  margin-bottom: 26px;
}

.section-heading.compact {
  margin-bottom: 18px;
}

.section-heading h2,
.docs-header h1,
.source-header h1 {
  margin: 0;
  font-size: clamp(24px, 4vw, 38px);
  line-height: 1.12;
  letter-spacing: -0.04em;
}

table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper);
}

.table-wrap {
  width: 100%;
  overflow: auto;
  border-radius: var(--radius-md);
}

th,
td {
  padding: 14px 15px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
  text-align: left;
  vertical-align: top;
  word-break: keep-all;
}

thead th {
  background: var(--canvas);
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

tbody tr:last-child td,
tbody tr:last-child th {
  border-bottom: 0;
}

th.danger {
  color: var(--danger);
}

th.success {
  color: var(--success);
}

.status-pill {
  display: inline-flex;
  margin-right: 8px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}

.status-pill.danger {
  background: var(--danger-bg);
  color: var(--danger);
}

.status-pill.success {
  background: var(--success-bg);
  color: var(--success);
}

.benchmark-grid,
.model-grid,
.role-grid,
.token-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
}

.benchmark-card,
.model-card,
.package-card,
.role-card,
.token-card,
.council-card,
.party-card,
.roadmap-card,
.architecture-layer {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper);
}

.benchmark-card {
  padding: 18px;
}

.benchmark-card strong,
.package-card strong,
.council-card strong,
.role-card strong,
.roadmap-card strong,
.architecture-layer strong {
  display: block;
  font-size: 16px;
  line-height: 1.45;
  word-break: keep-all;
}

.benchmark-card p,
.package-card p,
.role-card p,
.roadmap-card p,
.party-card p {
  margin: 10px 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
  word-break: keep-all;
}

.benchmark-card div {
  display: grid;
  gap: 5px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(47, 107, 255, 0.08);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.55;
}

.benchmark-card div span {
  color: var(--secondary);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.model-card {
  padding: 0;
  overflow: hidden;
}

.model-card-head {
  display: grid;
  gap: 8px;
  padding: 18px;
  background: linear-gradient(135deg, rgba(47, 107, 255, 0.12), rgba(63, 185, 255, 0.08));
}

.model-card-head strong {
  font-size: 17px;
  line-height: 1.4;
}

.model-card dl {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 16px 18px 18px;
}

.model-card dl div {
  display: grid;
  gap: 4px;
}

.model-card dt {
  color: var(--secondary);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.model-card dd {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.58;
}

.package-list,
.council-list,
.roadmap,
.architecture-stack {
  display: grid;
  gap: 14px;
}

.package-card {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 18px;
  align-items: center;
  padding: 18px;
}

.package-card p {
  margin: 0;
}

.consortium-map {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.party-card {
  min-height: 178px;
  padding: 18px;
}

.party-card.featured {
  border-color: rgba(47, 107, 255, 0.32);
  background: linear-gradient(180deg, rgba(47, 107, 255, 0.11), transparent);
}

.party-card strong {
  display: block;
  margin-top: 12px;
  font-size: 19px;
}

.council-card {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 16px 18px;
}

.council-card span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  text-align: right;
}

.role-card {
  padding: 18px;
}

.partner-profile {
  display: grid;
  gap: 16px;
  margin: 0 0 28px;
  padding: 22px;
  border: 1px solid rgba(47, 107, 255, 0.22);
  border-radius: var(--radius-md);
  background:
    radial-gradient(circle at top right, rgba(63, 185, 255, 0.14), transparent 42%),
    var(--canvas);
}

.partner-profile-head {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: flex-start;
}

.partner-brand {
  display: block;
  margin-bottom: 4px;
  color: var(--secondary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.partner-profile-head strong {
  display: block;
  font-size: 22px;
  letter-spacing: -0.03em;
}

.partner-profile-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.partner-link {
  flex-shrink: 0;
  padding: 8px 12px;
  border: 1px solid rgba(47, 107, 255, 0.28);
  border-radius: 999px;
  background: rgba(47, 107, 255, 0.08);
  color: var(--secondary);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.partner-link:hover {
  background: rgba(47, 107, 255, 0.16);
}

.partner-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.partner-meta div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
}

.partner-meta span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.partner-meta strong {
  font-size: 13px;
  line-height: 1.4;
  word-break: keep-all;
}

.partner-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
}

.partner-contact a {
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.partner-contact a:hover {
  color: var(--secondary);
}

.partner-pillars,
.partner-stack,
.partner-clients {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.partner-pillars span,
.partner-stack span,
.partner-clients span {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.partner-pillars span {
  background: rgba(47, 107, 255, 0.12);
  color: var(--secondary);
}

.partner-stack span {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--muted);
}

.partner-clients span {
  background: rgba(11, 45, 107, 0.08);
  color: var(--primary);
}

.partner-strengths {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 16px;
  margin: 0;
  padding-left: 18px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.5;
}

.role-card span {
  display: inline-flex;
  margin-top: 8px;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(63, 185, 255, 0.14);
  color: var(--primary);
  font-size: 12px;
  font-weight: 850;
}

:root[data-theme='dark'] .role-card span {
  color: var(--accent);
}

.rank {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-size: 12px;
  font-weight: 900;
}

.roadmap {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.roadmap-card {
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.roadmap-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--secondary), var(--accent));
}

.roadmap-card strong {
  margin-top: 10px;
  font-size: 20px;
}

.roadmap-card div {
  margin-top: 14px;
  padding: 12px;
  border-radius: 12px;
  background: var(--canvas);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.55;
}

.architecture-stack {
  gap: 10px;
}

.architecture-layer {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 14px;
  align-items: center;
  padding: 16px;
}

.architecture-layer div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.architecture-layer div span {
  display: inline-flex;
  padding: 7px 9px;
  border-radius: 999px;
  background: var(--canvas);
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.token-card {
  display: grid;
  gap: 8px;
  padding: 16px;
}

.swatch {
  width: 100%;
  height: 58px;
  border-radius: 12px;
  border: 1px solid var(--line);
}

.token-card code {
  width: fit-content;
  padding: 4px 7px;
  border-radius: 8px;
  background: var(--canvas);
  color: var(--secondary);
  font-size: 12px;
}

.token-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.typography-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.typography-list div {
  display: grid;
  grid-template-columns: 120px 160px 1fr;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.typography-list span,
.typography-list p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.docs-view,
.source-view {
  height: calc(100vh - 57px);
  padding: clamp(22px, 5vw, 58px);
  overflow: auto;
  border-radius: 0;
  border-width: 0;
  box-shadow: none;
}

.docs-header,
.source-header {
  display: grid;
  gap: 14px;
  max-width: 940px;
  margin-bottom: 36px;
}

.docs-view section {
  max-width: 940px;
  padding: 24px 0;
  border-top: 1px solid var(--line);
}

.docs-view h2 {
  margin: 0 0 10px;
  font-size: 22px;
}

.docs-view p,
.docs-view li {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.75;
}

.check-list {
  display: grid;
  gap: 8px;
  padding-left: 20px;
}

.props-table {
  display: grid;
  gap: 8px;
  max-width: 620px;
}

.props-table div {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.props-table strong {
  color: var(--secondary);
}

.source-view pre {
  max-width: 1080px;
  margin: 0;
  padding: 20px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #0e1729;
  color: #d6e7ff;
  line-height: 1.65;
}

.source-view code {
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
}

.right-panel {
  display: grid;
  align-content: start;
  gap: 18px;
  border-left: 1px solid var(--line);
  padding: 18px;
}

.right-panel:not(.is-open) {
  display: none;
}

.panel-section {
  display: grid;
  gap: 12px;
}

.panel-section h2 {
  margin: 0;
}

.control-row {
  display: grid;
  gap: 8px;
}

.control-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.control-row select {
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
}

.meta-list {
  display: grid;
  gap: 8px;
  margin: 0;
}

.meta-list div {
  display: grid;
  gap: 4px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.meta-list dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.meta-list dd {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.5;
}

.mobile-only {
  display: none;
}

.scrim {
  display: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.story-search-fab,
.story-mobile-search-panel {
  display: none;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  }

  .right-panel {
    display: none;
  }
}

@media (max-width: 860px) {
  body {
    overflow: auto;
  }

  .app-shell {
    display: block;
    height: auto;
    min-height: 100vh;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(88vw, var(--sidebar-width));
    transform: translateX(-104%);
    transition: transform 0.2s ease;
    box-shadow: var(--shadow);
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .scrim.is-visible {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 20;
    background: rgba(7, 15, 30, 0.42);
  }

  .main-panel {
    min-height: 100vh;
  }

  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .topbar-actions {
    display: none;
  }

  .mobile-only {
    display: inline-flex;
  }

  .desktop-only {
    display: none;
  }

  .tabs {
    justify-self: end;
  }

  .tab {
    min-width: 62px;
  }

  .canvas-toolbar {
    height: auto;
    min-height: 46px;
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 14px;
  }

  .toolbar-group {
    width: 100%;
    overflow: auto;
  }

  .canvas-stage {
    height: auto;
    min-height: calc(100vh - 130px);
    padding: 14px;
  }

  .hero-card,
  .doc-card {
    min-height: auto;
  }

  .partner-profile-head {
    flex-direction: column;
  }

  .partner-meta,
  .partner-strengths {
    grid-template-columns: 1fr;
  }

  .hero-grid,
  .benchmark-grid,
  .model-grid,
  .role-grid,
  .token-grid,
  .consortium-map,
  .roadmap {
    grid-template-columns: 1fr;
  }

  .package-card,
  .council-card,
  .architecture-layer,
  .typography-list div,
  .props-table div {
    grid-template-columns: 1fr;
  }

  .council-card {
    align-items: flex-start;
  }

  .council-card span {
    text-align: left;
  }

  .docs-view,
  .source-view {
    height: auto;
    min-height: calc(100vh - 57px);
  }

  .sidebar .search-box {
    display: none;
  }

  .story-search-fab {
    position: fixed;
    right: max(14px, env(safe-area-inset-right, 0px));
    bottom: max(18px, env(safe-area-inset-bottom, 0px));
    z-index: 74;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.94);
    color: var(--ink);
    box-shadow: 0 12px 26px rgba(8, 27, 58, 0.16);
    backdrop-filter: blur(18px);
  }

  :root[data-theme='dark'] .story-search-fab {
    background: rgba(21, 31, 49, 0.94);
  }

  .story-search-fab svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  body.search-open .story-search-fab {
    display: none;
  }

  .story-mobile-search-panel {
    position: fixed;
    inset: 0;
    z-index: 112;
    display: block;
  }

  .story-mobile-search-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(7, 15, 30, 0.46);
    backdrop-filter: blur(10px);
  }

  .story-mobile-search-sheet {
    position: absolute;
    top: max(12px, env(safe-area-inset-top, 0px));
    left: 50%;
    display: grid;
    gap: 12px;
    width: min(420px, calc(100vw - 28px));
    max-height: min(520px, calc(100svh - 24px - env(safe-area-inset-bottom, 0px)));
    padding: 14px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--paper);
    box-shadow: 0 24px 70px rgba(5, 20, 32, 0.24);
    transform: translateX(-50%);
  }

  .story-mobile-search-sheet header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .story-mobile-search-sheet header span {
    display: block;
    margin-bottom: 3px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .story-mobile-search-sheet header strong {
    color: var(--ink);
    font-size: 18px;
  }

  .story-mobile-search-sheet header button {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--canvas);
    color: var(--ink);
    font-size: 22px;
    font-weight: 900;
    line-height: 1;
  }

  .mobile-search-field {
    position: relative;
  }

  .mobile-search-field input {
    width: 100%;
    min-height: 46px;
    padding: 10px 42px 10px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--canvas);
    color: var(--ink);
    font-size: 16px;
    outline: none;
  }

  .mobile-search-field input:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(47, 107, 255, 0.16);
  }

  .mobile-search-clear {
    position: absolute;
    top: 50%;
    right: 8px;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    font-size: 20px;
    line-height: 1;
    transform: translateY(-50%);
  }

  .mobile-search-results {
    min-height: 72px;
    max-height: min(320px, calc(100svh - 220px));
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--canvas);
  }

  .mobile-search-hint,
  .mobile-search-empty {
    margin: 0;
    padding: 18px 14px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
  }

  .mobile-search-list {
    list-style: none;
    margin: 0;
    padding: 6px;
  }

  .mobile-search-item {
    display: grid;
    gap: 3px;
    width: 100%;
    padding: 12px 12px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--ink);
    text-align: left;
  }

  .mobile-search-item:hover,
  .mobile-search-item:focus-visible {
    background: var(--paper);
  }

  .mobile-search-item strong {
    font-size: 15px;
    font-weight: 800;
  }

  .mobile-search-item small {
    color: var(--muted);
    font-size: 12px;
  }
}

@media (max-width: 560px) {
  .breadcrumb span {
    display: none;
  }

  .breadcrumb strong {
    max-width: 130px;
  }

  .tab {
    min-width: auto;
    padding: 0 10px;
  }

  th,
  td {
    min-width: 170px;
  }

  .hero-card h1 {
    font-size: 32px;
  }

  .flow {
    display: grid;
    gap: 12px;
  }

  .flow-arrow {
    display: none;
  }

  .flow-node {
    width: 100%;
    border-radius: 14px;
  }
}
