/* ─────────────────────────────────────────────────────────────
   CyberSherpa – Main stylesheet
   Mobile-first, dark-mode capable, accessible
   ───────────────────────────────────────────────────────────── */

:root {
  --bg:         #f8fafc;
  --bg-card:    #ffffff;
  --bg-alt:     #f1f5f9;
  --border:     #e2e8f0;
  --text:       #1e293b;
  --text-sub:   #64748b;
  --text-muted: #94a3b8;
  --primary:    #6366f1;
  --primary-h:  #4f46e5;
  --primary-l:  #e0e7ff;
  --danger:     #ef4444;
  --danger-l:   #fee2e2;
  --warning:    #f59e0b;
  --warning-l:  #fef3c7;
  --success:    #22c55e;
  --success-l:  #dcfce7;
  --safe:       #22c55e;
  --suspicious: #f59e0b;
  --dangerous:  #ef4444;
  --radius:     0.75rem;
  --shadow:     0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:  0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg:  0 10px 25px rgba(0,0,0,.1);
  --font:       -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --trans:      0.2s ease;
  --nav-h:      4rem;
}

[data-theme="dark"] {
  --bg:         #0f172a;
  --bg-card:    #1e293b;
  --bg-alt:     #1a2538;
  --border:     #334155;
  --text:       #f1f5f9;
  --text-sub:   #94a3b8;
  --text-muted: #64748b;
  --primary-l:  #312e81;
  --danger-l:   #450a0a;
  --warning-l:  #451a03;
  --success-l:  #052e16;
}

*,::before,::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background var(--trans), color var(--trans);
}
img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ── */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 1rem; }
.page-narrow { max-width: 480px; }
.main-content { flex: 1; padding-bottom: 4rem; }

/* ── Navbar ── */
.navbar {
  position: sticky; top: 0; z-index: 100;
  height: var(--nav-h);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 100%;
}
.nav-brand {
  display: flex; align-items: center; gap: .5rem;
  font-weight: 700; font-size: 1.125rem;
  color: var(--text); text-decoration: none;
}
.nav-logo { font-size: 1.4rem; }
.nav-logo-img {
  height: 37px; width: auto; display: block;
  /* Invert logo text colour in dark mode */
}
[data-theme="dark"] .nav-logo-img {
  /* "Cyber" indigo stays vivid; "Sherpa" slate brightens to near-white */
  filter: brightness(1.6) saturate(0.9);
}
.nav-links {
  display: flex; align-items: center; gap: .25rem;
  list-style: none;
}
.nav-link {
  padding: .4rem .75rem; border-radius: .5rem;
  color: var(--text-sub); font-size: .9rem; font-weight: 500;
  transition: background var(--trans), color var(--trans);
  cursor: pointer; background: none; border: none;
  text-decoration: none; display: inline-block;
}
.nav-link:hover, .nav-link.active {
  background: var(--bg-alt); color: var(--text);
  text-decoration: none;
}
.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: .5rem; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: var(--trans); }

/* Dropdown */
.nav-dropdown { position: relative; }
.dropdown-menu {
  display: none; position: absolute; top: calc(100% + .5rem); right: 0;
  min-width: 180px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); list-style: none;
  padding: .4rem 0; z-index: 200;
}
.dropdown-menu.show { display: block; }
.dropdown-menu a { display: block; padding: .5rem 1rem; color: var(--text); font-size: .875rem; }
.dropdown-menu a:hover { background: var(--bg-alt); text-decoration: none; }
.dropdown-menu .divider { height: 1px; background: var(--border); margin: .25rem 0; }

/* Theme toggle */
.theme-toggle {
  background: none; border: 1px solid var(--border); border-radius: .5rem;
  padding: .35rem .5rem; cursor: pointer; font-size: 1rem;
  color: var(--text-sub); transition: var(--trans);
}
.theme-toggle:hover { background: var(--bg-alt); }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .55rem 1.25rem; border-radius: .6rem; font-size: .9rem; font-weight: 600;
  border: none; cursor: pointer; transition: var(--trans); text-decoration: none;
  white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-h); color: #fff; text-decoration: none; }
