:root {
  --sb-red: #2f363b;
  --sb-red-dark: #15191d;
  --sb-ink: #222831;
  --sb-muted: #606975;
  --sb-line: #d8dde3;
  --sb-soft: #f5f6f8;
  --sb-table: #f0f2f5;
  --sb-link: #2b5f7f;
  --sb-width: 1440px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--sb-ink);
  background: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans KR", "Apple SD Gothic Neo", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
}

a {
  color: var(--sb-link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.topbar {
  border-top: 5px solid var(--sb-red);
  background: #fff;
  border-bottom: 1px solid var(--sb-line);
}

.topbar-inner {
  max-width: var(--sb-width);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
  color: #111;
}

.brand-logo {
  width: 36px;
  height: 36px;
  display: block;
  object-fit: contain;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 14px;
}

.nav a {
  color: #333;
}

.notice {
  background: #f3f5f6;
  border-bottom: 1px solid #d9dee2;
  color: #2f363b;
}

.notice-inner {
  max-width: var(--sb-width);
  margin: 0 auto;
  padding: 8px 24px;
  font-size: 13px;
}

.page {
  max-width: var(--sb-width);
  margin: 0 auto;
  padding: 24px;
}

.page-shell {
  max-width: var(--sb-width);
  margin: 0 auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 22px;
  overflow: visible;
}

.campaign-content {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  padding-left: 0;
  padding-right: 0;
}

.campaign-sidebar {
  position: sticky;
  top: 18px;
  align-self: start;
  height: fit-content;
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  padding: 24px 0;
}

.sidebar-block {
  border-left: 3px solid var(--sb-red);
  padding-left: 14px;
  margin-bottom: 22px;
}

.sidebar-title {
  margin-bottom: 8px;
  color: #333;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.sidebar-links {
  display: grid;
  gap: 4px;
}

.sidebar-link {
  display: block;
  padding: 7px 8px;
  border-radius: 4px;
  color: var(--sb-muted);
  font-size: 13px;
  line-height: 1.35;
}

.sidebar-link span {
  display: inline-block;
  min-width: 44px;
  color: #333;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 12px;
}

.sidebar-link:hover,
.sidebar-link.active {
  background: var(--sb-soft);
  color: var(--sb-ink);
  text-decoration: none;
}

.breadcrumbs {
  color: var(--sb-muted);
  font-size: 13px;
  margin: 6px 0 18px;
}

.breadcrumbs span {
  color: #333;
}

h1 {
  margin: 0 0 14px;
  font-size: 34px;
  line-height: 1.2;
  font-weight: 650;
}

h2 {
  margin: 34px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--sb-line);
  font-size: 24px;
  font-weight: 650;
}

h3 {
  margin: 22px 0 10px;
  font-size: 18px;
  font-weight: 650;
}

.summary {
  max-width: 900px;
  margin-bottom: 18px;
}

.campaign-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 28px;
  align-items: start;
  margin-bottom: 22px;
}

.campaign-description {
  min-width: 0;
}

.campaign-description > :last-child {
  margin-bottom: 0;
}

.meta-grid {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 8px 14px;
  width: 100%;
  margin: 4px 0 0;
  border: 1px solid var(--sb-line);
  border-top: 4px solid var(--sb-red);
  background: #fff;
  padding: 14px 16px;
  box-shadow: 0 1px 0 rgba(21, 25, 29, 0.04);
}

.meta-label {
  color: #333;
  font-weight: 650;
}

.meta-value {
  color: var(--sb-muted);
}

.tag {
  display: inline-block;
  border: 1px solid var(--sb-line);
  background: var(--sb-soft);
  padding: 2px 8px;
  border-radius: 3px;
  color: #333;
  font-size: 12px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 20px;
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  border: 1px solid var(--sb-line);
  margin-bottom: 14px;
  -webkit-overflow-scrolling: touch;
}

.table-tools {
  display: flex;
  justify-content: flex-end;
  margin: -4px 0 10px;
}

.view-switch {
  display: inline-flex;
  margin: 18px 0 20px;
  overflow: hidden;
  border: 1px solid var(--sb-line);
  border-radius: 4px;
  background: #fff;
}

.view-switch button {
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-right: 1px solid var(--sb-line);
  appearance: none;
  background: #fff;
  color: #333;
  cursor: pointer;
  font: inherit;
  font-weight: 650;
}

.view-switch button:last-child {
  border-right: 0;
}

.view-switch button.active {
  background: var(--sb-red-dark);
  color: #fff;
}

.view-panel {
  display: none;
}

.view-panel.active {
  display: block;
}

.matrix-scroll {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--sb-line);
  border-radius: 4px;
  background: var(--sb-soft);
  -webkit-overflow-scrolling: touch;
}

.attack-matrix {
  min-width: 2240px;
  display: grid;
  grid-template-columns: repeat(14, minmax(150px, 1fr));
  gap: 1px;
  background: var(--sb-line);
}

.tactic {
  min-height: 390px;
  display: flex;
  flex-direction: column;
  background: #fff;
}

.tactic-header {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  border-bottom: 1px solid var(--sb-line);
  background: var(--sb-table);
  color: #222831;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  overflow-wrap: anywhere;
  word-break: keep-all;
}

.technique-card {
  min-height: 82px;
  margin: 8px;
  padding: 10px;
  border: 1px solid var(--sb-line);
  border-radius: 4px;
  background: #fff;
  color: var(--sb-muted);
}

.technique-card.used {
  border-color: #606975;
  background: #f8fafc;
  box-shadow: inset 4px 0 0 #606975;
}

