/* =========================================================
   Insynode UI
   © Upleashed Limited
========================================================= */

/* ===============================
   Design tokens
================================ */

:root{
  /* Capability colours (0 to 5) */
  --c0:#6b6f76;
  --c1:#b63b3b;
  --c2:#ee9c3c;
  --c3:#a9cf4f;
  --c4:#4ea06a;
  --c5:#5c56a6;

  /* Light theme */
  --bg:#f5f7fb;
  --surface:#ffffff;
  --surface-2:#f9fbff;

  --text:#0b1324;
  --muted:#5a6478;

  --border:rgba(16,24,40,.12);
  --border-2:rgba(16,24,40,.08);

  --primary:#3b73e6;
  --primary-dark:#2d5fd0;
  --primary-ink:#ffffff;

  --radius-xl:22px;
  --radius-lg:18px;
  --radius-md:14px;
  --radius-sm:10px;

  --shadow:0 12px 30px rgba(17,24,39,.12);
  --shadow-soft:0 8px 20px rgba(17,24,39,.10);

  --container:1040px;

  --font:"Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  --focus:0 0 0 4px rgba(59,115,230,.25);

  --space-1:8px;
  --space-2:16px;
  --space-3:24px;
  --space-4:32px;
  --radius-card:16px;
  --safe-top:env(safe-area-inset-top, 0px);

  /* Ambient visuals */
  --glow-1:rgba(59,115,230,.22);
  --glow-2:rgba(92,86,166,.18);
  --grid-line:rgba(16,24,40,.06);
}

#executiveSummarySection{ padding:18px; }
#executiveSummarySection .section-head{ margin-top:0; }
#executiveSummaryText{ min-height:140px; }

/* ===============================
   Dark theme
================================ */

[data-theme="dark"]{
  --bg:#0f1419;
  --surface:#1a1f2e;
  --surface-2:#1f2535;

  --text:#e8eaed;
  --muted:#9aa0a6;

  --border:rgba(255,255,255,.10);
  --border-2:rgba(255,255,255,.08);

  --primary:#5b8def;
  --primary-dark:#4a7ce8;
  --primary-ink:#ffffff;

  --shadow:0 12px 30px rgba(0,0,0,.40);
  --shadow-soft:0 8px 20px rgba(0,0,0,.30);

  --glow-1:rgba(91,141,239,.18);
  --glow-2:rgba(78,160,106,.14);
  --grid-line:rgba(255,255,255,.05);
}

/* Theme icon visibility */
[data-theme="dark"] .icon-sun{ display:none; }
[data-theme="dark"] .icon-moon{ display:inline; }

[data-theme="light"] .icon-sun,
:root:not([data-theme]) .icon-sun{ display:inline; }

[data-theme="light"] .icon-moon,
:root:not([data-theme]) .icon-moon{ display:none; }

/* ===============================
   Base and reset
================================ */

*{ box-sizing:border-box; }

html, body{ height:100%; }

body{
  margin:0;
  font-family:var(--font);
  background:var(--bg);
  color:var(--text);
  line-height:1.35;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  transition:background .2s ease, color .2s ease;
}

a{ color:var(--primary); text-decoration:none; }
a:hover{ text-decoration:underline; }
a:focus{ outline:none; box-shadow:var(--focus); border-radius:8px; }

img{ max-width:100%; display:block; }

.small{ font-size:12.5px; }
.muted{ color:var(--muted); }

.container{
  max-width:var(--container);
  margin:0 auto;
  padding:0 18px;
}

/* Accessibility */
.skip-link{
  position:absolute;
  left:-999px;
  top:10px;
  background:var(--surface);
  color:var(--text);
  border:1px solid var(--border);
  padding:10px 12px;
  border-radius:10px;
  z-index:99;
  box-shadow:var(--shadow-soft);
}
.skip-link:focus{ left:12px; }

:focus-visible{
  outline:none;
  box-shadow:var(--focus);
  border-radius:10px;
}

/* ===============================
   Ambient background (subtle)
================================ */

body::before{
  content:"";
  position:fixed;
  inset:-120px;
  background:
    radial-gradient(800px 520px at 18% 20%, var(--glow-1), transparent 60%),
    radial-gradient(780px 520px at 82% 24%, var(--glow-2), transparent 62%),
    radial-gradient(560px 380px at 50% 86%, rgba(238,156,60,.10), transparent 62%);
  filter:blur(14px);
  opacity:.75;
  pointer-events:none;
  z-index:-2;
  animation:ambientShift 12s ease-in-out infinite alternate;
}

body::after{
  content:"";
  position:fixed;
  inset:0;
  background:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size:44px 44px;
  opacity:.22;
  pointer-events:none;
  z-index:-1;
  mask-image:radial-gradient(900px 520px at 50% 22%, rgba(0,0,0,.9), transparent 60%);
}

@keyframes ambientShift{
  from{ transform:translate3d(0,0,0) scale(1); }
  to{ transform:translate3d(0,-18px,0) scale(1.03); }
}

/* ===============================
   Header
================================ */

.site-header{
  position:sticky;
  top:0;
  z-index:20;
  background:rgba(255,255,255,.78);
  border-bottom:1px solid var(--border-2);
  backdrop-filter:blur(14px) saturate(180%);
  transition:background .2s ease, border-color .2s ease;
}

[data-theme="dark"] .site-header{
  background:rgba(15,20,25,.72);
  border-bottom-color:rgba(255,255,255,.08);
}

.header-row{
  position:relative;
  display:flex;
  justify-content:flex-end;
  align-items:center;
  padding:16px 0;
  gap:12px;
}

