/* ========================================================================
   PNA Digital — SEO Deployment Report (Phase 0–5 + Round 1–2 audit fixes)
   styles.css
   ======================================================================== */

:root {
  --bg: #0d1117;
  --bg-elev: #161b22;
  --bg-elev-2: #1c2128;
  --border: #30363d;
  --border-soft: #21262d;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --text-soft: #b1bac4;

  /* PNA brand red */
  --brand: #ef4235;
  --brand-hover: #ff6358;
  --brand-soft: rgba(239, 66, 53, 0.15);
  --brand-border: rgba(239, 66, 53, 0.4);

  --accent: #58a6ff;
  --accent-hover: #79b8ff;
  --success: #3fb950;
  --warning: #d29922;
  --danger: #f85149;
  --critical: #ff6b6b;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --radius: 8px;
  --radius-sm: 4px;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Sarabun",
    "Noto Sans Thai", "IBM Plex Sans Thai", Tahoma, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "Cascadia Code", "Roboto Mono",
    Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  font-size: 17px;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a {
  color: var(--accent);
  text-decoration: none;
  transition: color .15s ease;
}
a:hover { color: var(--accent-hover); text-decoration: underline; }
code, pre, kbd { font-family: var(--font-mono); font-size: .92em; }

/* ============ Icon system (Lucide-style inline SVG) ============ */
.icon {
  display: inline-block;
  width: 1.15em;
  height: 1.15em;
  vertical-align: -0.18em;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.icon-lg { width: 1.5em; height: 1.5em; vertical-align: -0.28em; }
.icon-xl { width: 1.85em; height: 1.85em; vertical-align: -0.35em; }
.icon-2xl { width: 2.4em; height: 2.4em; vertical-align: middle; }
.icon-crit { color: var(--danger); }
.icon-high { color: var(--warning); }
.icon-med  { color: var(--accent); }
.icon-low  { color: var(--text-muted); }
.icon-brand { color: var(--brand); }
.icon-success { color: var(--success); }

/* ============ Layout ============ */
.layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}
.sidebar {
  background: var(--bg-elev);
  border-right: 1px solid var(--border);
  padding: 28px 20px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar h1 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text);
}
.sidebar .brand-mark {
  display: inline-block;
  width: 10px; height: 10px;
  background: var(--brand);
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
  box-shadow: 0 0 8px rgba(239,66,53,.5);
}
.sidebar .subtitle {
  font-size: .82rem;
  color: var(--text-muted);
  margin-bottom: 28px;
}
.sidebar nav ul { list-style: none; }
.sidebar nav li { margin: 2px 0; }
.sidebar nav a {
  display: block;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-soft);
  font-size: .9rem;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: all .15s ease;
}
.sidebar nav a:hover {
  background: var(--bg-elev-2);
  color: var(--text);
  text-decoration: none;
}
.sidebar nav a.active {
  background: var(--bg-elev-2);
  color: var(--brand);
  border-left-color: var(--brand);
}
.sidebar nav .nav-section {
  text-transform: uppercase;
  font-size: .7rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: .08em;
  padding: 18px 12px 6px;
}
.main {
  padding: 48px 64px 120px;
  max-width: 1100px;
}

/* ============ Hero ============ */
.hero {
  background: linear-gradient(135deg, #0d1117 0%, #2a1212 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 32px;
  margin-bottom: 36px;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  inset: auto -40px -40px auto;
  width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(239,66,53,.18), transparent 70%);
  pointer-events: none;
}
.hero .badge {
  display: inline-block;
  background: rgba(63,185,80,.15);
  color: var(--success);
  border: 1px solid rgba(63,185,80,.4);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
  margin-bottom: 12px;
}
.hero .badge.brand {
  background: var(--brand-soft);
  color: var(--brand);
  border-color: var(--brand-border);
}
.hero h1 {
  font-size: 1.85rem;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -.01em;
}
.hero p {
  color: var(--text-soft);
  font-size: 1rem;
  max-width: 760px;
}
.hero .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 18px;
  font-size: .85rem;
  color: var(--text-muted);
}
.hero .meta span strong { color: var(--text); }

/* ============ Section ============ */
section {
  margin-bottom: 64px;
  scroll-margin-top: 24px;
}
section h2 {
  font-size: 1.65rem;
  font-weight: 700;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--brand);
  display: inline-block;
  padding-right: 24px;
  letter-spacing: -.01em;
}
section h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 32px 0 14px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}
section h3::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 18px;
  background: var(--brand);
  border-radius: 2px;
  flex-shrink: 0;
}
section p {
  color: var(--text-soft);
  margin-bottom: 14px;
  font-size: 1rem;
}
section ul, section ol {
  padding-left: 28px;
  margin-bottom: 14px;
}
section li {
  color: var(--text-soft);
  margin-bottom: 8px;
  font-size: .98rem;
}

