/* ================================================================
   Community Feed — Soft Dark Social App Design System
   ================================================================ */

:root {
  color-scheme: dark;

  --bg-0: #0f0f12;
  --bg-1: #16161a;
  --bg-2: #1e1e24;
  --bg-3: #26262e;
  --bg: var(--bg-0);
  --panel: var(--bg-1);
  --panel-hover: var(--bg-2);

  --ink-0: #e8e8ed;
  --ink-1: #c8c8d0;
  --ink-2: #9898a6;
  --ink-3: #6b6b78;
  --text: var(--ink-0);
  --muted: var(--ink-2);

  --accent: #5865f2;
  --accent-hover: #4752c4;
  --accent-soft: rgba(88, 101, 242, 0.15);
  --accent-border: rgba(88, 101, 242, 0.35);

  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.35);

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Cascadia Code', 'Fira Code', ui-monospace, 'Cascadia Mono', 'Segoe UI Mono', monospace;
  --code-bg: rgba(88, 101, 242, 0.12);
  --code-border: rgba(88, 101, 242, 0.22);
  --code-text: #c4c9ff;
  --sidebar-left: 240px;
  --sidebar-right: 300px;
  --app-max: 1280px;
  --mobile-nav-h: 64px;

  font-family: var(--font-sans);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  overflow-x: clip;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-1);
  background: var(--bg-0);
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover { color: #7280ff; }

img { max-width: 100%; height: auto; }

.muted { color: var(--muted); }

/* --- App Layout --- */

.app-layout {
  display: grid;
  grid-template-columns: var(--sidebar-left) minmax(0, 1fr) var(--sidebar-right);
  gap: 24px;
  max-width: var(--app-max);
  margin: 0 auto;
  padding: 20px 20px 0;
  min-height: 100vh;
  align-items: start;
}

.app-main {
  min-width: 0;
  padding-bottom: 32px;
}

.app-sidebar-left,
.app-sidebar-right {
  position: sticky;
  top: 20px;
  align-self: start;
}

/* --- Left Sidebar --- */

.sidebar-brand {
  padding: 4px 12px 20px;
}

.sidebar-brand-link {
  display: block;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.sidebar-brand-link:hover { color: var(--text); }

.sidebar-tagline {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 8px;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--ink-1);
  font-weight: 500;
  font-size: 14px;
  transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-nav-item:hover {
  background: var(--panel-hover);
  color: var(--text);
}

.sidebar-nav-item.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.sidebar-nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: 0.85;
}

.sidebar-section {
  margin-top: 24px;
  padding: 0 8px;
}

.sidebar-section-title {
  margin: 0 0 10px 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
}

.category-chips {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.category-chip {
  display: block;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--ink-1);
  font-size: 13px;
  transition: background 0.15s ease, color 0.15s ease;
}

.category-chip:hover {
  background: var(--panel-hover);
  color: var(--text);
}

.category-chip.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 500;
}

.sidebar-promo {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* --- Right Sidebar Widgets --- */

.widget-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.widget-title {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-2);
}

.widget-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.widget-list-item a {
  display: block;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--ink-1);
  font-size: 14px;
  line-height: 1.35;
  transition: background 0.15s ease;
}

.widget-list-item a:hover {
  background: var(--panel-hover);
  color: var(--text);
}

.widget-meta {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.widget-author {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--ink-1);
  transition: background 0.15s ease;
}

.widget-author:hover {
  background: var(--panel-hover);
  color: var(--text);
}

.widget-author-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-3);
}

.widget-author-initials {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}

.widget-author-info {
  min-width: 0;
}

.widget-author-name {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: inherit;
}

.widget-author-stats {
  font-size: 12px;
  color: var(--muted);
}

.ad-block {
  margin-bottom: 16px;
  min-width: 0;
}

.ad-block iframe,
.ad-block img,
.ad-block object,
.ad-block embed {
  max-width: 100%;
}

/* --- Mobile Bottom Nav --- */

.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--mobile-nav-h);
  background: var(--bg-1);
  border-top: 1px solid var(--border);
  z-index: 100;
  padding: 0 8px;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.mobile-bottom-nav-inner {
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  height: 100%;
  max-width: 480px;
  margin: 0 auto;
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: 1;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  padding: 8px 4px;
  min-width: 0;
}

.mobile-nav-item:hover,
.mobile-nav-item.active {
  color: var(--accent);
}

