/* ==========================================================================
   Krokus Design System v2 — based on Figma brandbook
   Font: Inter · All values extracted from Figma "Home Screen" CSS
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');

/* ── Brand palette (brandbook) ─────────────────────────────────────────── */
:root {
  /* Brand gradient colors */
  --brand-c1-from:  #5E3EE9;
  --brand-c1-to:    #945FFA;
  --brand-c2-from:  #2971EF;
  --brand-c2-to:    #7CBDFD;
  --brand-c3-from:  #F5A427;
  --brand-c3-to:    #FDD47A;

  /* Brand gradients — exact angles from Figma */
  --brand-grad-1: linear-gradient(120.32deg, rgba(94,62,233,0.7) 13.27%, rgba(148,95,250,0.7) 92.76%);
  --brand-grad-2: linear-gradient(104.77deg, rgba(41,113,239,0.7) 9.41%, rgba(124,189,253,0.7) 93.52%);
  --brand-grad-3: linear-gradient(112.64deg, rgba(245,164,39,0.7) 13.09%, rgba(253,212,122,0.7) 89.5%);

  /* Neutral scale */
  --neutral-10:  #F0F1F5;
  --neutral-20:  #E3E4EB;
  --neutral-40:  #A7A8B8;
  --neutral-50:  #7B7A93;
  --neutral-70:  #525166;
  --neutral-80:  #3D3C4C;
  --black:       #111827;
  --white:       #FFFFFF;

  /* Primary (violet/purple) */
  --primary-10:  #E9E7FF;
  --primary-50:  #5F59C7;
  --primary-60:  #433F96;
  --primary-70:  #433F96;

  /* Secondary (blue) */
  --secondary-10:  #E2EBFF;
  --secondary-60:  #476FD1;
  --secondary-70:  #3758B0;

  /* Success */
  --success-10:  #D1F5E1;
  --success-50:  #43966E;
  --success-60:  #357B5A;

  /* Warning */
  --warning-10:  #FEF1C7;
  --warning-60:  #D89F0F;

  /* Danger */
  --danger-10:   #FEE2E2;
  --danger-60:   #DC2626;

  /* Semantic aliases (used by partials) */
  --bg:        var(--neutral-10);
  --surface:   var(--white);
  --ink:       var(--black);
  --ink-2:     var(--neutral-70);
  --ink-3:     var(--neutral-50);
  --line:      var(--neutral-20);
  --line-2:    var(--neutral-40);
  --accent:    var(--primary-50);
  --accent-soft: var(--primary-10);
  --accent-green: var(--success-50);
  --accent-yellow: var(--warning-60);
  --accent-red:   var(--danger-60);

  /* Nav active state */
  --nav-active-bg:   var(--primary-10);
  --nav-active-ink:  var(--neutral-70);
  --nav-active-icon: var(--primary-50);

  /* Sidebar */
  --sidebar: var(--white);
  --sidebar-width: 278px;

  /* Radius */
  --radius-sm:   6px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-xl:   16px;
  --radius-card: 16px;
  --radius-pill: 999px;

  /* Base unit — compatibility with sidebar/partials inline styles */
  --u: 20px;
}

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

html, body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { display: block; max-width: 100%; }

/* ── Typography scale (Figma) ────────────────────────────────────────────── */
.t-h3    { font-weight: 700; font-size: 40px; line-height: 48px; letter-spacing: -0.01em; }
.t-xxl-b { font-weight: 700; font-size: 24px; line-height: 32px; letter-spacing: -0.01em; }
.t-l-b   { font-weight: 700; font-size: 20px; line-height: 28px; letter-spacing: -0.01em; }
.t-l-r   { font-weight: 400; font-size: 20px; line-height: 28px; letter-spacing: -0.01em; }
.t-m-b   { font-weight: 700; font-size: 18px; line-height: 28px; letter-spacing: -0.01em; }
.t-s-b   { font-weight: 700; font-size: 16px; line-height: 24px; letter-spacing: -0.01em; }
.t-s-r   { font-weight: 400; font-size: 16px; line-height: 24px; letter-spacing: -0.01em; }
.t-xs-m  { font-weight: 500; font-size: 14px; line-height: 20px; letter-spacing: -0.01em; }
.t-xs-r  { font-weight: 400; font-size: 14px; line-height: 20px; letter-spacing: -0.01em; }
.t-xxs-r { font-weight: 400; font-size: 12px; line-height: 16px; letter-spacing: -0.01em; }

/* ── Layout ──────────────────────────────────────────────────────────────── */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: 100vh;
  min-width: 1200px;   /* below this the page scrolls horizontally instead of breaking the layout */
  background: var(--bg);
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.sidebar {
  background: var(--white);
  width: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 40px 40px 40px 40px;
  gap: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

/* Logo link override — sidebar partial uses inline styles */
.sidebar > a:first-child {
  padding: 0 !important;
  height: auto !important;
  margin-bottom: 62px;
  display: flex !important;
  align-items: center;
}
.sidebar > a:first-child img {
  height: 48px !important;
  width: auto;
}

/* Nav */
.nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 0;
}

.nav-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  height: 40px;
  border-radius: var(--radius-md);
  color: var(--neutral-70);
  font-weight: 400;
  font-size: 16px;
  line-height: 24px;
  letter-spacing: -0.01em;
  background: transparent;
  border: none;
  transition: background 0.15s, color 0.15s;
  width: 100%;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
}
.nav-item:hover { background: var(--neutral-10); color: var(--black); }
.nav-item.active {
  background: var(--primary-10);
  color: var(--neutral-70);
  font-weight: 400;
}
.nav-item.active .nav-icon { color: var(--primary-50); }
.nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--neutral-70);
}

