.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.dissect-main {
  width: min(100% - (var(--page-pad) * 2), 1100px);
  margin: 1.25rem auto calc(3rem + env(safe-area-inset-bottom, 0px));
}

.dissect-hero {
  background:
    linear-gradient(115deg, rgba(0, 12, 28, 0.72) 0%, rgba(0, 25, 45, 0.45) 48%, rgba(0, 18, 36, 0.28) 100%),
    url("../assets/hero.jpg") 72% 38% / cover no-repeat;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  padding: clamp(1.75rem, 4vw, 2.75rem);
  margin-bottom: 1.25rem;
  overflow: hidden;
}

.dissect-hero .eyebrow {
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: #9ec9e8;
  margin-bottom: 0.65rem;
}

.dissect-hero h1 {
  font-family: "Anton", Impact, sans-serif;
  font-weight: 400;
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  line-height: 0.98;
  letter-spacing: 0.01em;
  max-width: 16ch;
  margin-bottom: 0.85rem;
}

.dissect-hero .lead {
  max-width: 52ch;
  color: rgba(255, 255, 255, 0.92);
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.url-bar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.65rem;
  max-width: 720px;
}

.url-bar input {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  padding: 0.95rem 1.1rem;
  outline: none;
  min-height: 48px;
}
.url-bar input:focus {
  border-color: #fff;
}

.btn-go {
  border: 0;
  border-radius: 999px;
  background: var(--white);
  color: var(--black);
  font: inherit;
  font-weight: 700;
  padding: 0.95rem 1.35rem;
  cursor: pointer;
  min-height: 48px;
  -webkit-tap-highlight-color: transparent;
}
.btn-go:disabled {
  opacity: 0.55;
  cursor: wait;
}

