/* =====================
   Base, Theme & Glass
   ===================== */
:root {
  /* New palette (from your target style) */
  --ink: #0e1318;
  --bg-1: #0f141a;
  --bg-2: #131a22;
  --text: #eaf1f6;
  --muted: #9fb0c1;

  --teal:  #4aa8b5;
  --coral: #ff8c8c;
  --peach: #ffb0a3;
  --foam:  #b9f3e0;

  --accent: var(--teal);
  --card: rgba(20, 26, 34, 0.6);
  --stroke: rgba(255,255,255,.12);
  --shadow: rgba(0,0,0,.45);

  /* Glass tuning */
  --glass-blur: 12px;
  --glass-sat: 140%;

  /* Keep your custom layout vars so JS/CSS continues to work */
  --radius: 16px;
  --base-size: 18px;
  --open-h: 120vh;

  /* Map old variable names to new theme for compatibility */
  --bg: var(--bg-2);
  --bg-soft: var(--bg-1);
  --eule-blue: var(--teal);

  --search-gap-top: 10px; /* keeps search & sidebar aligned */
    --layout-gap: 24px;
  --sidebar-w: 320px;
  --sidebar-collapsed-w: 52px;   /* width when collapsed (shows just the toggle/label) */

}

.light {
  --bg-1: #f6f8fb;
  --bg-2: #ffffff;
  --text: #0f141a;
  --muted: #546475;
  --card: rgba(255,255,255,.7);
  --stroke: rgba(0,0,0,.10);
  --shadow: rgba(17,24,39,.08);
  --accent: #2e7f8c;

  /* compatibility */
  --bg: var(--bg-2);
  --bg-soft: var(--bg-1);
}

/* Resets / base */
* { box-sizing: border-box; }
/* One scroller (html) + stable gutter; avoid double scrollbars */
html { height: 100%; scrollbar-gutter: stable; }
body { min-height: 100%; overflow-y: auto; scroll-behavior: smooth; }

/* Fallback only for browsers that don't support scrollbar-gutter */
@supports not (scrollbar-gutter: stable) {
  body { overflow-y: scroll; } /* reserve space without layout shift */
}

body {
  margin: 0;
  font: var(--base-size)/1.6 system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background: var(--bg-2); /* base behind the gradient layer */
  overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }

/* Continuous fixed background (no seams) */
.bg {
  position: fixed; inset: -20vmax; z-index: -1; pointer-events: none;
  background:
    radial-gradient(120vmax 80vmax at 10% 10%, rgba(74,168,181,.18), transparent 60%),
    radial-gradient(90vmax 70vmax at 85% 15%, rgba(255,140,140,.16), transparent 60%),
    radial-gradient(90vmax 70vmax at 20% 90%, rgba(185,243,224,.12), transparent 60%),
    linear-gradient(180deg, var(--bg-1), var(--bg-2));
  background-repeat: no-repeat;
  background-attachment: fixed;
  will-change: transform;
}

/* Glass utility */
.glass {
  background: var(--card);
  border: 1px solid var(--stroke);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  box-shadow: 0 10px 30px var(--shadow);
  position: relative;
  border-radius: var(--radius);
}
.glass:before {
  content: "";
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(135deg, rgba(255,255,255,.14), rgba(255,255,255,0) 35%, rgba(255,255,255,.08) 70%);
  mix-blend-mode: overlay;
}

/* =====================
   Container & Header
   ===================== */
.container { width: 75%; max-width: 1200px; margin: 0 auto; padding: 24px; }

/* Top bar (use your existing markup) */
/* Make header a positioning context */
.topbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;   /* center the brand line */
  gap: 16px;
  flex-wrap: wrap;
  padding: 0px 0 8px;
}

/* Brand centered across the row */
.brand {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 36px;
  font-weight: 100;
}

/* Toggle pinned to top-right of header */
.actions {
  position: absolute;
  top: 12px;
  right: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 2;
}

/* (Optional) keep it clear on very small screens */
@media (max-width: 480px) {
  .actions { top: 8px; right: 10px; }
}

.logo-wrap { width: 64px; height: 64px; border-radius: 12px; overflow: hidden; display: grid; place-items: center; }
.logo-obj  { width: 100%; height: 100%; object-fit: contain; image-rendering: -webkit-optimize-contrast; image-rendering: crisp-edges; }
.brand-text { display: flex; flex-direction: column; }
.brand-line { display: flex; align-items: baseline; gap: 8px; }
.brand-name { margin: 0; font-weight: 300; letter-spacing: .02em; color: var(--text); line-height: 1.1; }
h1 { margin: 0; font-size: clamp(22px, 2.4vw, 28px); }
.sub { color: var(--muted); margin-top: 4px; font-size: 0.95em; }