.technique-card strong {
  display: block;
  margin-bottom: 6px;
  color: #222831;
  font-size: 13px;
  line-height: 1.35;
}

.technique-card span {
  display: block;
  font-size: 12px;
  line-height: 1.45;
}

.searchbox {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--sb-muted);
  font-size: 13px;
}

.searchbox input {
  width: min(360px, 64vw);
  border: 1px solid var(--sb-line);
  border-radius: 4px;
  padding: 7px 10px;
  color: var(--sb-ink);
  font: inherit;
}

.searchbox input:focus {
  border-color: var(--sb-link);
  outline: 2px solid rgba(43, 95, 127, 0.15);
}

.wide-table table {
  min-width: 980px;
}

.medium-table table {
  min-width: 820px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--sb-line);
  vertical-align: top;
  text-align: left;
  overflow-wrap: anywhere;
}

th {
  background: var(--sb-table);
  font-weight: 650;
  color: #333;
}

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

.id-cell {
  white-space: nowrap;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 13px;
}

.placeholder {
  color: #7a828c;
  font-style: italic;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.info-grid,
.phase-grid,
.cards,
.flow,
.code-grid {
  display: grid;
  gap: 12px;
}

.info-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.phase-grid {
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  margin: 16px 0 6px;
}

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

.flow {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  margin: 16px 0 18px;
}

.code-grid {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  margin: 12px 0 18px;
}

.info-cell,
.phase-item,
.card,
.flow-step {
  border: 1px solid var(--sb-line);
  background: var(--sb-soft);
  padding: 12px;
  border-radius: 4px;
}

.info-cell b,
.phase-item b,
.flow-step b {
  display: block;
  margin-bottom: 4px;
}

.info-cell span,
.phase-item span,
.flow-step span {
  color: var(--sb-muted);
  font-size: 13px;
}

.card h3 {
  margin-top: 0;
}

.concept-banner {
  display: grid;
  gap: 4px;
  margin: 18px 0 22px;
  padding: 14px 16px;
  border-left: 4px solid var(--sb-red);
  background: var(--sb-soft);
}

.concept-banner span {
  color: var(--sb-muted);
}

.doc-link-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  margin: 22px 0 26px;
}

.doc-link-card {
  display: grid;
  gap: 8px;
  min-height: 150px;
  padding: 18px;
  border: 1px solid var(--sb-line);
  border-left: 5px solid var(--sb-link);
  border-radius: 6px;
  background: #fff;
  color: var(--sb-text);
  text-decoration: none;
  box-shadow: 0 8px 22px rgba(16, 24, 40, 0.06);
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.doc-link-card:hover,
.doc-link-card:focus-visible {
  border-color: var(--sb-link);
  box-shadow: 0 14px 30px rgba(16, 24, 40, 0.12);
  transform: translateY(-2px);
}

.doc-link-card.featured {
  border-left-color: var(--sb-red);
  background: linear-gradient(180deg, #fff, #fff7f7);
}

.doc-link-kicker {
  color: var(--sb-muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.doc-link-card strong {
  color: var(--sb-link);
  font-size: 20px;
}

.doc-link-card > span:not(.doc-link-kicker):not(.doc-link-action) {
  color: var(--sb-muted);
  line-height: 1.55;
}

.doc-link-action {
  align-self: end;
  justify-self: start;
  margin-top: 6px;
  padding: 8px 12px;
  border-radius: 4px;
  background: var(--sb-link);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}

.doc-link-card.featured .doc-link-action {
  background: var(--sb-red);
}

.technique-panel {
  margin: 12px 0;
  border: 1px solid var(--sb-line);
  border-radius: 4px;
  background: #fff;
}

.technique-panel summary {
  cursor: pointer;
  padding: 14px 16px;
  background: var(--sb-table);
  font-weight: 650;
}

.technique-panel summary::marker {
  color: var(--sb-link);
}

.technique-body {
  padding: 16px;
}

.technique-body > :first-child {
  margin-top: 0;
}

.mapping-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 14px 0;
}

.mapping-grid > div {
  border: 1px solid var(--sb-line);
  border-radius: 4px;
  background: var(--sb-soft);
  padding: 12px;
}

.mapping-grid h3 {
  margin: 0 0 6px;
  font-size: 14px;
}

.mapping-grid p {
  margin: 0;
}

pre {
  max-width: 100%;
  overflow-x: auto;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--sb-line);
  border-radius: 4px;
  background: #15191d;
  color: #f5f6f8;
  font-size: 13px;
  line-height: 1.45;
}

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

.footer {
  margin-top: 48px;
  border-top: 1px solid var(--sb-line);
  color: var(--sb-muted);
  font-size: 13px;
  padding: 18px 0 8px;
}

@media (max-width: 760px) {
  .topbar-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .page-shell {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 0 18px;
  }

  .page {
    padding: 18px;
  }

  .campaign-content {
    padding-left: 0;
    padding-right: 0;
  }

  .campaign-sidebar {
    position: static;
    padding: 18px 0 0;
  }

  .sidebar-sections {
    display: none;
  }

  h1 {
    font-size: 28px;
  }

  .meta-grid {
    width: 100%;
    margin: 16px 0 18px;
  }

    .campaign-hero,
    .meta-grid,
    .two-col,
    .info-grid,
    .phase-grid,
    .cards,
    .flow,
    .code-grid,
    .mapping-grid {
    grid-template-columns: 1fr;
  }

  .table-tools {
    justify-content: flex-start;
  }
}