.btn-ghost {
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: transparent;
  color: #fff;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.65rem 1rem;
  min-height: 44px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.fine {
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}
.fine.err { color: #ff8a8a; }
.fine.ok { color: #b8e0b8; }

.panel {
  background: #111;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  padding: 1.25rem 1.35rem;
  margin-bottom: 1rem;
}

.panel h2 {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

.panel .subhead {
  font-size: 0.85rem;
  color: #aaa;
  margin: 1rem 0 0.4rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.danger-panel {
  border-color: rgba(139, 30, 30, 0.55);
  background: linear-gradient(160deg, #1a1010, #100c0c);
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.pill strong { color: #fff; }
.pill span { color: #bdbdbd; font-weight: 600; }

.note {
  border-radius: 14px;
  padding: 0.85rem 1rem;
  margin-bottom: 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.note:last-child { margin-bottom: 0; }
.note.block {
  background: rgba(139, 30, 30, 0.22);
  border-color: rgba(255, 120, 120, 0.35);
}
.note.warn {
  background: rgba(180, 120, 40, 0.16);
  border-color: rgba(255, 200, 120, 0.28);
}
.note.info {
  background: rgba(255, 255, 255, 0.04);
}
.note h3 {
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}
.note p {
  color: #cfcfcf;
  font-size: 0.88rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.summary {
  color: #cfcfcf;
  font-size: 0.9rem;
}
.summary ul {
  margin: 0.4rem 0 0 1.1rem;
}
.summary li { margin: 0.2rem 0; }

.tree, .code {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.74rem;
  line-height: 1.45;
  background: #050505;
  border-radius: 12px;
  padding: 0.85rem;
  overflow: auto;
  max-height: 420px;
  white-space: pre;
  color: #d8d8d8;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.walk {
  list-style: none;
  display: grid;
  gap: 0.75rem;
}
.walk li {
  border-left: 3px solid #8b1e1e;
  padding: 0.15rem 0 0.15rem 0.85rem;
}
.walk h3 {
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
}
.walk p {
  color: #c4c4c4;
  font-size: 0.88rem;
}
.walk strong { color: #fff; }
.walk code {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.84em;
  background: rgba(255, 255, 255, 0.08);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

.panel-head-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.panel-head-row h2 { margin-bottom: 0; }

/* Overview panel (purpose + tech stack) */
.overview-panel {
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(11, 108, 255, 0.16), transparent 55%),
    #101010;
  border: 1px solid rgba(11, 108, 255, 0.25);
}
.overview-summary {
  color: #dfe6ef;
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 0.85rem;
}
.overview-meta { margin-bottom: 1rem; }
.overview-kind {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #7fb0ff;
  background: rgba(11, 108, 255, 0.14);
  border: 1px solid rgba(11, 108, 255, 0.35);
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
}
.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.tech-tag {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.78rem;
  font-weight: 500;
  color: #e8edf4;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 0.35rem 0.7rem;
}
.tech-none { color: #9aa4b2; font-style: italic; font-size: 0.9rem; }

/* Source code tabs (HTML / CSS / JS) */
.src-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.src-tabs {
  display: inline-flex;
  gap: 0.3rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 0.2rem;
}
.src-tab {
  border: 0;
  background: transparent;
  color: #9aa4b2;
  font: inherit;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  padding: 0.4rem 0.9rem;
  min-height: 36px;
  border-radius: 999px;
  cursor: pointer;
  position: relative;
  transition: background 0.15s ease, color 0.15s ease;
}
.src-tab:hover { color: #e8edf4; }
.src-tab.active {
  background: #0b6cff;
  color: #fff;
}
.src-tab.has-code::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 8px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #37d67a;
}
.src-tab.active.has-code::after { background: #fff; }

.src-pane.empty {
  color: #7c8797;
  font-style: italic;
  white-space: pre-wrap;
}
/* Let the panel background show through highlight.js tokens */
.code code.hljs,
.code code {
  background: transparent;
  padding: 0;
  display: block;
}

.customize-panel {
  background:
    linear-gradient(135deg, rgba(139, 30, 30, 0.18), transparent 40%),
    #111;
}

.customize-lead {
  color: #bdbdbd;
  margin-bottom: 0.85rem;
  font-weight: 600;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1rem;
}
.chips button {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  border-radius: 999px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.45rem 0.8rem;
  cursor: pointer;
}
.chips button:hover {
  border-color: #fff;
}

.chat {
  display: grid;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
  max-height: 360px;
  overflow: auto;
}
.msg {
  border-radius: 14px;
  padding: 0.75rem 0.9rem;
  font-size: 0.9rem;
}
.msg.user {
  background: rgba(255, 255, 255, 0.08);
}
.msg.assistant {
  background: rgba(139, 30, 30, 0.2);
  border: 1px solid rgba(255, 160, 160, 0.18);
}
.msg .who {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.65;
  margin-bottom: 0.3rem;
}
.msg pre {
  margin: 0.45rem 0 0;
  padding: 0.55rem;
  background: #000;
  border-radius: 8px;
  overflow: auto;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
}

.chat-form {
  display: grid;
  gap: 0.55rem;
}
.chat-form textarea {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font: inherit;
  padding: 0.85rem 1rem;
  resize: vertical;
  min-height: 90px;
}

.nav a.active { color: var(--accent); }

@media (max-width: 860px) {
  .dissect-main {
    width: min(100% - 1.3rem, 1100px);
    margin-top: 1rem;
  }
  .grid-2 { grid-template-columns: 1fr; }
  .url-bar { grid-template-columns: 1fr; }
  .url-bar .btn-go,
  .chat-form .btn-go {
    width: 100%;
  }
  .panel-head-row {
    flex-direction: column;
    align-items: stretch;
  }
  .panel-head-row .btn-ghost {
    width: 100%;
    justify-content: center;
    display: inline-flex;
    align-items: center;
  }
  .src-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
  }
  .src-tabs { justify-content: space-between; }
  .src-tab { flex: 1; text-align: center; }
  .chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.25rem;
    gap: 0.45rem;
  }
  .chips button {
    flex: 0 0 auto;
    white-space: nowrap;
    min-height: 44px;
    padding: 0.55rem 0.9rem;
  }
  .chat { max-height: 280px; }
  .panel { padding: 1.05rem 1.1rem; border-radius: 18px; }
  .code, .tree {
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.78rem;
  }
  .chat-form textarea { font-size: 1rem; }
}

@media (max-width: 480px) {
  .dissect-hero { padding: 1.35rem 1.15rem; border-radius: 22px; }
  .dissect-hero h1 { font-size: clamp(2rem, 11vw, 2.6rem); max-width: none; }
  .code, .tree { font-size: 0.74rem; max-height: 320px; }
}