.mobile-nav-icon {
  width: 22px;
  height: 22px;
}

/* --- Footer --- */

.site-footer {
  margin-top: 32px;
  padding: 20px 0;
  border-top: 1px solid var(--border);
}

.site-footer p {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-link {
  font-size: 13px;
  color: var(--muted);
}

.footer-link:hover { color: var(--accent); }

/* --- Breadcrumbs --- */

.breadcrumbs {
  margin-bottom: 16px;
}

.breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 13px;
}

.breadcrumb-link {
  color: var(--muted);
}

.breadcrumb-link:hover { color: var(--accent); }

.breadcrumb-separator {
  color: var(--ink-3);
  margin: 0 2px;
}

.breadcrumb-current {
  color: var(--ink-1);
}

/* --- Feed Toolbar --- */

.feed-toolbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(15, 15, 18, 0.92);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  margin-bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.feed-toolbar-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  flex: 1;
  min-width: 120px;
}

.search-form-filter {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 180px;
  max-width: 360px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.search-input-filter {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px 14px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
}

.search-input-filter::placeholder { color: var(--ink-3); }

.search-button-filter {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s ease;
}

.search-button-filter:hover { color: var(--accent); }

.filters-divider {
  width: 1px;
  height: 24px;
  background: var(--border);
}

.filter-label {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

.filter-select {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 8px 12px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  outline: none;
}

.filter-select:focus {
  border-color: var(--accent-border);
}

.featured-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

/* --- Post List / Feed --- */

.post-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Feed Card */

.feed-card,
.post-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.feed-card:hover,
.post-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.feed-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 16px 0;
}

.feed-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-3);
}

.feed-avatar-initials {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 600;
  flex-shrink: 0;
}

.feed-author-info {
  flex: 1;
  min-width: 0;
}

.feed-author-name {
  display: block;
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}

.feed-author-name:hover { color: var(--accent); }

.feed-meta-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.feed-meta-dot::before {
  content: '·';
  margin-right: 6px;
}

.feed-card-body {
  padding: 12px 16px 0;
}

.feed-card-body h2 {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.35;
}

.feed-card-body h2 a {
  color: var(--text);
}

.feed-card-body h2 a:hover { color: var(--accent); }

.excerpt {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  margin: 0;
}

.feed-card-image-link {
  display: block;
  margin-top: 12px;
}

.feed-card-image,
.post-card-image {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  display: block;
  border-radius: var(--radius);
}

.post-card-image-link {
  display: block;
  margin: 12px 16px 0;
}

/* Engagement Bar */

.engagement-bar,
.post-card-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 12px 14px;
  border-top: 1px solid var(--border);
  margin-top: 12px;
}

.engagement-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  text-decoration: none;
  min-height: 44px;
}

.engagement-btn:hover {
  background: var(--panel-hover);
  color: var(--text);
}

.engagement-btn.liked {
  color: #f04747;
}

.read-more {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  transition: background 0.15s ease;
  margin-right: auto;
}

.read-more:hover {
  background: rgba(88, 101, 242, 0.25);
  color: var(--accent);
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  text-decoration: none;
  flex-shrink: 0;
}

.btn-icon:hover {
  background: var(--panel-hover);
  color: var(--text);
}

.like-btn-card,
.comment-btn-card {
  font-size: 18px;
  line-height: 1;
}

.like-btn-card.liked { color: #f04747; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--bg-2);
  font-size: 12px;
  color: var(--muted);
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.author-link {
  color: var(--accent);
  font-weight: 500;
}

/* --- Buttons --- */

.btn,
.btn-header,
.btn-hero,
.btn-article {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  color: #fff !important;
  text-decoration: none;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.15s ease;
  background: var(--accent);
}

.btn:hover,
.btn-header:hover,
.btn-hero:hover,
.btn-article:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  color: #fff !important;
}

.button-icon,
.button-icon-image {
  display: inline-block;
  vertical-align: middle;
}

.button-icon-image {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.button-text { display: inline-block; }

.copyable-block {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  cursor: pointer;
  transition: filter 0.15s ease;
}

.copyable-block:hover { filter: brightness(1.1); }

.copy-icon { font-size: 16px; }

/* --- Article Page --- */

.post-page-wrapper {
  display: block;
}

.post-article-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 16px;
}

.post-author-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 20px 0;
}

.post-author-header .feed-avatar,
.post-author-header .feed-avatar-initials {
  width: 52px;
  height: 52px;
  font-size: 18px;
}

