/* MBBEasy -- Unified Styles ("Dark Luxury / Technical" Design) */

/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/assets/fonts/DMSans-Variable.woff2) format('woff2');
}
@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/assets/fonts/SourceSerif4-Variable.woff2) format('woff2');
}

/* === Design Tokens === */
:root {
  --bg: #09090b; /* zinc-950 */
  --surface: #18181b; /* zinc-900 */
  --surface-hover: #27272a; /* zinc-800 */
  --border: #27272a;
  --border-hover: #3f3f46; /* zinc-700 */

  --accent: #38bdf8; /* sky-400 */
  --accent-dim: rgba(56, 189, 248, 0.1);
  --accent-hover: #7dd3fc; /* sky-300 */

  --pearl: #fbbf24; /* amber-400 */
  --pearl-dim: rgba(251, 191, 36, 0.1);

  --correct: #34d399; /* emerald-400 */
  --correct-dim: rgba(52, 211, 153, 0.1);
  --incorrect: #f87171; /* red-400 */
  --incorrect-dim: rgba(248, 113, 113, 0.1);

  --text: #f4f4f5; /* zinc-100 */
  --text-secondary: #a1a1aa; /* zinc-400 */
  --text-muted: #71717a; /* zinc-500 */

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.5);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.5);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 24px;
  --radius-full: 9999px;

  --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* === Base === */
html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  background: var(--bg); color: var(--text);
  line-height: 1.6; min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4 {
  font-family: 'Source Serif 4', Georgia, serif;
  line-height: 1.2;
  color: var(--text);
}
h1 { font-size: 2.5rem; font-weight: 400; letter-spacing: -0.02em; }
h2 { font-size: 1.75rem; font-weight: 400; letter-spacing: -0.01em; }
h3 { font-size: 1.25rem; font-weight: 400; }
a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }

.container { max-width: 800px; margin: 0 auto; padding: 0 24px; }

/* === Nav (sticky glass) === */
.nav {
  position: sticky; top: 0; z-index: 100;
  padding: 20px 0;
  background: rgba(9, 9, 11, 0.8);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.nav .container { display: flex; justify-content: space-between; align-items: center; }
.nav-logo {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.25rem; font-weight: 700;
  color: var(--text); text-decoration: none;
  letter-spacing: -0.02em;
}
.nav-logo:hover { color: var(--accent); }
.nav-links { display: flex; gap: 24px; }
.nav-links a {
  font-size: 0.875rem; color: var(--text-secondary);
  font-weight: 500;
  transition: color var(--transition);
}
.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--text); }

/* === Footer === */
.site-footer {
  padding: 48px 0; margin-top: 64px;
  border-top: 1px solid var(--border);
  text-align: center; font-size: 0.875rem; color: var(--text-muted);
}

/* === Buttons (all states) === */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--radius-full);
  font: inherit; font-size: 0.875rem; font-weight: 500;
  border: 1px solid transparent; cursor: pointer; min-height: 40px;
  transition: all var(--transition);
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:disabled:active { transform: none; }
.btn-primary {
  background: var(--text); color: var(--bg);
}
.btn-primary:hover {
  background: #d4d4d8; /* zinc-300 */
  box-shadow: 0 0 20px rgba(255,255,255,0.1);
}
.btn-primary:focus-visible {
  outline: 2px solid var(--text); outline-offset: 2px;
}
.btn-secondary {
  background: transparent; color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--surface); border-color: var(--border-hover); }
.btn-sm { padding: 6px 16px; font-size: 0.8125rem; min-height: 32px; }

/* === Tags === */
.tag {
  display: inline-flex; align-items: center; padding: 2px 10px; border-radius: var(--radius-full);
  font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.02em; text-transform: uppercase;
}
.tag-gold { background: var(--pearl-dim); color: var(--pearl); border: 1px solid rgba(251, 191, 36, 0.2); }
.tag-blue { background: var(--accent-dim); color: var(--accent); border: 1px solid rgba(56, 189, 248, 0.2); }
.tag-muted { background: var(--surface); color: var(--text-secondary); border: 1px solid var(--border); }