/* Theme switch (keep your minimal toggle) */
.switch { position: relative; width: 34px; height: 18px; border-radius: 999px; background: rgba(255,255,255,.08); border: 1px solid var(--stroke); display:flex; align-items:center; padding:2px; }
.switch .track { display:none; } /* not used with this look */
.thumb { position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; color: #0b1116; display: grid; place-items: center; box-shadow: 0 4px 14px rgba(0,0,0,.35); transition: transform 180ms; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch input:checked ~ .thumb { transform: translateX(16px); }

/* =====================
   Navigation & Search
   ===================== */
nav.primary { display:flex; justify-content:center; flex-wrap:wrap; gap:12px; margin: 16px 0 10px 0; }
.navbtn {
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,.04);
  color: var(--text);
  border-radius: 14px;
  padding: 10px 16px;
  font-weight: 600;
  box-shadow: 0 6px 18px var(--shadow);
  transition: transform .08s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
}
.navbtn:hover { transform: translateY(-1px); background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.18); }
.navbtn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.search { margin: var(--search-gap-top) 0 24px 0; display:flex; gap:10px; }
.search input {
  flex: 1; padding: 14px 16px; font-size: 1.05em; border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,.04);
  color: var(--text);
  box-shadow: 0 6px 18px var(--shadow);
}

/* =====================
   Sections & Titles
   ===================== */
section { margin: 28px 0; padding: 0; }
.section-title { margin: 0 0 12px; font-size: 24px; font-weight: 900; color: var(--text); }

/* =====================
   Workflow cards (glass)
   ===================== */
.wf-card {
  /* Apply glass look */
  background: var(--card);
  border: 1px solid var(--stroke);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  box-shadow: 0 10px 30px var(--shadow);
  position: relative;

  border-radius: var(--radius);
  margin: 12px 0;
  overflow: hidden;
  transition: box-shadow .2s ease, border-color .2s ease, background .2s ease;
}
.wf-card:before {
  content: "";
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(135deg, rgba(255,255,255,.14), rgba(255,255,255,0) 35%, rgba(255,255,255,.08) 70%);
  mix-blend-mode: overlay;
}
.wf-card:hover { box-shadow: 0 14px 36px var(--shadow); border-color: rgba(255,255,255,.18); }

.wf-head {
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding: 18px 20px; cursor: pointer;
  background: rgba(255,255,255,.04);
  border-bottom: 1px solid var(--stroke);
}
.wf-title { font-weight: 700; }
.wf-ind   { color: var(--muted); font-size: .95em; }

/* Expanding content (PDF) */
.wf-body { max-height: 0; transition: max-height .3s ease; background: var(--bg-1); }
.wf-card.open .wf-body { max-height: var(--open-h); }
.pdfwrap { height: var(--open-h); }
.pdfwrap iframe { width: 100%; height: 100%; border: 0; background: #fff; }

/* Footer */
footer { color: var(--muted); margin-top: 26px; font-size: .95em; border-top: 1px solid var(--stroke); padding-top: 16px; }

/* Responsive tweaks (mirroring target style) */
@media (max-width: 1024px) {
  .container { width: 85%; }
}
@media (max-width: 768px) {
  .topbar { justify-content: center; text-align: center; }
  .brand  { width: 100%; }
}
@media (max-width: 480px) {
  .container { width: 92%; }
  h1 { font-size: 22px; }
}
.nores{
  margin: 12px 0;
  padding: 10px 14px;
  border-radius: 10px;
  border:1px solid var(--stroke);
  background: rgba(255,255,255,.04);
  color: var(--muted);
  display: inline-block;
}
/* Grid: main content + sidebar. Sidebar column uses its own width so we can animate it */
.layout {
  display: grid;
  grid-template-columns: 1fr auto;   /* main grows; sidebar width is set on .sidebar */
  gap: var(--layout-gap);
  align-items: start;
}

/* Main column */
.content { min-width: 0; }

/* Sidebar column flush with right edge of the container (not floating) */
.sidebar {
  width: var(--sidebar-w);
  transition: width .25s ease;
  align-self: start;
  margin-top: var(--search-gap-top);  /* aligns top with search */
  position: sticky;
  top: 16px;                           /* stick under header as you scroll */
  overflow: visible;                   /* let the toggle sit inside nicely */
}

/* Panel inside the sidebar */
.side-panel.glass { padding: 16px; border-radius: 16px; }
.side-title { margin: 0 0 10px; font-size: 18px; color: var(--text); }

/* Text-only links */
.side-links { display: flex; flex-direction: column; gap: 8px; }
.side-link {
  display: block;
  padding: 2px 0;
  border: 0; background: transparent; box-shadow: none;
  font-size: 16px;
  color: var(--accent); text-decoration: none;
  transition: color .15s ease, opacity .15s ease;
}
.side-link:hover { text-decoration: underline; }
.side-link:active { opacity: .85; }

/* Toggle button (inside sidebar, top-right) */
.side-toggle {
  appearance: none;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  background: rgba(255,255,255,.06);
  color: var(--text);
  height: 36px; width: 36px;
  display: grid; place-items: center;
  cursor: pointer;
  box-shadow: 0 6px 18px var(--shadow);
  transition: background .15s ease, transform .08s ease;
  margin-left: auto;          /* push it to the right inside side-panel header area */
}
.side-toggle:hover { background: rgba(255,255,255,.1); }
.side-toggle:active { transform: translateY(1px); }

/* Optionally hide the toggle label text and use an icon-like character */
.side-toggle .lbl { font-size: 18px; line-height: 1; }

/* Collapsed state (applied on the layout wrapper) */
.layout.sidebar-collapsed .sidebar {
  width: var(--sidebar-collapsed-w);
}

/* Hide panel contents when collapsed, keep only the toggle visible */
.layout.sidebar-collapsed .side-title,
.layout.sidebar-collapsed .side-links {
  display: none;
}

/* Keep the glass box compact when collapsed */
.layout.sidebar-collapsed .side-panel.glass {
  padding: 8px;
  display: grid;
  justify-items: end;
}

/* Responsive: stack columns on tablets/phones and show full panel content */
@media (max-width: 1024px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; width: 100%; margin-top: 0; }
  .layout.sidebar-collapsed .sidebar { width: 100%; }
  .layout.sidebar-collapsed .side-title,
  .layout.sidebar-collapsed .side-links { display: block; }
  .side-toggle { display: none; } /* no need to collapse on narrow screens */
}
/* ===== Left sidebar, full-bleed, collapsible (clean) ===== */
:root{
  --layout-gap: 24px;
  --sidebar-w: 320px;
  --sidebar-collapsed-w: 52px;
}