/* Centre the logo in the header, keep actions on the right */
.brand-link{
  position:absolute;
  left:50%;
  transform:translateX(-50%);
  display:flex;
  align-items:center;
  gap:10px;
  text-decoration:none;
  transition:opacity .2s ease;
  max-width:70%;
}

.brand-link:hover{ opacity:.86; }

.brand-link img{ height:28px; width:auto; }

.brand-sub{
  font-size:13px;
  color:var(--muted);
  font-weight:600;
  letter-spacing:.3px;
  white-space:nowrap;
}

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

.sticky-summary{
  position:sticky;
  top:calc(8px + var(--safe-top));
  z-index:15;
  margin:0 auto;
  max-width:var(--container);
  padding:10px 14px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  background:rgba(26,31,46,.9);
  border:1px solid var(--border);
  border-radius:var(--radius-card);
  box-shadow:var(--shadow-soft);
  backdrop-filter:blur(12px) saturate(160%);
}
[hidden],
[hidden].sticky-summary{
  display:none !important;
}
[data-theme="light"] .sticky-summary{
  background:rgba(255,255,255,.92);
}

.sticky-summary-left{
  display:flex;
  gap:10px;
  align-items:center;
}
.sticky-summary-left img{
  width:28px;
  height:28px;
  border-radius:8px;
}
.sticky-role div:first-child{
  font-weight:800;
  font-size:14px;
}
.sticky-targets-line{
  font-size:12px;
  color:var(--muted);
}
.sticky-summary-metrics{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
}
.sticky-kpi{
  min-width:72px;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:10px;
  padding:6px 8px;
  text-align:center;
}
.sticky-kpi span{
  display:block;
  font-size:11px;
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:.06em;
}
.sticky-kpi strong{
  display:block;
  font-size:16px;
}
.sticky-actions{ display:flex; gap:8px; }

@media(max-width:720px){
  .sticky-summary{
    flex-direction:column;
    align-items:flex-start;
  }
  .sticky-summary-metrics{ width:100%; }
  .sticky-actions{ width:100%; }
  .sticky-actions .btn{ width:100%; justify-content:center; }
}

/* ===============================
   Buttons and inputs
================================ */

.btn{
  border:1px solid var(--border);
  background:var(--surface);
  color:var(--text);
  padding:10px 14px;
  border-radius:var(--radius-md);
  font-weight:700;
  cursor:pointer;
  transition:transform .12s ease, background .15s ease, border-color .15s ease, opacity .15s ease;
}

.btn:hover{
  background:rgba(59,115,230,.06);
  border-color:rgba(59,115,230,.22);
}

.btn:active{ transform:translateY(1px); }

.btn[disabled],
.btn:disabled{
  opacity:.55;
  cursor:not-allowed;
  transform:none;
}

.btn[aria-busy="true"]{
  opacity:.75;
  cursor:progress;
}

.btn-primary{
  background:linear-gradient(180deg, var(--primary), var(--primary-dark));
  color:var(--primary-ink);
  border:0;
  box-shadow:0 10px 20px rgba(59,115,230,.20);
}
.btn-primary:hover{ 
  filter:brightness(1.04);
  color:var(--primary-ink) !important;
  background:linear-gradient(180deg, var(--primary), var(--primary-dark)) !important;
}
.btn-primary:focus-visible{
  outline:2px solid var(--primary);
  outline-offset:2px;
  color:var(--primary-ink) !important;
  background:linear-gradient(180deg, var(--primary), var(--primary-dark)) !important;
}
.btn-primary:active{
  filter:brightness(0.96);
  color:var(--primary-ink) !important;
  background:linear-gradient(180deg, var(--primary), var(--primary-dark)) !important;
}
.btn-primary[disabled]{
  opacity:0.6;
  cursor:not-allowed;
  filter:none;
  color:var(--primary-ink) !important;
  background:linear-gradient(180deg, var(--primary), var(--primary-dark)) !important;
}

.btn-sm{ padding:8px 12px; font-size:13px; border-radius:12px; }

.btn-ghost{
  background:transparent;
  border:1px solid var(--border);
  color:var(--text);
}
.btn-ghost:hover{
  background:var(--surface);
  border-color:rgba(59,115,230,.25);
}

.btn-icon{
  width:44px;
  height:44px;
  padding:0;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:14px;
}

.btn-icon-mini{
  width:32px;
  height:32px;
  padding:0;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:10px;
  background:transparent;
  border:1px solid var(--border);
  color:var(--text);
  font-size:14px;
  font-weight:700;
  cursor:pointer;
  transition:background .15s ease, border-color .15s ease, color .15s ease;
}

.btn-icon-mini:hover{
  background:var(--surface-2);
  border-color:rgba(59,115,230,.35);
  color:var(--text);
}

.btn-icon-mini:focus{
  outline:none;
  box-shadow:var(--focus);
  border-color:rgba(59,115,230,.35);
}

.btn-icon-mini:disabled{
  opacity:0.4;
  cursor:not-allowed;
}

.btn-icon-mini:active:not(:disabled){
  background:var(--surface);
  transform:scale(0.95);
}

.text-input,
.select-input,
.search-input{
  width:100%;
  border:1px solid var(--border);
  border-radius:var(--radius-md);
  padding:12px 14px;
  font-size:15px;
  background:var(--surface);
  color:var(--text);
  transition:border-color .15s ease, background .15s ease;
}

.text-input::placeholder,
.search-input::placeholder{
  color:rgba(90,100,120,.85);
}