/* Group divider for issue cards */
.group-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 40px 0 18px;
  padding: 14px 18px;
  background: linear-gradient(90deg, var(--bg-elev) 0%, transparent 100%);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius-sm);
}
.group-header:first-of-type {
  margin-top: 24px;
}
.group-header .group-icon {
  font-size: 1.8rem;
  line-height: 1;
  flex-shrink: 0;
}
.group-header .group-title-block {
  flex: 1;
}
.group-header h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0;
  color: var(--text);
  display: block;
}
.group-header h3::before {
  display: none;
}
.group-header .group-subtitle {
  display: block;
  font-size: .88rem;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 500;
}
.group-header .group-count {
  background: var(--brand);
  color: #fff;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* Quick-nav cards */
.quick-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 22px 0 36px;
}
.quick-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  transition: all .15s ease;
}
.quick-nav a:hover {
  background: var(--bg-elev-2);
  border-color: var(--brand);
  transform: translateY(-2px);
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(239, 66, 53, 0.15);
}
.quick-nav .qn-icon {
  font-size: 1.6rem;
  line-height: 1;
  flex-shrink: 0;
}
.quick-nav .qn-text {
  flex: 1;
  min-width: 0;
}
.quick-nav .qn-title {
  display: block;
  font-weight: 600;
  font-size: .95rem;
  color: var(--text);
}
.quick-nav .qn-meta {
  display: block;
  font-size: .8rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.quick-nav a:hover .qn-title {
  color: var(--brand-hover);
}

/* Back to top button */
.back-to-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(239, 66, 53, 0.4);
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
  transition: opacity .25s ease, transform .25s ease, background .15s ease;
  z-index: 100;
}
.back-to-top.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.back-to-top:hover {
  background: var(--brand-hover);
  transform: translateY(-2px);
}

/* TLDR / Summary banner */
.tldr {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: start;
  margin: 24px 0 28px;
  padding: 22px 26px;
  background: linear-gradient(135deg, rgba(239,66,53,.08) 0%, rgba(239,66,53,.02) 100%);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius);
}
.tldr .tldr-icon {
  font-size: 2rem;
  line-height: 1;
}
.tldr .tldr-title {
  display: block;
  color: var(--brand);
  font-weight: 700;
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 6px;
}
.tldr p {
  margin: 0;
  color: var(--text);
  font-size: 1.02rem;
  line-height: 1.7;
}

/* ============ Callouts ============ */
.callout {
  border-left: 4px solid var(--accent);
  background: var(--bg-elev);
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin: 16px 0;
}
.callout strong { display: block; margin-bottom: 4px; color: var(--text); }
.callout.warning { border-left-color: var(--warning); }
.callout.warning strong { color: var(--warning); }
.callout.danger { border-left-color: var(--danger); }
.callout.danger strong { color: var(--danger); }
.callout.success { border-left-color: var(--success); }
.callout.success strong { color: var(--success); }
.callout.brand { border-left-color: var(--brand); }
.callout.brand strong { color: var(--brand); }

/* ============ Code block ============ */
.code-block {
  position: relative;
  background: #010409;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin: 12px 0;
  overflow-x: auto;
}
.code-block pre {
  font-family: var(--font-mono);
  color: #e6edf3;
  font-size: .88rem;
  line-height: 1.5;
  white-space: pre;
}
.code-block .copy-btn {
  position: absolute;
  top: 8px; right: 8px;
  background: var(--bg-elev-2);
  color: var(--text-soft);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: .75rem;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: all .15s ease;
}
.code-block .copy-btn:hover {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}
.code-block .copy-btn.copied {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}
code.inline {
  background: var(--bg-elev-2);
  color: var(--brand-hover);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: .88em;
  border: 1px solid var(--border-soft);
}

/* ============ File list / table ============ */
.file-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.file-toolbar input[type=search] {
  flex: 1;
  min-width: 240px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: .9rem;
}
.file-toolbar input[type=search]:focus {
  border-color: var(--brand);
  outline: none;
}
.filter-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.chip {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text-soft);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: .78rem;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: all .15s ease;
}
.chip:hover { color: var(--text); border-color: var(--brand-border); }
.chip.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

table.files {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  font-size: .9rem;
}
table.files thead { background: var(--bg-elev-2); }
table.files th {
  text-align: left;
  padding: 10px 14px;
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
table.files td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text-soft);
  vertical-align: middle;
}
table.files tr:last-child td { border-bottom: none; }
table.files tr:hover td { background: rgba(239,66,53,.04); }
table.files .path {
  font-family: var(--font-mono);
  font-size: .85rem;
  color: var(--text);
  word-break: break-all;
}
table.files .size {
  color: var(--text-muted);
  font-size: .85rem;
  white-space: nowrap;
}

