:root{
  --bg:#f5f7fb;
  --card:#ffffff;
  --ink:#0f172a;
  --muted:#64748b;
  --border:#e5e7eb;
  --shadow:0 12px 26px rgba(15,23,42,.06);
  --radius:16px;
  --topbarH:64px;
  --sidebarW:300px;
  --accent:#2563eb;
  --font-family: system-ui,-apple-system,"Segoe UI",Roboto,Inter,Arial,sans-serif;
}

/* ✅ Stop browser scroll anchoring (prevents auto scroll creep) */
html, body { overflow-anchor: none; }
/* ✅ Prevent micro layout shift from scrollbar */
html { scrollbar-gutter: stable; }

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: var(--font-family);
  font-size:15px;
  line-height:1.5;
  color:var(--ink);
  background:var(--bg);
  font-weight:400;
}

a{color:inherit; text-decoration:none}
a:hover{text-decoration:none}

/* Topbar */
.topbar{
  height:var(--topbarH);
  display:flex;
  align-items:center;
  gap:12px;
  padding:0 14px;
  background:#fff;
  border-bottom:1px solid var(--border);
  position:sticky;
  top:0;
  z-index:50;
}

/* Hamburger */
.menu-toggle{
  width:42px; height:42px;
  border-radius:999px;
  border:1px solid #dbe7ff;
  background:linear-gradient(135deg,#e8f1ff,#ffffff);
  box-shadow:0 8px 18px rgba(37,99,235,.10);
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
}
.menu-toggle-bars{
  width:18px; height:12px;
  position:relative;
  display:block;
}
.menu-toggle-bars::before,
.menu-toggle-bars::after,
.menu-toggle-bars span{
  content:"";
  position:absolute;
  left:0; right:0;
  height:2px;
  border-radius:999px;
  background:#2563eb;
}
.menu-toggle-bars::before{ top:0; }
.menu-toggle-bars span{ top:5px; }
.menu-toggle-bars::after{ bottom:0; }

/* Brand spacing */
.brand-link{
  display:flex;
  flex-direction:column;
  line-height:1.25;
  gap:2px;
  text-decoration:none !important;
}
.brand-main{ font-size:15px; font-weight:600; }
.brand-sub{ font-size:12px; color:var(--muted); font-weight:400; }

.layout{
  display:flex;
  min-height:calc(100vh - var(--topbarH));
  position:relative;
}

/* Sidebar */
.sidebar{
  width:var(--sidebarW);
  flex:0 0 var(--sidebarW);
  border-right:1px solid var(--border);
  background:#fff;
  position:sticky;
  top:var(--topbarH);
  height:calc(100vh - var(--topbarH));
  overflow:auto;
}

.sidebar-inner{ padding:12px; }

/* ✅ Remove sidebar footer text completely */
.sidebar-footer{ display:none; }

/* Desktop collapse */
body.sidebar-collapsed .sidebar{
  width:0;
  flex:0 0 0;
  overflow:hidden;
  border-right:0;
}
body.sidebar-collapsed .sidebar-inner{ display:none; }

/* Mobile */
.sidebar-scrim{
  display:none;
  position:fixed;
  inset:var(--topbarH) 0 0 0;
  background:rgba(15,23,42,.35);
  z-index:40;
}

@media (max-width: 980px){
  .sidebar{
    position:fixed;
    left:0;
    top:var(--topbarH);
    height:calc(100vh - var(--topbarH));
    transform:translateX(-105%);
    transition:transform .2s ease;
    z-index:60;
    box-shadow:0 20px 50px rgba(0,0,0,.12);
    width:min(var(--sidebarW), 86vw);
    flex:0 0 auto;
  }
  body.sidebar-open .sidebar{ transform:translateX(0); }
  body.sidebar-open .sidebar-scrim{ display:block; }

  body.sidebar-collapsed .sidebar{ transform:translateX(-105%); }
  body.sidebar-collapsed .sidebar-inner{ display:block; }
}

/* Sidebar blocks */
.side-block{
  border:1px solid var(--border);
  border-radius:14px;
  background:#fff;
  box-shadow:0 10px 20px rgba(15,23,42,.04);
  padding:10px;
  margin-bottom:10px;
}

/* ✅ "SECTIONS" slightly bigger */
.side-title{
  font-size:13px;
  letter-spacing:.08em;
  text-transform:uppercase;
  font-weight:600;
  color:#0f172a;
  margin:0 0 8px;
}

.side-back{
  display:block;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid #dbe7ff;
  background:#f8fbff;
  color:#1d4ed8;
  font-weight:500;
}

.side-search{
  width:100%;
  padding:10px 12px;
  border:1px solid var(--border);
  border-radius:12px;
  outline:none;
  font-weight:400;
  margin-bottom:10px;
}

.side-nav{ display:flex; flex-direction:column; gap:8px; }

.side-item{
  display:block;
  padding:10px 12px;
  border-radius:999px;
  border:1px solid var(--border);
  background:#fff;
  color:#0f172a;
  white-space:normal;
  word-break:break-word;
  font-weight:400;
}
.side-item-section{
  font-weight:500;
  text-transform:uppercase;
  letter-spacing:.04em;
  font-size:12px;
}
.side-item-tool{
  font-weight:400;
  font-size:13px;
}
.side-item-tool.active{
  border-color:#93c5fd;
  background:#eef6ff;
  font-weight:500;
}
.side-item:hover{ border-color:#dbe7ff; background:#fbfdff; }

/* Content */
.content{
  flex:1;
  padding:18px 18px 40px;
  min-width:0;
}
.container{
  max-width:1120px;
  margin:0 auto;
}

.hero{
  background:linear-gradient(135deg,#edf4ff,#ffffff);
  border:1px solid var(--border);
  border-radius:22px;
  box-shadow:var(--shadow);
  padding:18px;
  margin-bottom:14px;
}
.hero-compact{ padding:16px; }

.hero h1{
  margin:0 0 6px;
  font-size:26px;
  font-weight:600;
}
.hero p{
  margin:0 0 12px;
  color:var(--muted);
  font-weight:400;
}

.search-wrap{ position:relative; max-width:760px; }
.search{
  width:100%;
  padding:11px 12px;
  border:1px solid var(--border);
  border-radius:14px;
  outline:none;
  font-weight:400;
}
.search-results{
  position:absolute;
  left:0; right:0;
  top:46px;
  border:1px solid var(--border);
  border-radius:14px;
  background:#fff;
  box-shadow:0 16px 38px rgba(15,23,42,.10);
  overflow:hidden;
  display:none;
  z-index:30;
}
.search-results a{
  display:flex;
  justify-content:space-between;
  gap:10px;
  padding:10px 12px;
  border-bottom:1px solid #f1f5f9;
  font-weight:400;
}
.search-results a:last-child{ border-bottom:none; }
.search-results small{ color:var(--muted); font-weight:400; }

/* Cards */
.grid{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(260px, 1fr));
  gap:14px;
}

/* ✅ card is flex column (already), keep it */
.card{
  background:#fff;
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:14px;
  display:flex;
  flex-direction:column;
  /* OPTIONAL: gives more consistent card height */
  min-height: 140px;
}

.card-title{
  text-transform:uppercase;
  letter-spacing:.06em;
  font-weight:500;
  font-size:13px;
  margin-bottom:6px;
}

.tool-title{
  font-weight:600;
  font-size:14px;
  margin-bottom:6px;
}

.card-desc{
  color:var(--muted);
  font-weight:400;
  font-size:13px;
  margin:0;
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:9px 12px;
  border-radius:999px;
  border:1px solid #c7dbff;
  background:#fff;
  color:#1d4ed8;
  font-weight:500;
  min-width:130px;
  width:max-content;
  margin-top:12px;
}

/* ✅ KEY FIX: aligns "Open tool" buttons */
.card .btn{
  margin-top:auto;
}

/* Tool iframe (legacy tools) */
.tool-frame{
  width:100%;
  border:0;
  display:block;
  min-height:700px;
  background:transparent;
  opacity:0;
  transition:height .18s ease, opacity .12s ease;
}
.tool-frame.is-ready{ opacity:1; }

/* Reviewer badge (bigger + clearer + icon) */
.tool-review{
  position: fixed;
  right: 18px;
  bottom: 14px;
  z-index: 45;

  display: inline-flex;           /* ✅ icon + text inline */
  align-items: center;
  gap: 8px;

  background: rgba(255,255,255,.95);
  border: 1px solid var(--border);
  box-shadow: 0 12px 26px rgba(15,23,42,.12);
  border-radius: 999px;

  padding: 10px 14px;
  font-size: 13px;
  color: var(--muted);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* ✅ review/verified icon (no image file needed) */
.tool-review::before{
  content:"";
  width:16px;
  height:16px;
  flex:0 0 16px;
  opacity:.9;
  background-repeat:no-repeat;
  background-size:contain;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M20 6l-11 11-5-5' stroke='%232563eb' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.tool-review a{
  color: var(--accent);
  font-weight: 700;
}

/* Hide when mobile sidebar is open */
body.sidebar-open .tool-review{ display:none; }

/* Mobile: keep it readable */
@media (max-width: 980px){
  .tool-review{
    right: 12px;
    bottom: 12px;
    padding: 11px 14px;
    font-size: 13px;
  }
  .tool-review::before{
    width:18px;
    height:18px;
    flex-basis:18px;
  }
}