/* Grid: left sidebar + main content */
.page{
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  gap: var(--layout-gap);
  align-items: start;
  width: 100%;
  max-width: none;
  margin: 0;
  transition: grid-template-columns .2s ease;
}
.page.sidebar-collapsed{
  grid-template-columns: var(--sidebar-collapsed-w) minmax(0, 1fr);
}

/* Center the content column within the right grid cell */
.page > .container{
  justify-self: center;
  width: min(75%, 1200px);
}

/* Left rail: attached to window edge, full height */
.sidebar{
  position: sticky;
  top: 0;
  height: 100vh;
  width: var(--sidebar-w);
  margin: 0;
  transition: width .25s ease;
}
.page.sidebar-collapsed .sidebar{ width: var(--sidebar-collapsed-w); }

/* Sidebar panel visuals */
.side-panel.glass{
  height: 100%;
  padding: 16px;
  border-radius: 0 0 0 0; /* flush left edge */
}

/* Hide content when collapsed (keep just the toggle) */
.page.sidebar-collapsed .side-title,
.page.sidebar-collapsed .side-links{ display: none; }
.page.sidebar-collapsed .side-panel.glass{
  padding: 8px;
  display: grid;
  justify-items: end;
}

/* Icon-only toggle (no box) */
.side-toggle{
  appearance: none;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: px;          /* keeps a decent hit area */
  margin-left: auto;
  cursor: pointer;
  transition: transform .08s ease, color .15s ease, opacity .15s ease;
}

.side-toggle:hover{ color: var(--accent); }
.side-toggle:active{ transform: scale(0.96); }

/* Accessible focus ring */
.side-toggle:focus-visible{
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;    /* just for the focus ring shape */
}

/* The “≡” icon */
.side-toggle .lbl{
  font-size: 20px;
  line-height: 1;
  font-weight: 600;
}

/* Text-only links (keep) */
.side-links{ display: flex; flex-direction: column; gap: 8px; }
.side-link{
  display: block;
  padding: 2px 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  font-size: 16px;
  color: var(--accent);
  text-decoration: none;
  transition: color .15s ease, opacity .15s ease;
}
.side-link:hover{ text-decoration: underline; }
.side-link:active{ opacity: .85; }

/* Responsive: stack; content full-width; rounded panel; hide toggle */
@media (max-width: 1024px){
  .page{ grid-template-columns: 1fr; }
  .page > .container{ justify-self: stretch; width: 100%; }
  .sidebar{ position: static; height: auto; width: 100%; }
  .side-panel.glass{ border-radius: 16px; }
  .side-toggle{ display: none; }
}
/* 1) Keep card background inside the border */
.wf-card { background-clip: padding-box; }

/* 2) Pull the overlay in by 1px so it never hits the border */
.wf-card::before{
  inset: 1px;                               /* was: inset: 0 */
  border-radius: calc(var(--radius) - 1px); /* match the inset */
}

/* 3) Make sure a collapsed body can’t draw a divider */
.wf-body{
  overflow: hidden;
  border-top: 0 !important; /* in case an old rule adds one */
}

/* 4) Nudge GPU to avoid subpixel hairlines on some setups */
.wf-card,
.wf-card::before{
  transform: translateZ(0);
  backface-visibility: hidden;
}