[data-theme="dark"] .text-input::placeholder,
[data-theme="dark"] .search-input::placeholder{
  color:rgba(154,160,166,.86);
}

.text-input:focus,
.select-input:focus,
.search-input:focus{
  outline:none;
  box-shadow:var(--focus);
  border-color:rgba(59,115,230,.35);
}

/* ===============================
   Cards and layout
================================ */

.card{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  box-shadow:var(--shadow);
}

.site-main{ padding:24px 0; }

/* ===============================
   Hero
================================ */

.hero{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  min-height:calc(100vh - 160px);
  padding:48px 20px 32px;
  text-align:center;
  position:relative;
}

.hero-inner{
  width:100%;
  max-width:760px;
  margin:0 auto;
  animation:fadeInUp .55s ease-out;
}

@keyframes fadeInUp{
  from{ opacity:0; transform:translateY(18px); }
  to{ opacity:1; transform:translateY(0); }
}

.hero-content{ margin-bottom:36px; }

.hero-logo-block{
  display:flex;
  justify-content:center;
  margin-bottom:24px;
}

.hero-logo{
  width:auto;
  max-width:200px;
  height:auto;
  filter:drop-shadow(0 10px 30px rgba(0,0,0,.14));
}

.hero-headlines{
  display:flex;
  flex-direction:column;
  gap:10px;
  text-align:center;
  margin:0 auto;
  max-width:820px;
}

.hero-line{
  font-weight:700;
  line-height:1.35;
}

.hero-brand{ font-size:20px; letter-spacing:0.4px; text-transform:uppercase; color:var(--muted); }
.hero-promise{ font-size:clamp(26px, 4vw, 36px); font-weight:800; }
.hero-how{ font-size:16px; color:var(--muted); }

.hero-title{
  font-size:clamp(36px, 6vw, 64px);
  font-weight:300;
  line-height:1.08;
  margin:0 0 12px;
  letter-spacing:-0.8px;
}

.title-main{ display:block; color:var(--text); }

.title-accent{
  display:block;
  background:linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  -webkit-background-clip:text;
  -webkit-text-fill-color:transparent;
  background-clip:text;
  font-weight:420;
}

.hero-description{
  font-size:clamp(16px, 2vw, 18px);
  line-height:1.6;
  color:var(--muted);
  margin:0;
  max-width:640px;
  margin-left:auto;
  margin-right:auto;
  font-weight:400;
}

/* ===============================
   About Insynode (SEO details)
================================ */

.seo-details{
  margin:12px auto 0;
  max-width:720px;
  text-align:left;
}

.seo-details summary{
  cursor:pointer;
  font-weight:900;
  user-select:none;
}

.seo-details summary::-webkit-details-marker{ display:none; }

.seo-details .seo-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  margin-top:10px;
}

.seo-details .seo-card{
  border:1px solid var(--border);
  background:var(--surface);
  border-radius:14px;
  padding:12px;
  line-height:1.45;
}

/* ===============================
   Search box, actions, suggestions
================================ */

.search-container{ width:100%; margin-bottom:28px; }

.search-box-wrapper{ 
  position:relative; 
  margin-bottom:14px; 
  z-index:100;
}

.search-box{
  position:relative;
  width:100%;
  max-width:652px;
  margin:0 auto;
  background:var(--surface);
  border:1.5px solid var(--border-2);
  border-radius:28px;
  box-shadow:0 1px 6px rgba(32,33,36,.20);
  transition:transform .15s ease, box-shadow .2s ease, border-color .2s ease;
  display:flex;
  align-items:center;
  padding:0 18px;
  height:56px;
}

[data-theme="dark"] .search-box{ box-shadow:0 1px 6px rgba(0,0,0,.42); }

.search-box:hover{
  box-shadow:0 2px 10px rgba(32,33,36,.22);
  border-color:rgba(59,115,230,.22);
}

.search-box:focus-within{
  box-shadow:0 4px 16px rgba(59,115,230,.18);
  border-color:rgba(59,115,230,.55);
}

.search-icon{
  width:20px;
  height:20px;
  color:#9aa0a6;
  margin-right:14px;
  flex-shrink:0;
  transition:color .15s ease;
}
.search-box:focus-within .search-icon{ color:var(--primary); }

.search-box .search-input{
  flex:1;
  border:0;
  background:transparent;
  padding:0;
  font-size:16px;
  outline:none;
  box-shadow:none;
}

.clear-btn{
  width:34px;
  height:34px;
  padding:0;
  border:0;
  background:transparent;
  cursor:pointer;
  color:#9aa0a6;
  display:flex;
  align-items:center;
  justify-content:center;
  margin-left:10px;
  border-radius:999px;
  transition:background .15s ease, color .15s ease, opacity .15s ease;
  opacity:.8;
}
.clear-btn:hover{
  background:rgba(59,115,230,.10);
  color:var(--text);
  opacity:1;
}

.search-actions{
  display:flex;
  gap:12px;
  justify-content:center;
  align-items:center;
  margin-top:18px;
}

.search-btn-primary,
.search-btn-secondary{
  border-radius:24px;
  font-size:14px;
  font-weight:700;
  padding:11px 28px;
  cursor:pointer;
  transition:transform .12s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
  font-family:var(--font);
}