/* ============ Download buttons ============ */
.dl-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-elev-2);
  color: var(--brand-hover);
  border: 1px solid var(--border);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: .78rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: all .15s ease;
}
.dl-btn:hover {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
  text-decoration: none;
}
.dl-btn-inline {
  font-family: var(--font-mono);
  font-size: .76rem;
  padding: 4px 8px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dl-btn-large {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--brand) 0%, #b8281d 100%);
  color: #fff;
  border: none;
  padding: 14px 26px;
  border-radius: var(--radius);
  font-size: .98rem;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(239,66,53,.35);
  transition: all .2s ease;
}
.dl-btn-large:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(239,66,53,.55);
  color: #fff;
  text-decoration: none;
}
.dl-btn-large .icon { font-size: 1.2em; }
.dl-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin: 22px 0 6px;
}
.dl-meta {
  font-size: .85rem;
  color: var(--text-muted);
}
.dl-meta strong { color: var(--text); }

/* ============ Status pills ============ */
.pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .03em;
  white-space: nowrap;
}
.pill.modified { background: rgba(210,153,34,.18); color: var(--warning); border: 1px solid rgba(210,153,34,.35); }
.pill.added    { background: rgba(63,185,80,.18);  color: var(--success); border: 1px solid rgba(63,185,80,.35); }
.pill.deleted  { background: rgba(248,81,73,.18);  color: var(--danger);  border: 1px solid rgba(248,81,73,.35); }
.pill.sql      { background: rgba(88,166,255,.18); color: var(--accent);  border: 1px solid rgba(88,166,255,.35); }
.pill.doc      { background: rgba(177,154,255,.18); color: #b19aff;       border: 1px solid rgba(177,154,255,.35); }

/* ============ Plain-language issue ============ */
.plain-issue {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 28px;
  margin: 18px 0;
  position: relative;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.plain-issue:hover {
  border-color: var(--brand-border);
  box-shadow: 0 4px 14px rgba(0,0,0,.2);
}
.plain-issue .pi-explain {
  font-size: 1rem !important;
  line-height: 1.75 !important;
}
.plain-issue .pi-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.plain-issue .pi-num {
  flex-shrink: 0;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand) 0%, #b8281d 100%);
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(239,66,53,.4);
}
.plain-issue .pi-title-block { flex: 1; min-width: 220px; }
.plain-issue h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--text);
}
.plain-issue .pi-tag {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  margin-right: 6px;
}
.plain-issue .pi-tag.crit { background: rgba(248,81,73,.18); color: var(--danger); }
.plain-issue .pi-tag.high { background: rgba(210,153,34,.18); color: var(--warning); }
.plain-issue .pi-tag.med  { background: rgba(88,166,255,.18); color: var(--accent); }
.plain-issue .pi-tag.kw   { background: var(--brand-soft);    color: var(--brand);  border: 1px solid var(--brand-border); }
.plain-issue .pi-ref {
  font-size: .76rem;
  color: var(--text-muted);
}
.plain-issue .pi-explain {
  color: var(--text-soft);
  margin-bottom: 14px;
  font-size: .95rem;
}
.plain-issue .pi-analogy {
  background: rgba(239,66,53,.07);
  border-left: 3px solid var(--brand);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin: 12px 0;
  font-size: .92rem;
  color: var(--text-soft);
}
.plain-issue .pi-analogy strong {
  color: var(--brand);
  display: block;
  margin-bottom: 3px;
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.before-after {
  display: grid;
  grid-template-columns: 1fr 40px 1fr;
  gap: 0;
  margin: 14px 0;
  align-items: stretch;
}
.before-after .ba-box {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: .88rem;
  line-height: 1.5;
}
.before-after .ba-before {
  background: rgba(248,81,73,.08);
  border: 1px solid rgba(248,81,73,.3);
  color: var(--text-soft);
}
.before-after .ba-after {
  background: rgba(63,185,80,.08);
  border: 1px solid rgba(63,185,80,.3);
  color: var(--text-soft);
}
.before-after .ba-label {
  display: block;
  font-size: .72rem;
  font-weight: 700;
  margin-bottom: 4px;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.before-after .ba-before .ba-label { color: var(--danger); }
.before-after .ba-after .ba-label { color: var(--success); }
.before-after .ba-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: var(--brand);
  font-weight: 700;
}
.before-after code,
.plain-issue code {
  background: var(--bg-elev-2);
  padding: 1px 5px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: .85em;
  color: var(--brand-hover);
  border: 1px solid var(--border-soft);
}
.pi-impact {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .88rem;
  color: var(--text-muted);
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}
.pi-impact strong { color: var(--text); }
@media (max-width: 700px) {
  .before-after { grid-template-columns: 1fr; }
  .before-after .ba-arrow {
    transform: rotate(90deg);
    padding: 4px 0;
  }
}

/* ============ Stats grid ============ */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin: 24px 0 32px;
}
.stat {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  position: relative;
  transition: transform .15s ease, border-color .15s ease;
}
.stat:hover {
  transform: translateY(-2px);
  border-color: var(--brand-border);
}
.stat .num {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.05;
  letter-spacing: -.02em;
}
.stat .num.brand { color: var(--brand); }
.stat .label {
  font-size: .8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-top: 8px;
  font-weight: 600;
}