.sidebar-spacer { flex: 1; }

/* Hide tip card */
.tip-card { display: none !important; }

/* Admin separator */
.sidebar .nav > div[style*="background:var(--line)"] {
  background: var(--neutral-20) !important;
  margin: 8px 0 !important;
}

/* Logout */
.logout-btn {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0;
  height: 24px;
  color: var(--primary-50);
  font-weight: 400;
  font-size: 16px;
  line-height: 24px;
  letter-spacing: -0.01em;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
  width: auto;
}
.logout-btn .nav-icon { color: var(--primary-50); width: 24px; height: 24px; }
.logout-btn:hover { color: var(--primary-60); }

/* ── Main area ────────────────────────────────────────────────────────────── */
.main {
  padding: 50px 40px 80px 40px;
  display: flex;
  flex-direction: column;
  gap: 50px;
  min-width: 0;
}

/* ── Topbar ──────────────────────────────────────────────────────────────── */
.topbar {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

.greeting {
  font-weight: 700;
  font-size: 40px;
  line-height: 48px;
  letter-spacing: -0.01em;
  color: var(--black);
}
.greeting .wave {
  display: inline-block;
  transform-origin: 70% 70%;
  animation: wave 2.6s ease-in-out infinite;
}
@keyframes wave {
  0%, 60%, 100% { transform: rotate(0); }
  10%  { transform: rotate(14deg); }
  20%  { transform: rotate(-8deg); }
  30%  { transform: rotate(14deg); }
  40%  { transform: rotate(-4deg); }
  50%  { transform: rotate(10deg); }
}

.topbar-right { display: flex; align-items: center; gap: 16px; }

/* ── Topbar: notification bell ───────────────────────────────────────────── */
.icon-btn {
  width: 45px;
  height: 45px;
  border-radius: var(--radius-pill);
  background: var(--white);
  border: 1px solid var(--neutral-20);
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--black);
  position: relative;
  transition: border-color 0.15s;
  flex-shrink: 0;
}
.icon-btn:hover { border-color: var(--neutral-40); }
.icon-btn .badge {
  position: absolute;
  top: 8px;
  right: 7px;
  min-width: 17px;
  height: 17px;
  border-radius: var(--radius-pill);
  background: var(--success-50);
  color: var(--white);
  font-size: 12px;
  font-weight: 400;
  line-height: 16px;
  letter-spacing: -0.01em;
  display: grid;
  place-items: center;
  padding: 0 4px;
  border: 2px solid var(--white);
}

/* ── Topbar: language switcher ───────────────────────────────────────────── */
.theme-switcher { display: none !important; }

.lang-wrap, .k-lang { position: relative; }

.lang-trigger, .k-lang__toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 14px;
  height: 36px;
  border-radius: var(--radius-pill);
  background: var(--white);
  border: 1px solid var(--neutral-20);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--neutral-70);
  font-family: inherit;
  transition: border-color 0.15s;
}
.lang-trigger:hover, .k-lang__toggle:hover { border-color: var(--neutral-40); }

.lang-menu, .k-lang__menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--white);
  border: 1px solid var(--neutral-20);
  border-radius: var(--radius-lg);
  padding: 4px 0;
  min-width: 160px;
  z-index: 200;
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}
.lang-menu.open, .k-lang__menu.open { display: block; }

.lang-opt, .k-lang__option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--black);
  background: none;
  border: none;
  width: 100%;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s;
}
.lang-opt:hover, .k-lang__option:hover { background: var(--neutral-10); }
.lang-opt--active { font-weight: 600; }
.lang-check, .k-lang__check { color: var(--success-50); font-weight: 700; }

/* ── Topbar: profile ─────────────────────────────────────────────────────── */
.profile-wrap { position: relative; }

.profile {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
}

.profile-avatar {
  width: 62px;
  height: 62px;
  border-radius: var(--radius-pill);
  background: var(--primary-10);
  color: var(--primary-50);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 20px;
  flex-shrink: 0;
}

.profile-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.profile-name {
  font-weight: 700;
  font-size: 20px;
  line-height: 28px;
  letter-spacing: -0.01em;
  color: var(--black);
  white-space: nowrap;
}
.profile-role {
  font-weight: 400;
  font-size: 14px;
  line-height: 20px;
  letter-spacing: -0.01em;
  color: var(--neutral-50);
  white-space: nowrap;
}
.profile-chev { color: var(--black); flex-shrink: 0; }

.profile-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--white);
  border: 1px solid var(--neutral-20);
  border-radius: var(--radius-xl);
  padding: 8px 0;
  min-width: 200px;
  z-index: 200;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}
.profile-menu.is-open { display: block; }

.profile-menu__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--black);
  text-decoration: none;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s;
}
.profile-menu__item:hover { background: var(--neutral-10); }
.profile-menu__item--danger { color: var(--danger-60); }
.profile-menu__item--danger:hover { background: var(--danger-10); color: #B91C1C; }
.profile-menu__sep { height: 1px; background: var(--neutral-20); margin: 4px 0; }

/* ── Feature cards ───────────────────────────────────────────────────────── */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.feature {
  position: relative;
  border-radius: var(--radius-xl);
  padding: 34px 32px;
  min-height: 292px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  color: var(--white);
  transition: transform 0.2s, box-shadow 0.2s;
}
.feature:hover { transform: translateY(-2px); box-shadow: 0 16px 48px rgba(0,0,0,0.18); }

.feature.c1 { background: var(--brand-grad-1); }
.feature.c2 { background: var(--brand-grad-2); }
.feature.c3 { background: var(--brand-grad-3); }

.feature-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  max-width: 82%;
  position: relative;
  z-index: 1;
}

