:root {
  --bg: #f4f6f8;
  --paper: #ffffff;
  --ink: #15202b;
  --muted: #607080;
  --line: #d8dee6;
  --line-strong: #aeb8c5;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --blueprint: #10243a;
  --shadow: 0 14px 34px rgba(22, 34, 51, 0.06);
  font-family: Avenir Next, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

.site-shell {
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
  min-height: 100vh;
}

.side-rail {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 16px;
  padding: 22px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  color: #fff;
  background: var(--ink);
  font-weight: 900;
}

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

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

.rail-panel {
  padding: 6px 0 0;
  border-top: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.category-nav {
  display: grid;
  gap: 7px;
}

.category-nav button {
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-size: 13px;
  font-weight: 750;
}

.category-nav button:hover,
.category-nav button.is-active {
  color: var(--ink);
  border-color: var(--line);
  background: #eef5f4;
}

.ai-panel {
  align-self: end;
  display: grid;
  gap: 8px;
}

.ai-panel a {
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
}

.ai-panel a:hover {
  color: var(--accent-dark);
}

.content {
  min-width: 0;
  padding: 32px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 390px);
  gap: 22px;
  align-items: end;
  padding: 0 0 22px;
  border-bottom: 1px solid var(--line);
}

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

h1 {
  max-width: 820px;
  font-size: clamp(30px, 3vw, 44px);
  line-height: 1.05;
  letter-spacing: 0;
}

h2 {
  font-size: 26px;
  line-height: 1.15;
}

h3 {
  font-size: 18px;
  line-height: 1.2;
}

.search-wrap {
  display: grid;
  gap: 8px;
}

.search-wrap label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.search-wrap input {
  width: 100%;
  min-height: 48px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
}

.search-wrap input:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.18);
  outline-offset: 2px;
}

.ad-slot {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  margin-top: 16px;
  padding: 10px 10px 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--paper);
}

.ad-slot[hidden] {
  display: none;
}

.ad-slot strong,
.ad-slot p {
  display: block;
}

.ad-slot strong {
  margin-top: 4px;
  color: var(--ink);
  font-size: 13px;
}

.ad-slot p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

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

.icon-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.74);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.summary-grid {
  display: none;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.summary-grid article {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.summary-grid strong,
.summary-grid span {
  display: block;
}

.summary-grid strong {
  font-size: 24px;
  line-height: 1.1;
}

.summary-grid span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.featured-band {
  display: grid;
  grid-template-columns: minmax(220px, 0.34fr) minmax(0, 0.66fr);
  gap: 20px;
  align-items: stretch;
  margin-top: 22px;
  padding: 0 0 22px;
  border-bottom: 1px solid var(--line);
}

.blueprint-visual {
  position: relative;
  min-height: 170px;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid #24496f;
  background:
    linear-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.12) 1px, transparent 1px),
    var(--blueprint);
  background-size: 24px 24px;
}

.blueprint-visual::before,
.blueprint-visual::after,
.blueprint-visual span {
  content: "";
  position: absolute;
  border: 2px solid #e7f4ff;
  opacity: 0.92;
}

.blueprint-visual::before {
  left: 14%;
  top: 22%;
  width: 68%;
  height: 46%;
  border-radius: 8px;
}

.blueprint-visual::after {
  left: 35%;
  top: 36%;
  width: 70px;
  height: 70px;
  border-radius: 50%;
}

.blueprint-visual span:nth-child(1) {
  left: 15%;
  bottom: 16%;
  width: 70%;
  border-width: 1px 0 0;
}

.blueprint-visual span:nth-child(2) {
  right: 12%;
  top: 16%;
  height: 68%;
  border-width: 0 1px 0 0;
}

.blueprint-visual span:nth-child(3) {
  left: 10%;
  top: 12%;
  width: 90px;
  height: 26px;
}

.featured-band p:not(.eyebrow) {
  margin-top: 12px;
  max-width: 680px;
  color: var(--muted);
  line-height: 1.55;
}

.primary-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  margin-top: 18px;
  padding: 0 14px;
  border-radius: 8px;
  color: #fff;
  background: var(--accent);
  font-weight: 800;
  text-decoration: none;
}

.tool-section {
  margin-top: 22px;
}

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

.section-head > p {
  color: var(--muted);
  font-size: 13px;
}

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

.tool-card {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 10px;
  min-height: 236px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.tool-card-head {
  display: flex;
  gap: 12px;
  align-items: center;
}

.tool-mark {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  color: #fff;
  background: var(--ink);
  font-weight: 900;
}

.tool-mark-cad {
  background: #24496f;
}

.tool-mark-documents {
  background: #725532;
}

.tool-mark-commerce {
  background: #0f766e;
}

.tool-mark-research {
  background: #5f4b8b;
}

.tool-mark-media {
  background: #8a3b12;
}

.status-pill {
  display: inline-flex;
  min-height: 24px;
  margin-top: 7px;
  padding: 4px 8px;
  border: 1px solid rgba(15, 118, 110, 0.26);
  border-radius: 999px;
  color: var(--accent-dark);
  background: #e8f7f3;
  font-size: 11px;
  font-weight: 850;
}

.tool-card > p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.48;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-content: start;
}

.tag-list span {
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: #f8fafc;
  font-size: 12px;
}

.tool-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.tool-card-footer span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.tool-card-footer a {
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 850;
  text-decoration: none;
}

.empty-state {
  padding: 22px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 1100px) {
  .site-shell {
    grid-template-columns: 1fr;
  }

  .side-rail {
    position: relative;
    height: auto;
    grid-template-columns: 1fr;
    order: 2;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .content {
    order: 1;
  }

  .ai-panel {
    display: none;
  }

  .topbar,
  .featured-band {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 680px) {
  .content,
  .side-rail {
    padding: 14px;
  }

  .topbar,
  .featured-band {
    padding-bottom: 18px;
  }

  h1 {
    font-size: 32px;
    line-height: 1.08;
  }

  h2 {
    font-size: 24px;
  }

  .summary-grid,
  .tool-grid {
    grid-template-columns: 1fr;
  }

  .section-head {
    align-items: start;
    flex-direction: column;
  }
}