.post-title {
  margin: 16px 20px 0;
  font-size: clamp(22px, 4vw, 28px);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
}

.post-meta {
  padding: 0 20px;
  margin-top: 10px;
}

.article-engagement-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-top: 16px;
}

.article-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  padding: 16px 20px;
}

.article-buttons-top { padding-top: 8px; }

.article-buttons-bottom {
  border-top: 1px solid var(--border);
}

.post-body,
.article-prose {
  padding: 20px;
  line-height: 1.75;
  color: var(--ink-1);
  font-size: 16px;
}

:is(.post-body, .article-prose) p { margin: 0 0 16px; }
:is(.post-body, .article-prose) p:last-child { margin-bottom: 0; }

:is(.post-body, .article-prose) h1,
:is(.post-body, .article-prose) h2,
:is(.post-body, .article-prose) h3,
:is(.post-body, .article-prose) h4,
:is(.post-body, .article-prose) h5,
:is(.post-body, .article-prose) h6 {
  color: var(--text);
  margin: 28px 0 12px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

:is(.post-body, .article-prose) h1:first-child,
:is(.post-body, .article-prose) h2:first-child,
:is(.post-body, .article-prose) h3:first-child { margin-top: 0; }

:is(.post-body, .article-prose) h1 { font-size: 1.75em; }
:is(.post-body, .article-prose) h2 { font-size: 1.4em; }
:is(.post-body, .article-prose) h3 { font-size: 1.2em; }
:is(.post-body, .article-prose) h4 { font-size: 1.08em; }
:is(.post-body, .article-prose) h5 { font-size: 1em; }
:is(.post-body, .article-prose) h6 {
  font-size: 0.92em;
  color: var(--ink-1);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

:is(.post-body, .article-prose) ul,
:is(.post-body, .article-prose) ol {
  margin: 12px 0 16px;
  padding-left: 24px;
}

:is(.post-body, .article-prose) li {
  margin: 6px 0;
  padding-left: 4px;
}

:is(.post-body, .article-prose) li::marker { color: var(--ink-3); }

:is(.post-body, .article-prose) ul ul,
:is(.post-body, .article-prose) ul ol,
:is(.post-body, .article-prose) ol ul,
:is(.post-body, .article-prose) ol ol {
  margin: 6px 0;
}

:is(.post-body, .article-prose) img {
  border-radius: var(--radius);
  margin: 12px 0;
}

:is(.post-body, .article-prose) a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(88, 101, 242, 0.35);
  text-underline-offset: 2px;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

:is(.post-body, .article-prose) a:hover {
  color: #7280ff;
  text-decoration-color: rgba(114, 128, 255, 0.5);
}

:is(.post-body, .article-prose) strong,
:is(.post-body, .article-prose) b {
  font-weight: 600;
  color: var(--text);
}

:is(.post-body, .article-prose) em,
:is(.post-body, .article-prose) i {
  font-style: italic;
  color: var(--ink-0);
}

:is(.post-body, .article-prose) u {
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.25);
  text-underline-offset: 2px;
}

:is(.post-body, .article-prose) s,
:is(.post-body, .article-prose) del {
  color: var(--ink-3);
  text-decoration: line-through;
  text-decoration-color: rgba(255, 255, 255, 0.2);
}

:is(.post-body, .article-prose) ins {
  text-decoration: none;
  background: rgba(88, 101, 242, 0.18);
  color: var(--text);
  padding: 1px 4px;
  border-radius: 4px;
}

:is(.post-body, .article-prose) mark {
  background: rgba(250, 204, 21, 0.18);
  color: #fde68a;
  padding: 1px 5px;
  border-radius: 4px;
}

:is(.post-body, .article-prose) sub,
:is(.post-body, .article-prose) sup {
  font-size: 0.75em;
  line-height: 0;
}

:is(.post-body, .article-prose) code,
:is(.post-body, .article-prose) .code,
:is(.post-body, .article-prose) tt,
:is(.post-body, .article-prose) samp {
  font-family: var(--font-mono);
  font-size: 0.875em;
  font-weight: 500;
  color: var(--code-text);
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  padding: 2px 7px;
  border-radius: 6px;
  word-break: break-word;
}

:is(.post-body, .article-prose) pre,
:is(.post-body, .article-prose) .codehilite,
:is(.post-body, .article-prose) .highlight {
  margin: 18px 0;
  padding: 16px 18px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

:is(.post-body, .article-prose) .codehilite pre,
:is(.post-body, .article-prose) .highlight pre {
  margin: 0;
  padding: 0;
  background: none;
  border: none;
  box-shadow: none;
}

:is(.post-body, .article-prose) pre code,
:is(.post-body, .article-prose) pre .code,
:is(.post-body, .article-prose) .codehilite code,
:is(.post-body, .article-prose) .highlight code {
  display: block;
  padding: 0;
  background: none;
  border: none;
  color: var(--ink-0);
  font-size: 0.84em;
  font-weight: 400;
  line-height: 1.65;
  white-space: pre;
  word-break: normal;
}

/* Pygments / codehilite — dark palette */
:is(.post-body, .article-prose) .codehilite .c,
:is(.post-body, .article-prose) .codehilite .cm,
:is(.post-body, .article-prose) .codehilite .c1,
:is(.post-body, .article-prose) .highlight .c,
:is(.post-body, .article-prose) .highlight .cm,
:is(.post-body, .article-prose) .highlight .c1 { color: var(--ink-3); font-style: italic; }

:is(.post-body, .article-prose) .codehilite .k,
:is(.post-body, .article-prose) .codehilite .kn,
:is(.post-body, .article-prose) .codehilite .kd,
:is(.post-body, .article-prose) .highlight .k,
:is(.post-body, .article-prose) .highlight .kn,
:is(.post-body, .article-prose) .highlight .kd { color: #c792ea; }

:is(.post-body, .article-prose) .codehilite .s,
:is(.post-body, .article-prose) .codehilite .s1,
:is(.post-body, .article-prose) .codehilite .s2,
:is(.post-body, .article-prose) .highlight .s,
:is(.post-body, .article-prose) .highlight .s1,
:is(.post-body, .article-prose) .highlight .s2 { color: #c3e88d; }

:is(.post-body, .article-prose) .codehilite .nf,
:is(.post-body, .article-prose) .codehilite .nc,
:is(.post-body, .article-prose) .highlight .nf,
:is(.post-body, .article-prose) .highlight .nc { color: #82aaff; }

:is(.post-body, .article-prose) .codehilite .mi,
:is(.post-body, .article-prose) .codehilite .mf,
:is(.post-body, .article-prose) .highlight .mi,
:is(.post-body, .article-prose) .highlight .mf { color: #f78c6c; }

:is(.post-body, .article-prose) kbd {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.82em;
  font-weight: 500;
  color: var(--ink-0);
  background: var(--bg-3);
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  padding: 2px 7px;
  border-radius: 6px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
}

:is(.post-body, .article-prose) hr {
  margin: 28px 0;
  border: none;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--border-strong) 20%,
    var(--border-strong) 80%,
    transparent
  );
}

:is(.post-body, .article-prose) blockquote {
  margin: 18px 0;
  padding: 14px 18px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--ink-1);
  font-style: italic;
}

:is(.post-body, .article-prose) blockquote p {
  margin: 0 0 10px;
}

:is(.post-body, .article-prose) blockquote p:last-child { margin-bottom: 0; }

:is(.post-body, .article-prose) blockquote cite,
:is(.post-body, .article-prose) blockquote footer {
  display: block;
  margin-top: 10px;
  font-size: 0.88em;
  font-style: normal;
  color: var(--muted);
}

:is(.post-body, .article-prose) table {
  width: 100%;
  margin: 18px 0;
  border-collapse: collapse;
  font-size: 0.94em;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

:is(.post-body, .article-prose) thead { background: var(--bg-2); }

:is(.post-body, .article-prose) th,
:is(.post-body, .article-prose) td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

:is(.post-body, .article-prose) th {
  font-weight: 600;
  color: var(--text);
  border-bottom-color: var(--border-strong);
}

:is(.post-body, .article-prose) tbody tr:last-child td { border-bottom: none; }

:is(.post-body, .article-prose) tbody tr:nth-child(even) { background: rgba(255, 255, 255, 0.02); }

:is(.post-body, .article-prose) tbody tr:hover { background: rgba(88, 101, 242, 0.06); }

:is(.post-body, .article-prose) figure {
  margin: 18px 0;
}

:is(.post-body, .article-prose) figcaption {
  margin-top: 8px;
  font-size: 0.88em;
  color: var(--muted);
  text-align: center;
}

:is(.post-body, .article-prose) video,
:is(.post-body, .article-prose) iframe {
  max-width: 100%;
  border-radius: var(--radius);
  margin: 12px 0;
}

/* Hero buttons injected into article body */
:is(.post-body, .article-prose) .hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin: 20px 0;
  padding: 14px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.prose-card :is(.post-body, .article-prose) {
  padding: 0;
}

.post-article-card :is(.post-body, .article-prose) {
  padding: 20px;
}

.post-footer-html {
  padding: 0 20px 20px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
  padding-top: 16px;
  line-height: 1.7;
  font-size: 14px;
  color: var(--muted);
}

.post-footer-html p { margin: 0 0 12px; }
.post-footer-html p:last-child { margin-bottom: 0; }

.post-footer-html strong,
.post-footer-html b {
  font-weight: 600;
  color: var(--ink-1);
}

.post-footer-html a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.post-footer-html a:hover { color: #7280ff; }

.post-footer-html code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  color: var(--code-text);
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  padding: 1px 6px;
  border-radius: 5px;
}

.similar-posts-sidebar { display: none; }

.similar-post-sidebar-card {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.similar-post-sidebar-card:last-child { border-bottom: none; }

.similar-post-sidebar-content h3 {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
}

.similar-post-sidebar-content h3 a {
  color: var(--ink-1);
}

.similar-post-sidebar-content h3 a:hover { color: var(--accent); }

.similar-post-sidebar-excerpt {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

.similar-post-sidebar-meta {
  display: flex;
  gap: 6px;
}

/* --- Comments --- */

.comments {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.comments h2 {
  margin: 0 0 20px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.comment-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.comment-bubble {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.comment-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
}

.comment-bubble-content {
  flex: 1;
  min-width: 0;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  border-top-left-radius: 4px;
  padding: 12px 14px;
}

.comment-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
}

.comment-header strong {
  font-size: 14px;
  color: var(--text);
}

.comment-header .muted {
  font-size: 12px;
}

.comment-bubble-content p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-1);
}

.comment-form h3 {
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.form-grid {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
}

.form-grid input[type="text"],
.form-grid input[type="email"],
.form-grid input[type="number"],
.form-grid textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease;
}

.form-grid input:focus,
.form-grid textarea:focus {
  border-color: var(--accent-border);
}

.form-grid textarea {
  min-height: 100px;
  resize: vertical;
}

.form-grid label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-1);
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.like-btn.liked { color: #f04747; }

/* --- Profile / Team --- */

.profile-header {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 16px;
}

.profile-cover {
  height: 120px;
  background: linear-gradient(135deg, var(--accent) 0%, #7280ff 50%, #9b59f5 100%);
}

.profile-header-body {
  padding: 0 20px 20px;
  margin-top: -40px;
  position: relative;
}

.profile-avatar-large {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 4px solid var(--panel);
  object-fit: cover;
  background: var(--bg-3);
}

.profile-avatar-initials {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 4px solid var(--panel);
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
}

.profile-name {
  margin: 12px 0 4px;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

.profile-bio {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.authors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.author-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.author-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.author-card-cover {
  height: 72px;
  background: linear-gradient(135deg, var(--accent) 0%, #7280ff 100%);
}

.author-card-body {
  padding: 0 16px 16px;
  margin-top: -28px;
  text-align: center;
}

.author-avatar {
  display: inline-block;
  margin-bottom: 8px;
}

.author-avatar .avatar-img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 3px solid var(--panel);
  object-fit: cover;
  background: var(--bg-3);
}

.author-card h2 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 600;
}

.author-card h2 a {
  color: var(--text);
}

.author-card h2 a:hover { color: var(--accent); }

.author-email {
  margin: 0 0 8px;
  font-size: 13px;
}

.author-email a { color: var(--muted); }

.author-stats { margin: 0 0 12px; }

.author-actions {
  padding-top: 4px;
}

.team-page-header {
  margin-bottom: 20px;
}

.team-page-header h1 {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

.team-page-header p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

/* --- Prose / Legal --- */

.prose-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
}

.prose-card h1 {
  margin: 0 0 20px;
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
}

/* --- Pagination --- */

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 20px 0;
}

.pagination-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.pagination-link {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--ink-1);
  font-size: 13px;
  font-weight: 500;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.pagination-link:hover {
  background: var(--panel-hover);
  border-color: var(--border-strong);
  color: var(--text);
}

.pagination-link-disabled {
  opacity: 0.4;
  pointer-events: none;
}

.pagination-info {
  font-size: 13px;
  color: var(--muted);
  padding: 0 8px;
}

/* --- 404 --- */

.page-404 {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
}

.page-404-inner {
  text-align: center;
  max-width: 420px;
  padding: 40px 24px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.page-404-eyebrow {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.page-404-title {
  margin: 0 0 12px;
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
}

.page-404-text {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.page-404-actions { display: flex; justify-content: center; }

/* --- Lazy Loading --- */

.lazy-loading-indicator {
  text-align: center;
  padding: 24px;
}

.lazy-loading-indicator p {
  margin: 0;
  font-size: 14px;
}

/* --- Share Toast --- */

.share-toast {
  position: fixed;
  bottom: calc(var(--mobile-nav-h) + 16px);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-2);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 200;
}

.share-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* --- Search Results --- */

.search-results-header {
  margin-bottom: 16px;
}

.search-results-header h1 {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

.search-query {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

.search-query strong { color: var(--text); }

/* --- Responsive --- */

@media (max-width: 1023px) {
  .app-layout {
    grid-template-columns: var(--sidebar-left) minmax(0, 1fr);
  }

  .app-sidebar-right {
    display: none;
  }
}

@media (max-width: 767px) {
  .app-layout {
    grid-template-columns: 1fr;
    padding: 12px 12px 0;
    padding-bottom: var(--mobile-nav-h);
  }

  .app-sidebar-left {
    display: none;
  }

  .mobile-bottom-nav {
    display: block;
  }

  .feed-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .search-form-filter {
    max-width: none;
  }

  .filters-divider { display: none; }

  .authors-grid {
    grid-template-columns: 1fr;
  }

  .share-toast {
    bottom: calc(var(--mobile-nav-h) + 12px);
  }

  :is(.post-body, .article-prose) {
    padding: 16px;
    font-size: 15px;
  }

  :is(.post-body, .article-prose) pre,
  :is(.post-body, .article-prose) .codehilite,
  :is(.post-body, .article-prose) .highlight {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
  }

  :is(.post-body, .article-prose) pre code,
  :is(.post-body, .article-prose) .codehilite code,
  :is(.post-body, .article-prose) .highlight code { font-size: 0.8em; }

  :is(.post-body, .article-prose) table { font-size: 0.88em; }

  :is(.post-body, .article-prose) th,
  :is(.post-body, .article-prose) td { padding: 8px 10px; }
}

/* --- Tools Page --- */

.tools-page {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.tools-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 26px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--accent-border);
  background:
    radial-gradient(ellipse at top right, rgba(88, 101, 242, 0.22), transparent 55%),
    linear-gradient(135deg, var(--bg-1), var(--bg-2));
}

.tools-eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.tools-hero h1 {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.tools-hero-desc {
  margin: 0;
  max-width: 52ch;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.tools-ip-chip {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-strong);
}

.tools-ip-chip-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-2);
}

.tools-ip-chip code {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.02em;
}

.tools-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.tools-nav {
  position: sticky;
  top: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 14px;
  border-radius: var(--radius-lg);
  background: var(--panel);
  border: 1px solid var(--border);
}

.tools-nav-label {
  margin: 0 0 6px 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.tools-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-1);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.tools-nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.7;
}

.tools-nav-item:hover {
  background: var(--bg-2);
  color: var(--text);
}

.tools-nav-item.is-active {
  background: var(--accent-soft);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--accent-border);
}

.tools-nav-item.is-active svg {
  opacity: 1;
  color: var(--accent);
}

.tools-panels {
  min-width: 0;
}

.tools-panel {
  padding: 26px;
  border-radius: var(--radius-lg);
  background: var(--panel);
  border: 1px solid var(--border);
  animation: tools-fade-in 0.2s ease;
}

@keyframes tools-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.tools-panel-head {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.tools-panel-head h2 {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
}

.tools-panel-head p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
}

.tools-panel-toolbar {
  margin-bottom: 16px;
}

.tools-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.tools-form-inline {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}

.tools-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.tools-field-grow {
  flex: 1 1 200px;
}

.tools-field-sm {
  flex: 0 0 110px;
}

.tools-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
}

.tools-input {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-2);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tools-input:focus {
  outline: none;
  border-color: var(--accent-border);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.tools-run-inline {
  flex-shrink: 0;
  margin-bottom: 1px;
}

.tools-callout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 14px;
}

.tools-callout-info {
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--ink-1);
}

.tools-callout code {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.tools-result {
  min-height: 48px;
}

.tools-result.is-loading,
.tools-result.is-success,
.tools-result.is-warning,
.tools-result.is-error {
  padding: 16px;
  border-radius: var(--radius);
  background: var(--bg-2);
  border: 1px solid var(--border);
}

.tools-result.is-success { border-color: rgba(76, 175, 80, 0.35); }
.tools-result.is-warning { border-color: rgba(255, 193, 7, 0.35); }
.tools-result.is-error { border-color: rgba(244, 67, 54, 0.35); color: #ff8a80; }
.tools-result.is-loading { border-color: var(--border); }

.tools-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.tools-loading::before {
  content: "";
  width: 16px;
  height: 16px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: tools-spin 0.7s linear infinite;
}

@keyframes tools-spin {
  to { transform: rotate(360deg); }
}

.tools-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.tools-stat {
  padding: 16px;
  border-radius: var(--radius);
  background: var(--bg-0);
  border: 1px solid var(--border);
  text-align: center;
}

.tools-stat-value {
  display: block;
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
}

.tools-stat-unit {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

.tools-stat-label {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-2);
}

.tools-kv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.tools-kv {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-0);
  border: 1px solid var(--border);
}

.tools-kv span {
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-3);
}

.tools-kv strong {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  word-break: break-word;
}

.tools-kv-wide {
  grid-column: 1 / -1;
}

.tools-progress {
  margin-bottom: 16px;
}

.tools-progress-bar {
  height: 8px;
  background: var(--bg-0);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.tools-progress-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), #7280ff);
  border-radius: 999px;
  transition: width 0.25s ease;
}

.tools-progress-label {
  margin: 8px 0 0;
  font-size: 13px;
  text-align: center;
}

.network-scan-summary {
  margin: 0 0 12px;
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
}

.network-scan-safe {
  margin: 0;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: rgba(76, 175, 80, 0.12);
  border: 1px solid rgba(76, 175, 80, 0.3);
  color: #81c784;
  font-size: 14px;
}

.risk-port-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.risk-port-item {
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-left-width: 4px;
}

.risk-port-item.risk-severity-critical { border-left-color: #f44336; }
.risk-port-item.risk-severity-high { border-left-color: #ff9800; }
.risk-port-item.risk-severity-medium { border-left-color: #ffc107; }
.risk-port-item.risk-severity-low { border-left-color: #8bc34a; }

.risk-port-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.risk-port-title {
  color: var(--text);
  font-size: 14px;
}

.risk-severity-badge {
  flex-shrink: 0;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.risk-severity-critical .risk-severity-badge {
  background: rgba(244, 67, 54, 0.18);
  color: #ff8a80;
}

.risk-severity-high .risk-severity-badge {
  background: rgba(255, 152, 0, 0.18);
  color: #ffcc80;
}

.risk-severity-medium .risk-severity-badge {
  background: rgba(255, 193, 7, 0.18);
  color: #ffe082;
}

.risk-severity-low .risk-severity-badge {
  background: rgba(139, 195, 74, 0.18);
  color: #c5e1a5;
}

.risk-port-meta {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--muted);
}

.risk-port-label {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-2);
}

.risk-port-text {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-1);
}

.risk-port-text:last-child {
  margin-bottom: 0;
}

@media (max-width: 900px) {
  .tools-hero {
    flex-direction: column;
    padding: 20px;
  }

  .tools-ip-chip {
    align-items: flex-start;
    width: 100%;
  }

  .tools-shell {
    grid-template-columns: 1fr;
  }

  .tools-nav {
    position: static;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 8px;
    padding: 10px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .tools-nav::-webkit-scrollbar {
    display: none;
  }

  .tools-nav-group {
    display: contents;
  }

  .tools-nav-label {
    display: none;
  }

  .tools-nav-item {
    flex: 0 0 auto;
    width: auto;
    white-space: nowrap;
    padding: 9px 14px;
  }

  .tools-panel {
    padding: 18px;
  }

  .tools-form-inline {
    flex-direction: column;
    align-items: stretch;
  }

  .tools-field-sm {
    flex: 1 1 auto;
  }

  .tools-run-inline {
    width: 100%;
  }

  .tools-kv-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }

  html { scroll-behavior: auto; }
}