.topmark {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-pill);
  background: rgba(255,255,255,0.9);
  color: var(--primary-60);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.feature-title {
  font-weight: 700;
  font-size: 18px;
  line-height: 28px;
  letter-spacing: -0.01em;
  color: var(--white);
}
.feature-body {
  font-weight: 400;
  font-size: 16px;
  line-height: 24px;
  letter-spacing: -0.01em;
  color: rgba(255,255,255,0.9);
}

.feature-foot {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 62%;
  position: relative;
  z-index: 1;
}

/* Progress bar (on card c2) */
.progress-text {
  font-weight: 400;
  font-size: 14px;
  line-height: 20px;
  letter-spacing: -0.01em;
  color: var(--white);
}
.progress {
  height: 4px;
  background: rgba(255,255,255,0.3);
  border-radius: var(--radius-pill);
  overflow: hidden;
  width: 100%;
}
.progress > span {
  display: block;
  height: 100%;
  background: rgba(255,255,255,0.95);
  border-radius: var(--radius-pill);
}

/* Corner icon (image) — absolute positioned top-right, aligned with the «01» number */
.corner-icon {
  position: absolute;
  right: 28px;
  top: 28px;
  width: 56px;
  height: 56px;
  object-fit: contain;
  z-index: 0;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 26px;
  height: 48px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 16px;
  line-height: 24px;
  letter-spacing: -0.01em;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.12s;
  font-family: inherit;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--black); color: var(--white); }
.btn-primary:hover { opacity: 0.88; }
.btn-light { background: var(--white); color: var(--black); }
.btn-light:hover { opacity: 0.92; }

/* k-btn — used on settings and other admin pages */
.k-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.01em;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s;
  font-family: inherit;
}
.k-btn--primary { background: var(--primary-50); color: var(--white); }
.k-btn--primary:hover { opacity: 0.88; }
.k-btn--outline { background: transparent; border: 1px solid var(--neutral-40); color: var(--black); }
.k-btn--outline:hover { border-color: var(--accent); color: var(--accent); }
.k-btn--ghost { background: transparent; color: var(--neutral-70); border: none; }
.k-btn--ghost:hover { background: var(--neutral-10); }
.k-btn--danger { background: transparent; border: 1px solid var(--danger-60); color: var(--danger-60); }
.k-btn--logout { background: transparent; border: 1px solid var(--neutral-20); color: var(--neutral-70); }
.k-btn--logout:hover { background: var(--neutral-10); color: var(--danger-60); border-color: var(--danger-60); }

/* ── Projects section card ───────────────────────────────────────────────── */
.dash-section {
  background: var(--white);
  border: 1px solid var(--neutral-40);
  border-radius: var(--radius-xl);
  padding: 24px 8px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dash-section-head {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px;
  gap: 16px;
  flex-wrap: wrap;
}

.dash-section h2 {
  font-weight: 700;
  font-size: 24px;
  line-height: 32px;
  letter-spacing: -0.01em;
  color: var(--black);
  display: flex;
  align-items: center;
  gap: 10px;
}

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

/* Count badge */
.count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  border-radius: var(--radius-pill);
  background: var(--primary-10);
  color: var(--primary-50);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.01em;
  padding: 0 8px;
}

/* ── Filter bar ──────────────────────────────────────────────────────────── */
.dash-filter-bar { display: flex; gap: 8px; align-items: center; }

.dash-filter-select {
  height: 44px;
  border: 1px solid var(--neutral-10);
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 0 24px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--neutral-50);
  font-family: inherit;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s;
}
.dash-filter-select:focus { border-color: var(--primary-50); }

.dash-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  width: 312px;
  border: 1px solid var(--neutral-10);
  border-radius: var(--radius-md);
  padding: 0 24px;
  background: var(--white);
  transition: border-color 0.15s;
}
.dash-search-wrap:focus-within { border-color: var(--primary-50); }
.dash-search-wrap svg { color: var(--neutral-50); flex-shrink: 0; }

.dash-search-input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--black);
  font-family: inherit;
  width: 100%;
}
.dash-search-input::placeholder { color: var(--neutral-50); }

/* ── Projects table ──────────────────────────────────────────────────────── */
table.projects-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.projects-table thead th {
  text-align: left;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--neutral-50);
  border-bottom: 1px solid var(--neutral-20);
  padding: 0 16px 12px 16px;
}
.projects-table thead th:first-child { padding-left: 32px; padding-right: 32px; }
.projects-table thead th:nth-child(2) { padding-left: 24px; }
.projects-table thead th:last-child { padding-right: 16px; text-align: right; }

.projects-table tbody td {
  height: 68px;
  font-size: 14px;
  letter-spacing: -0.01em;
  color: var(--neutral-50);
  vertical-align: middle;
  padding: 24px 16px;
}
.projects-table tbody td.proj-name-cell { padding: 8px 32px; }
.projects-table tbody td:nth-child(2) { padding: 20px 24px; vertical-align: middle; }
.projects-table tbody tr { transition: background 0.12s; }
.projects-table tbody tr:hover { background: color-mix(in srgb, var(--primary-10) 40%, transparent); }