/* === Landing: Hero === */
.hero {
  padding: 100px 0 64px; text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; top: -100px; left: 50%; transform: translateX(-50%);
  width: 600px; height: 400px; background: radial-gradient(circle, rgba(56, 189, 248, 0.05) 0%, transparent 70%);
  pointer-events: none; z-index: -1;
}
.hero-content {
  position: relative;
  z-index: 1;
}
.hero-eyebrow {
  font-size: 0.75rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--accent); margin-bottom: 24px;
  display: inline-block; padding: 4px 12px;
  border-radius: var(--radius-full); background: var(--accent-dim);
}
.hero-title {
  font-size: 4rem; font-weight: 400;
  line-height: 1.1; margin-bottom: 24px;
}
.hero-sub {
  color: var(--text-secondary); font-size: 1.125rem;
  max-width: 480px; margin: 0 auto; line-height: 1.6;
}

/* === Landing: Tool Cards === */
.tool-cards { display: grid; gap: 24px; margin: 64px 0; }
.tool-card {
  display: block; padding: 32px; border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--border);
  text-decoration: none; color: inherit;
  transition: all var(--transition);
  position: relative; overflow: hidden;
}
.tool-card::before {
  content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background: linear-gradient(180deg, rgba(255,255,255,0.03) 0%, transparent 100%);
  opacity: 0; transition: opacity var(--transition);
}
.tool-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.tool-card:hover::before { opacity: 1; }
.tool-card-number {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.5rem; font-weight: 400; font-style: italic;
  color: var(--text-muted); margin-bottom: 16px;
}
.tool-card h3 { margin-bottom: 12px; font-size: 1.5rem; }
.tool-card p { color: var(--text-secondary); font-size: 1rem; margin: 0; line-height: 1.6; }
.tool-card-action {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 24px; font-size: 0.875rem; font-weight: 500;
  color: var(--text);
  transition: gap var(--transition);
}
.tool-card:hover .tool-card-action { gap: 12px; color: var(--accent); }

