:root {
  --bg: #f6f8f8;
  --panel: #ffffff;
  --ink: #172122;
  --muted: #5f6f72;
  --line: #d8e1e1;
  --accent: #19757a;
  --accent-2: #b94b30;
  --accent-3: #315fa8;
  --soft: #e9f4f4;
  --shadow: 0 10px 28px rgba(16, 36, 38, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

button:hover,
button:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 28px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}

.eyebrow {
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 5px;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(1.5rem, 2.2vw, 2.35rem);
  margin-bottom: 0;
}

h2 {
  font-size: 1.55rem;
  margin-bottom: 0;
}

.top-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.top-actions button,
.card-actions button,
.card-actions a {
  padding: 9px 12px;
}

.layout {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  min-height: calc(100vh - 86px);
}

.sidebar {
  padding: 22px;
  border-right: 1px solid var(--line);
  background: #fbfdfd;
  position: sticky;
  top: 86px;
  height: calc(100vh - 86px);
  overflow: auto;
}

.search-label {
  display: block;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 8px;
}

#searchBox {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  margin-bottom: 18px;
  background: #fff;
}

.category-list {
  display: grid;
  gap: 8px;
}

.category-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 11px 12px;
  text-align: left;
}

.category-btn.active {
  background: var(--soft);
  border-color: var(--accent);
  color: #0b555a;
  font-weight: 800;
}

.count {
  color: var(--muted);
  font-size: 0.86rem;
}

.content {
  padding: 24px 28px 42px;
}

.content-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  margin-bottom: 20px;
}

.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter {
  padding: 8px 10px;
}

.filter.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 16px;
  margin-bottom: 22px;
}

.live-panel,
.quick-list,
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.live-panel {
  display: grid;
  grid-template-columns: 270px minmax(260px, 1fr);
  gap: 16px;
  padding: 18px;
  align-items: center;
}

.live-copy p:last-child {
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 0;
}

.demo-canvas {
  min-height: 260px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #eef6f6 100%);
  overflow: hidden;
  position: relative;
}

.demo-canvas svg {
  width: 100%;
  height: 100%;
  min-height: 260px;
  display: block;
}

.demo-controls {
  grid-column: 1 / -1;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.demo-controls label {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
}

.demo-controls input[type="range"] {
  width: 180px;
}

.quick-list {
  padding: 16px;
}

.quick-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.quick-head button {
  padding: 6px 8px;
}

.favorites-list {
  display: grid;
  gap: 8px;
}

.favorite-item {
  border-left: 3px solid var(--accent);
  background: #f6fbfb;
  padding: 8px 10px;
  font-size: 0.9rem;
}

.empty {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.card {
  padding: 16px;
  display: flex;
  flex-direction: column;
  min-height: 315px;
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.badge,
.chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 0.78rem;
  line-height: 1;
}

.badge {
  background: #eef2f8;
  color: #274d8a;
  font-weight: 800;
  padding: 7px 9px;
}

.save {
  width: 36px;
  height: 34px;
  font-size: 1.15rem;
}

.save.saved {
  background: #fff3df;
  border-color: #d38a22;
  color: #9c5c00;
}

.card h3 {
  margin-bottom: 8px;
}

.summary {
  color: var(--muted);
  line-height: 1.45;
}

.chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.chip {
  background: var(--soft);
  color: #235f64;
  padding: 6px 8px;
  font-weight: 700;
}

.prompts {
  margin: 0 0 14px;
  display: grid;
  gap: 7px;
  color: #354548;
  font-size: 0.93rem;
}

.prompt {
  padding-left: 10px;
  border-left: 2px solid var(--line);
}

.card-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  flex-wrap: wrap;
}

.demo-button {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.resource-link {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
}

.resource-link[href="#"] {
  display: none;
}

.node {
  fill: #fff;
  stroke: var(--ink);
  stroke-width: 2;
}

.bond {
  stroke: var(--ink);
  stroke-width: 3;
  stroke-linecap: round;
}

.hot {
  stroke: var(--accent-2);
  fill: none;
  stroke-width: 3;
}

.blue {
  stroke: var(--accent-3);
}

.label {
  fill: var(--ink);
  font-size: 15px;
  font-weight: 800;
  text-anchor: middle;
}

.small-label {
  fill: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-anchor: middle;
}

@media (max-width: 980px) {
  .layout,
  .stage,
  .live-panel {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .content-head,
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media print {
  .sidebar,
  .top-actions,
  .filters,
  .demo-controls,
  .card-actions {
    display: none;
  }

  .layout,
  .stage,
  .live-panel {
    display: block;
  }

  .card,
  .live-panel,
  .quick-list {
    box-shadow: none;
    break-inside: avoid;
    margin-bottom: 12px;
  }
}