.proj-name-cell { padding: 8px 32px !important; }
.proj-name {
  font-weight: 700;
  font-size: 16px;
  line-height: 24px;
  letter-spacing: -0.01em;
  color: var(--black);
}
.proj-meta {
  font-weight: 500;
  font-size: 14px;
  line-height: 20px;
  letter-spacing: -0.01em;
  color: var(--neutral-50);
  margin-top: 4px;
}

/* Status badges */
.status {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  letter-spacing: -0.01em;
}
.status.work  { background: var(--primary-10);  color: var(--primary-50); }
.status.draft { background: var(--warning-10);  color: var(--warning-60); }
.status.done  { background: var(--success-10);  color: var(--success-50); }

/* Row progress */
.row-progress {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
}
.row-progress .pct {
  font-weight: 500;
  font-size: 14px;
  letter-spacing: -0.01em;
  color: var(--neutral-50);
  min-width: 32px;
}
.row-progress .bar {
  flex: 1;
  height: 4px;
  background: var(--neutral-20);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.row-progress .bar > span {
  display: block;
  height: 100%;
  background: var(--success-60);
  border-radius: var(--radius-pill);
}

/* Sector column */
.col-sector {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--neutral-50);
  padding: 0 16px;
}
.col-sector-empty { font-style: italic; color: var(--neutral-40); }

/* Actions column */
.col-actions { width: 64px; text-align: right !important; padding-right: 32px !important; }

.row-action {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--neutral-40);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.15s, color 0.15s;
}
.row-action:hover { background: var(--neutral-10); color: var(--black); }

.row-menu-wrap { position: relative; display: inline-block; }
.row-menu {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  background: var(--white);
  border: 1px solid var(--neutral-20);
  border-radius: var(--radius-lg);
  padding: 4px 0;
  min-width: 200px;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}
.row-menu.open { display: block; }
.row-menu-item {
  display: block;
  width: 100%;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--black);
  text-decoration: none;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s;
}
.row-menu-item:hover { background: var(--neutral-10); }
.row-menu-item--danger { color: var(--danger-60); }
.row-menu-item--danger:hover { background: var(--danger-10); }
.row-menu-divider { height: 1px; background: var(--neutral-20); margin: 4px 0; }

/* Show all link */
.show-all {
  display: flex;
  justify-content: center;
  padding: 16px 32px 4px;
  border-top: 1px solid var(--neutral-20);
  margin-top: 4px;
}
.show-all a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--neutral-70);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  transition: background 0.15s, gap 0.15s;
}
.show-all a:hover { background: var(--neutral-10); gap: 12px; }

/* Empty state */
.dash-empty {
  padding: 40px 32px;
  text-align: center;
  color: var(--neutral-50);
  font-size: 14px;
  line-height: 20px;
  letter-spacing: -0.01em;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 1400px) {
  :root { --sidebar-width: 238px; }
  .greeting { font-size: 32px; }
  .main { padding: 40px 32px 60px; gap: 40px; }
}
@media (max-width: 1100px) {
  .cards { grid-template-columns: 1fr 1fr; }
  .greeting { font-size: 28px; line-height: 36px; }
  .profile-role { display: none; }
}
@media (max-width: 768px) {
  /* Layout no longer collapses — page scrolls horizontally (see .app min-width). */
  .greeting { font-size: 24px; line-height: 32px; }
  .profile-meta { display: none; }
}