/* Card stagger animation */
@media (prefers-reduced-motion: no-preference) {
  @keyframes card-enter {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .tool-card {
    opacity: 0; transform: translateY(20px);
    animation: card-enter 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  }
  .tool-card:nth-child(1) { animation-delay: 0.1s; }
  .tool-card:nth-child(2) { animation-delay: 0.2s; }
  .tool-card:nth-child(3) { animation-delay: 0.3s; }
}

/* === System buttons (practicals + theory) === */
.system-btns { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0; }
.system-btn {
  padding: 8px 16px; border-radius: var(--radius-full);
  font: inherit; font-size: 0.875rem; font-weight: 500; cursor: pointer;
  background: transparent; color: var(--text-secondary);
  border: 1px solid var(--border);
  transition: all var(--transition);
}
.system-btn:hover { border-color: var(--border-hover); color: var(--text); background: var(--surface); }
.system-btn.active { background: var(--text); border-color: var(--text); color: var(--bg); }

/* === Case accordion (practicals) === */
details.case { margin-bottom: 16px; border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--border); background: var(--surface); }
details.case summary {
  padding: 20px 24px; cursor: pointer;
  font-weight: 500; font-size: 1.0625rem; list-style: none;
  display: flex; align-items: center; justify-content: space-between;
  transition: background var(--transition);
}
details.case summary:hover { background: var(--surface-hover); }
details.case summary::-webkit-details-marker { display: none; }
details.case summary::after { content: '+'; color: var(--text-muted); font-weight: 400; font-size: 1.25rem; transition: transform var(--transition); }
details.case[open] summary::after { content: '\2212'; transform: rotate(180deg); }
details.case[open] summary { border-bottom: 1px solid var(--border); }
details.case .case-body {
  padding: 24px; background: var(--bg);
}
@media (prefers-reduced-motion: no-preference) {
  details.case .case-body { animation: slide-down 0.3s cubic-bezier(0.2, 0.8, 0.2, 1); }
  @keyframes slide-down { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
}
details.case .case-body h4 {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 0.875rem; font-weight: 600; color: var(--accent);
  margin: 24px 0 8px; text-transform: uppercase; letter-spacing: 0.05em;
}
details.case .case-body h4:first-child { margin-top: 0; }
details.case .case-body p, details.case .case-body li {
  font-size: 0.9375rem; color: var(--text-secondary); line-height: 1.7; margin-bottom: 8px;
}
details.case .case-body ul { padding-left: 24px; margin-bottom: 16px; }

/* === Flashcard (theory) === */
.flashcard {
  padding: 24px; border-radius: var(--radius-md);
  background: var(--surface); border: 1px solid var(--border);
  margin-bottom: 16px; transition: border-color var(--transition);
}
.flashcard:hover { border-color: var(--border-hover); }
.flashcard-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.flashcard-question { flex: 1; font-size: 1.0625rem; font-weight: 400; line-height: 1.5; }
.flashcard-meta { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.flashcard-toggle {
  font: inherit; font-size: 0.8125rem; font-weight: 500; cursor: pointer;
  background: transparent; color: var(--text-secondary);
  border: 1px solid var(--border); border-radius: var(--radius-full);
  padding: 4px 12px; transition: all var(--transition);
}
.flashcard-toggle:hover { color: var(--text); border-color: var(--border-hover); background: var(--surface-hover); }
.flashcard-answer {
  display: none; margin-top: 20px; padding-top: 20px;
  border-top: 1px solid var(--border);
  color: var(--text-secondary); font-size: 0.9375rem; line-height: 1.7;
}
@media (prefers-reduced-motion: no-preference) {
  .flashcard-answer.visible { animation: fade-in 0.3s ease; }
  @keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
}
.flashcard-answer.visible { display: block; }
.flashcard-topic { margin-top: 12px; font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.flashcard-group { margin-bottom: 32px; }
.flashcard-group-header {
  display: flex; align-items: center; gap: 12px; cursor: pointer;
  padding: 12px 0; margin-bottom: 16px; border-bottom: 1px solid var(--border);
}
.flashcard-group-header h3 { flex: 1; font-size: 1.5rem; }
.group-count { font-size: 0.875rem; color: var(--text-muted); }
.group-chevron { font-size: 0.75rem; color: var(--text-muted); transition: transform var(--transition); }
.flashcard-group.collapsed .flashcard-group-cards { display: none; }
.flashcard-group.collapsed .group-chevron { transform: rotate(-90deg); }

/* Clinical Pearl (warm amber) & Explanations */
.clinical-pearl, .mcq-explanation {
  margin-top: 16px; padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--pearl);
  border-radius: var(--radius-sm);
  font-size: 0.9375rem; color: var(--text-secondary); line-height: 1.6;
}
.mcq-explanation { display: none; }
.clinical-pearl-label {
  font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--pearl); margin-bottom: 8px; display: block;
}
.empty-state { padding: 64px 24px; text-align: center; color: var(--text-muted); font-size: 1.0625rem; }

/* === Predictor: choose / parsing / results === */
.predictor-choose {
  min-height: 70dvh; display: flex; align-items: center; justify-content: center;
  padding: 64px 0;
}
.choose-content { text-align: center; max-width: 560px; width: 100%; }
.choose-content h1 { margin-bottom: 16px; font-size: 2.5rem; }
.choose-sub { color: var(--text-secondary); font-size: 1.0625rem; margin-bottom: 32px; line-height: 1.6; }
.input-tabs { display: flex; justify-content: center; gap: 8px; margin-bottom: 32px; }
.input-tab {
  background: transparent; border: 1px solid transparent; cursor: pointer;
  padding: 8px 20px; font: inherit; font-size: 0.875rem; font-weight: 500;
  color: var(--text-muted); border-radius: var(--radius-full);
  transition: all var(--transition);
}
.input-tab:hover { color: var(--text); }
.input-tab.active { color: var(--text); background: var(--surface); border-color: var(--border); }
.upload-zone {
  border: 1px dashed var(--border-hover); border-radius: var(--radius-lg);
  padding: 64px 24px; cursor: pointer; background: var(--surface);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  transition: all var(--transition);
}
.upload-zone:hover { border-color: var(--accent); background: var(--surface-hover); }
.upload-zone--active { border-style: solid; border-color: var(--accent); background: var(--accent-dim); }
.upload-icon { width: 48px; height: 48px; color: var(--text-muted); transition: color var(--transition); }
.upload-zone:hover .upload-icon { color: var(--accent); }
.upload-label { font-size: 1.0625rem; color: var(--text); font-weight: 500; }
.upload-formats { font-size: 0.875rem; color: var(--text-muted); }
.upload-error { color: var(--incorrect); font-size: 0.875rem; margin-top: 12px; }
.choose-demo { margin-top: 32px; font-size: 0.875rem; color: var(--text-muted); }
.choose-demo a { color: var(--text); text-decoration: underline; text-underline-offset: 4px; }
.choose-demo a:hover { color: var(--accent); }
.paste-area {
  width: 100%; min-height: 240px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 20px; color: var(--text); font: inherit; font-size: 0.9375rem;
  line-height: 1.6; resize: vertical;
  transition: border-color var(--transition);
}
.paste-area::placeholder { color: var(--text-muted); }
.paste-area:focus { outline: none; border-color: var(--accent); }
.paste-submit { margin-top: 24px; width: 100%; max-width: 240px; }

.predictor-parsing {
  min-height: 50dvh; display: flex; align-items: center; justify-content: center;
  padding: 64px 0;
}
.parsing-content { text-align: center; max-width: 400px; width: 100%; }
.parsing-status { margin-bottom: 16px; font-size: 1.0625rem; }
.parsing-progress { width: 100%; height: 4px; background: var(--surface); border-radius: var(--radius-full); margin: 0 auto 16px; overflow: hidden; }
.parsing-bar-fill { height: 100%; width: 0%; background: var(--text); border-radius: var(--radius-full); transition: width 300ms ease; }
.parsing-detail { font-size: 0.875rem; color: var(--text-muted); }
.loading-spinner {
  display: inline-block; width: 24px; height: 24px;
  border: 2px solid var(--border); border-top-color: var(--text);
  border-radius: 50%; animation: spin 1s linear infinite; margin-bottom: 20px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Results topbar (glass) */
.results-topbar {
  position: sticky; top: 0; z-index: 9;
  background: rgba(9, 9, 11, 0.9);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 16px 0; margin-bottom: 24px;
  margin-left: -24px; margin-right: -24px; padding-left: 24px; padding-right: 24px;
}
.results-meta { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 16px; }
.results-source { font-size: 0.875rem; color: var(--text-secondary); }
.results-controls { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.view-toggles { display: flex; gap: 8px; }
.view-btn {
  padding: 8px 16px; border-radius: var(--radius-full); font: inherit;
  font-size: 0.875rem; font-weight: 500; min-height: 36px;
  border: 1px solid transparent; background: transparent;
  color: var(--text-secondary); cursor: pointer;
  transition: all var(--transition);
}
.view-btn:hover { color: var(--text); background: var(--surface); }
.view-btn.active { background: var(--surface); border-color: var(--border); color: var(--text); }
.stats-bar { display: flex; gap: 24px; font-size: 0.875rem; color: var(--text-secondary); }
.results-grid { display: flex; flex-direction: column; gap: 16px; padding-bottom: 64px; }

/* === Topic card === */
.topic-card {
  padding: 24px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); transition: border-color var(--transition);
}
.topic-card:hover { border-color: var(--border-hover); }
.topic-card.excluded { opacity: 0.5; filter: grayscale(100%); }
.topic-header { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.topic-rank { font-family: 'Source Serif 4', serif; font-size: 1.25rem; font-style: italic; color: var(--text-muted); min-width: 32px; }
.topic-name { font-size: 1.125rem; font-weight: 500; flex: 1; min-width: 200px; }
.topic-system { font-size: 0.6875rem; }
.topic-reasons { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.topic-rationale { font-size: 0.875rem; color: var(--text-muted); margin-bottom: 12px; }
.topic-score-bar {
  height: 4px; background: var(--bg);
  border-radius: var(--radius-full); margin-bottom: 16px; overflow: hidden;
}
.score-fill {
  height: 100%; border-radius: var(--radius-full); min-width: 8px;
  background: var(--text);
}
@media (prefers-reduced-motion: no-preference) {
  .score-fill { animation: bar-grow 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; }
  @keyframes bar-grow { from { width: 0%; } }
}
.topic-detail { margin-bottom: 16px; }
.topic-detail summary { cursor: pointer; font-size: 0.875rem; font-weight: 500; color: var(--text-secondary); list-style: none; display: flex; align-items: center; gap: 8px; }
.topic-detail summary::-webkit-details-marker { display: none; }
.topic-detail summary::before { content: '+'; color: var(--text-muted); font-weight: 400; transition: transform var(--transition); }
.topic-detail[open] summary::before { content: '\2212'; }
.topic-detail p { padding-top: 12px; font-size: 0.9375rem; line-height: 1.6; color: var(--text-secondary); }
.topic-actions { display: flex; gap: 8px; }

/* Utility classes (used by predictor-ui.js) */
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.mono { font-family: ui-monospace, 'SF Mono', monospace; }

/* === Slot / System cards === */
.slot-card { padding: 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); }
.slot-header { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; border-bottom: 1px solid var(--border); padding-bottom: 16px; }
.slot-number { font-size: 0.875rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.slot-header h3 { flex: 1; min-width: 160px; font-size: 1.25rem; }
.slot-confidence { font-size: 0.875rem; }
.slot-topics { display: flex; flex-direction: column; gap: 8px; }
.slot-topic-item { display: flex; align-items: baseline; gap: 12px; font-size: 0.9375rem; padding: 4px 0; color: var(--text-secondary); }
.slot-topic-item::before { content: '\2022'; color: var(--border-hover); }
.empty-slot { color: var(--text-muted); font-size: 0.875rem; font-style: italic; }
.system-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; border-bottom: 1px solid var(--border); padding-bottom: 12px; }
.system-count { font-size: 0.875rem; color: var(--text-muted); }
.system-topic { font-size: 0.9375rem; color: var(--text-secondary); padding: 4px 0; display: flex; align-items: baseline; gap: 8px; }
.system-topic::before { content: '\2022'; color: var(--border-hover); }

/* === MCQ cards (theory) === */
.mcq-card {
  padding: 24px; border-radius: var(--radius-md);
  background: var(--surface); border: 1px solid var(--border);
  margin-bottom: 16px; transition: border-color var(--transition);
}
.mcq-card:hover { border-color: var(--border-hover); }
.mcq-head { display: flex; gap: 12px; margin-bottom: 20px; }
.mcq-number { color: var(--text-muted); font-weight: 500; font-size: 1rem; flex-shrink: 0; min-width: 24px; }
.mcq-question { font-weight: 400; font-size: 1.0625rem; line-height: 1.6; }
.mcq-options { display: flex; flex-direction: column; gap: 8px; }
.mcq-option {
  display: flex; align-items: flex-start; gap: 16px;
  width: 100%; text-align: left; padding: 16px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); cursor: pointer;
  font: inherit; font-size: 0.9375rem; color: var(--text-secondary);
  transition: all var(--transition);
}
.mcq-option:hover:not(:disabled) { border-color: var(--border-hover); color: var(--text); background: var(--surface-hover); }
.mcq-option:disabled { cursor: default; }
.mcq-option-label {
  font-weight: 600; color: var(--text-muted); flex-shrink: 0; min-width: 20px;
  display: flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 4px; background: var(--surface);
}
.mcq-option-text { flex: 1; line-height: 1.5; padding-top: 2px; }
.mcq-option.correct {
  border-color: var(--correct); background: var(--correct-dim); color: var(--text);
}
.mcq-option.correct .mcq-option-label { color: var(--bg); background: var(--correct); }
.mcq-option.incorrect {
  border-color: var(--incorrect); background: var(--incorrect-dim);
}
.mcq-option.incorrect .mcq-option-label { color: var(--bg); background: var(--incorrect); }
.mcq-explanation.visible { display: block; }
.mcq-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

/* === Tools catalog (theory) === */
.tools-group { margin-bottom: 40px; }
.tools-group h3 { margin-bottom: 16px; text-transform: capitalize; font-size: 1.5rem; }
.tool-link {
  display: block; padding: 16px 20px; border-radius: var(--radius-md);
  color: var(--text-secondary); margin-bottom: 8px;
  border: 1px solid var(--border); background: var(--surface);
  transition: all var(--transition);
}
.tool-link:hover {
  color: var(--text); background: var(--surface-hover);
  border-color: var(--border-hover); transform: translateY(-2px);
}
.tool-link-title { color: var(--text); font-weight: 500; font-size: 1.0625rem; margin-bottom: 4px; }
.tool-link-desc { font-size: 0.9375rem; line-height: 1.5; }

/* === Section divider === */
.section-divider { border: none; border-top: 1px solid var(--border); margin: 64px 0; }

/* === Filter status === */
.filter-status { font-size: 0.875rem; color: var(--text-muted); margin: 16px 0 24px; }

/* === Focus === */
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

/* === Responsive === */
@media (max-width: 768px) {
  .hero-title { font-size: 3rem; }
  .hero { padding: 80px 0 48px; }
  .tool-cards { gap: 16px; margin: 48px 0; }
  .system-btns { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 8px; }
  .system-btns::-webkit-scrollbar { display: none; }
  .system-btn { flex-shrink: 0; }
}
@media (max-width: 640px) {
  .hero-title { font-size: 2.5rem; }
  .results-meta { flex-direction: column; align-items: flex-start; gap: 12px; }
  .results-controls { flex-direction: column; align-items: flex-start; gap: 12px; }
  .container { padding: 0 20px; }
  .results-topbar { margin-left: -20px; margin-right: -20px; padding-left: 20px; padding-right: 20px; }
}
@media (max-width: 400px) {
  .hero-title { font-size: 2rem; }
  .nav-logo { font-size: 1.125rem; }
  .nav-links { gap: 16px; }
  .nav-links a { font-size: 0.8125rem; }
  .tool-card { padding: 24px; }
}