/* ============ Phase timeline ============ */
.timeline {
  position: relative;
  padding-left: 28px;
  margin: 16px 0 24px;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 4px; bottom: 4px;
  width: 2px;
  background: var(--border);
}
.timeline .step {
  position: relative;
  padding: 10px 14px 10px 20px;
  margin-bottom: 12px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.timeline .step::before {
  content: "";
  position: absolute;
  left: -23px;
  top: 16px;
  width: 16px; height: 16px;
  background: var(--brand);
  border: 3px solid var(--bg);
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--brand-border);
}
.timeline .step.done::before {
  background: var(--success);
  box-shadow: 0 0 0 2px rgba(63,185,80,.3);
}
.timeline .step.pending::before {
  background: var(--warning);
  box-shadow: 0 0 0 2px rgba(210,153,34,.3);
}
.timeline .step-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.timeline .step h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
.timeline .step .step-tag {
  font-size: .72rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
}
.timeline .step.done .step-tag { background: rgba(63,185,80,.18); color: var(--success); }
.timeline .step.pending .step-tag { background: rgba(210,153,34,.18); color: var(--warning); }
.timeline .step p {
  margin: 6px 0 0;
  font-size: .9rem;
  color: var(--text-soft);
}

/* ============ Keyword table ============ */
.kw-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  font-size: .9rem;
  margin: 14px 0;
}
.kw-table thead { background: var(--bg-elev-2); }
.kw-table th {
  text-align: left;
  padding: 10px 14px;
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.kw-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text-soft);
  vertical-align: top;
  line-height: 1.55;
}
.kw-table tr:last-child td { border-bottom: none; }
.kw-table tr:hover td { background: rgba(239,66,53,.04); }
.kw-table .kw-name {
  display: inline-block;
  background: rgba(63,185,80,.15);
  color: var(--success);
  padding: 3px 9px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: .85rem;
  border: 1px solid rgba(63,185,80,.35);
  margin: 2px 4px 2px 0;
}
.kw-table .page-link {
  font-family: var(--font-mono);
  font-size: .82rem;
  color: var(--brand-hover);
  word-break: break-all;
}
.kw-table .score-badge {
  display: inline-block;
  background: rgba(210,153,34,.15);
  color: var(--warning);
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 700;
  font-size: .78rem;
  border: 1px solid rgba(210,153,34,.35);
  white-space: nowrap;
}
.kw-table .score-badge.high { background: rgba(248,81,73,.15); color: var(--danger); border-color: rgba(248,81,73,.35); }
.kw-table .score-badge.low  { background: rgba(63,185,80,.15); color: var(--success); border-color: rgba(63,185,80,.35); }

/* ============ Issue cards (grid) ============ */
.issues {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
  margin: 16px 0;
}
.issue-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  transition: transform .15s ease, box-shadow .15s ease;
}
.issue-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--brand-border);
}
.issue-card .issue-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.issue-card .issue-tag {
  font-size: .72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}
.issue-card .issue-tag.crit { background: rgba(248,81,73,.18); color: var(--danger); }
.issue-card .issue-tag.high { background: rgba(210,153,34,.18); color: var(--warning); }
.issue-card .issue-tag.med  { background: rgba(88,166,255,.18); color: var(--accent); }
.issue-card .issue-tag.low  { background: rgba(139,148,158,.18); color: var(--text-muted); }
.issue-card h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}
.issue-card p {
  font-size: .88rem;
  color: var(--text-muted);
  margin: 0;
}
.issue-card .files-hint {
  font-family: var(--font-mono);
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: 8px;
  background: var(--bg-elev-2);
  padding: 4px 8px;
  border-radius: 3px;
  border: 1px solid var(--border-soft);
}

/* ============ kbd / footer ============ */
.kbd {
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 3px;
  padding: 1px 6px;
  font-family: var(--font-mono);
  font-size: .82em;
  color: var(--text);
}
footer {
  margin-top: 60px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: .85rem;
}
footer a { color: var(--text-soft); }

/* ============ Mobile ============ */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: relative;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .main { padding: 24px 18px 60px; }
  .hero { padding: 22px 18px; }
  .hero h1 { font-size: 1.4rem; }
}