.search-btn-primary{
  background:linear-gradient(135deg, #ee9c3c 0%, #d87a2e 50%, #b63b3b 100%);
  border:none;
  color:#fff;
  position:relative;
  box-shadow:0 4px 16px rgba(238,156,60,.35), 0 2px 8px rgba(182,59,59,.25);
  font-weight:700;
}
.search-btn-primary::before{
  content:"";
  position:absolute;
  inset:-2px;
  border-radius:24px;
  background:linear-gradient(135deg, #ee9c3c, #d87a2e, #b63b3b, #ee9c3c);
  background-size:200% 200%;
  z-index:-1;
  opacity:0.6;
  animation:gradientShift 3s ease infinite;
  filter:blur(8px);
}
@keyframes gradientShift{
  0%{ background-position:0% 50%; }
  50%{ background-position:100% 50%; }
  100%{ background-position:0% 50%; }
}
.search-btn-primary:hover{
  background:linear-gradient(135deg, #f0a850 0%, #e08a40 50%, #c84d4d 100%);
  transform:translateY(-1px);
  box-shadow:0 6px 20px rgba(238,156,60,.45), 0 4px 12px rgba(182,59,59,.35);
}
.search-btn-primary:hover::before{
  opacity:0.8;
  animation-duration:2s;
  filter:blur(10px);
}
.search-btn-primary:active{ 
  transform:translateY(0); 
  box-shadow:0 2px 8px rgba(238,156,60,.3);
}
.search-btn-primary:focus{ 
  outline:none; 
  box-shadow:0 0 0 4px rgba(238,156,60,.3), 0 6px 20px rgba(238,156,60,.45);
}

.search-btn-secondary{
  background:var(--surface);
  border:1px solid var(--border);
  color:var(--text);
}
.search-btn-secondary:hover{
  border-color:rgba(59,115,230,.35);
  background:rgba(59,115,230,.06);
}
.search-btn-secondary:focus{ outline:none; box-shadow:var(--focus); }

/* Suggestions dropdown */
.suggestions{
  position:absolute;
  top:calc(100% + 8px);
  left:0;
  right:0;
  background:var(--surface);
  border:1px solid var(--border-2);
  border-radius:16px;
  box-shadow:0 10px 28px rgba(17,24,39,.18);
  z-index:1000;
  max-height:420px;
  overflow:auto;
  animation:slideDown .18s ease-out;
  pointer-events:auto;
}

@keyframes slideDown{
  from{ opacity:0; transform:translateY(-8px); }
  to{ opacity:1; transform:translateY(0); }
}

.suggestion{
  width:100%;
  border:0;
  background:transparent;
  color:var(--text);
  text-align:left;
  padding:14px 18px;
  cursor:pointer;
  display:flex;
  align-items:center;
  gap:14px;
  border-bottom:1px solid var(--border-2);
  transition:background .12s ease;
  font-size:15px;
  position:relative;
  z-index:1;
  pointer-events:auto;
}

.suggestion:last-child{
  border-bottom:0;
  border-bottom-left-radius:16px;
  border-bottom-right-radius:16px;
}
.suggestion:first-child{
  border-top-left-radius:16px;
  border-top-right-radius:16px;
}

.suggestion:hover,
.suggestion:focus{
  outline:none;
  background:rgba(59,115,230,.08);
}

.suggestion svg{
  width:18px;
  height:18px;
  color:#9aa0a6;
  flex-shrink:0;
  transition:color .12s ease;
  pointer-events:none;
}

.suggestion:hover svg,
.suggestion:focus svg{ color:var(--primary); }

.suggestion span{
  pointer-events:none;
}

.hl{
  background:rgba(59,115,230,.16);
  padding:2px 4px;
  border-radius:6px;
  font-weight:800;
  color:var(--primary);
  pointer-events:none;
}

/* ===============================
   Popular chips and footer info
================================ */

.popular-section{
  margin:28px 0 16px;
  width:100%;
}

.popular-label{
  font-size:12px;
  color:var(--muted);
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.5px;
}

.search-stats-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px;
  margin-top:10px;
}
.search-stats-col{
  padding:12px;
  border:1px solid var(--border);
  border-radius:14px;
  background:var(--surface);
}
.search-stats-title{
  text-align:center;
  font-size:12px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.5px;
  color:var(--muted);
  margin-bottom:6px;
}
.total-searches-message{
  font-weight:800;
}
.chip-count{
  margin-left:8px;
  font-size:11px;
  font-weight:900;
  padding:2px 8px;
  border-radius:999px;
  border:1px solid var(--border-2);
  background:rgba(59,115,230,.08);
  color:var(--text);
}
@media(max-width:900px){
  .search-stats-grid{ grid-template-columns:1fr; }
}

.occupation-chips{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  justify-content:center;
  align-items:center;
  margin-top:10px;
}

.occupation-chip{
  background:var(--surface);
  border:1px solid var(--border-2);
  border-radius:999px;
  padding:6px 14px;
  font-size:12px;
  color:var(--text);
  cursor:pointer;
  transition:transform .12s ease, background .15s ease, border-color .15s ease, color .15s ease;
  white-space:nowrap;
  box-shadow:0 1px 2px rgba(0,0,0,.04);
}

.occupation-chip:hover{
  border-color:rgba(59,115,230,.40);
  background:rgba(59,115,230,.06);
  transform:translateY(-1px);
  color:var(--primary);
}

.empty-state{
  border:1px dashed var(--border);
  border-radius:12px;
  padding:10px 12px;
  text-align:center;
}

.hero-footer{
  display:flex;
  flex-direction:column;
  gap:8px;
  align-items:center;
  margin-top:18px;
  font-size:13px;
  color:var(--muted);
}

.stat-skeleton{
  display:flex;
  gap:8px;
  align-items:center;
}

.skeleton-bar{
  display:inline-block;
  height:10px;
  width:180px;
  border-radius:999px;
  background:linear-gradient(90deg, rgba(255,255,255,.08), rgba(59,115,230,.3), rgba(255,255,255,.08));
  background-size:200% 100%;
  animation:skeletonMove 1.4s ease-in-out infinite;
}
.skeleton-bar.short{ width:90px; }

@keyframes skeletonMove{
  0%{ background-position:200% 0; }
  100%{ background-position:-200% 0; }
}

.api-status{
  font-size:12px;
  opacity:.82;
  font-weight:700;
}

/* ===============================
   Search collapse animation
================================ */

body.search-collapsed .hero{
  min-height:auto;
  padding:22px 18px;
}

body.search-collapsed .hero-content,
body.search-collapsed .popular-section,
body.search-collapsed .hero-footer{
  display:none;
}

body.search-collapsed .search-container{ margin-bottom:0; }

body.search-collapsed .search-box{
  max-width:100%;
  height:48px;
  border-radius:24px;
}

body.search-collapsed .change-search{ display:inline-flex; }

/* ===============================
   Results list
================================ */

#resultsCard{ margin-top:18px; padding:14px; }

.results-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin-bottom:10px;
}

.results-header h2{ margin:0; font-size:16px; }

.pager{ display:flex; gap:10px; }

.results-list{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.result-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  padding:12px 14px;
  border:1px solid var(--border);
  border-radius:var(--radius-md);
  cursor:pointer;
  background:var(--surface);
  transition:background .15s ease, border-color .15s ease, transform .12s ease;
}

.result-row strong{ font-size:14.5px; }

.result-row:hover{
  background:rgba(59,115,230,.06);
  border-color:rgba(59,115,230,.25);
  transform:translateY(-1px);
}

.result-row:focus{ outline:none; box-shadow:var(--focus); }

/* ===============================
   Detail, summary, sections
================================ */

#detailCard{ margin-top:18px; padding:16px; }

.detail-header{
  display:flex;
  flex-direction:column;
  gap:12px;
  border-bottom:1px solid var(--border);
  padding-bottom:12px;
  margin-bottom:14px;
}

.detail-header-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}