.btn-outline { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover { background: var(--primary-l); text-decoration: none; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-danger-outline { background: transparent; color: var(--danger); border: 1.5px solid var(--danger); }
.btn-disabled { background: var(--bg-alt); color: var(--text-muted); cursor: default; border: 1.5px solid var(--border); }
.btn-lg { padding: .75rem 1.75rem; font-size: 1rem; }
.btn-sm { padding: .35rem .85rem; font-size: .8rem; }
.btn-full { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ── Forms ── */
.form-group { margin-bottom: 1.1rem; }
label { display: block; font-size: .875rem; font-weight: 600; margin-bottom: .35rem; color: var(--text); }
.form-control {
  width: 100%; padding: .6rem .9rem;
  border: 1.5px solid var(--border); border-radius: .6rem;
  background: var(--bg-card); color: var(--text);
  font-size: .95rem; font-family: var(--font);
  transition: border-color var(--trans), box-shadow var(--trans);
}
.form-control:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}
.form-control::placeholder { color: var(--text-muted); }
.form-hint { font-size: .78rem; color: var(--text-muted); margin-top: .3rem; display: block; }
.form-check { display: flex; align-items: flex-start; gap: .5rem; }
.form-check input[type=checkbox] { margin-top: .2rem; accent-color: var(--primary); }
.label-link { float: right; font-size: .78rem; font-weight: 400; }
.password-wrap { position: relative; }
.pwd-toggle {
  position: absolute; right: .75rem; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; color: var(--text-muted); font-size: 1rem;
  padding: .25rem;
}
.password-strength {
  height: 4px; border-radius: 2px; margin-top: .4rem;
  background: var(--border); overflow: hidden;
}
.password-strength::after {
  content: ''; display: block; height: 100%;
  width: var(--str-width, 0%); background: var(--str-color, var(--primary));
  transition: width .3s, background .3s;
}

/* ── Alerts ── */
.alert {
  padding: .85rem 1rem; border-radius: var(--radius);
  border-left: 4px solid; margin-bottom: 1.25rem; font-size: .9rem;
}
.alert p { margin: 0; }
.alert p + p { margin-top: .25rem; }
.alert-error   { background: var(--danger-l);  border-color: var(--danger);  color: #7f1d1d; }
.alert-success { background: var(--success-l); border-color: var(--success); color: #14532d; }
.alert-warning { background: var(--warning-l); border-color: var(--warning); color: #713f12; }
.alert-info    { background: var(--primary-l); border-color: var(--primary); color: #312e81; }
[data-theme="dark"] .alert-error   { color: #fca5a5; }
[data-theme="dark"] .alert-success { color: #86efac; }
[data-theme="dark"] .alert-warning { color: #fcd34d; }
[data-theme="dark"] .alert-info    { color: #a5b4fc; }
.alert-link { font-weight: 600; text-decoration: underline; color: inherit; }

/* ── Cards ── */
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px,1fr)); gap: 1.25rem; }
.feature-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem; transition: var(--trans); text-decoration: none; color: var(--text);
  display: flex; flex-direction: column; gap: .5rem;
}
.feature-card:hover { box-shadow: var(--shadow-md); border-color: var(--primary); transform: translateY(-2px); text-decoration: none; }
.feature-icon { font-size: 2rem; }
.feature-title { font-size: 1rem; font-weight: 700; }
.feature-desc { font-size: .875rem; color: var(--text-sub); flex: 1; }
.feature-link { font-size: .8rem; color: var(--primary); font-weight: 600; }

/* ── Sections ── */
.section { padding: 4rem 0; }
.section-alt { background: var(--bg-alt); }
.section-title { font-size: 1.75rem; font-weight: 700; text-align: center; margin-bottom: 2.5rem; }
.page-header { padding: 2rem 0 1.5rem; }
.page-header h1 { font-size: 1.75rem; font-weight: 700; }

/* ── Hero ── */
.hero { padding: 5rem 0 4rem; text-align: center; background: linear-gradient(135deg, var(--bg) 0%, var(--bg-alt) 100%); }
.hero-inner { display: flex; flex-direction: column; align-items: center; gap: 1.25rem; }
.hero-logo { height: 55px; width: auto; margin-bottom: .25rem; }
[data-theme="dark"] .hero-logo { filter: brightness(1.6) saturate(0.9); }
.hero-badge { background: var(--primary-l); color: var(--primary); border-radius: 2rem; padding: .3rem .9rem; font-size: .8rem; font-weight: 600; }
.hero-title { font-size: clamp(1.75rem, 5vw, 2.75rem); font-weight: 800; line-height: 1.2; }
.hero-sub { font-size: 1.05rem; color: var(--text-sub); max-width: 540px; }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center; }
.hero-note { font-size: .8rem; color: var(--text-muted); }
.cta-section { padding: 4rem 0; }

/* ── Steps ── */
.steps { display: flex; align-items: flex-start; gap: 1rem; flex-wrap: wrap; justify-content: center; }
.step { flex: 1; min-width: 180px; max-width: 220px; text-align: center; }
.step-num { width: 2.5rem; height: 2.5rem; background: var(--primary); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1.1rem; margin: 0 auto .75rem; }
.step h3 { font-size: 1rem; font-weight: 700; margin-bottom: .35rem; }
.step p { font-size: .875rem; color: var(--text-sub); }
.step-arrow { font-size: 1.5rem; color: var(--text-muted); padding-top: .75rem; }

/* ── Stats bar ── */
.stats-bar { display: flex; gap: 2rem; justify-content: center; flex-wrap: wrap; }
.stat-item { text-align: center; }
.stat-val { display: block; font-size: 1.75rem; font-weight: 800; color: var(--primary); }
.stat-label { font-size: .8rem; color: var(--text-muted); }

/* ── Auth ── */
.auth-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 2.25rem; box-shadow: var(--shadow-md); margin: 2.5rem auto; }
.auth-header { text-align: center; margin-bottom: 1.75rem; }
.auth-icon { font-size: 2.5rem; margin-bottom: .5rem; }
.auth-header h1 { font-size: 1.5rem; font-weight: 700; }
.auth-header p { color: var(--text-sub); font-size: .9rem; }
.auth-form { display: flex; flex-direction: column; gap: 0; }
.auth-footer { text-align: center; font-size: .875rem; color: var(--text-sub); margin-top: 1.25rem; }

/* ── Badges ── */
.badge { display: inline-block; padding: .2rem .6rem; border-radius: 2rem; font-size: .78rem; font-weight: 600; }
.badge-info    { background: var(--primary-l); color: var(--primary); }
.badge-danger  { background: var(--danger-l);  color: var(--danger); }
.badge-premium { background: linear-gradient(135deg,#f59e0b,#ef4444); color: #fff; }

/* ── Analyze page ── */
.analyze-wrap { max-width: 800px; margin: 0 auto; padding: 2rem 0; }
.analyze-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.analyze-header h1 { font-size: 1.5rem; font-weight: 700; }
.type-tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1.25rem; }
.type-tab {
  display: flex; align-items: center; gap: .3rem;
  padding: .45rem .9rem; border-radius: 2rem;
  border: 1.5px solid var(--border); background: var(--bg-card);
  color: var(--text-sub); font-size: .85rem; font-weight: 600;
  cursor: pointer; transition: var(--trans);
}
.type-tab:hover { border-color: var(--primary); color: var(--primary); }
.type-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.type-tab.locked { opacity: .6; cursor: default; }
.tab-label { display: none; }
@media(min-width:520px) { .tab-label { display: inline; } }
.tab-lock { font-size: .7rem; }
.analyze-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); }
.analyze-textarea { resize: vertical; min-height: 160px; font-size: .95rem; }
.char-counter { text-align: right; font-size: .78rem; color: var(--text-muted); margin-top: .25rem; }
.analyze-actions { display: flex; gap: .75rem; margin-top: 1rem; flex-wrap: wrap; }

/* Upload zone */
.upload-zone {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 3rem 1.5rem; text-align: center; cursor: pointer;
  transition: var(--trans);
}
.upload-zone:hover, .upload-zone.drag-over { border-color: var(--primary); background: var(--primary-l); }
.upload-icon { font-size: 3rem; margin-bottom: .75rem; }
.upload-text { font-weight: 600; margin-bottom: .25rem; }
.upload-note { font-size: .8rem; color: var(--text-muted); }
.upload-preview { max-width: 100%; max-height: 300px; border-radius: var(--radius); margin: 0 auto .75rem; }

/* Upgrade prompt */
.upgrade-prompt { text-align: center; padding: 3rem 1.5rem; }
.upgrade-icon { font-size: 3rem; margin-bottom: .75rem; }
.upgrade-prompt h3 { font-size: 1.25rem; margin-bottom: .5rem; }
.upgrade-prompt p { color: var(--text-sub); margin-bottom: 1.25rem; }

/* ── Results ── */
.results-wrap { margin-top: 2rem; }
.result-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.result-header h2 { font-size: 1.25rem; font-weight: 700; }
.result-actions { display: flex; gap: .5rem; }

.verdict-banner {
  display: flex; align-items: center; gap: 1rem;
  padding: 1.25rem 1.5rem; border-radius: var(--radius);
  margin-bottom: 1.25rem; border: 2px solid var(--border);
  background: var(--bg-card); box-shadow: var(--shadow-md);
}
.verdict-banner.verdict-safe      { border-color: var(--safe);       background: var(--success-l); }
.verdict-banner.verdict-suspicious{ border-color: var(--suspicious); background: var(--warning-l); }
.verdict-banner.verdict-dangerous { border-color: var(--dangerous);  background: var(--danger-l); }
.verdict-icon { font-size: 2.5rem; }
.verdict-text { flex: 1; }
.verdict-label { font-size: 1.25rem; font-weight: 800; }
.verdict-sub   { font-size: .85rem; color: var(--text-sub); }

/* Score ring */
.score-ring-wrap { position: relative; width: 80px; height: 80px; flex-shrink: 0; }
.score-ring { width: 80px; height: 80px; }
.ring-bg   { fill: none; stroke: var(--border); stroke-width: 8; }
.ring-fill { fill: none; stroke: var(--primary); stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset .8s ease, stroke .5s; }
.score-num {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: .95rem; font-weight: 800;
}
.ring-safe       .ring-fill { stroke: var(--safe); }
.ring-suspicious .ring-fill { stroke: var(--suspicious); }
.ring-dangerous  .ring-fill { stroke: var(--dangerous); }

.result-cards { display: grid; gap: 1rem; margin-bottom: 1rem; }
@media(min-width:680px) { .result-cards { grid-template-columns: 1fr 1fr; } }
.result-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
.result-card h3 { font-size: .95rem; font-weight: 700; margin-bottom: .6rem; }
.result-list { list-style: none; display: flex; flex-direction: column; gap: .4rem; }
.result-list li::before { content: '• '; color: var(--primary); }
.result-list li { font-size: .875rem; color: var(--text-sub); }
.result-disclaimer { font-size: .78rem; color: var(--text-muted); text-align: center; margin-top: .75rem; }

/* Verdict chips */
.verdict-chip { display: inline-block; padding: .15rem .55rem; border-radius: 2rem; font-size: .75rem; font-weight: 700; }
.verdict-safe       { background: var(--success-l); color: #166534; }
.verdict-suspicious { background: var(--warning-l); color: #92400e; }
.verdict-dangerous  { background: var(--danger-l);  color: #7f1d1d; }
[data-theme="dark"] .verdict-safe       { color: #86efac; }
[data-theme="dark"] .verdict-suspicious { color: #fcd34d; }
[data-theme="dark"] .verdict-dangerous  { color: #fca5a5; }

/* ── History ── */
.history-list { display: flex; flex-direction: column; gap: .75rem; }
.history-item {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem 1.25rem; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.history-type { display: flex; align-items: center; gap: .4rem; font-size: .85rem; font-weight: 600; color: var(--text-sub); min-width: 120px; }
.history-body { flex: 1; min-width: 0; }
.history-input { font-size: .875rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: .3rem; }
.history-meta { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.history-score { font-size: .78rem; color: var(--text-muted); }
.history-time  { font-size: .78rem; color: var(--text-muted); }
.history-actions { flex-shrink: 0; }

/* ── Pricing ── */
.pricing-header { text-align: center; padding: 3rem 0 2rem; }
.pricing-header h1 { font-size: 2rem; font-weight: 800; }
.pricing-header p { color: var(--text-sub); }
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px,1fr)); gap: 1.5rem; margin-bottom: 2rem; }
.pricing-card {
  background: var(--bg-card); border: 2px solid var(--border); border-radius: var(--radius);
  padding: 2rem; display: flex; flex-direction: column; gap: 1.25rem;
}
.pricing-featured { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-l); }
.plan-badge { font-size: .85rem; font-weight: 700; color: var(--text-sub); }
.plan-badge-premium { color: var(--primary); }
.plan-price { display: flex; align-items: baseline; gap: .2rem; }
.price-amount { font-size: 2.5rem; font-weight: 800; }
.price-currency { font-size: 1rem; font-weight: 600; }
.price-period { font-size: .9rem; color: var(--text-muted); }
.plan-features { list-style: none; display: flex; flex-direction: column; gap: .55rem; flex: 1; }
.plan-features li { font-size: .9rem; color: var(--text-sub); }
.pricing-note { text-align: center; color: var(--text-muted); font-size: .85rem; padding: 1rem 0 3rem; }

/* ── Profile ── */
.profile-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1.5rem; }
.profile-card h2 { font-size: 1.1rem; font-weight: 700; margin-bottom: 1rem; }
.profile-danger { border-color: var(--danger); }

/* ── Pagination ── */
.pagination { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 2rem; }
.page-btn { background: var(--bg-card); border: 1px solid var(--border); border-radius: .5rem; padding: .4rem .85rem; font-size: .875rem; color: var(--text); transition: var(--trans); }
.page-btn:hover { background: var(--primary-l); border-color: var(--primary); color: var(--primary); text-decoration: none; }
.page-info { font-size: .875rem; color: var(--text-muted); }

/* ── Empty state ── */
.empty-state { text-align: center; padding: 5rem 1rem; }
.empty-icon  { font-size: 4rem; margin-bottom: 1rem; }
.empty-state h2 { font-size: 1.5rem; margin-bottom: .5rem; }
.empty-state p  { color: var(--text-sub); margin-bottom: 1.5rem; }

/* ── Modal ── */
.modal { position: fixed; inset: 0; z-index: 500; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.55); }
.modal-box { position: relative; z-index: 1; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); max-width: 600px; width: 100%; max-height: 90vh; overflow: auto; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border); }
.modal-header h2 { font-size: 1.1rem; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 1.25rem; cursor: pointer; color: var(--text-sub); line-height: 1; }
.modal-body { padding: 1.5rem; }

/* ── Footer ── */
.footer { background: var(--bg-alt); border-top: 1px solid var(--border); padding: 2.5rem 0 1.5rem; margin-top: auto; }
.footer-inner { display: flex; flex-direction: column; align-items: center; gap: .75rem; text-align: center; }
.footer-brand { display: flex; align-items: center; gap: .5rem; font-weight: 700; }
.footer-logo-img { height: 30px; width: auto; opacity: 0.85; }
[data-theme="dark"] .footer-logo-img { filter: brightness(1.6) saturate(0.9); }
.footer-tagline { font-size: .875rem; color: var(--text-sub); }
.footer-links { display: flex; gap: 1.25rem; flex-wrap: wrap; justify-content: center; }
.footer-links a { font-size: .85rem; color: var(--text-muted); }
.footer-links a:hover { color: var(--primary); }
.footer-note { font-size: .78rem; color: var(--text-muted); max-width: 500px; }
.footer-copy { font-size: .78rem; color: var(--text-muted); }

/* ── Responsive ── */
@media(max-width: 768px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: fixed; inset: var(--nav-h) 0 0 0;
    background: var(--bg-card); border-top: 1px solid var(--border);
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 1rem; overflow-y: auto;
    transform: translateX(100%); transition: transform var(--trans);
    z-index: 99;
  }
  .nav-links.open { transform: translateX(0); }
  .nav-link { padding: .85rem 1rem; font-size: 1rem; }
  .nav-title { display: none; }
  .hero { padding: 3rem 0; }
  .steps { flex-direction: column; align-items: center; }
  .step-arrow { transform: rotate(90deg); padding: 0; }
  .pricing-grid { grid-template-columns: 1fr; }
}
@media(max-width:480px) {
  .analyze-header { flex-direction: column; align-items: flex-start; gap: .5rem; }
  .result-cards { grid-template-columns: 1fr; }
}

/* ── Technical Inspection Card ───────────────────────────────── */
.tech-inspection-card { grid-column: 1 / -1; }

.inspection-score-row {
  display: flex; align-items: center; gap: .4rem;
  font-size: .9rem; font-weight: 600; margin-bottom: .9rem;
}
.inspection-score-label { color: var(--text-sub); }
.inspection-score-val   { font-size: 1.3rem; font-weight: 800; }
.inspection-score-max   { color: var(--text-muted); font-size: .85rem; }

.inspection-signals { display: flex; flex-direction: column; gap: .4rem; }

.inspection-signal {
  display: grid;
  grid-template-columns: 1.1rem 8rem 1fr 2.5rem;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 0 .5rem;
  font-size: .8rem;
  padding: .3rem 0;
  border-bottom: 1px solid var(--border);
}
.inspection-signal:last-child { border-bottom: none; }

.sig-icon  { font-size: .75rem; font-weight: 800; text-align: center; }
.sig-label { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sig-bar-wrap {
  height: 6px; background: var(--border); border-radius: 3px; overflow: hidden;
}
.sig-bar {
  height: 100%; border-radius: 3px; transition: width .6s ease;
  background: var(--primary);
}
.sig-pct   { text-align: right; font-weight: 700; font-size: .75rem; }
.sig-detail {
  grid-column: 2 / -1;
  color: var(--text-muted);
  font-size: .75rem;
  line-height: 1.4;
  margin-top: .1rem;
}

.sig-ok   .sig-icon { color: var(--success); }
.sig-ok   .sig-bar  { background: var(--success); }
.sig-ok   .sig-pct  { color: var(--success); }

.sig-warn .sig-icon { color: var(--warning); }
.sig-warn .sig-bar  { background: var(--warning); }
.sig-warn .sig-pct  { color: var(--warning); }

.sig-bad  .sig-icon { color: var(--danger); }
.sig-bad  .sig-bar  { background: var(--danger); }
.sig-bad  .sig-pct  { color: var(--danger); }

@media (max-width: 500px) {
  .inspection-signal {
    grid-template-columns: 1.1rem 1fr 2.5rem;
  }
  .sig-label { grid-column: 2; }
  .sig-bar-wrap { display: none; }
  .sig-detail { grid-column: 2 / -1; }
}

/* ── Evidence-based result additions ─────────────────────────── */
.verdict-banner.verdict-unknown {
  border-color: #64748b;
  background: color-mix(in srgb, var(--bg-card) 86%, #94a3b8 14%);
}
.verdict-unknown { background: #e2e8f0; color: #334155; }
[data-theme="dark"] .verdict-unknown { background: #334155; color: #e2e8f0; }

.score-num {
  inset: 14px 0 20px;
  align-items: center;
  font-size: 1rem;
}
.score-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 17px;
  text-align: center;
  font-size: .58rem;
  line-height: 1;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.ring-unknown .ring-fill { stroke: #64748b; }

.coverage-card { margin-bottom: 1rem; }
.coverage-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto auto;
  gap: .65rem;
  align-items: center;
}
.coverage-bar-wrap {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--border);
}
.coverage-bar {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
  transition: width .6s ease;
}
.coverage-level {
  padding: .15rem .5rem;
  border-radius: 999px;
  background: var(--bg-soft, var(--border));
  color: var(--text-sub);
  font-size: .75rem;
  font-weight: 700;
}
.coverage-note {
  margin-top: .55rem;
  color: var(--text-muted);
  font-size: .78rem;
}
.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: .5rem;
  margin-top: .8rem;
}
.check-item {
  display: grid;
  grid-template-columns: 1.1rem 1fr;
  gap: .05rem .4rem;
  align-items: center;
  padding: .55rem .65rem;
  border: 1px solid var(--border);
  border-radius: .65rem;
  background: var(--bg-card);
}
.check-item > span { grid-row: 1 / 3; font-weight: 900; }
.check-item strong { font-size: .76rem; }
.check-item small { color: var(--text-muted); font-size: .68rem; }
.check-ok > span { color: var(--success); }
.check-bad > span { color: var(--danger); }
.check-na > span { color: var(--text-muted); }

@media (max-width: 560px) {
  .verdict-banner { align-items: flex-start; flex-wrap: wrap; }
  .score-ring-wrap { margin-left: auto; }
  .coverage-row { grid-template-columns: 1fr auto; }
  .coverage-level { grid-column: 1 / -1; justify-self: start; }
}


/* ── Structured evidence cards ───────────────────────────────── */
.action-card {
  border-left: 4px solid var(--primary);
}
.action-list {
  padding-left: 1.35rem;
}
.action-list li::marker {
  font-weight: 700;
}
.evidence-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: .65rem;
}
.evidence-item {
  border: 1px solid var(--border);
  border-left: 4px solid #94a3b8;
  border-radius: .55rem;
  padding: .7rem .8rem;
  background: color-mix(in srgb, var(--bg-card) 94%, #94a3b8 6%);
}
.evidence-item p {
  margin: .35rem 0 .25rem;
  color: var(--text-sub);
  line-height: 1.5;
}
.evidence-item small {
  color: var(--text-muted);
}
.evidence-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .7rem;
}
.evidence-severity {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: .15rem .5rem;
  font-size: .68rem;
  font-weight: 700;
  background: #e2e8f0;
  color: #334155;
}
.evidence-critical { border-left-color: #991b1b; }
.evidence-high { border-left-color: #dc2626; }
.evidence-medium { border-left-color: #d97706; }
.evidence-low { border-left-color: #64748b; }
.evidence-positive { border-left-color: #16a34a; }
.evidence-critical .evidence-severity,
.evidence-high .evidence-severity { background: #fee2e2; color: #991b1b; }
.evidence-medium .evidence-severity { background: #fef3c7; color: #92400e; }
.evidence-positive .evidence-severity { background: #dcfce7; color: #166534; }
[data-theme="dark"] .evidence-critical .evidence-severity,
[data-theme="dark"] .evidence-high .evidence-severity { background: #7f1d1d; color: #fee2e2; }
[data-theme="dark"] .evidence-medium .evidence-severity { background: #78350f; color: #fef3c7; }
[data-theme="dark"] .evidence-positive .evidence-severity { background: #14532d; color: #dcfce7; }

/* Analysis queue status */
.queue-status {
    margin-top: .85rem;
    padding: .75rem 1rem;
    border: 1px solid var(--border);
    border-radius: .75rem;
    background: var(--surface-2, rgba(59, 130, 246, .06));
    color: var(--text-sub);
    font-size: .92rem;
    line-height: 1.45;
}