/* ── idea_chat step navigation (consistent Назад / Продовжити across all steps) ── */
.step-nav { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:20px;
  position:sticky; bottom:0; z-index:20; background:var(--bg, #F7F5FB); padding:14px 0;
  box-shadow:0 -10px 18px -12px rgba(0,0,0,.14); }
.step-nav--end { justify-content:flex-end; }
.step-nav-btn { display:inline-flex; align-items:center; gap:8px; padding:11px 26px; border-radius:10px; font-size:15px; font-weight:600; font-family:inherit; cursor:pointer; text-decoration:none; border:1.5px solid transparent; transition:opacity .15s, border-color .15s; box-sizing:border-box; }
.step-nav-btn--back { background:#FFFFFF; color:#5F59C7; border-color:#C9C5F2; }
.step-nav-btn--back:hover { border-color:#5F59C7; }
.step-nav-btn--next { background:#5F59C7; color:#FFFFFF; border-color:#5F59C7; }
.step-nav-btn--next:hover { opacity:.9; color:#FFFFFF; }

/* ── idea_chat step pills (shared; supports locked state) ── */
.vs-pill { display:inline-flex; align-items:center; gap:8px; padding:6px 12px; height:28px; border-radius:var(--radius-pill); background:var(--neutral-20); text-decoration:none; }
.vs-pill.active { background: var(--primary-50); }
.vs-pill.locked { opacity:.5; cursor:not-allowed; }
.vs-pill .vs-num { width:16px; height:16px; border-radius:var(--radius-pill); background:var(--neutral-50); color:var(--white); font-size:10px; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.vs-pill.active .vs-num { background:var(--white); color:var(--primary-50); }
.vs-pill.locked .vs-num { background:transparent; }
.vs-pill .vs-lbl { font-size:12px; color:var(--neutral-70); white-space:nowrap; }
.vs-pill.active .vs-lbl { color:var(--white); }
.vs-conn { width:16px; height:1px; background:var(--neutral-20); flex-shrink:0; }


/* ===== Auth pages (login/register) — moved here so portal + auth share krokus2.css ===== */
.auth-page {
  font-family: 'Onest', system-ui, sans-serif;
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--bg, #F7F5FB); color: var(--ink, #1B1A2E);
  padding: calc(var(--u) * 1.5) calc(var(--u) * 1.5) min(calc(var(--u) * 6), 12vh);
  -webkit-font-smoothing: antialiased;
}

.auth-logo {
  display: flex; align-items: center; justify-content: center;
  margin-bottom: calc(var(--u) * 1.4); text-decoration: none;
  height: calc(var(--u) * 2.2);
}
.auth-logo img { height: 100%; width: auto; }


/* ── Auth card redesign: login / register tabs (Figma) ───────────────────────
   New tabbed card for login+register. Reuses .auth-page/.auth-logo/.auth-theme.
   Standalone child classes so the shared .auth-card (totp/activation/terms)
   stays untouched. */
.auth-card--tabs {
  width: 100%; max-width: 440px;
  box-sizing: border-box;
  display: flex; flex-direction: column; gap: 24px;
  padding: 32px;
  background: #FFFFFF;
  border: 1px solid #E3E4EB;
  box-shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px -1px rgba(0,0,0,.1);
  border-radius: 20px;
}
.auth-head {
  margin: 0; text-align: center;
  font-size: 20px; line-height: 28px; font-weight: 700; letter-spacing: -0.01em;
  color: #26244F;
}

/* Segmented tab switcher */
.auth-tabs {
  display: flex; gap: 0; padding: 4px;
  background: #F9F8FF; border-radius: 10px;
}
.auth-tab {
  flex: 1 1 0; min-width: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 8px 0; height: 36px; box-sizing: border-box;
  border: 0; background: transparent; border-radius: 8px; cursor: pointer;
  font-family: inherit; font-size: 14px; line-height: 20px; font-weight: 500;
  letter-spacing: -0.01em; color: #7B7A93;
  transition: background .15s, color .15s, box-shadow .15s;
}
.auth-tab--active { background: #FFFFFF; color: #26244F; box-shadow: 0 1px 4px rgba(38,36,79,.1); }

/* Panels */
.auth-panel { display: none; flex-direction: column; gap: 16px; }
.auth-panel--active { display: flex; }
.auth-panel form { display: flex; flex-direction: column; gap: 16px; margin: 0; }

/* Fields */
.auth-field { display: flex; flex-direction: column; gap: 6px; }
.auth-field-label {
  font-family: inherit; font-size: 14px; line-height: 20px; font-weight: 500;
  letter-spacing: -0.01em; color: #26244F;
}
.auth-input {
  box-sizing: border-box; width: 100%;
  padding: 12px 16px;
  background: #F9F8FF; border: 1.5px solid #E3E4EB; border-radius: 10px;
  font-family: inherit; font-size: 14px; line-height: 20px; letter-spacing: -0.01em;
  color: #26244F; outline: none; transition: border-color .15s;
}
.auth-input::placeholder { color: #7B7A93; }
.auth-input:focus { border-color: #5F59C7; }
.auth-pass { position: relative; }
.auth-pass .auth-input { padding-right: 44px; }
.auth-eye {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px; padding: 0; border: 0; background: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; color: #7B7A93;
}

/* Primary submit */
.auth-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; box-sizing: border-box; padding: 12px 24px; height: 44px;
  background: #5F59C7; border: 0; border-radius: 10px;
  font-family: inherit; font-size: 14px; line-height: 20px; font-weight: 500;
  letter-spacing: -0.01em; color: #FFFFFF; cursor: pointer; transition: opacity .15s;
}
.auth-btn:hover { opacity: .92; }

/* Divider with «або» */
.auth-divider { display: flex; align-items: center; gap: 12px; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1 1 0; height: 1px; background: #C9CBD6; }
.auth-divider span { font-size: 14px; line-height: 20px; letter-spacing: -0.01em; color: #7B7A93; }

/* Social (placeholder) buttons */
.auth-social { display: flex; gap: 12px; }
.auth-social-btn {
  flex: 1 1 0; min-width: 0; box-sizing: border-box;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 0; height: 43px;
  background: #FFFFFF; border: 1.5px solid #E3E4EB; border-radius: 10px;
  font-family: inherit; font-size: 14px; line-height: 20px; font-weight: 500;
  letter-spacing: -0.01em; color: #26244F; cursor: pointer; transition: border-color .15s, background .15s;
}
.auth-social-btn:hover { background: #F9F8FF; }
.auth-social-btn svg, .auth-social-btn img { width: 16px; height: 16px; flex: none; }

/* Bottom switch line */
.auth-bottom { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap;
  font-size: 14px; line-height: 20px; letter-spacing: -0.01em; color: #7B7A93; text-align: center; }
.auth-bottom button {
  border: 0; background: none; padding: 0; cursor: pointer; font-family: inherit;
  font-size: 14px; line-height: 20px; font-weight: 500; letter-spacing: -0.01em; color: #476FD1;
}
.auth-bottom button:hover { text-decoration: underline; }

/* Inline messages inside the tabbed card */
.auth-card--tabs .auth-alert { padding: 10px 14px; border-radius: 10px; font-size: 13px; line-height: 19px; }
.auth-card--tabs .auth-alert--ok { background: #DCEEDF; border: 1px solid #b5d9bb; color: #2F6A3A; }
.auth-card--tabs .auth-alert--err { background: #FEE2E2; border: 1px solid #FCA5A5; color: #B91C1C; }
.auth-card--tabs .errorlist { list-style: none; margin: 0; padding: 0; color: #B91C1C; font-size: 13px; line-height: 18px; }

/* ===== Registration wizard (Figma) ===== */
.auth-card--tabs.auth-card--wide { max-width: 600px; }
.reg-subtitle { margin: 0; text-align: center; font-size: 14px; line-height: 20px; color: #7B7A93; letter-spacing: -0.01em; }

/* Account-type choice cards */
.reg-choices { display: flex; flex-direction: column; gap: 16px; }
.reg-choice { position: relative; display: flex; gap: 16px; padding: 20px 48px 20px 20px; cursor: pointer;
  background: #FFFFFF; border: 1.5px solid #E3E4EB; border-radius: 14px; transition: border-color .15s, background .15s; }
.reg-choice:hover { border-color: #C9C5F2; }
.reg-choice--active { border-color: #5F59C7; background: #F9F8FF; }
.reg-choice-radio { position: absolute; top: 20px; right: 18px; width: 20px; height: 20px; margin: 0;
  accent-color: #5F59C7; cursor: pointer; }
.reg-choice-icon { flex: none; width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  background: #EFEEFC; color: #5F59C7; }
.reg-choice-body { display: flex; flex-direction: column; gap: 6px; }
.reg-choice-title { font-size: 16px; font-weight: 700; color: #26244F; }
.reg-choice-desc { font-size: 13px; line-height: 19px; color: #4B4A63; }
.reg-choice-note { font-size: 13px; line-height: 19px; color: #7B7A93; }

/* Wizard form layout: vertical rhythm between blocks and the nav buttons */
.reg-form { display: flex; flex-direction: column; gap: 22px; margin: 0; }

/* Wizard nav */
.reg-nav { display: flex; gap: 12px; align-items: center; margin-top: 4px; }
.reg-btn-back { display: inline-flex; align-items: center; justify-content: center; padding: 12px 22px; height: 44px;
  box-sizing: border-box; background: #FFFFFF; border: 1.5px solid #E3E4EB; border-radius: 10px;
  color: #26244F; text-decoration: none; font-size: 14px; font-weight: 500; letter-spacing: -0.01em; }
.reg-btn-back:hover { background: #F9F8FF; }
.reg-btn-next { flex: 1 1 auto; }
.reg-foot-note { margin: 0; text-align: center; font-size: 13px; color: #7B7A93; letter-spacing: -0.01em; }

/* Inner tabs (organization data) */
.reg-tabs { display: flex; gap: 24px; border-bottom: 1.5px solid #E3E4EB; }
.reg-tab { border: 0; background: none; padding: 0 0 10px; margin-bottom: -1.5px; cursor: pointer; font-family: inherit;
  font-size: 15px; font-weight: 500; color: #7B7A93; border-bottom: 2px solid transparent; letter-spacing: -0.01em; }
.reg-tab--active { color: #26244F; border-bottom-color: #5F59C7; }
.reg-section { display: none; flex-direction: column; gap: 16px; }
.reg-section--active { display: flex; }

/* Two-column field grid */
.reg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 520px) { .reg-grid { grid-template-columns: 1fr; } }
.reg-hint { font-size: 12px; line-height: 16px; color: #7B7A93; }
select.auth-input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237B7A93' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }

/* Step dots */
.reg-dots { display: flex; gap: 8px; align-items: center; justify-content: center; }
.reg-dot { width: 8px; height: 8px; border-radius: 999px; background: #C9CBD6; transition: width .15s, background .15s; }
.reg-dot--active { width: 22px; background: #5F59C7; }

/* Review */
.reg-review-group { display: flex; flex-direction: column; gap: 12px; margin-bottom: 4px; }
.reg-review-head { font-size: 12px; font-weight: 600; letter-spacing: .6px; color: #A7A8B8; margin-bottom: 2px; }
.reg-review-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: #F9F8FF;
  border: 1px solid #E3E4EB; border-radius: 12px; }
.reg-review-ic { flex: none; width: 26px; height: 26px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; }
.reg-review-ic--ok { background: #E6F6EC; color: #2F8A4D; }
.reg-review-ic--miss { background: #FBF1DE; color: #C2810C; }
.reg-review-main { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.reg-review-label { font-size: 11px; color: #A7A8B8; letter-spacing: .3px; }
.reg-review-value { font-size: 14px; color: #26244F; }
.reg-review-value--miss { color: #C2810C; }
.reg-review-fill { flex: none; font-size: 13px; font-weight: 500; color: #476FD1; text-decoration: none; }
.reg-review-fill:hover { text-decoration: underline; }

/* Done */
.reg-done { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.reg-done-icon { width: 64px; height: 64px; border-radius: 50%; background: #EFEEFC; display: flex; align-items: center; justify-content: center; }
.reg-done-links { display: flex; flex-direction: column; gap: 10px; width: 100%; margin-top: 6px; }
.reg-done-link { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 20px; height: 44px; box-sizing: border-box;
  background: #5F59C7; border-radius: 10px; color: #fff; text-decoration: none; font-size: 14px; font-weight: 500; letter-spacing: -0.01em; }
.reg-done-link:hover { opacity: .92; }


/* ===== knowledge-base shared classes (migrated from krokus.css) ===== */
.s-badge {
  display: inline-flex; align-items: center;
  padding: calc(var(--u) * 0.2) calc(var(--u) * 0.65);
  border-radius: var(--radius-pill, 999px);
  font-size: calc(var(--u) * 0.78); font-weight: 600;
}
.s-badge--work { background: var(--status-work-bg, #EFE9FB);  color: var(--status-work-ink, #5B36B0); }
.s-badge--draft { background: var(--status-draft-bg, #FBF1DE); color: var(--status-draft-ink, #8A6512); }
.s-badge--done { background: var(--status-done-bg, #E1F1E3);  color: var(--status-done-ink, #2D6A35); }
.s-badge--muted { background: var(--line, #ECEAF3); color: var(--ink-3, #7B7A93); }
.d-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: calc(var(--u) * 0.45) calc(var(--u) * 1);
  border-radius: var(--radius-pill, 999px);
  font-weight: 600; font-size: calc(var(--u) * 0.85);
  border: none; cursor: pointer; transition: background 0.16s;
  font-family: inherit; text-decoration: none; white-space: nowrap;
}
.d-btn--primary { background: var(--accent, #6B46C1); color: var(--accent-ink, #fff); }
.d-btn--primary:hover { background: color-mix(in srgb, var(--accent, #6B46C1) 85%, black); }
.d-btn--outline { background: transparent; color: var(--ink-2, #4B4A63); border: 1px solid var(--line-2, #E0DEEB); }
.d-btn--outline:hover { border-color: var(--accent, #6B46C1); color: var(--ink, #1B1A2E); }
.d-btn--danger { background: transparent; color: #C2410C; border: 1px solid #FCD9C8; }
.d-btn--danger:hover { background: #FEF0E9; }
.kb-page-hero { padding: 0 0 calc(var(--u) * 1.5); }
.kb-page-sub { font-size: calc(var(--u) * 0.9); color: var(--ink-3, #7B7A93); line-height: 1.6; margin: 0; max-width: calc(var(--u) * 46); }
.kb-breadcrumb { display: flex; align-items: center; gap: calc(var(--u) * 0.45); font-size: calc(var(--u) * 0.85); color: var(--ink-3, #7B7A93); margin-bottom: calc(var(--u) * 1.2); }
.kb-breadcrumb a { color: var(--ink-3, #7B7A93); text-decoration: none; }
.kb-breadcrumb a:hover { color: var(--accent, #6B46C1); }
.kb-search-bar { display: flex; gap: calc(var(--u) * 0.6); margin-bottom: calc(var(--u) * 1.2); }
.kb-search-input {
  flex: 1; height: calc(var(--u) * 2.8); padding: 0 calc(var(--u) * 0.9);
  background: var(--bg, #F7F5FB); border: 1px solid var(--line, #ECEAF3);
  border-radius: calc(var(--u) * 0.65); font-size: calc(var(--u) * 0.9);
  font-family: inherit; color: var(--ink, #1B1A2E); outline: none; transition: border-color 0.15s;
}
.kb-search-input:focus { border-color: var(--accent, #6B46C1); }
.kb-search-input::placeholder { color: var(--ink-3, #7B7A93); }
.kb-search-btn {
  height: calc(var(--u) * 2.8); padding: 0 calc(var(--u) * 1.2);
  background: var(--accent, #6B46C1); color: var(--accent-ink, #fff);
  border: none; border-radius: calc(var(--u) * 0.65);
  font-size: calc(var(--u) * 0.9); font-weight: 600; cursor: pointer; font-family: inherit;
  transition: background 0.15s;
}
.kb-search-btn:hover { background: color-mix(in srgb, var(--accent, #6B46C1) 85%, black); }
.kb-filter-section { margin-bottom: calc(var(--u) * 1); }
.kb-filter-label { font-size: calc(var(--u) * 0.78); font-weight: 600; color: var(--ink-3, #7B7A93); margin-bottom: calc(var(--u) * 0.45); }
.kb-filter-row { display: flex; flex-wrap: wrap; gap: calc(var(--u) * 0.4); }
.kb-filter-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: calc(var(--u) * 2.2); height: calc(var(--u) * 2.2); padding: 0 calc(var(--u) * 0.65);
  border-radius: var(--radius-pill, 999px); font-size: calc(var(--u) * 0.82); font-weight: 600;
  border: 1px solid var(--line, #ECEAF3); color: var(--ink-3, #7B7A93); background: transparent;
  text-decoration: none; cursor: pointer; font-family: inherit; transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.kb-filter-btn:hover { border-color: var(--accent, #6B46C1); color: var(--ink, #1B1A2E); }
.kb-filter-btn.active { background: var(--accent, #6B46C1); color: var(--accent-ink, #fff); border-color: var(--accent, #6B46C1); }
.kb-term-list { display: grid; gap: calc(var(--u) * 0.75); }
.kb-term-card {
  background: var(--surface, #fff); border: 1px solid var(--line, #ECEAF3);
  border-radius: var(--radius-card, 1.25rem); padding: calc(var(--u) * 1.2) calc(var(--u) * 1.4);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.kb-term-card:hover { border-color: var(--line-2, #E0DEEB); box-shadow: 0 4px 16px color-mix(in srgb, var(--accent, #6B46C1) 6%, transparent); }
.kb-term-title { font-size: calc(var(--u) * 1.1); font-weight: 700; margin: 0 0 calc(var(--u) * 0.35); }
.kb-term-title a { color: var(--ink, #1B1A2E); text-decoration: none; }
.kb-term-title a:hover { color: var(--accent, #6B46C1); }
.kb-term-def { font-size: calc(var(--u) * 0.88); color: var(--ink-3, #7B7A93); line-height: 1.65; }
.kb-tag-list { display: flex; flex-wrap: wrap; gap: calc(var(--u) * 0.4); margin-top: calc(var(--u) * 0.75); }
.kb-tag {
  display: inline-block; padding: calc(var(--u) * 0.22) calc(var(--u) * 0.6);
  border-radius: var(--radius-pill, 999px); font-size: calc(var(--u) * 0.78); font-weight: 600;
  background: var(--accent-soft, #EFE9FB); color: var(--accent, #6B46C1); text-decoration: none; transition: background 0.15s;
}
.kb-tag:hover { background: color-mix(in srgb, var(--accent-soft, #EFE9FB) 60%, var(--accent, #6B46C1)); }
.kb-empty { text-align: center; padding: calc(var(--u) * 2); color: var(--ink-3, #7B7A93); font-size: calc(var(--u) * 0.9); }
.kb-detail-layout { display: grid; grid-template-columns: minmax(0, 2fr) calc(var(--u) * 20); gap: calc(var(--u) * 1.5); align-items: start; }
@media (max-width: 1000px) {
.kb-detail-layout { grid-template-columns: 1fr; }
.kb-sidebar-stack { position: static !important; }
}
.kb-gloss-card {
  background: var(--surface, #fff); border: 1px solid var(--line, #ECEAF3);
  border-radius: var(--radius-card, 1.25rem); padding: calc(var(--u) * 1.8) calc(var(--u) * 2);
}
.kb-gloss-title { font-size: calc(var(--u) * 1.9); font-weight: 800; letter-spacing: -0.02em; color: var(--ink, #1B1A2E); margin: 0 0 calc(var(--u) * 0.4); line-height: 1.15; }
.kb-gloss-meta { font-size: calc(var(--u) * 0.82); color: var(--ink-3, #7B7A93); margin-bottom: calc(var(--u) * 1.2); }
.kb-short-def {
  padding: calc(var(--u) * 0.85) calc(var(--u) * 1); border-radius: calc(var(--u) * 0.65);
  background: var(--accent-soft, #EFE9FB); border: 1px solid color-mix(in srgb, var(--accent, #6B46C1) 18%, transparent);
  font-size: calc(var(--u) * 0.9); line-height: 1.7; margin-bottom: calc(var(--u) * 1.2); color: var(--ink-2, #4B4A63);
}
.kb-definition { line-height: 1.8; color: var(--ink-2, #4B4A63); font-size: calc(var(--u) * 0.92); }
.kb-gloss-section { margin-top: calc(var(--u) * 1.6); }
.kb-gloss-section-title { font-size: calc(var(--u) * 1); font-weight: 700; color: var(--ink, #1B1A2E); margin: 0 0 calc(var(--u) * 0.6); }
.kb-step-pill {
  display: inline-block; padding: calc(var(--u) * 0.28) calc(var(--u) * 0.75);
  border-radius: var(--radius-pill, 999px); font-size: calc(var(--u) * 0.82); font-weight: 600;
  background: var(--c2-bg, #DDE6EF); color: var(--c2-ink, #1C3A5A);
}
.kb-related-link {
  display: inline-block; padding: calc(var(--u) * 0.28) calc(var(--u) * 0.75);
  border-radius: var(--radius-pill, 999px); font-size: calc(var(--u) * 0.82); font-weight: 600;
  background: var(--accent-soft, #EFE9FB); color: var(--accent, #6B46C1);
  border: 1px solid color-mix(in srgb, var(--accent, #6B46C1) 22%, transparent);
  text-decoration: none; transition: background 0.15s;
}
.kb-related-link:hover { background: color-mix(in srgb, var(--accent-soft, #EFE9FB) 60%, var(--accent, #6B46C1)); }
.kb-sidebar-stack { display: grid; gap: calc(var(--u) * 1); position: sticky; top: calc(var(--u) * 1); }
.kb-sidebar-card {
  background: var(--surface, #fff); border: 1px solid var(--line, #ECEAF3);
  border-radius: var(--radius-card, 1.25rem); padding: calc(var(--u) * 1.3) calc(var(--u) * 1.4);
}
.kb-sidebar-title { font-size: calc(var(--u) * 0.95); font-weight: 700; color: var(--ink, #1B1A2E); margin: 0 0 calc(var(--u) * 0.5); }
.kb-sidebar-text { font-size: calc(var(--u) * 0.85); color: var(--ink-3, #7B7A93); line-height: 1.7; margin: 0 0 calc(var(--u) * 0.9); }
.kb-ai-actions { display: flex; flex-wrap: wrap; gap: calc(var(--u) * 0.5); }
.kb-ai-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: calc(var(--u) * 0.42) calc(var(--u) * 0.85);
  background: var(--accent, #6B46C1); color: var(--accent-ink, #fff);
  border: none; border-radius: calc(var(--u) * 0.6); font-size: calc(var(--u) * 0.85);
  font-weight: 600; cursor: pointer; font-family: inherit; transition: background 0.15s;
}
.kb-ai-btn:hover { background: color-mix(in srgb, var(--accent, #6B46C1) 85%, black); }
.kb-ai-btn.ai-loading { opacity: 0.6; pointer-events: none; }
.main .ws-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-card); padding: calc(var(--u)*1.3) calc(var(--u)*1.5);
}
.main .ws-card h2 { margin: 0 0 calc(var(--u)*0.85); font-size: calc(var(--u)*1.05); font-weight: 700; color: var(--ink); }