.detail-title h2{ margin:0; font-size:20px; }
.role-title-row{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}
.change-role-link{
  font-size:13px;
  font-weight:700;
}
.role-meta{
  margin-top:6px;
}

.detail-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.export-group{
  display:flex;
  align-items:center;
  gap:6px;
  position:relative;
}

.export-menu{
  position:absolute;
  top:110%;
  right:0;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:12px;
  padding:6px;
  box-shadow:var(--shadow-soft);
  display:flex;
  flex-direction:column;
  gap:6px;
  min-width:180px;
  z-index:50;
}
.export-menu button{
  width:100%;
  text-align:left;
  border:1px solid var(--border);
  border-radius:10px;
  padding:8px 10px;
  background:var(--surface-2);
  cursor:pointer;
  font-weight:700;
  color:var(--text);
}
.export-menu button:hover{
  background:rgba(59,115,230,.06);
  border-color:rgba(59,115,230,.25);
}
.export-menu button:disabled{
  opacity:0.7;
  cursor:not-allowed;
  color:var(--muted);
  background:var(--surface);
}

.section-head{
  display:flex;
  justify-content:space-between;
  align-items:baseline;
  gap:10px;
  margin:14px 0 10px;
}

.section-head h3{ margin:0; font-size:15px; }

.kpi-row-header{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(140px, 1fr));
  gap:10px;
}
.kpi-pill{
  border:1px solid var(--border);
  border-radius:12px;
  padding:10px 12px;
  background:var(--surface);
  box-shadow:var(--shadow-soft);
}
.kpi-pill-label{
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:.08em;
  color:var(--muted);
  margin-bottom:4px;
}
.kpi-pill-value{
  font-size:22px;
  font-weight:900;
}

/* Pivot potential card */
.pivot-card{
  margin-bottom:14px;
  padding:14px;
}

.pivot-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}

.pivot-toggle{
  display:flex;
  align-items:center;
  gap:10px;
  border:1px solid var(--border);
  border-radius:12px;
  padding:10px 12px;
  background:var(--surface-2);
  color:var(--text);
  cursor:pointer;
  width:100%;
}

.pivot-count-badge{
  background:var(--primary);
  color:var(--primary-ink);
  border-radius:999px;
  padding:4px 10px;
  font-weight:800;
  font-size:12px;
}

.pivot-collapsible{
  margin-top:10px;
  border-top:1px solid var(--border-2);
  padding-top:10px;
}

.pivot-explainer{
  border:1px solid var(--border);
  border-radius:12px;
  padding:10px 12px;
  background:var(--surface-2);
  margin-bottom:12px;
}
.pivot-explainer-title{ font-weight:800; margin-bottom:6px; }
.pivot-explainer ul{ margin:0; padding-left:18px; color:var(--muted); }

.pivot-plan{
  border:1px dashed var(--border);
  border-radius:12px;
  padding:10px;
  margin-bottom:10px;
}
.pivot-plan-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.pivot-plan-title{ font-weight:800; }
.pivot-plan-list{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:8px;
}
.pivot-plan-chip{
  display:flex;
  align-items:center;
  gap:8px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--border);
  background:var(--surface);
  box-shadow:0 2px 6px rgba(0,0,0,.06);
}
.pivot-loading{
  padding:12px;
  text-align:center;
  color:var(--muted);
  font-size:13px;
}

.pivot-note{
  display:flex;
  align-items:flex-start;
  gap:8px;
  padding:10px 12px;
  margin:0 0 14px;
  background:var(--surface-2);
  border:1px solid var(--border-2);
  border-radius:var(--radius-sm);
  font-size:12.5px;
  color:var(--muted);
  line-height:1.5;
}

[data-theme="dark"] .pivot-note{
  background:rgba(255,255,255,.03);
  border-color:var(--border);
}

.pivot-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px;
  margin-bottom:8px;
  border:1px solid var(--border);
  border-radius:var(--radius-sm);
  background:var(--surface);
  text-decoration:none;
  color:var(--text);
  transition:background .15s ease, border-color .15s ease;
}

.pivot-row:hover{
  background:rgba(59,115,230,.06);
  border-color:rgba(59,115,230,.25);
}

[data-theme="dark"] .pivot-row:hover{
  background:rgba(91,141,239,.08);
  border-color:rgba(91,141,239,.3);
}

.pivot-row > div:first-child{
  flex:1;
  min-width:0;
}

.pivot-row .pivot-name{
  font-weight:600;
  font-size:14px;
  margin-bottom:4px;
  color:var(--text);
}

.pivot-row .pivot-sub{
  font-size:12px;
  color:var(--muted);
  line-height:1.4;
}

.pivot-pill{
  flex-shrink:0;
  padding:4px 10px;
  background:var(--primary);
  color:var(--primary-ink);
  border-radius:12px;
  font-weight:600;
  font-size:13px;
  white-space:nowrap;
}

[data-theme="dark"] .pivot-pill{
  background:var(--primary-dark);
}

.pivot-actions{
  display:flex;
  align-items:center;
  gap:8px;
}

.summary{
  border:1px solid var(--border);
  border-radius:var(--radius-md);
  padding:12px;
  margin-bottom:12px;
  background:linear-gradient(180deg, rgba(59,115,230,.05), transparent 70%);
}

[data-theme="dark"] .summary{
  background:linear-gradient(180deg, rgba(91,141,239,.10), transparent 70%);
}

.summary summary{
  cursor:pointer;
  list-style:none;
  user-select:none;
}

.summary summary::-webkit-details-marker{ display:none; }

.summary-top{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding:4px 0;
}

.summary-top h3{ margin:0; font-size:15px; }

.summary[open] summary svg{
  transform:rotate(180deg);
}

.summary-content{
  margin-top:10px;
  padding-top:10px;
  border-top:1px solid var(--border-2);
}

.summary-grid{
  display:grid;
  grid-template-columns:repeat(4, 1fr);
  gap:8px;
  margin-top:10px;
}

.kpi{
  border:1px solid var(--border);
  border-radius:12px;
  padding:8px 10px;
  background:var(--surface);
}

.kpi-label{
  font-size:10px;
  letter-spacing:.12em;
  color:var(--muted);
  font-weight:900;
  text-transform:uppercase;
  margin-bottom:4px;
}

.kpi-value{
  font-size:24px;
  font-weight:900;
  letter-spacing:-.5px;
  line-height:1;
}

.kpi-value.key1{ color:var(--c1); }
.kpi-value.key2{ color:var(--c2); }
.kpi-value.key3{ color:var(--c3); }
.kpi-value.key4{ color:var(--c4); }
.kpi-value.key5{ color:var(--c5); }

.summary-lists{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  margin-top:10px;
}

.summary-title{
  font-weight:900;
  margin:8px 0 10px;
  font-size:13px;
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:.08em;
}

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

.mini-list li{
  display:flex;
  align-items:center;
  gap:8px;
  padding:6px 10px;
  border-radius:10px;
  border:1px solid var(--border);
  background:var(--surface);
  font-size:12px;
}

.summary-note{ margin:12px 0 0; }

.targets-summary .kpi-value{ font-size:20px; }
.targets-summary-grid{
  display:grid;
  grid-template-columns:repeat(3, 1fr);
  gap:12px;
  margin-top:10px;
}
@media(max-width:720px){
  .targets-summary-grid{ grid-template-columns:1fr; }
}

.radar-chart-container{
  margin-top:20px;
  padding:16px;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius-md);
  min-height:320px; /* Ensure container has size for rendering */
}

.radar-chart-title{
  font-size:16px;
  font-weight:700;
  margin-bottom:4px;
  color:var(--text);
}

.radar-chart-note{
  font-size:12px;
  margin-bottom:12px;
}

.radar-chart-svg{
  display:flex;
  justify-content:center;
  align-items:center;
  min-height:280px;
}

.radar-chart-message{
  text-align:center;
  padding:40px 20px;
  color:var(--muted);
  font-size:14px;
}

.radar-svg{
  width:100%;
  max-width:280px;
  height:auto;
}

.breadth-chart-wrap{
  position:relative;
  height:340px;
  display:flex;
  justify-content:center;
  align-items:center;
}

.breadth-chart-wrap canvas{
  max-width:100%;
  max-height:100%;
}

@media (max-width: 640px) {
  .breadth-chart-wrap{
    height:260px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .radar-svg polygon {
    transition: none !important;
  }
}

/* ===============================
   How-to capability headline cards
================================ */

.framework-compact{
  display:grid;
  grid-template-columns:repeat(3, 1fr);
  gap:10px;
  margin-top:10px;
}

.framework-compact .fc-item{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 10px;
  border-radius:12px;
  border:1px solid var(--border);
  background:var(--surface);
  transition:transform .12s ease, border-color .15s ease, background .15s ease;
}

.framework-compact .fc-item:hover{
  transform:translateY(-1px);
  border-color:rgba(59,115,230,.20);
  background:rgba(59,115,230,.05);
}

.framework-compact .fc-text{
  display:flex;
  flex-direction:column;
  gap:2px;
  line-height:1.2;
}

.framework-compact .fc-title{ font-weight:900; font-size:13px; }
.framework-compact .fc-desc{ font-size:11px; margin-top:2px; line-height:1.3; }
.framework-compact .fc-weight{ font-weight:900; opacity:.82; margin-top:2px; }

/* ===============================
   Skills list and skill rows
================================ */

.skill-list{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.skill-row{
  display:grid;
  grid-template-columns:auto 1fr 1.6fr auto;
  gap:10px;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid var(--border);
  background:var(--surface);
  transition:border-color .15s ease, background .15s ease, transform .12s ease;
  --track-color:var(--c0);
  align-items:center;
}

.skill-actions{
  display:flex;
  align-items:center;
  gap:6px;
}

.skill-row.lvl-unset{
  --track-color:var(--c0);
  opacity:0.85;
}

.skill-row:hover{
  border-color:rgba(59,115,230,.25);
  background:rgba(59,115,230,.04);
}

.skill-name{
  font-size:15px;
  font-weight:700;
  align-self:center;
}

/* Track colour by rating */
.skill-row.lvl-0{ --track-color:var(--c0); }
.skill-row.lvl-1{ --track-color:var(--c1); }
.skill-row.lvl-2{ --track-color:var(--c2); }
.skill-row.lvl-3{ --track-color:var(--c3); }
.skill-row.lvl-4{ --track-color:var(--c4); }
.skill-row.lvl-5{ --track-color:var(--c5); }

.level-pill{
  width:44px;
  height:44px;
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:900;
  font-size:16px;
  border:2px solid var(--border);
  background:var(--surface);
  color:var(--text);
  align-self:center;
  transition:background .15s ease, color .15s ease, border-color .15s ease;
  box-shadow:0 2px 6px rgba(0,0,0,.1);
}

.level-pill.unset{
  background:var(--surface);
  color:var(--muted);
  border-color:var(--border);
}

.skill-row.lvl-1 .level-pill,
.skill-row.lvl-4 .level-pill,
.skill-row.lvl-5 .level-pill{
  background:var(--track-color);
  border-color:rgba(255,255,255,.20);
  color:#fff;
}

.skill-row.lvl-2 .level-pill,
.skill-row.lvl-3 .level-pill{
  background:var(--track-color);
  border-color:rgba(0,0,0,.08);
  color:#111;
}

/* Slider */
.slider{
  width:100%;
  appearance:none;
  height:9px;
  border-radius:999px;
  background:var(--track-color);
  outline:none;
  align-self:center;
}

.slider::-webkit-slider-thumb{
  appearance:none;
  width:22px;
  height:22px;
  border-radius:999px;
  background:var(--track-color);
  border:3px solid var(--surface);
  box-shadow:0 10px 18px rgba(0,0,0,.18);
  cursor:pointer;
}

.slider::-moz-range-thumb{
  width:22px;
  height:22px;
  border-radius:999px;
  background:var(--track-color);
  border:3px solid var(--surface);
  box-shadow:0 10px 18px rgba(0,0,0,.18);
  cursor:pointer;
}

.slider:focus{ box-shadow:var(--focus); }

.target-input-wrap{
  display:flex;
  flex-direction:column;
  gap:4px;
  min-width:140px;
}
.target-gap{
  font-size:12px;
  color:var(--muted);
}
.target-gap.has-gap{
  color:var(--primary);
  font-weight:800;
}

/* ===============================
   Add skill
================================ */

.addbox{
  border:1px solid var(--border);
  border-radius:var(--radius-md);
  padding:14px;
  margin-top:14px;
  background:var(--surface);
}

.addbox-head{
  display:flex;
  justify-content:space-between;
  align-items:baseline;
  gap:10px;
  margin-bottom:12px;
}

.addbox-head h3{ margin:0; font-size:15px; }

.add-row{
  display:grid;
  grid-template-columns:1fr 160px 120px;
  gap:10px;
  align-items:center;
}

.filters-card{
  margin-top:12px;
  padding:14px;
}

.filter-chips{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}

.filter-chip{
  padding:8px 14px;
  border-radius:16px;
  border:1px solid var(--border);
  background:var(--surface);
  cursor:pointer;
  font-weight:700;
  color:var(--text);
  transition:background .15s ease, border-color .15s ease, color .15s ease;
}
.filter-chip:hover{
  border-color:rgba(59,115,230,.35);
  background:rgba(59,115,230,.06);
}
.filter-chip.active{
  background:var(--primary);
  color:var(--primary-ink);
  border-color:transparent;
}

/* ===============================
   Framework (details)
================================ */

.framework{
  margin-top:12px;
  border:1px solid var(--border);
  border-radius:14px;
  padding:10px;
  background:var(--surface-2);
}

.framework summary{
  cursor:pointer;
  font-weight:900;
  list-style:none;
  user-select:none;
}
.framework summary::-webkit-details-marker{ display:none; }

.framework-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  margin-top:10px;
}

.keychip{
  width:36px;
  height:36px;
  border-radius:50%;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-weight:900;
  font-size:16px;
  color:#fff;
  margin-right:10px;
  flex-shrink:0;
  box-shadow:0 2px 8px rgba(0,0,0,.15);
}

.key0{ background:var(--c0); }
.key1{ background:var(--c1); }
.key2{ background:var(--c2); color:#111; }
.key3{ background:var(--c3); color:#111; }
.key4{ background:var(--c4); }
.key5{ background:var(--c5); }

/* ===============================
   Footer
================================ */

.site-footer{
  margin-top:48px;
  padding:32px 0 24px;
  border-top:1px solid var(--border);
  background:var(--surface-2);
}

.footer-cta-card{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  padding:20px 24px;
  margin-bottom:32px;
  box-shadow:var(--shadow-soft);
}

.footer-accordion{
  border:1px solid var(--border);
  border-radius:12px;
  padding:10px 12px;
  background:var(--surface-2);
  margin-bottom:12px;
}
.footer-accordion summary{
  cursor:pointer;
  font-weight:800;
  list-style:none;
}
.footer-accordion summary::-webkit-details-marker{ display:none; }

.footer-links-grid{
  display:grid;
  grid-template-columns:repeat(3, 1fr);
  gap:24px;
  margin-bottom:32px;
  padding-bottom:32px;
  border-bottom:1px solid var(--border);
}

.footer-links-column h4{
  color:var(--text);
}

.footer-links-list{
  list-style:none;
  padding:0;
  margin:0;
  display:flex;
  flex-direction:column;
  gap:8px;
}

.footer-links-list li{
  margin:0;
}

.footer-links-list a{
  color:var(--muted);
  text-decoration:none;
  font-size:13px;
  transition:color .15s ease;
}

.footer-links-list a:hover{
  color:var(--primary);
  text-decoration:underline;
}

.footer-meta-row{
  display:grid;
  grid-template-columns:1fr auto;
  gap:32px;
  align-items:start;
}

.footer-meta-text{
  font-size:11px;
  line-height:1.6;
}

.footer-share-block{
  min-width:200px;
}

.footer-share-buttons{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.footer-share-icon{
  width:40px;
  height:40px;
  padding:0;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:10px;
  background:var(--surface);
  border:1px solid var(--border);
  color:var(--text);
  cursor:pointer;
  transition:background .15s ease, border-color .15s ease, transform .12s ease;
}

.footer-share-icon:hover{
  background:rgba(59,115,230,.06);
  border-color:rgba(59,115,230,.25);
  transform:translateY(-1px);
}

.footer-share-icon:focus{
  outline:none;
  box-shadow:var(--focus);
}

.footer-share-icon:active{
  transform:translateY(0);
}

@media(max-width:900px){
  .footer-links-grid{
    grid-template-columns:1fr;
    gap:20px;
  }
  
  .footer-meta-row{
    grid-template-columns:1fr;
    gap:24px;
  }
  
  .footer-share-block{
    min-width:auto;
  }
}

/* ===============================
   Responsive
================================ */

@media(max-width:980px){
  .summary-grid{ grid-template-columns:1fr 1fr; }
  .summary-lists{ grid-template-columns:1fr; }
}

@media(max-width:900px){
  .skill-row{ 
    grid-template-columns:auto 1fr auto; 
    gap:8px; 
  }
  .skill-row .skill-rating-inputs{ 
    grid-column:1 / -1; 
    order:3; 
  }
  .skill-row .skill-actions{ 
    order:2; 
    justify-self:end; 
  }
  .level-pill{ width:46px; height:46px; }
  .add-row{ grid-template-columns:1fr; }
  .framework-grid{ grid-template-columns:1fr; }
  .framework-compact{ grid-template-columns:1fr; }
}

@media(max-width:780px){
  .seo-details .seo-grid{ grid-template-columns:1fr; }
}

@media(max-width:768px){
  .hero{
    min-height:calc(100vh - 120px);
    padding:40px 18px 32px;
  }

  .hero-content{ margin-bottom:30px; }

  .hero-title{ margin-bottom:14px; letter-spacing:-1px; }

  .hero-description{ font-size:15px; }

  .search-box{
    height:52px;
    padding:0 16px;
    border-radius:26px;
  }

  .search-actions{
    flex-direction:column;
    width:100%;
    gap:10px;
  }

  .search-btn-primary,
  .search-btn-secondary{
    width:100%;
    max-width:320px;
  }

  .footer-row{ flex-direction:column; }
}

/* On smaller screens, avoid header overlap */
@media(max-width:560px){
  .header-row{ justify-content:space-between; }

  .brand-link{
    position:static;
    transform:none;
    left:auto;
    max-width:none;
  }

  .brand-sub{ display:none; }
}

@media(max-width:520px){
  .hero{ padding:32px 14px 24px; }

  .hero-title{ font-size:32px; letter-spacing:-.8px; }

  .hero-description{ font-size:14px; }

  .search-box{
    height:48px;
    padding:0 14px;
    border-radius:24px;
  }

  .search-icon{ width:18px; height:18px; margin-right:12px; }

  #detailCard{ padding:14px; }

  .detail-header{ flex-direction:column; align-items:stretch; }
  .detail-actions{ justify-content:flex-start; }
}

/* ===============================
   Print
================================ */

@media print{
  .site-header,
  .hero,
  #resultsCard,
  .addbox,
  .site-footer,
  #themeToggle{
    display:none !important;
  }

  body{ background:#fff; color:#000; }

  body::before,
  body::after{ display:none !important; }

  .card{ box-shadow:none; border:0; }

  #detailCard{ padding:0; margin:0; }

  .skill-row{ border-color:#ddd; background:#fff; }

  .slider{ display:none !important; }

  /* Always show framework in PDF */
  details.summary[aria-label="How to use Insynode"]{ display:block !important; }
  details.summary[aria-label="How to use Insynode"] > summary{ display:none !important; }
  details.summary[aria-label="How to use Insynode"] .summary-content{ display:block !important; border-top:none !important; padding-top:0 !important; }
}
