﻿*{box-sizing:border-box;margin:0;padding:0}
:root{
  --brand-start:#ff5630;--brand-end:#ffab00;
  --brand-grad:linear-gradient(90deg, rgb(237, 76, 139) 0%, rgb(241, 91, 94) 25%, rgb(247, 108, 43) 50%, rgb(249, 114, 23) 100%);
  /* Sidebar stays rich dark for contrast */
  --sidebar-bg:#212b36;--sidebar-hover:rgba(255,255,255,.07);--sidebar-active:rgba(255,255,255,.12);
  --sidebar-text:rgba(255,255,255,.6);--sidebar-text-active:#fff;
  /* Light surfaces */
  --bg:#fcfdfd;--surface:#ffffff;--surface2:#f9fafb;--surface3:#f4f6f8;
  --border:#dfe3e8;--border2:#c4cdd5;
  --text:#1c252e;--text2:#454f5b;--text3:#637381;
  --success:#16a34a;--success-bg:#f0fdf4;--success-border:#bbf7d0;
  --warning:#d97706;--warning-bg:#fffbeb;--warning-border:#fde68a;
  --error:#dc2626;--error-bg:#fef2f2;--error-border:#fecaca;
  --info:#2563eb;--info-bg:#eff6ff;--info-border:#bfdbfe;
  --radius:8px;--radius-lg:14px;--radius-xl:20px;
  --shadow-sm:0 1px 3px rgba(33,43,54,.08),0 1px 2px rgba(33,43,54,.04);
  --shadow:0 4px 16px rgba(33,43,54,.1),0 1px 4px rgba(33,43,54,.06);
  --shadow-lg:0 12px 40px rgba(33,43,54,.14),0 4px 12px rgba(33,43,54,.08);
  --shadow-brand:0 4px 20px rgba(255,86,48,.25);
}

/* ── THEMES ────────────────────────────────────────────────────────────────
 * Every theme below overrides the same set of CSS variables. The whole UI
 * reads from those variables, so flipping data-theme on <html> retones the
 * platform end-to-end without touching component code. Brand gradient is a
 * separate axis (data-brand) so users can mix-and-match.
 * ────────────────────────────────────────────────────────────────────────── */

/* Dark — slate-based, comfortable for long sessions */
html[data-theme="dark"]{
  --bg:#1c252e;--surface:#212b36;--surface2:#1a2129;--surface3:#2b3642;
  --border:#454f5b;--border2:#637381;
  --text:#f9fafb;--text2:#dfe3e8;--text3:#919eab;
  --success-bg:rgba(22,163,74,.16);--success-border:rgba(22,163,74,.4);
  --warning-bg:rgba(217,119,6,.16);--warning-border:rgba(217,119,6,.4);
  --error-bg:rgba(220,38,38,.16);--error-border:rgba(220,38,38,.4);
  --info-bg:rgba(37,99,235,.16);--info-border:rgba(37,99,235,.4);
  --shadow-sm:0 1px 3px rgba(0,0,0,.5),0 1px 2px rgba(0,0,0,.3);
  --shadow:0 4px 16px rgba(0,0,0,.55),0 1px 4px rgba(0,0,0,.3);
  --shadow-lg:0 12px 40px rgba(0,0,0,.7),0 4px 12px rgba(0,0,0,.5);
  --sidebar-bg:#141a20;--sidebar-hover:rgba(255,255,255,.06);--sidebar-active:rgba(255,255,255,.12);
}

/* Midnight — deeper navy with a subtle violet undertone */
html[data-theme="midnight"]{
  --bg:#141a20;--surface:#1a2129;--surface2:#212b36;--surface3:#2b3642;
  --border:#4a5158;--border2:#637381;
  --text:#f4f6f8;--text2:#dfe3e8;--text3:#919eab;
  --success-bg:rgba(22,163,74,.2);--success-border:rgba(22,163,74,.45);
  --warning-bg:rgba(245,158,11,.2);--warning-border:rgba(245,158,11,.45);
  --error-bg:rgba(220,38,38,.2);--error-border:rgba(220,38,38,.45);
  --info-bg:rgba(99,102,241,.2);--info-border:rgba(99,102,241,.45);
  --shadow-sm:0 1px 3px rgba(0,0,0,.55),0 1px 2px rgba(0,0,0,.35);
  --shadow:0 4px 16px rgba(0,0,0,.6),0 1px 4px rgba(0,0,0,.4);
  --shadow-lg:0 12px 40px rgba(0,0,0,.75),0 4px 12px rgba(0,0,0,.5);
  --sidebar-bg:#0f141a;--sidebar-hover:rgba(255,255,255,.06);--sidebar-active:rgba(255,255,255,.12);
}

/* Solar — warm sepia, easy on eyes during the day */
html[data-theme="solar"]{
  --bg:#fff5cc;--surface:#fcfdfd;--surface2:#fff9e6;--surface3:#fff0c2;
  --border:#ffd666;--border2:#ffab00;
  --text:#1c252e;--text2:#454f5b;--text3:#637381;
  --success-bg:#e8f5cf;--success-border:#a3c66f;
  --warning-bg:#fbe9b5;--warning-border:#d4a843;
  --error-bg:#f5d4cf;--error-border:#c66f6a;
  --info-bg:#dde9f0;--info-border:#7a9bb3;
  --shadow-sm:0 1px 3px rgba(58,50,32,.08),0 1px 2px rgba(58,50,32,.04);
  --shadow:0 4px 16px rgba(58,50,32,.1),0 1px 4px rgba(58,50,32,.06);
  --shadow-lg:0 12px 40px rgba(58,50,32,.14),0 4px 12px rgba(58,50,32,.08);
  --sidebar-bg:#3a3220;--sidebar-hover:rgba(253,246,227,.08);--sidebar-active:rgba(253,246,227,.16);
}

/* High contrast — accessibility / WCAG AAA */
html[data-theme="high-contrast"]{
  --bg:#ffffff;--surface:#ffffff;--surface2:#f5f5f5;--surface3:#e5e5e5;
  --border:#000000;--border2:#000000;
  --text:#000000;--text2:#0a0a0a;--text3:#3a3a3a;
  --success:#0a6b1a;--success-bg:#d8efdc;--success-border:#0a6b1a;
  --warning:#9a5a00;--warning-bg:#fde8c5;--warning-border:#9a5a00;
  --error:#a00000;--error-bg:#f9d6d6;--error-border:#a00000;
  --info:#0040a0;--info-bg:#d0deff;--info-border:#0040a0;
  --shadow-sm:0 0 0 1px #000;
  --shadow:0 0 0 2px #000;
  --shadow-lg:0 0 0 3px #000;
  --sidebar-bg:#000000;--sidebar-hover:rgba(255,255,255,.1);--sidebar-active:rgba(255,255,255,.18);
  --sidebar-text:rgba(255,255,255,.9);
}

/* ── BRAND COLOR PRESETS (data-brand) ──────────────────────────────────────
 * Overrides --brand-start / --brand-end / --brand-grad / --shadow-brand.
 * The default unset state keeps the existing crimson→orange gradient.
 * ────────────────────────────────────────────────────────────────────────── */
html[data-brand="indigo"]{
  --brand-start:#5119b7;--brand-end:#8e33ff;
  --brand-grad:linear-gradient(135deg,#5119b7,#8e33ff);
  --shadow-brand:0 4px 20px rgba(81,25,183,.3);
}
html[data-brand="emerald"]{
  --brand-start:#118d57;--brand-end:#22c55e;
  --brand-grad:linear-gradient(135deg,#118d57,#22c55e);
  --shadow-brand:0 4px 20px rgba(17,141,87,.3);
}
html[data-brand="sunset"]{
  --brand-start:#ff5630;--brand-end:#ffc107;
  --brand-grad:linear-gradient(135deg,#ff5630,#ffc107);
  --shadow-brand:0 4px 20px rgba(255,86,48,.3);
}
html[data-brand="ocean"]{
  --brand-start:#006c9c;--brand-end:#00b8d9;
  --brand-grad:linear-gradient(135deg,#006c9c,#00b8d9);
  --shadow-brand:0 4px 20px rgba(0,108,156,.3);
}

/* Theme picker UI primitives */
.theme-tile{display:flex;flex-direction:column;cursor:pointer;border:2px solid var(--border);border-radius:12px;padding:0;background:var(--surface);overflow:hidden;transition:all .15s;text-align:left}
.theme-tile:hover{border-color:var(--text3);transform:translateY(-1px)}
.theme-tile.active{border-color:var(--brand-start);box-shadow:0 0 0 3px rgba(255,86,48,.18)}
.theme-tile-preview{height:64px;display:flex;position:relative;overflow:hidden}
.theme-tile-preview .swatch-sidebar{flex:0 0 28%;background:var(--tile-sidebar)}
.theme-tile-preview .swatch-main{flex:1;background:var(--tile-bg);display:flex;flex-direction:column;justify-content:flex-end;padding:6px}
.theme-tile-preview .swatch-card{height:18px;background:var(--tile-surface);border:1px solid var(--tile-border);border-radius:4px;box-shadow:0 1px 2px rgba(0,0,0,.05);position:relative}
.theme-tile-preview .swatch-card::before{content:'';position:absolute;left:4px;top:4px;width:30%;height:5px;background:var(--tile-text);border-radius:2px;opacity:.7}
.theme-tile-preview .swatch-card::after{content:'';position:absolute;left:4px;top:11px;width:55%;height:3px;background:var(--tile-text);border-radius:2px;opacity:.4}
.theme-tile-meta{padding:9px 12px;display:flex;align-items:center;gap:8px}
.theme-tile-name{font-weight:700;font-size:12.5px;color:var(--text);flex:1}
.theme-tile-check{width:18px;height:18px;border-radius:50%;background:var(--brand-grad);color:#fff;font-size:10px;display:flex;align-items:center;justify-content:center;flex-shrink:0;opacity:0;transition:opacity .15s}
.theme-tile.active .theme-tile-check{opacity:1}

.brand-swatch{width:36px;height:36px;border-radius:10px;border:2px solid transparent;cursor:pointer;transition:transform .12s;padding:0;position:relative}
.brand-swatch:hover{transform:scale(1.08)}
.brand-swatch.active{border-color:var(--text);box-shadow:0 0 0 3px var(--surface),0 0 0 5px var(--text)}
.brand-swatch::after{content:'';position:absolute;inset:0;border-radius:8px;background:var(--swatch-grad)}

/* Theme picker popover (topbar) */
.theme-picker-btn{width:36px;height:36px;border-radius:10px;border:1px solid var(--border);background:var(--surface);color:var(--text2);font-size:16px;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all .15s}
.theme-picker-btn:hover{background:var(--surface2);color:var(--text)}
.theme-picker-pop{position:absolute;top:54px;right:24px;background:var(--surface);border:1px solid var(--border);border-radius:14px;box-shadow:var(--shadow-lg);padding:14px;width:300px;z-index:200}
.theme-picker-pop::before{content:'';position:absolute;top:-6px;right:18px;width:12px;height:12px;background:var(--surface);border-left:1px solid var(--border);border-top:1px solid var(--border);transform:rotate(45deg)}
body{font-family:'Inter',system-ui,-apple-system,sans-serif;background:rgb(244, 246, 248);color:var(--text);min-height:100vh;-webkit-font-smoothing:antialiased;overflow-x:hidden}
a{color:inherit;text-decoration:none}
button{cursor:pointer;font-family:inherit}
input,select,textarea{font-family:inherit}
::-webkit-scrollbar{width:5px;height:5px}
::-webkit-scrollbar-track{background:transparent}
::-webkit-scrollbar-thumb{background:var(--border2);border-radius:3px}
::-webkit-scrollbar-thumb:hover{background:var(--text3)}

/* ── Layout ── */
#sidebar{width:276px;min-height:100vh;background:rgb(255,255,255);border-right:1px solid rgba(145,158,171,.2);display:flex;flex-direction:column;position:fixed;top:0;left:0;bottom:0;z-index:100;box-shadow:none;transition:width .22s ease}
#sidebar.collapsed{width:64px}
#main{position:absolute;top:0;left:276px;right:0;min-height:100vh;display:flex;flex-direction:column;transition:left .22s ease}
#main.with-collapsed-sidebar{left:64px}

/* Collapsed-state overrides — show only icons centered */
#sidebar.collapsed .sidebar-brand{padding:16px 0 12px}
#sidebar.collapsed .sidebar-brand-caption{display:none}
#sidebar.collapsed .sidebar-brand-logo{width:44px}
#sidebar.collapsed .sidebar-divider{margin:0 12px}
#sidebar.collapsed .sidebar-nav{padding:14px 8px}
#sidebar.collapsed .nav-item,#sidebar.collapsed .nav-group-header{justify-content:center;padding:0}
#sidebar.collapsed .nav-label{display:none}
#sidebar.collapsed .nav-group-chev{display:none}
#sidebar.collapsed .nav-item .nav-icon,#sidebar.collapsed .nav-group-header .nav-icon{flex:0 0 auto;width:36px;height:36px;border-radius:9px;font-size:16px}
#sidebar.collapsed .nav-item.active .nav-icon{background:var(--sidebar-active)}
#sidebar.collapsed .nav-item.active::before{height:24px}
#sidebar.collapsed .nav-group-children{margin:2px 0;padding-left:0;border-left:none}
#sidebar.collapsed .nav-group-children::before{display:none}
#sidebar.collapsed .nav-group-children .nav-item{height:30px}
#sidebar.collapsed .nav-group-children .nav-item .nav-icon{width:30px;height:30px;font-size:13px}
#sidebar.collapsed .nav-group.has-active .nav-group-header::after{display:none}
#sidebar.collapsed .sidebar-footer{padding:10px 0;display:flex;justify-content:center}
#sidebar.collapsed .sidebar-status{justify-content:center}
#sidebar.collapsed .sidebar-status > div{display:none}

/* Sidebar collapse toggle — sits on the divider line, half on / half off */
.sidebar-toggle{position:absolute;top:64px;right:-12px;width:24px;height:24px;border-radius:50%;background:var(--surface);border:1px solid var(--border);color:var(--text2);cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:11px;font-weight:700;box-shadow:var(--shadow-sm);z-index:101;transition:transform .22s ease,background .15s,color .15s}
.sidebar-toggle:hover{background:var(--surface2);color:var(--text)}
#sidebar.collapsed .sidebar-toggle{transform:rotate(180deg)}
#topbar{height:64px;background:var(--surface);border-bottom:1px solid var(--border);display:flex;align-items:center;padding:0 32px;gap:16px;position:sticky;top:0;z-index:50;box-shadow:var(--shadow-sm)}
#content{flex:1;padding:28px 32px;overflow-y:auto}

/* ── Sidebar ── */
.sidebar-brand{padding:16px 16px 12px;display:flex;flex-direction:column;align-items:flex-start;gap:4px}
.sidebar-brand-logo{width:200px;max-width:100%;height:auto;display:block}
.sidebar-brand-caption{font-family:"Public Sans",sans-serif;font-size:11px;font-weight:600;line-height:1.35;color:rgb(99,115,129);text-align:center;margin:0 auto}
.sidebar-divider{height:1px;background:rgba(145,158,171,.2);margin:0 12px}
.sidebar-nav{flex:1;padding:10px 10px 12px;overflow-y:auto}

.nav-group{margin-bottom:6px}
.nav-group-header,
.nav-item-top{
  display:flex;align-items:center;gap:8px;position:relative;
  width:100%;border:none;background:transparent;text-align:left;cursor:pointer;
  padding:12px 12px 6px;border-radius:8px;
  font-family:"Public Sans",sans-serif;font-size:11px;font-weight:700;
  text-transform:uppercase;letter-spacing:.6px;color:rgb(145,158,171);
  transition:color .15s,background .15s;
}
.nav-group-header:hover,.nav-item-top:hover{color:rgb(99,115,129);background:rgb(249,250,251)}
.nav-group-header .nav-icon,.nav-item-top .nav-icon{flex:0 0 18px;display:inline-flex;align-items:center;justify-content:center;font-size:14px;color:inherit}
.nav-group-header .nav-label,.nav-item-top .nav-label{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.nav-group-header{padding-right:36px}
.nav-group-chev{position:absolute;right:12px;top:50%;transform:translateY(-50%);pointer-events:none;display:inline-flex;align-items:center;justify-content:center;color:rgb(99,115,129);transition:transform .2s,color .15s}
.nav-group-chev.open{transform:translateY(-50%) rotate(-90deg);color:rgb(99,115,129)}
.nav-group.has-active .nav-group-header,.nav-item-top.active{color:rgb(69,79,91)}

.nav-group-children{margin:2px 0 8px;padding-left:12px;position:relative;animation:navFade .18s ease}
.nav-group-children::before{display:none}
.nav-item-sub{
  display:flex;align-items:center;gap:12px;padding:9px 12px 9px 14px;position:relative;
  border-radius:8px;border:none;background:transparent;cursor:pointer;margin-bottom:2px;
  transition:color .15s,background .15s;white-space:nowrap;width:100%;text-align:left;
  font-family:"Public Sans",sans-serif;font-size:14px;font-weight:600;color:rgb(99,115,129);
}
.nav-item-sub::before{
  content:'';position:absolute;left:0;top:8px;bottom:8px;width:3px;border-radius:999px;
  background:linear-gradient(90deg,rgb(237,76,139) 0%,rgb(241,91,94) 25%,rgb(247,108,43) 50%,rgb(249,114,23) 100%);
  opacity:0;transition:opacity .15s;
}
.nav-item-sub .nav-icon{flex:0 0 22px;display:inline-flex;align-items:center;justify-content:center;font-size:16px;color:rgb(99,115,129)}
.nav-item-sub .nav-label{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.nav-item-sub:hover{color:rgb(69,79,91);background:rgb(249,250,251)}
.nav-item-sub.active{color:rgb(33,43,54);background:rgb(244,246,248)}
.nav-item-sub.active::before{opacity:1}
/* Base nav-item fallback for shared collapsed selectors */
.nav-item{position:relative}
/* Keep all sidebar icons grayscale across menu states. */
#sidebar .nav-icon{filter:grayscale(1) saturate(0)}

@keyframes navFade{from{opacity:0;transform:translateY(-2px)}to{opacity:1;transform:none}}
.nav-icon{font-size:17px;flex-shrink:0;width:20px;text-align:center}
.sidebar-footer{padding:12px 12px 16px;border-top:1px solid rgba(145,158,171,.2)}
.sidebar-status{display:flex;align-items:center;gap:8px;padding:10px 12px;background:rgb(249,250,251);border-radius:10px;border:1px solid rgba(145,158,171,.22)}
.status-pulse{width:8px;height:8px;border-radius:50%;background:#22c55e;box-shadow:0 0 0 3px rgba(34,197,94,.25);animation:pulse 2s infinite}
.sidebar-status-title{font-family:"Public Sans",sans-serif;font-size:12px;font-weight:700;color:rgb(69,79,91)}
.sidebar-status-subtitle{font-family:"Public Sans",sans-serif;font-size:10px;color:rgb(145,158,171);margin-top:1px}
.sidebar-profile-launcher{margin-top:10px;width:100%;display:flex;align-items:center;gap:12px;padding:10px;border-radius:12px;background:rgb(244,246,248);border:1px solid rgba(145,158,171,.2);cursor:pointer;transition:background .15s,border-color .15s}
.sidebar-profile-launcher:hover{background:rgb(236,240,244);border-color:rgba(99,115,129,.28)}
.sidebar-profile-avatar{width:40px;height:40px;border-radius:50%;flex-shrink:0;background:rgba(29,37,46,.1);color:rgb(29,37,46);font-weight:700;font-family:"Public Sans",sans-serif;font-size:15px;display:flex;align-items:center;justify-content:center}
.sidebar-profile-meta{min-width:0;flex:1}
.sidebar-profile-name{font-family:"Public Sans",sans-serif;font-size:13.5px;font-weight:700;color:rgb(28,37,46);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:left}
.sidebar-profile-role{font-family:"Public Sans",sans-serif;font-size:12px;color:rgb(99,115,129);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:left}
.sidebar-profile-gear{display:inline-flex;vertical-align:middle;flex-shrink:0;color:rgb(99,115,129)}
#sidebar.collapsed .sidebar-profile-launcher{padding:7px;justify-content:center;border-radius:10px}
#sidebar.collapsed .sidebar-profile-meta,#sidebar.collapsed .sidebar-profile-gear{display:none}
#sidebar.collapsed .sidebar-profile-avatar{width:34px;height:34px;font-size:12.5px}
@keyframes pulse{0%,100%{box-shadow:0 0 0 3px rgba(34,197,94,.25)}50%{box-shadow:0 0 0 6px rgba(34,197,94,.1)}}

.profile-drawer-overlay{position:fixed;inset:0;background:rgba(20,26,33,.45);opacity:0;pointer-events:none;transition:opacity .2s ease;z-index:1200}
.profile-drawer-overlay.open{opacity:1;pointer-events:auto}
.profile-drawer{position:absolute;top:0;right:0;width:min(480px,94vw);height:100%;background:var(--surface);border-left:1px solid var(--border);box-shadow:0 0 2px rgba(145,158,171,.24),-20px 20px 40px -4px rgba(145,158,171,.24);display:flex;flex-direction:column;transform:translateX(100%);transition:transform .22s ease}
.profile-drawer-overlay.open .profile-drawer{transform:translateX(0)}
.profile-drawer-head{padding:22px 24px;border-bottom:1px solid var(--border);display:flex;align-items:center;gap:14px;position:sticky;top:0;background:var(--surface);z-index:2}
.profile-drawer-avatar{width:48px;height:48px;border-radius:50%;background:rgba(29,37,46,.1);color:rgb(29,37,46);font-size:18px;font-weight:700;display:flex;align-items:center;justify-content:center;box-shadow:none}
.profile-drawer-ident{min-width:0;flex:1}
.profile-drawer-name{font-size:17px;font-weight:700;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.profile-drawer-role{font-size:13px;color:var(--text3);margin-top:2px}
.profile-drawer-close{width:32px;height:32px;border-radius:8px;border:1px solid var(--border);background:var(--surface2);color:var(--text2);cursor:pointer;font-size:14px;display:flex;align-items:center;justify-content:center;transition:all .15s}
.profile-drawer-close:hover{background:var(--surface3)}
.profile-drawer-tabs{padding:0 24px;display:flex;gap:4px;border-bottom:1px solid var(--border)}
.profile-drawer-tab{padding:12px 6px;margin-right:22px;font-size:14px;font-weight:600;color:var(--text3);border:none;border-bottom:2px solid transparent;background:none;cursor:pointer;white-space:nowrap;transition:color .15s;display:inline-flex;align-items:center;gap:8px}
.profile-drawer-tab.active{color:var(--text);font-weight:700;border-bottom-color:var(--text)}
.profile-tab-icon{display:inline-flex;flex-shrink:0;color:currentColor}
.profile-drawer-body{padding:24px;display:flex;flex-direction:column;gap:14px;flex:1;overflow:auto}
.profile-section-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:2px}
.profile-section-head span{font-size:15px;font-weight:700;color:var(--text)}
.profile-edit-btn{font-family:"Public Sans",sans-serif;font-weight:600;font-size:14px;border:none;cursor:pointer;opacity:1;border-radius:10px;padding:9px 18px;display:inline-flex;align-items:center;justify-content:center;gap:8px;transition:.18s;white-space:nowrap;width:auto;line-height:1.4;box-sizing:border-box;background:rgba(29,37,46,.1);color:rgb(26,33,41)}
.profile-edit-btn:hover{background:rgba(29,37,46,.15)}
.profile-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px}
.profile-item{padding:0;border:none;background:transparent;border-radius:0}
.profile-item-label{font-size:11px;text-transform:uppercase;letter-spacing:.5px;color:rgb(145,158,171);font-weight:700;margin-bottom:6px}
.profile-item-value{font-size:14.5px;font-weight:700;color:rgb(28,37,46);margin-top:0;word-break:break-word}
.profile-form-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.profile-field{display:flex;flex-direction:column;gap:6px}
.profile-field span{font-size:11px;text-transform:uppercase;letter-spacing:.5px;color:rgb(145,158,171);font-weight:700}
.profile-field .form-input{font-size:13.5px;padding:8px 11px}
.security-stack{display:flex;flex-direction:column;gap:14px}
.security-section{display:flex;flex-direction:column;gap:8px}
.security-section-title{font-size:13.5px;font-weight:700;color:var(--text)}
.security-box{border:1px solid var(--border);background:#fff;border-radius:12px;padding:12px;display:flex;flex-direction:column;gap:10px}
.security-item-title{font-size:13.5px;font-weight:700;color:var(--text)}
.security-item-sub{font-size:12px;color:var(--text3);margin-top:2px}
.security-switch{width:42px;height:24px;border:none;border-radius:999px;background:#cbd5e1;position:relative;cursor:pointer;transition:background .15s;flex-shrink:0}
.security-switch.on{background:#16a34a}
.security-switch-handle{position:absolute;top:3px;left:3px;width:18px;height:18px;border-radius:50%;background:#fff;box-shadow:0 1px 2px rgba(15,23,42,.3);transition:left .15s}
.security-switch.on .security-switch-handle{left:21px}
.security-row{display:flex;align-items:center;justify-content:space-between;gap:10px}
.security-box .security-row + .security-row{border-top:1px solid var(--border);padding-top:10px}
.security-row-main{display:flex;align-items:center;gap:9px;min-width:0}
.security-row-icon{flex-shrink:0;color:var(--text2)}
.security-row-text{min-width:0}
.security-row-title{font-size:13px;font-weight:700;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.security-row-sub{font-size:12px;color:var(--text3);margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.security-actions{display:flex;flex-wrap:wrap;gap:8px}
.security-mini-btn{font-family:"Public Sans",sans-serif;font-weight:600;font-size:14px;border:1px solid rgba(145,158,171,.32);cursor:pointer;opacity:1;border-radius:10px;padding:9px 18px;display:inline-flex;align-items:center;justify-content:center;gap:8px;transition:.18s;white-space:nowrap;width:auto;line-height:1.4;box-sizing:border-box;background:var(--surface);color:rgb(29,37,46)}
.security-mini-btn:hover{background:var(--surface3);border-color:rgba(145,158,171,.45)}
.security-mini-btn-danger{color:var(--brand-start)}
.security-badge{font-size:11px;font-weight:700;padding:4px 8px;border-radius:999px;background:rgba(22,163,74,.14);color:#15803d;border:1px solid rgba(22,163,74,.28)}
.profile-drawer-footer{padding:16px 24px;border-top:1px solid var(--border);background:var(--surface);position:sticky;bottom:0}
.profile-signout-btn{width:100%;font-family:"Public Sans",sans-serif;font-weight:600;font-size:14px;border:1px solid rgba(145,158,171,.32);cursor:pointer;opacity:1;border-radius:10px;padding:9px 18px;display:inline-flex;align-items:center;justify-content:center;gap:8px;transition:.18s;white-space:nowrap;line-height:1.4;box-sizing:border-box;background:var(--surface);color:var(--brand-start)}
.profile-signout-btn:hover{background:var(--surface2);border-color:rgba(145,158,171,.45)}
@media (max-width:640px){
  .profile-grid,.profile-form-grid{grid-template-columns:1fr}
  .security-row{flex-direction:column;align-items:flex-start}
}

/* ── Topbar ── */
.topbar-title{font-size:16px;font-weight:700;color:var(--text);flex:1}
.topbar-search{display:flex;align-items:center;gap:8px;background:#fff;border:1px solid rgba(145,158,171,.2);border-radius:8px;padding:8px 14px;box-sizing:border-box;min-width:300px}
.topbar-search-input{border:none;outline:none;font-family:"Public Sans",sans-serif;font-size:14px;color:rgb(28,37,46);flex:1 1 0%;background:transparent;min-width:0}
.topbar-search-input::placeholder{color:rgb(99,115,129)}

/* Shared search field style (icon + borderless input) */
.search-field{display:flex;align-items:center;gap:8px;background:#fff;border:1px solid rgba(145,158,171,.2);border-radius:8px;padding:8px 14px;box-sizing:border-box;min-width:0}
.search-field-icon{display:inline-flex;vertical-align:middle;flex-shrink:0;color:rgb(99,115,129)}
.search-field-input{border:none;outline:none;font-family:"Public Sans",sans-serif;font-size:14px;color:rgb(28,37,46);flex:1 1 0%;background:transparent;min-width:0;width:100%}
.search-field-input::placeholder{color:rgb(99,115,129)}
.user-avatar{width:34px;height:34px;border-radius:50%;background:var(--brand-grad);display:flex;align-items:center;justify-content:center;font-weight:700;font-size:13px;color:#fff;box-shadow:var(--shadow-brand)}

/* ── Cards ── */
.card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);padding:24px;box-shadow:var(--shadow-sm)}
.card:hover{box-shadow:var(--shadow)}
.card-sm{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:16px;box-shadow:var(--shadow-sm)}
.stat-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);padding:22px;display:flex;align-items:center;gap:18px;box-shadow:var(--shadow-sm);transition:all .2s;overflow:hidden;position:relative}
.stat-card::after{content:'';position:absolute;top:0;right:0;width:80px;height:80px;border-radius:50%;opacity:.05;transform:translate(20px,-20px)}
.stat-card:hover{box-shadow:var(--shadow);transform:translateY(-1px)}
.stat-icon{width:52px;height:52px;border-radius:12px;display:flex;align-items:center;justify-content:center;flex-shrink:0;font-size:24px}

/* ── Buttons ── */
.btn{font-family:"Public Sans",sans-serif;font-weight:600;font-size:14px;border:none;cursor:pointer;opacity:1;border-radius:10px;padding:9px 18px;display:inline-flex;align-items:center;justify-content:center;gap:8px;transition:.18s;white-space:nowrap;width:auto;height:40px;line-height:1.4;box-sizing:border-box}
.btn-primary{background:linear-gradient(90deg, rgb(237, 76, 139) 0%, rgb(241, 91, 94) 25%, rgb(247, 108, 43) 50%, rgb(249, 114, 23) 100%) !important;color:#fff !important;border:none !important;border-radius:10px;font-weight:600;font-size:14px;height:40px;padding:9px 18px;line-height:1.4;font-family:"Public Sans",sans-serif}
.btn-primary:hover{box-shadow:var(--shadow-brand);transform:translateY(-1px)}
.btn-primary:active{transform:translateY(0)}
.btn-secondary{background:rgb(255,255,255);color:rgb(29,37,46);border:1px solid rgb(196,205,213);box-shadow:none;border-radius:10px;font-weight:600;height:40px}
.btn-secondary:hover{background:#f8fafc;border-color:rgb(196,205,213);color:rgb(29,37,46);box-shadow:none}
.btn-ghost{background:transparent;color:var(--text2);border:1px solid var(--border);border-radius:10px;font-weight:600;height:40px}
.btn-ghost:hover{background:var(--surface2);color:var(--text);border-color:var(--border2)}
.btn-refresh{
  font-family:"Public Sans",sans-serif;
  font-weight:600;
  font-size:14px;
  border:1px solid rgb(196,205,213);
  cursor:pointer;
  opacity:1;
  border-radius:10px;
  padding:9px 18px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  transition:.18s;
  white-space:nowrap;
  width:auto;
  height:40px;
  line-height:1.4;
  box-sizing:border-box;
  background:rgb(255,255,255);
  color:rgb(29,37,46);
}
.btn-refresh:hover{background:#f8fafc;border-color:rgb(196,205,213);color:rgb(29,37,46)}
.btn-danger{background:var(--error-bg);color:var(--error);border:1px solid var(--error-border);border-radius:10px;font-weight:600;height:40px}
.btn-danger:hover{background:#fee2e2;border-color:var(--error)}
.btn-success{background:var(--success-bg);color:var(--success);border:1px solid var(--success-border);border-radius:10px;font-weight:600;height:40px}
.btn-success:hover{background:#dcfce7;border-color:var(--success)}
.btn-warning{background:var(--warning-bg);color:var(--warning);border:1px solid var(--warning-border);border-radius:10px;font-weight:600;height:40px}
.btn-warning:hover{background:#fef3c7}
.btn-sm{padding:6px 12px;font-size:13px;border-radius:10px;height:32px;font-weight:600}
.btn-xs{padding:4px 10px;font-size:12px;border-radius:10px;height:28px;font-weight:600}
.btn-icon{padding:8px;border-radius:10px;aspect-ratio:1;width:40px;height:40px}
.int-row-btn{font-family:"Public Sans",sans-serif;font-weight:700;font-size:13px;border:none;cursor:pointer;opacity:1;border-radius:8px;padding:6px 12px;display:inline-flex;align-items:center;justify-content:center;gap:8px;transition:.18s;white-space:nowrap;width:auto;height:auto;line-height:1.4;box-sizing:border-box}
.int-row-btn:disabled{opacity:.55;cursor:not-allowed}
.int-row-btn-grey{background:rgba(29,37,46,.1);color:rgb(26,33,41)}
.int-row-btn-grey:hover{background:rgba(29,37,46,.16)}
.int-row-btn-light{background:rgb(255,255,255);color:rgb(29,37,46);border:1px solid rgb(196,205,213)}
.int-row-btn-light:hover{background:#f8fafc}
.int-row-btn-gradient{background:linear-gradient(90deg,rgb(237,76,139) 0%,rgb(241,91,94) 25%,rgb(247,108,43) 50%,rgb(249,114,23) 100%);color:#fff}
.int-row-btn-gradient:hover{filter:brightness(1.04)}
.int-row-btn-success{background:var(--success-bg);color:var(--success)}
.int-row-btn-success:hover{background:#dcfce7}
.int-row-btn-danger{background:var(--error-bg);color:var(--error);border:1px solid var(--error-border)}
.int-row-btn-danger:hover{background:#fee2e2;border-color:var(--error)}
.btn.row-icon-action,.row-icon-action{min-width:32px;width:32px;height:32px;padding:0!important;border-radius:8px;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0}
.btn-ghost.row-icon-action{background:rgba(29,37,46,.1);border:none;color:rgb(26,33,41)}
.btn-ghost.row-icon-action:hover{background:rgba(29,37,46,.16);color:rgb(26,33,41)}
.int-row-status{font-family:"Public Sans",sans-serif;font-weight:700;font-size:13px;border:none;border-radius:8px;padding:6px 12px;display:inline-flex;align-items:center;justify-content:center;gap:8px;line-height:1.4;box-sizing:border-box;background:rgba(29,37,46,.1);color:rgb(26,33,41);cursor:default;white-space:nowrap;flex-shrink:0}
.int-row-status.is-live{background:rgba(34,197,94,.16);color:rgb(17,141,87)}
.int-row-status.is-error{background:rgba(220,38,38,.12);color:rgb(185,28,28)}
.int-row-status.is-warn{background:var(--warning-bg);color:var(--warning)}

/* ── Forms ── */
.form-group{margin-bottom:18px}
.form-label{display:block;font-size:12.5px;font-weight:600;color:var(--text2);margin-bottom:6px;letter-spacing:.1px}
.req{color:var(--brand-start);margin-left:2px}
.form-input{width:100%;padding:9px 13px;background:var(--surface);border:1.5px solid var(--border2);border-radius:var(--radius);color:var(--text);font-size:13.5px;transition:all .15s;box-shadow:var(--shadow-sm)}
.form-input:focus{outline:none;border-color:var(--brand-start);box-shadow:0 0 0 3px rgba(255,86,48,.12)}
.form-input.error{border-color:var(--error)!important;box-shadow:0 0 0 3px rgba(220,38,38,.08)!important}
.form-input::placeholder{color:var(--text3)}
.field-error{font-size:11.5px;color:var(--error);margin-top:5px;display:flex;align-items:center;gap:4px;font-weight:500}
.form-select{width:100%;padding:9px 13px;background:var(--surface);border:1.5px solid var(--border2);border-radius:var(--radius);color:var(--text);font-size:13.5px;appearance:none;-webkit-appearance:none;cursor:pointer;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%231d252e' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m19 9l-7 6l-7-6'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 10px center;background-size:20px 20px;padding-right:40px;box-shadow:var(--shadow-sm)}
.form-select:focus{outline:none;border-color:var(--brand-start);box-shadow:0 0 0 3px rgba(255,86,48,.12)}
.form-select.error{border-color:var(--error)!important}
.icon-select{position:relative;width:100%}
.icon-select-leading{position:absolute;left:12px;top:50%;transform:translateY(-50%);z-index:1;display:inline-flex;color:var(--text2);pointer-events:none}
.icon-select .form-select{padding-left:36px}
.icon-dropdown{position:relative}
.icon-dropdown-trigger{width:100%;min-height:40px;padding:8px 11px;border:1.5px solid var(--border2);border-radius:var(--radius);background:var(--surface);color:var(--text);box-shadow:var(--shadow-sm);display:flex;align-items:center;gap:9px;cursor:pointer;font-family:"Public Sans",sans-serif;font-size:13.5px;text-align:left;transition:all .15s}
.icon-dropdown-trigger:hover{border-color:var(--brand-start)}
.icon-dropdown.open .icon-dropdown-trigger{border-color:var(--brand-start);box-shadow:0 0 0 3px rgba(255,86,48,.12)}
.icon-dropdown-leading{display:inline-flex;color:var(--accent);flex-shrink:0}
.icon-dropdown-label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.icon-dropdown-trigger>svg:last-child{color:var(--text3);transition:transform .15s}
.icon-dropdown.open .icon-dropdown-trigger>svg:last-child{transform:rotate(180deg)}
.icon-dropdown-menu{position:absolute;left:0;right:0;top:calc(100% + 6px);z-index:80;padding:6px;background:var(--surface);border:1px solid var(--border);border-radius:12px;box-shadow:0 16px 38px rgba(15,23,42,.18);max-height:310px;overflow-y:auto}
.icon-dropdown-menu button{width:100%;padding:8px 9px;border:0;border-radius:8px;background:transparent;color:var(--text2);display:flex;align-items:center;gap:9px;cursor:pointer;font-family:"Public Sans",sans-serif;font-size:13px;text-align:left;transition:background .12s,color .12s}
.icon-dropdown-menu button:hover{background:var(--surface2);color:var(--text)}
.icon-dropdown-menu button.selected{background:rgba(99,102,241,.1);color:var(--accent);font-weight:700}
.icon-dropdown-menu button>svg:first-child{flex-shrink:0}
.icon-dropdown-menu button span{flex:1}
.icon-dropdown-menu button>svg:last-child:not(:first-child){color:var(--accent)}
.input-wrap{position:relative}
.input-wrap .eye-btn{position:absolute;right:10px;top:50%;transform:translateY(-50%);background:none;border:none;color:var(--text3);cursor:pointer;padding:4px;border-radius:4px;font-size:14px}
.input-wrap .eye-btn:hover{color:var(--text2);background:var(--surface2)}
.form-row{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.form-row-3{display:grid;grid-template-columns:1fr 1fr 1fr;gap:16px}
textarea.form-input{resize:vertical;min-height:84px;line-height:1.5}
.form-hint{font-size:11.5px;color:var(--text3);margin-top:4px}

/* ── Badges ── */
.badge{display:inline-flex;align-items:center;gap:5px;padding:4px 10px;border-radius:20px;font-size:11.5px;font-weight:600}
.badge-success{background:var(--success-bg);color:var(--success);border:1px solid var(--success-border)}
.badge-error{background:var(--error-bg);color:var(--error);border:1px solid var(--error-border)}
.badge-warning{background:var(--warning-bg);color:var(--warning);border:1px solid var(--warning-border)}
.badge-info{background:var(--info-bg);color:var(--info);border:1px solid var(--info-border)}
.badge-gray{background:var(--surface3);color:var(--text2);border:1px solid var(--border)}

/* ── Tables ── */
.table-wrap{overflow-x:auto;border-radius:var(--radius);border:1px solid var(--border)}
/* Monitoring page — executions table */
.exec-card{padding:0;overflow:hidden}
.exec-toolbar{display:flex;align-items:center;gap:10px;padding:14px 16px;flex-wrap:wrap;background:var(--surface);border-bottom:1px solid var(--border)}
.exec-adv{padding:12px 16px;background:var(--surface2);border-bottom:1px solid var(--border);display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:14px;align-items:end}
.exec-adv-field{display:flex;flex-direction:column;gap:4px;min-width:0}
.exec-adv-field label{font-size:10.5px;font-weight:700;color:var(--text3);text-transform:uppercase;letter-spacing:.7px}
.exec-adv-field input{padding:6px 10px;font-size:12.5px;border:1px solid var(--border);border-radius:6px;background:var(--surface);color:var(--text);width:100%}
.exec-adv-field input:focus{outline:none;border-color:var(--accent);box-shadow:0 0 0 3px rgba(99,102,241,.15)}
.exec-adv-row{display:flex;gap:6px;align-items:center}
.exec-table-wrap{overflow:auto;max-height:calc(100vh - 360px)}
.exec-table-wrap table{table-layout:auto}
.exec-table-wrap thead th{position:sticky;top:0;z-index:2;background:var(--surface2);box-shadow:0 1px 0 var(--border)}
.exec-table-wrap thead th.sortable{cursor:pointer;user-select:none}
.exec-table-wrap thead th.sortable:hover{color:var(--accent)}
.exec-table-wrap tbody tr{cursor:pointer}
.exec-filter-chips{display:flex;gap:6px;align-items:center;flex-wrap:wrap}
.exec-chip{display:inline-flex;align-items:center;gap:5px;padding:3px 8px 3px 9px;border-radius:14px;background:rgba(99,102,241,.12);color:var(--accent);border:1px solid rgba(99,102,241,.3);font-size:11px;font-weight:600}
.exec-chip button{background:none;border:none;cursor:pointer;color:var(--accent);font-size:13px;line-height:1;padding:0}
.exec-chip button:hover{color:var(--error)}
.btn-toggle{display:inline-flex;align-items:center;gap:5px;padding:6px 11px;border-radius:7px;background:var(--surface);border:1px solid var(--border);color:var(--text2);font-size:12.5px;font-weight:600;cursor:pointer;transition:all .15s}
.btn-toggle:hover{border-color:var(--accent);color:var(--accent)}
.btn-toggle.active{background:rgba(99,102,241,.12);color:var(--accent);border-color:rgba(99,102,241,.3)}
.exec-view-toggle{display:flex;background:var(--surface3);border-radius:8px;padding:3px;border:1px solid var(--border);font-size:11px;font-weight:600}
.exec-view-toggle button{padding:5px 11px;border-radius:6px;border:none;cursor:pointer;background:transparent;color:var(--text2);font:inherit;transition:all .15s}
.exec-view-toggle button:hover{color:var(--accent)}
.exec-view-toggle button.active{background:var(--surface);color:var(--accent);box-shadow:0 1px 4px rgba(0,0,0,.12)}
table{width:100%;border-collapse:collapse;background:var(--surface)}
thead{background:var(--surface2)}
th{text-align:left;padding:12px 16px;font-size:11px;font-weight:700;color:var(--text3);border-bottom:1px solid var(--border);text-transform:uppercase;letter-spacing:.8px}
td{padding:13px 16px;font-size:13.5px;border-bottom:1px solid var(--border);vertical-align:middle;color:var(--text)}
tr:last-child td{border-bottom:none}
tbody tr{transition:background .12s}
tbody tr:hover td{background:#fafbff}

/* ── Modal ── */
.modal-overlay{position:fixed;inset:0;background:rgba(10,12,28,.55);backdrop-filter:blur(6px);display:flex;align-items:center;justify-content:center;z-index:1000;padding:20px}
.modal{background:var(--surface);border:1px solid var(--border);border-radius:20px;width:100%;max-height:92vh;display:flex;flex-direction:column;overflow:hidden;box-shadow:0 32px 80px rgba(0,0,0,.22),0 0 0 1px rgba(255,255,255,.06)}
.modal-sm{max-width:480px}
.modal-md{max-width:640px}
.modal-lg{max-width:880px}
.modal-xl{max-width:1080px}
.modal-header{padding:22px 28px 18px;border-bottom:1px solid var(--border);display:flex;align-items:center;justify-content:space-between;flex-shrink:0;background:var(--surface);border-radius:20px 20px 0 0}
.modal-title{font-size:17px;font-weight:700;color:var(--text);letter-spacing:-.2px}
.modal-subtitle{font-size:12.5px;color:var(--text3);margin-top:2px}
/* display:flex (column) so the single panels child stretches to fill
   the body. Previously this was display:block, which let .conn-modal-panels
   size to its content (1063px even when the body itself was 495px tall).
   The form's overflow:scroll then never engaged because the form was as
   tall as its content. With display:flex the panels are constrained to
   the body's actual height and the form scrolls inside. */
.modal-body{padding:0;overflow:hidden;flex:1;min-height:0;display:flex;flex-direction:column}
/* Visible-but-subtle scrollbars on modal scroll containers so users have a
   physical signal that there's more content below the fold. Previously these
   were hidden with `scrollbar-width:none`, which made tall forms (Oracle
   Fusion, NetSuite, Workday) look truncated. */
.modal-body-scroll{padding:26px 28px;overflow-y:auto;overflow-x:hidden;height:100%;scrollbar-width:thin;scrollbar-color:var(--border) transparent}
.modal-body-scroll::-webkit-scrollbar{width:8px;height:8px}
.modal-body-scroll::-webkit-scrollbar-thumb{background:var(--border);border-radius:4px}
.modal-body-scroll::-webkit-scrollbar-thumb:hover{background:var(--text3)}
.modal-body-scroll::-webkit-scrollbar-track{background:transparent}
.modal-footer{padding:16px 24px;border-top:1px solid var(--border);display:flex;gap:8px;justify-content:flex-end;background:var(--surface2);border-radius:0 0 20px 20px;flex-shrink:0}
.modal-heading{display:flex;align-items:center;gap:12px;min-width:0}
.modal-heading-icon{width:38px;height:38px;border-radius:11px;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0}
.modal-heading-icon.user{background:rgba(37,99,235,.12);color:#2563eb}
.modal-heading-icon.role{background:rgba(124,58,237,.12);color:#7c3aed}
.modal-heading-icon.api-key{background:rgba(217,119,6,.14);color:#b76e00}
.modal-form-section{padding:18px;background:var(--surface2);border:1px solid var(--border);border-radius:14px;margin-bottom:16px}
.modal-form-section:last-child{margin-bottom:0}
.modal-form-section-title{display:flex;align-items:center;gap:7px;margin-bottom:15px;color:var(--text);font-size:13px;font-weight:700}
.modal-form-section-count{padding:2px 7px;border-radius:10px;background:var(--surface3);color:var(--text3);font-size:10.5px}
.form-label-note{margin-left:5px;color:var(--text3);font-size:11px;font-weight:500}
.role-picker-list{display:flex;flex-direction:column;gap:8px}
.role-picker-item{display:flex;align-items:center;gap:10px;padding:10px 12px;background:var(--surface);border:1px solid var(--border);border-radius:10px;cursor:pointer;transition:all .15s}
.role-picker-item:hover{border-color:var(--border2);box-shadow:var(--shadow-sm)}
.role-picker-item.selected{background:rgba(124,58,237,.06);border-color:rgba(124,58,237,.32)}
.role-picker-description{flex:1;min-width:0;font-size:11.5px;color:var(--text3);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.role-picker-count{font-size:10.5px;color:var(--text3);font-weight:700;white-space:nowrap}
.role-color-picker{display:flex;gap:7px;flex-wrap:wrap;padding-top:2px}
.role-color-picker button{width:28px;height:28px;border-radius:8px;border:2px solid transparent;padding:0;box-shadow:0 0 0 1px rgba(0,0,0,.08);transition:transform .15s,box-shadow .15s}
.role-color-picker button:hover:not(:disabled){transform:scale(1.08)}
.role-color-picker button.selected{border-color:var(--surface);box-shadow:0 0 0 2px var(--text)}
.api-key-notice{display:flex;align-items:flex-start;gap:8px;padding:10px 12px;margin-bottom:16px;border-radius:10px;background:rgba(217,119,6,.08);border:1px solid rgba(217,119,6,.25);color:var(--warning);font-size:12px;line-height:1.45}
.api-key-notice svg{margin-top:1px}
.api-key-row-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:nowrap}
@media(max-width:640px){
  .form-row,.form-row-3{grid-template-columns:1fr}
  .modal-form-section{padding:14px}
  .role-picker-item{align-items:flex-start;flex-wrap:wrap}
  .role-picker-description{flex-basis:calc(100% - 36px);white-space:normal}
  .role-picker-count{margin-left:auto}
}

/* ── Connection modal two-panel layout ── */
.conn-modal-panels{display:flex;height:100%;min-height:0}
/* Visible-but-subtle scroll for the right form pane too. Same rationale as
   .modal-body-scroll — the previous `scrollbar-width:none` hid the affordance. */
.conn-modal-sidebar{width:220px;flex-shrink:0;border-right:1px solid var(--border);display:flex;flex-direction:column;background:var(--surface2);padding:24px 20px;gap:20px;overflow-y:auto;scrollbar-width:none}
.conn-modal-sidebar::-webkit-scrollbar{display:none}
/* Form pane — visible-but-quiet scrollbar. 14px wide, neutral gray thumb
   on a lightly tinted track, gentle hover lift. Wide enough to grab but
   doesn't shout indigo at you the whole time the modal is open.
   The scroll-shadow trick (radial gradient pinned to local-scroll +
   surface-color cover layers pinned to viewport-scroll) puts a soft
   shadow at the top/bottom of the pane that fades away when you've
   scrolled to the edge — gives a clear "more below" signal even before
   the user reaches for the bar. */
.conn-modal-form{flex:1;overflow-y:scroll;overflow-x:hidden;padding:22px 32px 22px 28px;
  scrollbar-width:thin;scrollbar-color:var(--text3) var(--surface2);
  background:
    radial-gradient(farthest-side at 50% 0,    rgba(0,0,0,.08), rgba(0,0,0,0)) top    / 100% 8px no-repeat local,
    radial-gradient(farthest-side at 50% 100%, rgba(0,0,0,.08), rgba(0,0,0,0)) bottom / 100% 8px no-repeat local,
    linear-gradient(var(--surface), var(--surface)) top    / 100% 14px no-repeat scroll,
    linear-gradient(var(--surface), var(--surface)) bottom / 100% 14px no-repeat scroll;
}
.conn-modal-form::-webkit-scrollbar{width:14px}
.conn-modal-form::-webkit-scrollbar-track{background:var(--surface2)}
.conn-modal-form::-webkit-scrollbar-thumb{
  background:var(--text3);
  border:3px solid var(--surface2);
  border-radius:8px;
  min-height:40px;
}
.conn-modal-form::-webkit-scrollbar-thumb:hover{background:var(--text2)}
.conn-modal-form::-webkit-scrollbar-thumb:active{background:var(--text)}
.conn-modal-form::-webkit-scrollbar-button{display:none}

/* ── Connection form: top toolbar (Expand-all / Collapse-all) ───────────── */
.conn-form-toolbar{display:flex;align-items:center;justify-content:space-between;
  margin-bottom:14px;padding:8px 10px;border-radius:8px;
  background:linear-gradient(135deg,rgba(99,102,241,.05),rgba(139,92,246,.03));
  border:1px solid var(--border);}
.conn-form-toolbar-hint{font-size:11px;color:var(--text3);font-weight:600;letter-spacing:.03em}
.conn-form-toolbar-btn{background:none;border:1px solid var(--border);border-radius:6px;
  padding:4px 10px;font-size:11px;font-weight:700;color:var(--text2);cursor:pointer;
  transition:background .12s,color .12s,border-color .12s;}
.conn-form-toolbar-btn:hover{background:var(--surface2);color:var(--text);border-color:var(--text3)}

/* ── Connection form: collapsible section ──────────────────────────────── */
.conn-section{border:1px solid var(--border);border-radius:10px;margin-bottom:12px;
  background:var(--surface);overflow:hidden;transition:border-color .15s,box-shadow .15s;}
.conn-section.is-open{border-color:color-mix(in srgb,#6366f1 25%,var(--border));
  box-shadow:0 1px 3px rgba(99,102,241,.05);}
.conn-section.has-error{border-color:rgba(239,68,68,.5);box-shadow:0 0 0 1px rgba(239,68,68,.15)}
.conn-section-head{display:flex;align-items:center;gap:10px;padding:11px 14px;
  user-select:none;background:var(--surface2);border-bottom:1px solid transparent;
  transition:background .12s;}
.conn-section.is-open .conn-section-head{border-bottom-color:var(--border);background:var(--surface)}
.conn-section-head:hover{background:color-mix(in srgb,#6366f1 4%,var(--surface2))}
.conn-section-icon{font-size:14px;line-height:1;flex-shrink:0}
.conn-section-label-text{font-size:12.5px;font-weight:700;color:var(--text);letter-spacing:.01em;flex-shrink:0}
.conn-section-meta{font-size:10.5px;color:var(--text3);font-weight:500;margin-left:6px;flex:1;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.conn-section-err-dot{color:#ef4444;font-size:14px;line-height:1;margin-left:auto;animation:tlPulse 1.4s infinite}
.conn-section-chevron{font-size:11px;color:var(--text3);font-weight:700;margin-left:auto;flex-shrink:0;
  transition:transform .15s, color .15s;}
.conn-section-head:hover .conn-section-chevron{color:var(--text2)}
.conn-section.has-error .conn-section-chevron{margin-left:8px}
.conn-section-body{padding:14px 14px 6px}
.conn-adapter-badge{display:flex;flex-direction:column;align-items:center;text-align:center;gap:10px;padding-bottom:18px;border-bottom:1px solid var(--border)}
.conn-adapter-badge-icon{width:52px;height:52px;border-radius:14px;display:flex;align-items:center;justify-content:center;background:var(--surface);border:1px solid var(--border);box-shadow:0 2px 8px rgba(0,0,0,.08)}
.conn-adapter-badge-name{font-size:13px;font-weight:700;color:var(--text);line-height:1.3}
.conn-adapter-badge-cat{font-size:11px;color:var(--text3);font-weight:500;margin-top:2px}
.conn-impact-block{background:rgba(245,158,11,.07);border:1px solid rgba(245,158,11,.28);border-radius:10px;padding:12px 14px}
.conn-impact-title{display:flex;align-items:center;gap:6px;font-size:12px;font-weight:700;color:#b45309;margin-bottom:6px}
.conn-impact-desc{font-size:11px;color:#92400e;line-height:1.5;margin-bottom:8px;opacity:.85}
.conn-impact-chips{display:flex;flex-direction:column;gap:4px}
.conn-impact-chip{font-size:11px;font-weight:600;color:#92400e;background:rgba(255,255,255,.7);border:1px solid rgba(245,158,11,.3);border-radius:6px;padding:3px 8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.conn-section-label{font-size:10.5px;font-weight:700;color:var(--text3);letter-spacing:.06em;text-transform:uppercase;margin:18px 0 10px}
.conn-section-label:first-child{margin-top:0}
/* Close button redesign */
.modal-close-btn{width:32px;height:32px;padding:0;border-radius:8px;border:1px solid var(--border);background:var(--surface2);color:var(--text2);cursor:pointer;display:inline-flex;align-items:center;justify-content:center;font-size:14px;flex-shrink:0;transition:all .15s}
.modal-close-btn:hover{background:var(--surface3);color:var(--text);border-color:var(--border)}
.modal-close-btn:disabled{opacity:.45;cursor:not-allowed}
.modal-close-btn-on-dark{background:rgba(255,255,255,.14);border-color:rgba(255,255,255,.28);color:#fff}
.modal-close-btn-on-dark:hover{background:rgba(255,255,255,.24);color:#fff;border-color:rgba(255,255,255,.45)}

/* ── Adapter / Connector Grid ── */
.adapter-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:10px}
.adapter-card{background:var(--surface);border:1.5px solid var(--border);border-radius:var(--radius);padding:16px 10px;text-align:center;cursor:pointer;transition:all .18s;box-shadow:var(--shadow-sm)}
.adapter-card:hover{border-color:var(--brand-start);box-shadow:0 4px 16px rgba(255,86,48,.12);transform:translateY(-2px)}
.adapter-card.selected{border-color:var(--brand-start);background:linear-gradient(135deg,rgba(255,86,48,.07),rgba(255,171,0,.05));box-shadow:0 4px 16px rgba(255,86,48,.15)}
.adapter-card .adapter-name{font-size:11.5px;color:var(--text2);font-weight:600;margin-top:8px;line-height:1.3}
.adapter-card.selected .adapter-name{color:var(--brand-start)}
.cat-label{font-size:11px;font-weight:700;color:var(--text3);letter-spacing:.8px;text-transform:uppercase;margin:18px 0 10px;padding:6px 10px;background:var(--surface2);border-radius:6px;border-left:3px solid var(--brand-start)}

/* ── Trigger Types ── */
.trigger-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(155px,1fr));gap:14px}
.trigger-card{background:var(--surface);border:1.5px solid var(--border);border-radius:var(--radius-lg);padding:22px 14px;text-align:center;cursor:pointer;transition:all .2s;box-shadow:var(--shadow-sm)}
.trigger-card:hover{border-color:var(--brand-start);box-shadow:0 6px 24px rgba(255,86,48,.14);transform:translateY(-3px)}
.trigger-card.selected{border-color:var(--brand-start);background:linear-gradient(145deg,rgba(255,86,48,.07),rgba(255,171,0,.05));box-shadow:0 6px 24px rgba(255,86,48,.2)}
.trigger-icon{font-size:30px;margin-bottom:12px;display:block}
.trigger-name{font-size:13px;font-weight:700;color:var(--text);margin-bottom:5px}
.trigger-card.selected .trigger-name{color:var(--brand-start)}
.trigger-desc{font-size:11.5px;color:var(--text3);line-height:1.4}

/* ── Wizard Steps ── */
.wizard-steps{display:flex;align-items:center;margin-bottom:28px}
.wizard-step{display:flex;align-items:center;gap:10px;flex:1}
.wizard-step:not(:last-child)::after{content:'';flex:1;height:2px;background:var(--border2);margin:0 12px;border-radius:1px}
.step-num{width:30px;height:30px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:13px;font-weight:700;flex-shrink:0;transition:all .2s}
.step-num.done{background:var(--success);color:#fff;box-shadow:0 2px 8px rgba(22,163,74,.3)}
.step-num.active{background:var(--brand-grad);color:#fff;box-shadow:0 2px 8px rgba(255,86,48,.4)}
.step-num.pending{background:var(--surface3);color:var(--text3);border:1.5px solid var(--border2)}
.step-label{font-size:12.5px;font-weight:500;color:var(--text3)}
.step-label.active{color:var(--text);font-weight:700}
.step-label.done{color:var(--success);font-weight:600}

/* ── Integration Rows ── */
.integration-row{display:flex;flex-direction:column;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);margin-bottom:10px;transition:border-color .18s,box-shadow .18s;box-shadow:var(--shadow-sm);overflow:hidden}
.integration-row:hover{border-color:var(--border2);box-shadow:var(--shadow)}
.integration-row.expanded{border-color:var(--border2)}
.integration-row-head{display:flex;align-items:center;gap:14px;padding:14px 18px;cursor:pointer;min-height:64px}
.integration-row-chev{flex:0 0 26px;width:26px;height:26px;border-radius:8px;border:none;background:none;color:var(--text3);cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:11px;transition:transform .2s,color .15s,background .15s;padding:0}
.integration-row-chev:hover{background:var(--surface3);color:var(--text)}
.integration-row.expanded .integration-row-chev{transform:rotate(90deg);color:var(--text)}
.integration-row-detail{padding:10px 16px 12px 50px;border-top:1px dashed var(--border);background:var(--surface2);display:flex;flex-direction:column;gap:8px;font-size:12px;color:var(--text2);animation:rowDetailFade .18s ease}
@keyframes rowDetailFade{from{opacity:0;transform:translateY(-3px)}to{opacity:1;transform:none}}
.integration-row .row-chip{font-size:11px;font-weight:700;border-radius:14px;padding:3px 9px;border:1px solid transparent;letter-spacing:.3px;display:inline-flex;align-items:center;gap:5px;line-height:1.4}
.integration-row .row-chip.trigger-chip{color:var(--text2);background:var(--surface3);border-color:var(--border)}
.integration-row-meta{display:flex;align-items:center;gap:14px;flex-wrap:wrap;font-size:11px;color:var(--text3)}
.integration-row-meta>span,.integration-row-meta>div{display:inline-flex;align-items:center;gap:4px}
.integration-row-stat{text-align:right;flex-shrink:0;font-size:11.5px;color:var(--text3);line-height:1.25;font-weight:600;min-width:44px}
.integration-row-stat strong{display:block;font-size:15px;font-weight:700;color:var(--text);letter-spacing:-.2px;margin-bottom:1px}
.integration-row-stat strong.success{color:var(--success)}
.integration-row-stat strong.muted{color:var(--text3)}
/* Collapsible group headers on the Integrations list (Group by Project/Trigger/Status) */
.integration-group-head{display:flex;align-items:center;gap:9px;padding:9px 4px 7px;margin-top:14px;cursor:pointer;user-select:none}
.integration-group-head:first-child{margin-top:2px}
.integration-group-head .chev{font-size:9px;color:var(--text3);transition:transform .2s;flex-shrink:0}
.integration-group-head:not(.collapsed) .chev{transform:rotate(90deg)}
.integration-group-head .grp-name{font-weight:700;font-size:11.5px;letter-spacing:.5px;color:var(--text2);text-transform:uppercase;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:340px}
.integration-group-head .grp-count{font-size:10px;font-weight:700;color:var(--text3);background:var(--surface3);border:1px solid var(--border);border-radius:10px;padding:0 8px;min-width:22px;text-align:center;flex-shrink:0}
.integration-group-head .grp-line{flex:1;height:1px;background:var(--border);margin-left:4px}
.integration-group-head:hover .grp-name{color:var(--text)}
.project-route-row:hover{background:var(--surface2)}
.project-route-row:last-child{border-bottom:none}

/* ── Route Builder Swimlanes (Oracle-style: Inbound | Processing | Outbound) ── */
.swimlane-canvas{display:flex;flex-direction:column;height:100%;overflow:auto;padding:14px 18px;background:radial-gradient(circle,rgba(0,0,0,.04) 1px,transparent 1px);background-size:24px 24px;position:relative}
/* Lane widths — Processing is wider than the side lanes because that's where
   most steps land in a typical route (transforms, logging, splits, choices,
   etc.). Side lanes stay narrow because they usually hold 1-2 cards. The
   ratio also makes nested children inside a Split card legible at depths 2-3
   without their text getting squeezed into a 33%-wide column. */
.swimlane-headers{display:grid;grid-template-columns:0.7fr 2fr 0.7fr;gap:12px;position:sticky;top:0;z-index:5;background:linear-gradient(to bottom, var(--surface) 75%, rgba(255,255,255,.6));padding:4px 0 8px;margin-bottom:8px;backdrop-filter:blur(2px)}
.swimlane-header{padding:9px 12px;border-radius:10px;text-align:center;font-weight:700;font-size:11px;text-transform:uppercase;letter-spacing:.9px;display:flex;align-items:center;justify-content:center;gap:6px;box-shadow:0 1px 3px rgba(0,0,0,.04)}
.swimlane-header.inbound{background:linear-gradient(135deg, rgba(8,145,178,.18), rgba(8,145,178,.08));color:#0e7490;border:1px solid rgba(8,145,178,.4)}
.swimlane-header.processing{background:linear-gradient(135deg, rgba(99,102,241,.18), rgba(139,92,246,.08));color:#4f46e5;border:1px solid rgba(99,102,241,.4)}
.swimlane-header.outbound{background:linear-gradient(135deg, rgba(22,163,74,.18), rgba(22,163,74,.08));color:#15803d;border:1px solid rgba(22,163,74,.4)}
/* Tinted lane backgrounds — gives each column its own visual territory.
   Widths match .swimlane-headers (0.7 / 2 / 0.7 = 3.4 total). Percentages
   for the absolute-positioned tint layers are derived from that ratio:
     inbound:    0.7 / 3.4 ≈ 20.59%
     processing: 2.0 / 3.4 ≈ 58.82% (left at 20.59%)
     outbound:   0.7 / 3.4 ≈ 20.59% (left at 79.41%) */
.swimlane-grid{display:grid;grid-template-columns:0.7fr 2fr 0.7fr;column-gap:14px;row-gap:0;align-items:start;flex:1;position:relative;padding:6px 0}
.swimlane-grid::before,.swimlane-grid::after{content:'';position:absolute;top:0;bottom:0;border-radius:14px;pointer-events:none;z-index:0}
.swimlane-grid::before{
  /* inbound column tint (left ~20%) */
  left:0;
  width:20.59%;
  background:linear-gradient(180deg, rgba(8,145,178,.05), rgba(8,145,178,.02) 60%, transparent);
  border:1px dashed rgba(8,145,178,.18);
}
.swimlane-grid::after{
  /* outbound column tint (right ~20%) */
  left:79.41%;
  width:20.59%;
  background:linear-gradient(180deg, rgba(22,163,74,.05), rgba(22,163,74,.02) 60%, transparent);
  border:1px dashed rgba(22,163,74,.18);
}
/* The middle (processing) lane gets its own background via a child element so we can keep two ::before/::after for the side lanes */
.swimlane-grid > .lane-bg-processing{position:absolute;top:0;bottom:0;left:20.59%;width:58.82%;border-radius:14px;pointer-events:none;z-index:0;background:linear-gradient(180deg, rgba(99,102,241,.05), rgba(99,102,241,.02) 60%, transparent);border:1px dashed rgba(99,102,241,.18)}
/* Cells: clip everything inside so emoji / step boxes can't bleed across lanes */
.lane-cell{min-height:8px;padding:6px 10px;position:relative;z-index:1;min-width:0;overflow:hidden}
.lane-cell.empty{min-height:8px}
.lane-add-row{grid-column:1 / -1;display:flex;justify-content:center;align-items:center;min-height:24px;padding:2px 0;position:relative;z-index:2}
.lane-add-row.drop-target{min-height:32px}
.lane-add-row.drop-target::before{content:'';position:absolute;left:8%;right:8%;height:3px;border-radius:2px;background:linear-gradient(90deg, transparent, #6366f1 14%, #6366f1 86%, transparent);box-shadow:0 0 0 4px rgba(99,102,241,.18);pointer-events:none}
.swimlane-step-box.draggable-step{cursor:grab}
.swimlane-step-box.draggable-step:active{cursor:grabbing}
.swimlane-step-box.dragging{opacity:.45;outline:2px dashed #6366f1;outline-offset:2px}
.swimlane-step-box{width:100%;max-width:100%;background:var(--surface);border-radius:10px;overflow:hidden;box-shadow:0 1px 3px rgba(0,0,0,.06);transition:box-shadow .15s,transform .15s;box-sizing:border-box}
.swimlane-step-box:hover{box-shadow:0 4px 14px rgba(0,0,0,.08);transform:translateY(-1px)}
.swimlane-step-box.inbound{border:2px solid #0891b2;box-shadow:0 0 18px rgba(8,145,178,.12)}
.swimlane-step-box.processing{border:2px solid rgba(99,102,241,.5);box-shadow:0 0 14px rgba(99,102,241,.10)}
.swimlane-step-box.outbound{border:2px solid #16a34a;box-shadow:0 0 18px rgba(22,163,74,.12)}
.swimlane-step-header{padding:7px 10px;display:flex;align-items:center;gap:8px;min-width:0}
.swimlane-step-header.inbound-bg{background:rgba(8,145,178,.1)}
.swimlane-step-header.outbound-bg{background:rgba(22,163,74,.1)}
.swimlane-step-meta{flex:1;min-width:0;overflow:hidden}
.swimlane-step-kind{font-size:9.5px;font-weight:700;text-transform:uppercase;letter-spacing:.5px;color:var(--text3);display:flex;align-items:center;gap:4px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.swimlane-step-name{font-size:12.5px;font-weight:600;color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.swimlane-step-cfg{font-size:10.5px;color:var(--text3);font-family:ui-monospace,monospace;margin-top:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.swimlane-step-actions{display:flex;gap:3px;flex-shrink:0;margin-left:auto}
.swimlane-step-actions button{background:rgba(255,255,255,.6);border:none;cursor:pointer;border-radius:5px;padding:3px 6px;font-size:10.5px;font-weight:600;flex-shrink:0}
.swimlane-conn-tail{display:flex;justify-content:center;margin-top:4px;height:14px;align-items:flex-start}
.swimlane-conn-tail .stub{width:2px;height:100%;background:linear-gradient(to bottom, rgba(99,102,241,.4), rgba(99,102,241,.05));border-radius:1px}
.swimlane-conn-tail .stub.inbound{background:linear-gradient(to bottom, rgba(8,145,178,.45), rgba(8,145,178,.05))}
.swimlane-conn-tail .stub.outbound{background:linear-gradient(to bottom, rgba(22,163,74,.45), rgba(22,163,74,.05))}
.swimlane-empty{grid-column:1 / -1;text-align:center;padding:30px 14px;color:var(--text3);font-size:13;border:2px dashed var(--border);border-radius:12px;background:var(--surface2);margin-top:8px;position:relative;z-index:1}
/* SVG flow connector overlay — sits between lane backgrounds and step boxes */
.swimlane-paths{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;z-index:1;overflow:visible}
.swimlane-paths path{transition:stroke .15s, opacity .15s}
/* Step boxes need to sit above the SVG so the line tucks behind them at endpoints */
.swimlane-grid .lane-cell{z-index:2}
.swimlane-grid .lane-add-row{z-index:3}
/* The "+" button needs an opaque background so the line behind it doesn't show through */
.swimlane-grid .lane-add-row > div > button{background:var(--surface) !important;border:2px dashed #6366f1 !important}
.trigger-badge{padding:4px 11px;border-radius:20px;font-size:11.5px;font-weight:600;background:var(--surface2);color:var(--text2);border:1.5px solid var(--border)}
.flow-arrow{color:var(--text3);font-size:14px;margin:0 4px}

/* ── Metrics ── */
.metric-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:18px;margin-bottom:26px}
@media(max-width:960px){.metric-grid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:560px){.metric-grid{grid-template-columns:1fr}}
.chart-bar-wrap{display:flex;flex-direction:column;gap:8px;margin-top:14px}
.chart-bar-row{display:flex;align-items:center;gap:12px;font-size:12.5px}
.chart-bar-label{width:100px;color:var(--text2);text-align:right;font-size:12px;font-weight:500}
.chart-bar-bg{flex:1;height:8px;background:var(--surface3);border-radius:4px;overflow:hidden}
.chart-bar-fill{height:100%;border-radius:4px;background:var(--brand-grad)}
.chart-bar-val{width:44px;color:var(--text2);font-size:12px;font-weight:600;text-align:right}

/* ── Tab Pills ── */
.tab-pills{display:flex;gap:6px;margin-bottom:22px;flex-wrap:wrap;background:var(--surface2);padding:5px;border-radius:10px;width:fit-content;border:1px solid var(--border)}
.tab-pill{padding:7px 18px;border-radius:7px;font-size:13px;font-weight:500;cursor:pointer;background:transparent;color:var(--text2);transition:all .15s;border:none;display:inline-flex;align-items:center;gap:8px;line-height:1.2}
.tab-pill.active{background:var(--surface);color:var(--text);font-weight:600;box-shadow:var(--shadow-sm);border:none}
.tab-pill:hover:not(.active){color:var(--text)}
.tab-pill-ico{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;line-height:0}
.tab-pill-ico svg{width:18px;height:18px;display:block}
.tab-pill .tab-count{font-size:10px;font-weight:700;background:var(--surface3);color:var(--text3);padding:1px 7px;border-radius:8px;border:1px solid var(--border);margin-left:0}
.tab-pill.active .tab-count{background:var(--brand-start);color:#fff;border-color:transparent}

/* Test console tabs (in EndpointsPage test modal) */
.test-tab{padding:8px 16px;font-size:12.5px;font-weight:500;cursor:pointer;background:transparent;color:var(--text3);border:none;border-bottom:2px solid transparent;transition:all .15s}
.test-tab:hover{color:var(--text2)}
.test-tab.active{color:var(--brand-start);font-weight:600;border-bottom-color:var(--brand-start)}
.mono{font-family:'ui-monospace','SF Mono',Monaco,Consolas,monospace}

/* ── Page Header ── */
.page-header{display:flex;align-items:flex-start;justify-content:space-between;margin-bottom:28px}
.page-actions{display:flex;align-items:flex-start;gap:12px;flex-wrap:wrap}
.page-title{font-size:36px;font-weight:800;color:var(--text);letter-spacing:-0.6px;font-family: Barlow, sans-serif;}
.page-subtitle{font-size:13.5px;color:var(--text2);margin-top:4px;font-weight:400}

/* ── Empty State ── */
.empty-state{text-align:center;padding:70px 20px;color:var(--text3)}
.empty-state .empty-icon{
  width:46px;height:46px;border-radius:12px;border:none;
  display:inline-flex;align-items:center;justify-content:center;
  margin:0 auto 14px;font-size:24px;opacity:1;flex-shrink:0;
  background:rgba(8,145,178,.16);color:rgb(14,116,144);
}
.empty-state p{font-size:14px;color:var(--text2)}
.empty-state .empty-title{font-size:16px;font-weight:700;color:var(--text);margin-bottom:6px}

/* ── Toast ── */
.toast{position:fixed;bottom:28px;right:28px;padding:14px 20px;border-radius:var(--radius-lg);font-size:13.5px;font-weight:600;z-index:9999;display:flex;align-items:center;gap:10px;box-shadow:var(--shadow-lg);animation:slideUp .25s cubic-bezier(.34,1.56,.64,1);max-width:360px}
.toast-success{background:#fff;border:1.5px solid var(--success-border);color:var(--success);box-shadow:0 8px 32px rgba(22,163,74,.2)}
.toast-error{background:#fff;border:1.5px solid var(--error-border);color:var(--error);box-shadow:0 8px 32px rgba(220,38,38,.2)}
.toast-info{background:#fff;border:1.5px solid var(--info-border);color:var(--info);box-shadow:0 8px 32px rgba(37,99,235,.2)}
@keyframes slideUp{from{transform:translateY(24px) scale(.96);opacity:0}to{transform:translateY(0) scale(1);opacity:1}}

/* ── Section title ── */
.section-title{font-size:14px;font-weight:700;color:var(--text);margin-bottom:16px;display:flex;align-items:center;gap:8px}
.section-title::after{content:'';flex:1;height:1px;background:var(--border);margin-left:4px}

/* ── Misc utilities ── */
.sep{border:none;border-top:1px solid var(--border);margin:20px 0}
.flex{display:flex}.items-center{align-items:center}.justify-between{justify-content:space-between}
.gap-2{gap:8px}.gap-3{gap:12px}.gap-4{gap:16px}
.text-sm{font-size:12.5px}.text-xs{font-size:11.5px}
.text-muted{color:var(--text2)}.text-dim{color:var(--text3)}
.font-bold{font-weight:700}.font-semibold{font-weight:600}
.mt-1{margin-top:4px}.mt-2{margin-top:8px}.mt-3{margin-top:12px}.mt-4{margin-top:16px}
.mb-2{margin-bottom:8px}.mb-3{margin-bottom:12px}.mb-4{margin-bottom:16px}
.w-full{width:100%}
.grid-2{display:grid;grid-template-columns:1fr 1fr;gap:18px}
.grid-3{display:grid;grid-template-columns:1fr 1fr 1fr;gap:16px}
.spin{animation:spin .8s linear infinite;display:inline-block}
@keyframes spin{to{transform:rotate(360deg)}}
.dot{width:8px;height:8px;border-radius:50%;display:inline-block;flex-shrink:0}
.dot-success{background:var(--success)}.dot-error{background:var(--error)}.dot-warning{background:var(--warning)}.dot-gray{background:var(--text3)}.dot-info{background:var(--info)}
.pill{display:inline-flex;align-items:center;gap:5px;padding:3px 10px;border-radius:20px;font-size:11.5px;font-weight:600;background:var(--surface2);color:var(--text2);border:1px solid var(--border)}
.surface-raised{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:14px 16px;box-shadow:var(--shadow-sm)}
code{background:var(--surface2);border:1px solid var(--border);padding:2px 7px;border-radius:5px;font-size:12px;color:var(--text);font-family:ui-monospace,monospace}
p-2{padding:8px}.p-3{padding:12px}.p-4{padding:16px}

/* ── Route Editor ── */
.route-file-item{padding:11px 14px;cursor:pointer;border-bottom:1px solid var(--border);border-left:3px solid transparent;transition:all .12s}
.route-file-item:hover{background:rgba(255,86,48,.05);border-left-color:rgba(255,86,48,.32)}
.route-file-item.active{background:var(--surface);border-left-color:var(--brand-start)}
.view-toggle-btn{padding:4px 10px;border:none;border-radius:5px;font-weight:600;font-size:11.5px;cursor:pointer;background:transparent;color:var(--text2);transition:all .12s}
.view-toggle-btn.active{background:var(--surface);color:var(--text);box-shadow:var(--shadow-sm)}
.route-status-pill{display:inline-flex;align-items:center;gap:5px;padding:3px 8px 3px 6px;border-radius:20px;font-size:11.5px}
.step-card{display:flex;align-items:flex-start;gap:8px;padding:7px 12px;border-radius:8px;cursor:pointer;transition:box-shadow .12s}
.step-card:hover{box-shadow:0 2px 8px rgba(0,0,0,.1)}
.flow-connector{display:flex;justify-content:center;height:10px;position:relative;margin:0 0 2px}
.flow-connector-line{width:2px;background:var(--border2);height:100%}

/* ── YAML textarea ── */
.yaml-editor-textarea{field-sizing:fixed}

/* ── User Management ── */
.um-tabs{display:flex;gap:0;border-bottom:1px solid var(--border);margin-bottom:18px}
.um-tab{padding:11px 18px;border:none;background:none;cursor:pointer;font-size:13px;font-weight:600;color:var(--text3);border-bottom:2px solid transparent;margin-bottom:-1px;transition:all .15s;display:inline-flex;align-items:center;gap:8px}
.um-tab:hover{color:var(--text2)}
.um-tab.active{color:#7c3aed;border-bottom-color:#7c3aed}
.um-tab .count{font-size:10.5px;font-weight:700;background:var(--surface3);color:var(--text3);padding:1px 7px;border-radius:8px;border:1px solid var(--border)}
.um-tab.active .count{background:#7c3aed;color:#fff;border-color:transparent}

.user-row{display:flex;align-items:center;gap:14px;padding:14px 18px;background:var(--surface);border:1px solid var(--border);border-radius:12px;margin-bottom:8px;transition:box-shadow .15s,transform .15s}
.user-row:hover{box-shadow:0 4px 14px -4px rgba(15,23,42,.1)}
.user-avatar-circ{flex:0 0 42px;width:42px;height:42px;border-radius:50%;display:flex;align-items:center;justify-content:center;color:#fff;font-weight:700;font-size:16px;letter-spacing:-.3px}
.user-meta{flex:1;min-width:0}
.user-name{font-weight:700;font-size:14px;color:var(--text);display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.user-email{font-size:12px;color:var(--text3);margin-top:2px;font-family:ui-monospace,monospace}
.user-roles{display:flex;flex-wrap:wrap;gap:5px;margin-top:6px}
.role-chip{font-size:10.5px;font-weight:700;padding:2px 9px;border-radius:999px;color:#fff;display:inline-flex;align-items:center;gap:4px;letter-spacing:.2px}
.role-chip.system svg{flex-shrink:0}
.user-status-pill{font-size:10px;font-weight:700;padding:2px 8px;border-radius:999px;text-transform:uppercase;letter-spacing:.5px}
.user-status-pill.ACTIVE{background:#ecfdf5;color:#15803d;border:1px solid #bbf7d0}
.user-status-pill.DISABLED{background:#fef2f2;color:#dc2626;border:1px solid #fecaca}
.user-status-pill.INVITED{background:#fef3c7;color:#b45309;border:1px solid #fde68a}

.role-card{background:var(--surface);border:1px solid var(--border);border-radius:14px;padding:18px 20px;margin-bottom:12px;transition:box-shadow .15s,transform .15s;position:relative;overflow:hidden}
.role-card:hover{box-shadow:0 6px 18px -6px rgba(15,23,42,.1)}
.role-card .role-accent{position:absolute;left:0;top:0;bottom:0;width:4px}
.role-card-header{display:flex;align-items:flex-start;gap:14px;margin-left:6px}
.role-card-icon{flex:0 0 44px;width:44px;height:44px;border-radius:11px;display:flex;align-items:center;justify-content:center;font-size:20px;color:#fff;font-weight:700}
.role-card-meta{flex:1;min-width:0}
.role-card-title{font-weight:700;font-size:15px;color:var(--text);display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.role-card-desc{font-size:12.5px;color:var(--text2);margin-top:5px;line-height:1.55}
.role-card-stats{display:flex;gap:14px;margin-top:10px;font-size:11.5px;color:var(--text3)}
.role-card-stats strong{color:var(--text);font-weight:700}
.system-lock{font-size:10.5px;font-weight:700;color:var(--text3);background:var(--surface3);border:1px solid var(--border);border-radius:8px;padding:1px 8px;text-transform:uppercase;letter-spacing:.4px;display:inline-flex;align-items:center;gap:4px}

.perm-cat-header{font-size:11.5px;font-weight:700;letter-spacing:.6px;text-transform:uppercase;color:var(--text3);margin:14px 0 8px 2px;display:flex;align-items:center;gap:8px}
.perm-cat-header .perm-cat-count{background:var(--surface3);border:1px solid var(--border);color:var(--text2);padding:1px 8px;border-radius:10px;font-size:10px}
.perm-row{display:flex;align-items:flex-start;gap:12px;padding:9px 12px;border-radius:9px;border:1px solid var(--border);background:var(--surface);margin-bottom:6px;transition:background .12s,border-color .12s}
.perm-row:hover{border-color:var(--border2);background:var(--surface2)}
.perm-row.checked{background:rgba(124,58,237,.04);border-color:rgba(124,58,237,.3)}
.perm-row label{display:flex;align-items:flex-start;gap:10px;cursor:pointer;flex:1}
.perm-row input[type=checkbox]{margin-top:2px;width:16px;height:16px;accent-color:#7c3aed;flex-shrink:0}
.perm-row .perm-id{font-family:ui-monospace,monospace;font-size:10.5px;color:var(--text3);background:var(--surface3);border-radius:5px;padding:1px 6px;border:1px solid var(--border);margin-top:3px;display:inline-block}
.perm-row .perm-label{font-weight:600;font-size:12.5px;color:var(--text)}
.perm-row .perm-desc{font-size:11.5px;color:var(--text3);margin-top:2px;line-height:1.5}

/* ── Recipe Marketplace ── */
.recipe-card{display:flex;flex-direction:column;background:var(--surface);border:1px solid var(--border);border-radius:14px;padding:16px;cursor:pointer;transition:all .18s;box-shadow:var(--shadow-sm);position:relative;overflow:hidden;min-height:170px}
.recipe-card:hover{border-color:var(--border2);box-shadow:0 6px 20px rgba(0,0,0,.08);transform:translateY(-2px)}
.recipe-card .accent-bar{position:absolute;top:0;left:0;right:0;height:5px;border-radius:14px 14px 0 0;background:linear-gradient(90deg,#e91d41 0%,#ff5a6e 100%)}
.recipe-card-header{display:flex;align-items:flex-start;gap:12px;margin-top:6px}
.recipe-card-icon{width:56px;height:56px;border-radius:14px;display:flex;align-items:center;justify-content:center;flex-shrink:0;background:rgba(233,29,65,.12);color:#e91d41}
/* Source → target row on recipe cards. Two adapter tiles flanking an arrow
 * so customers see at a glance which two systems the recipe connects. */
.recipe-card-flow{display:flex;align-items:center;gap:8px;margin:14px 0 10px;padding:10px 12px;background:var(--surface2);border:1px solid var(--border);border-radius:10px}
.recipe-card-flow-side{flex:1;min-width:0;display:flex;align-items:center;gap:7px}
.recipe-card-flow-side .label{display:flex;flex-direction:column;min-width:0}
.recipe-card-flow-side .role{font-size:9px;font-weight:700;letter-spacing:.6px;text-transform:uppercase;color:var(--text3);line-height:1.2}
.recipe-card-flow-side .name{font-size:11.5px;font-weight:600;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.recipe-card-flow-arrow{flex:0 0 auto;display:flex;align-items:center;justify-content:center;width:22px;height:22px;border-radius:50%;background:var(--brand-grad);color:#fff;font-size:11px;font-weight:800;box-shadow:0 2px 6px rgba(0,0,0,.12)}
.recipe-card-title{font-weight:700;font-size:14.5px;color:var(--text);line-height:1.3;margin-bottom:3px}
.recipe-card-publisher{font-size:11px;color:var(--text3);font-weight:500}
.recipe-card-tagline{font-size:12px;color:var(--text2);line-height:1.4;margin-top:8px;margin-bottom:12px;flex:1;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;min-height:0}
.recipe-card-footer{display:flex;align-items:center;gap:6px;margin-top:4px;flex-wrap:wrap}
.recipe-tag{font-size:11px;font-weight:600;color:var(--text3);background:var(--surface3);border:1px solid var(--border);border-radius:10px;padding:3px 9px;text-transform:uppercase;letter-spacing:.4px}
.recipe-tag-cat{background:rgba(233,29,65,.12);color:#e91d41;border-color:rgba(233,29,65,.32)}
/* Recipe detail modal — premium hero + tabbed layout */
.recipe-modal{max-width:1180px;width:96vw;max-height:94vh;padding:0;display:flex;flex-direction:column;overflow:hidden;border-radius:18px;box-shadow:0 30px 80px -20px rgba(15,23,42,.6),0 8px 24px -4px rgba(15,23,42,.25)}
.recipe-hero{position:relative;padding:28px 32px 24px;color:#fff;overflow:hidden;flex-shrink:0;background:#e91d41}
.recipe-hero::before{content:'';position:absolute;inset:0;background:radial-gradient(circle at 80% 20%, rgba(255,255,255,.18), transparent 55%),radial-gradient(circle at 10% 110%, rgba(255,255,255,.10), transparent 60%);pointer-events:none}
.recipe-hero::after{content:'';position:absolute;inset:0;background-image:linear-gradient(135deg, rgba(255,255,255,.04) 1px, transparent 1px),linear-gradient(45deg, rgba(255,255,255,.04) 1px, transparent 1px);background-size:32px 32px,32px 32px;opacity:.55;pointer-events:none}
.recipe-hero-row{display:flex;align-items:flex-start;gap:18px;position:relative;z-index:1}
.recipe-hero-icon{flex:0 0 88px;width:88px;height:88px;border-radius:18px;background:rgba(255,255,255,.16);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);border:1px solid rgba(255,255,255,.25);display:flex;align-items:center;justify-content:center;font-size:42px;box-shadow:inset 0 1px 0 rgba(255,255,255,.3),0 8px 22px -4px rgba(0,0,0,.25)}
.recipe-hero-meta{flex:1;min-width:0}
.recipe-hero-eyebrow{display:inline-flex;align-items:center;gap:6px;font-size:11px;font-weight:700;letter-spacing:.6px;text-transform:uppercase;color:rgba(255,255,255,.85);background:rgba(255,255,255,.16);border:1px solid rgba(255,255,255,.25);border-radius:999px;padding:3px 10px;margin-bottom:10px}
.recipe-hero-title{font-size:24px;font-weight:800;letter-spacing:-.4px;line-height:1.18;color:#fff;margin-bottom:8px;text-shadow:0 1px 2px rgba(0,0,0,.18)}
.recipe-hero-tagline{font-size:13.5px;line-height:1.55;color:rgba(255,255,255,.86);max-width:680px;margin-bottom:14px}
.recipe-hero-meta-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap;font-size:11.5px;color:rgba(255,255,255,.78)}
.recipe-hero-chip{display:inline-flex;align-items:center;gap:5px;font-size:11px;font-weight:600;color:#fff;background:rgba(255,255,255,.18);border:1px solid rgba(255,255,255,.28);border-radius:999px;padding:3px 10px;backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px)}
.recipe-hero-chip.installed{background:rgba(22,163,74,.85);border-color:rgba(255,255,255,.35)}
.recipe-hero-actions{display:flex;gap:8px;flex-shrink:0;align-items:center;position:relative;z-index:1}
.recipe-cta{display:inline-flex;align-items:center;gap:8px;padding:10px 20px;border-radius:11px;font-weight:700;font-size:13.5px;cursor:pointer;border:none;background:#fff;color:var(--text);box-shadow:0 6px 18px -4px rgba(15,23,42,.35),inset 0 -1px 0 rgba(15,23,42,.06);transition:transform .12s,box-shadow .12s}
.recipe-cta:hover{transform:translateY(-1px);box-shadow:0 10px 24px -4px rgba(15,23,42,.4)}
.recipe-cta:active{transform:translateY(0)}
.recipe-hero-close{width:32px;height:32px;border-radius:8px;border:1px solid rgba(255,255,255,.28);background:rgba(255,255,255,.14);color:#fff;font-size:14px;cursor:pointer;display:flex;align-items:center;justify-content:center;flex-shrink:0;padding:0;transition:background .15s,border-color .15s}
.recipe-hero-close:hover{background:rgba(255,255,255,.24);border-color:rgba(255,255,255,.45)}

.recipe-detail-tabs{display:flex;gap:0;background:var(--surface);border-bottom:1px solid var(--border);padding:0 24px;position:sticky;top:0;z-index:5;flex-shrink:0}
.recipe-detail-tab{padding:13px 18px;border:none;background:none;cursor:pointer;font-size:13px;font-weight:600;color:var(--text3);border-bottom:2px solid transparent;margin-bottom:-1px;transition:all .15s;display:inline-flex;align-items:center;gap:7px}
.recipe-detail-tab:hover{color:var(--text2);background:var(--surface2)}
.recipe-detail-tab.active{color:var(--text);border-bottom-color:#e91d41;background:linear-gradient(180deg, transparent, rgba(233,29,65,.05))}
.recipe-detail-tab .tab-count{font-size:10px;font-weight:700;background:var(--surface3);color:var(--text3);padding:1px 7px;border-radius:8px;border:1px solid var(--border)}
.recipe-detail-tab.active .tab-count{background:#e91d41;color:#fff;border-color:transparent}

.recipe-modal-body{flex:1;overflow:auto;background:var(--surface2)}
.recipe-modal-body-inner{padding:24px 28px;max-width:1180px;margin:0 auto}

/* Card primitives reused across recipe tabs */
.r-card{background:var(--surface);border:1px solid var(--border);border-radius:14px;box-shadow:0 1px 3px rgba(15,23,42,.04);overflow:hidden}
.r-card-pad{padding:18px 20px}
.r-card-title{font-size:11px;font-weight:700;letter-spacing:.7px;text-transform:uppercase;color:var(--text3);margin-bottom:10px;display:flex;align-items:center;gap:6px}
.r-section-title{font-size:18px;font-weight:700;letter-spacing:-.2px;color:var(--text);margin:0 0 12px 0;display:flex;align-items:center;gap:8px}

/* What-gets-created artefact cards */
.artefact-grid{display:grid;grid-template-columns:repeat(3, 1fr);gap:12px}
@media (max-width:900px){.artefact-grid{grid-template-columns:1fr}}
.artefact-card{display:flex;align-items:flex-start;gap:12px;padding:14px 16px;background:var(--surface);border:1px solid var(--border);border-radius:12px;transition:transform .15s,box-shadow .15s}
.artefact-card:hover{transform:translateY(-1px);box-shadow:0 4px 14px -4px rgba(15,23,42,.1)}
.artefact-icon{flex:0 0 38px;width:38px;height:38px;border-radius:10px;display:flex;align-items:center;justify-content:center;font-size:18px;font-weight:600}
.artefact-meta{flex:1;min-width:0}
.artefact-count-row{display:flex;align-items:baseline;gap:8px}
.artefact-count{font-size:22px;font-weight:800;line-height:1;color:var(--text);letter-spacing:-.5px}
.artefact-label{font-size:11.5px;font-weight:700;letter-spacing:.4px;text-transform:uppercase;color:var(--text3)}
.artefact-detail{font-size:11.5px;color:var(--text2);margin-top:6px;line-height:1.5;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}

/* Connection-slot cards in Overview */
.slot-card{display:flex;align-items:flex-start;gap:14px;padding:14px 16px;background:var(--surface);border:1px solid var(--border);border-radius:12px;margin-bottom:10px;position:relative;overflow:hidden}
.slot-card::before{content:'';position:absolute;left:0;top:0;bottom:0;width:3px;background:#e91d41}
.slot-icon{flex:0 0 40px;width:40px;height:40px;border-radius:10px;background:var(--surface3);display:flex;align-items:center;justify-content:center;font-size:20px}
.slot-meta{flex:1;min-width:0}
.slot-title{font-weight:700;font-size:13.5px;color:var(--text);display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.slot-adapter-pill{font-size:10.5px;font-weight:700;font-family:ui-monospace,monospace;background:var(--surface3);color:var(--text2);padding:1px 8px;border-radius:8px;border:1px solid var(--border)}
.slot-desc{font-size:12px;color:var(--text2);margin-top:5px;line-height:1.5}
.slot-hint{font-size:11px;color:var(--text3);margin-top:6px;font-family:ui-monospace,monospace;background:var(--surface2);border:1px solid var(--border);border-radius:6px;padding:4px 8px;display:inline-block}

/* Right rail info cards */
.info-card{background:var(--surface);border:1px solid var(--border);border-radius:12px;padding:14px 16px;margin-bottom:12px}
.info-card-key{font-size:10.5px;font-weight:700;letter-spacing:.7px;text-transform:uppercase;color:var(--text3);margin-bottom:8px;display:flex;align-items:center;gap:6px}
.info-row{display:flex;justify-content:space-between;align-items:center;font-size:12.5px;padding:6px 0;border-bottom:1px solid var(--border)}
.info-row:last-child{border-bottom:none;padding-bottom:0}
.info-row:first-child{padding-top:0}
.info-row .k{color:var(--text3);font-weight:600;text-transform:capitalize}
.info-row .v{color:var(--text);font-weight:600;font-family:ui-monospace,monospace;font-size:11.5px}
.code-block{background:#0f172a;color:#e2e8f0;border-radius:8px;padding:8px 11px;font-family:ui-monospace,monospace;font-size:11.5px;line-height:1.55;overflow-x:auto;border:1px solid #1e293b}

/* Specs list */
.spec-card{background:var(--surface);border:1px solid var(--border);border-radius:12px;padding:8px 18px;margin-bottom:14px}
.spec-card .spec-item{display:grid;grid-template-columns:170px 1fr;gap:18px;padding:11px 0;border-bottom:1px solid var(--border)}
.spec-card .spec-item:last-child{border-bottom:none}
.spec-card .spec-key{font-size:11px;font-weight:700;letter-spacing:.5px;text-transform:uppercase;color:var(--text3);padding-top:2px}
.spec-card .spec-val{font-size:12.5px;color:var(--text);font-family:ui-monospace,monospace;word-break:break-word;line-height:1.55}
.markdown-body{font-size:13.5px;line-height:1.65;color:var(--text)}
.markdown-body h1{font-size:22px;font-weight:700;margin:0 0 12px 0;border-bottom:1px solid var(--border);padding-bottom:8px}
.markdown-body h2{font-size:17px;font-weight:700;margin:24px 0 8px 0;color:var(--text)}
.markdown-body h3{font-size:14px;font-weight:700;margin:18px 0 6px 0;color:var(--text)}
.markdown-body p{margin:0 0 12px 0}
.markdown-body ul,.markdown-body ol{margin:0 0 12px 0;padding-left:24px}
.markdown-body li{margin-bottom:4px}
.markdown-body code{background:var(--surface3);border:1px solid var(--border);border-radius:4px;padding:1px 5px;font-family:ui-monospace,monospace;font-size:12px}
.markdown-body pre{background:#0f172a;color:#e2e8f0;padding:12px 14px;border-radius:8px;overflow-x:auto;font-family:ui-monospace,monospace;font-size:12px;line-height:1.55;margin:0 0 14px 0}
.markdown-body pre code{background:none;border:none;padding:0;color:inherit;font-size:inherit}
.markdown-body table{border-collapse:collapse;margin:0 0 14px 0;width:100%;font-size:12.5px}
.markdown-body th,.markdown-body td{border:1px solid var(--border);padding:6px 10px;text-align:left;vertical-align:top}
.markdown-body th{background:var(--surface2);font-weight:700}
.markdown-body blockquote{border-left:3px solid var(--accent);background:rgba(99,102,241,.06);padding:8px 14px;margin:0 0 12px 0;border-radius:0 6px 6px 0;color:var(--text2)}
.recipe-modal .markdown-body a{color:#e91d41;text-decoration:none}
.markdown-body a:hover{text-decoration:underline}
.mapping-group{background:var(--surface);border:1px solid var(--border);border-radius:10px;margin-bottom:14px;overflow:hidden}
.mapping-group-header{padding:11px 14px;background:linear-gradient(135deg,rgba(233,29,65,.08),rgba(233,29,65,.03));border-bottom:1px solid var(--border)}
.mapping-group-name{font-weight:700;font-size:13.5px;color:var(--text)}
.mapping-group-desc{font-size:12px;color:var(--text3);margin-top:3px;line-height:1.5}
.mapping-table{width:100%;border-collapse:collapse;font-size:12px}
.mapping-table th{background:var(--surface2);text-align:left;padding:7px 10px;font-weight:600;font-size:10.5px;text-transform:uppercase;letter-spacing:.5px;color:var(--text3);border-bottom:1px solid var(--border);position:sticky;top:0}
.mapping-table td{padding:8px 10px;border-bottom:1px solid var(--border);vertical-align:top}
.mapping-table tr:last-child td{border-bottom:none}
.mapping-table tr:hover td{background:var(--surface2)}
.mapping-target{font-family:ui-monospace,monospace;color:#e91d41;font-weight:600;font-size:11.5px;white-space:nowrap}
.mapping-source{font-family:ui-monospace,monospace;color:#0891b2;font-size:11.5px}
.mapping-card{font-size:10px;font-weight:700;padding:1px 6px;border-radius:8px;background:var(--surface3);color:var(--text3);display:inline-block}
.mapping-card.req{background:rgba(220,38,38,.1);color:#dc2626}
.mapping-transform{font-family:ui-monospace,monospace;font-size:11px;color:var(--text2)}
.mapping-notes{font-size:11px;color:var(--text3);font-style:italic;line-height:1.5}
.spec-item{display:flex;gap:14px;padding:10px 0;border-bottom:1px solid var(--border)}
.spec-item:last-child{border-bottom:none}
.spec-key{flex:0 0 160px;font-size:11.5px;font-weight:600;color:var(--text3);text-transform:uppercase;letter-spacing:.5px;padding-top:1px}
.spec-val{flex:1;font-size:13px;color:var(--text);font-family:ui-monospace,monospace;word-break:break-word}
.wizard-step{display:flex;align-items:center;gap:8px;padding:6px 10px;border-radius:8px;font-size:12.5px;font-weight:600;color:var(--text3)}
.wizard-step.active{background:rgba(233,29,65,.1);color:#e91d41}
.wizard-step.done{color:var(--success)}
.wizard-step-num{width:22px;height:22px;border-radius:50%;background:var(--surface3);border:1.5px solid var(--border);display:flex;align-items:center;justify-content:center;font-size:11px;font-weight:700}
.wizard-step.active .wizard-step-num{background:#e91d41;color:#fff;border-color:#e91d41}
.wizard-step.done .wizard-step-num{background:var(--success);color:#fff;border-color:var(--success)}

/* ── Recipe install wizard — premium redesign ── */
.iw-modal{max-width:880px;width:96vw;max-height:92vh;padding:0;display:flex;flex-direction:column;overflow:hidden;border-radius:18px;box-shadow:0 30px 80px -20px rgba(15,23,42,.6),0 8px 24px -4px rgba(15,23,42,.25)}
.iw-header{position:relative;padding:20px 24px;display:flex;align-items:center;gap:14px;flex-shrink:0;background:var(--surface);border-bottom:1px solid var(--border)}
.iw-header::before{content:'';position:absolute;top:0;left:0;right:0;height:3px;background:linear-gradient(90deg, var(--iw-accent, #e91d41), var(--iw-accent-2, #ff5a6e));border-radius:18px 18px 0 0}
.iw-header-icon{flex:0 0 44px;width:44px;height:44px;border-radius:11px;background:linear-gradient(135deg, var(--iw-accent, #e91d41), var(--iw-accent-2, #ff5a6e));color:#fff;display:flex;align-items:center;justify-content:center;font-size:20px;box-shadow:0 4px 12px -3px rgba(15,23,42,.25)}
.iw-header-meta{flex:1;min-width:0}
.iw-header-eyebrow{font-size:10.5px;font-weight:700;letter-spacing:.7px;text-transform:uppercase;color:var(--iw-accent, #e91d41);margin-bottom:3px}
.iw-header-title{font-size:16px;font-weight:700;color:var(--text);letter-spacing:-.2px;line-height:1.2;display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.iw-header-sub{font-size:11.5px;color:var(--text3);margin-top:3px}
.iw-close{flex-shrink:0;width:32px;height:32px;padding:0;border-radius:8px;border:1px solid var(--border);background:var(--surface2);color:var(--text2);font-size:14px;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all .15s}
.iw-close:hover{background:var(--surface3);color:var(--text);border-color:var(--border)}

.iw-stepper{display:flex;align-items:center;padding:18px 32px;background:var(--surface2);border-bottom:1px solid var(--border);flex-shrink:0;gap:0}
.iw-step{display:flex;align-items:center;gap:10px;cursor:default}
.iw-step-num{flex:0 0 28px;width:28px;height:28px;border-radius:50%;background:var(--surface);border:1.5px solid var(--border);color:var(--text3);font-size:12px;font-weight:700;display:flex;align-items:center;justify-content:center;transition:all .2s}
.iw-step.active .iw-step-num{background:var(--iw-accent, #e91d41);border-color:var(--iw-accent, #e91d41);color:#fff;box-shadow:0 0 0 4px var(--iw-accent-tint, rgba(233,29,65,.15))}
.iw-step.done .iw-step-num{background:#16a34a;border-color:#16a34a;color:#fff}
.iw-step-label{font-size:12.5px;font-weight:600;color:var(--text3);transition:color .15s;white-space:nowrap}
.iw-step.active .iw-step-label{color:var(--text)}
.iw-step.done .iw-step-label{color:#16a34a}
.iw-step-divider{flex:1;height:2px;background:var(--border);margin:0 14px;border-radius:1px;position:relative;overflow:hidden}
.iw-step-divider.done{background:#16a34a}
.iw-step-divider.partial::after{content:'';position:absolute;left:0;top:0;bottom:0;width:50%;background:linear-gradient(90deg, #16a34a, var(--iw-accent, #e91d41))}

.iw-body{flex:1;overflow:auto;background:var(--surface2);padding:22px 28px}
.iw-body-inner{max-width:760px;margin:0 auto}

/* ── Route Builder Canvas — Layout Toggle (Swimlanes ↔ Linear) ─────────── */
/* The toggle sits at the top of the canvas, sticky so it stays visible while
   the user scrolls a tall route. Pill-style buttons mirror the .tab-pills
   look so it feels native to the platform. */
.canvas-toolbar{display:flex;justify-content:flex-end;align-items:center;gap:10px;position:sticky;top:0;z-index:6;background:linear-gradient(to bottom, var(--surface) 60%, transparent);padding:2px 0 6px;margin-bottom:2px;backdrop-filter:blur(2px)}
.canvas-layout-toggle{display:inline-flex;background:var(--surface2);padding:3px;border-radius:8px;border:1px solid var(--border);box-shadow:var(--shadow-sm)}
.canvas-layout-toggle button{padding:5px 12px;border-radius:6px;font-size:11.5px;font-weight:600;cursor:pointer;background:transparent;color:var(--text2);transition:all .15s;border:none;display:inline-flex;align-items:center;gap:5px}
.canvas-layout-toggle button:hover:not(.active){color:var(--text);background:rgba(255,255,255,.5)}
.canvas-layout-toggle button.active{background:var(--surface);color:#4f46e5;box-shadow:0 1px 3px rgba(99,102,241,.18);border:1px solid rgba(99,102,241,.25)}

/* Linear-mode canvas — single vertical column, no lane tints, no column tabs.
   Reuses the same .lane-cell / .lane-add-row primitives so the path-aware
   refs (setBoxRef) and drag-drop wiring keep working without any branching
   in the React component. The only thing that changes is the grid template:
   one wide column instead of three. */
.linear-grid{display:grid;grid-template-columns:minmax(0, 760px);justify-content:center;column-gap:0;row-gap:0;align-items:start;flex:1;position:relative;padding:6px 0}
.linear-grid > .lane-cell{padding:6px 12px;z-index:2}
.linear-grid > .lane-add-row{grid-column:1 / -1;z-index:3}
/* Hide the side-lane / processing tints in linear mode (they're absolutely
   positioned at percentage offsets that only make sense in 3-column grids). */
.linear-canvas .swimlane-grid::before,
.linear-canvas .swimlane-grid::after{display:none}
/* The "+" button needs an opaque background in linear mode too so the SVG
   path behind it doesn't show through. Mirrors the swimlane-grid rule. */
.linear-grid .lane-add-row > div > button{background:var(--surface) !important;border:2px dashed #6366f1 !important}
/* Step boxes in linear mode: a touch more vertical breathing room since
   they're not constrained by a narrow column. */
.linear-grid .swimlane-step-box{max-width:720px;margin:0 auto}
/* Container steps (split/filter/multicast/choice/doTry/etc.) get a stronger
   visual treatment so they read as "this is a group whose contents are
   indented below". Their inner background is tinted purple, the border is
   thicker, and a tiny "wrapper" label appears in the kind line. Children
   below inherit a left-side guide rail from the parent's color. */
.swimlane-step-box.is-container{
  background:linear-gradient(135deg, rgba(99,102,241,.06), rgba(99,102,241,.02));
  border-width:2px !important;
  box-shadow:0 2px 8px rgba(99,102,241,.12) !important;
}
.swimlane-step-box.is-container .swimlane-step-header{
  background:linear-gradient(90deg, rgba(99,102,241,.14), rgba(99,102,241,.04)) !important;
  border-bottom:1px dashed rgba(99,102,241,.3);
}
.swimlane-step-box.is-container .swimlane-step-kind::after{
  content:' · CONTAINER';
  font-size:8.5px;
  margin-left:6px;
  padding:1px 6px;
  border-radius:4px;
  background:rgba(99,102,241,.15);
  color:#6366f1;
  font-weight:700;
  letter-spacing:.4px;
}
/* "Container subtree" — applied to nested rows to give them a left ruler that
   visually connects back to the parent. The ruler color matches the
   container's accent for visual grouping. */
.linear-grid .lane-cell.nested-row{
  border-left:2px solid rgba(99,102,241,.2);
  margin-left:14px;
  padding-left:14px;
  background:linear-gradient(90deg, rgba(99,102,241,.02), transparent 90%);
}
.linear-grid .lane-cell.nested-row.last-child{
  border-bottom-left-radius:8px;
  padding-bottom:6px;
}
/* Hover the parent container card and the descendant rail darkens — a tiny
   affordance that says "these are related". */
.swimlane-step-box.is-container:hover ~ .lane-cell.nested-row,
.swimlane-step-box.is-container:hover + * .lane-cell.nested-row{
  border-left-color:rgba(99,102,241,.5);
}

/* Nested-step indentation guides — visible in both modes. The vertical
   guide rail is drawn by an inline absolute-positioned div inside the
   step box; nested lane-cells need overflow:visible so the rail (which
   sits 10px LEFT of the cell's left edge) doesn't get clipped. The render
   already applies overflow:visible inline on depth>0 cells. */

/* ═══════════════════════════════════════════════════════════════════════
   LINEAR TREE — Karavan-style compact recursive view
   Compact circular icons + outlined container boxes + branch columns.
   Used when canvasLayout === 'linear'. Lives inside .linear-grid.
   ═══════════════════════════════════════════════════════════════════════ */

.linear-grid{padding:14px 24px 24px}
.linear-tree-root{display:flex;flex-direction:column;align-items:center;gap:0;grid-column:1 / -1;min-width:0;max-width:100%;padding:8px 0 18px}

/* FROM card in linear mode — same compact icon-card style as the downstream
   steps so it doesn't visually dominate the canvas. Sits centered above
   the first add-button. */
.linear-from-wrap{grid-column:1 / -1;display:flex;justify-content:center;padding:14px 0 6px}

/* Compact icon card — circular icon (44px) + label below + sublabel + hover actions.
   This is the building block of every step in linear mode. Click = open config. */
.linear-icon-card{
  --accent:#475569;
  position:relative;display:flex;flex-direction:column;align-items:center;
  padding:6px 10px 8px;border-radius:12px;background:var(--surface);
  border:1.5px solid transparent;
  min-width:110px;max-width:200px;cursor:pointer;
  transition:transform .12s ease, box-shadow .15s ease, border-color .12s ease, background .12s ease;
}
.linear-icon-card:hover{
  transform:translateY(-1px);
  border-color:var(--accent);
  background:linear-gradient(180deg, var(--surface), color-mix(in srgb, var(--accent) 4%, var(--surface)));
  box-shadow:0 6px 18px -6px color-mix(in srgb, var(--accent) 40%, transparent),
             0 2px 4px rgba(0,0,0,.04);
}
.linear-icon-card.is-active{
  border-color:var(--accent);
  box-shadow:0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent),
             0 8px 20px -6px color-mix(in srgb, var(--accent) 35%, transparent);
}
.linear-icon-circle{
  width:48px;height:48px;border-radius:50%;
  background:radial-gradient(circle at 30% 25%, color-mix(in srgb, var(--accent) 18%, var(--surface)), color-mix(in srgb, var(--accent) 8%, var(--surface)));
  border:2px solid color-mix(in srgb, var(--accent) 55%, transparent);
  display:flex;align-items:center;justify-content:center;
  color:var(--accent);
  font-size:22px;line-height:1;
  box-shadow:inset 0 -2px 4px color-mix(in srgb, var(--accent) 12%, transparent),
             0 2px 4px color-mix(in srgb, var(--accent) 18%, transparent);
  transition:transform .15s ease;
}
.linear-icon-circle img{width:24px;height:24px;object-fit:contain}
.linear-icon-card:hover .linear-icon-circle{transform:scale(1.06)}
.linear-icon-label{
  margin-top:6px;font-size:11.5px;font-weight:600;color:var(--text);
  text-align:center;max-width:180px;line-height:1.3;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%
}
.linear-icon-sublabel{
  font-size:10px;color:var(--text3);font-family:ui-monospace,Consolas,monospace;
  margin-top:2px;max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%;text-align:center
}
.linear-icon-actions{
  position:absolute;top:-10px;right:-10px;display:flex;gap:2px;
  background:var(--surface);border:1px solid var(--border);border-radius:14px;padding:2px;
  opacity:0;pointer-events:none;transform:translateY(-2px);
  transition:opacity .12s ease, transform .12s ease;
  box-shadow:0 4px 12px rgba(0,0,0,.08);
}
.linear-icon-card:hover .linear-icon-actions{opacity:1;pointer-events:auto;transform:translateY(0)}
.linear-icon-actions button{
  width:22px;height:22px;border:none;border-radius:11px;background:transparent;
  cursor:pointer;font-size:11px;color:var(--text2);display:flex;align-items:center;justify-content:center;
  transition:background .12s, color .12s
}
.linear-icon-actions button:hover:not(:disabled){background:rgba(99,102,241,.12);color:#6366f1}
.linear-icon-actions button.danger:hover{background:rgba(239,68,68,.12);color:#ef4444}
.linear-icon-actions button:disabled{opacity:.3;cursor:not-allowed}

/* The "step + its container subtree" wrapper. Vertical flex so the icon card
   sits above the container box. */
.linear-step-wrap{display:flex;flex-direction:column;align-items:center;gap:8px;width:100%;max-width:920px;margin:0 auto;position:relative}

/* Container box — outlined rounded rectangle that wraps the children of a
   container step (split/filter/multicast/...). The accent color matches the
   parent's color so the box reads as "these belong to the split above". */
.linear-container-box{
  --accent:#6366f1;
  position:relative;width:100%;max-width:920px;
  margin-top:4px;
  padding:24px 18px 14px;
  border:1.5px solid color-mix(in srgb, var(--accent) 40%, var(--border));
  border-top:1px dashed color-mix(in srgb, var(--accent) 50%, transparent);
  border-radius:14px;
  background:linear-gradient(180deg, color-mix(in srgb, var(--accent) 4%, transparent), transparent 30%);
  box-shadow:inset 0 0 0 1px color-mix(in srgb, var(--accent) 8%, transparent);
}
.linear-container-tag{
  position:absolute;top:-10px;left:24px;
  font-size:9.5px;font-weight:800;letter-spacing:.8px;
  padding:3px 10px;border-radius:10px;
  background:color-mix(in srgb, var(--accent) 18%, var(--surface));
  border:1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  color:color-mix(in srgb, var(--accent) 80%, var(--text));
  text-transform:uppercase;
}
.linear-container-body{display:flex;flex-direction:column;align-items:center;gap:0;width:100%}

/* ── Main scope — top-level wrapper around the entire flow ─────────────────
   Karavan / OIC "Scope" pattern: a labeled container that holds the whole
   route's processing block. Gives the flow a clear "where it begins / ends"
   boundary, sets up the visual home for future error-handler children
   (doTry / doCatch / doFinally), and gets a minimize toggle so long routes
   collapse to a one-line summary. */
.linear-scope-box{
  --scope-accent:#6366f1;
  position:relative;width:100%;max-width:920px;
  margin:4px auto 8px;
  border:1.5px solid color-mix(in srgb, var(--scope-accent) 35%, var(--border));
  border-radius:16px;
  background:linear-gradient(180deg,
    color-mix(in srgb, var(--scope-accent) 6%, transparent),
    color-mix(in srgb, var(--scope-accent) 1%, transparent) 14%,
    transparent 30%);
  box-shadow:inset 0 0 0 1px color-mix(in srgb, var(--scope-accent) 8%, transparent),
             0 1px 3px rgba(0,0,0,.04);
  transition:max-height .25s ease, border-color .15s ease;
}
.linear-scope-box.is-minimized{border-color:color-mix(in srgb, var(--scope-accent) 25%, var(--border))}
/* Header bar — pill-shaped tag (left) + step count meta + minimize toggle (right) */
.linear-scope-head{
  display:flex;align-items:center;gap:10px;
  padding:10px 14px;
  border-bottom:1px solid color-mix(in srgb, var(--scope-accent) 18%, var(--border));
  background:color-mix(in srgb, var(--scope-accent) 5%, var(--surface));
  border-radius:16px 16px 0 0;
  user-select:none;
}
.linear-scope-box.is-minimized .linear-scope-head{
  border-bottom-color:transparent;
  border-radius:16px;
}
.linear-scope-tag{
  font-size:10.5px;font-weight:800;letter-spacing:.8px;text-transform:uppercase;
  padding:4px 12px;border-radius:10px;
  background:color-mix(in srgb, var(--scope-accent) 18%, var(--surface));
  border:1px solid color-mix(in srgb, var(--scope-accent) 40%, transparent);
  color:color-mix(in srgb, var(--scope-accent) 80%, var(--text));
  white-space:nowrap;
}
.linear-scope-meta{
  font-size:11.5px;color:var(--text3);font-weight:600;
  flex:1;
}
.linear-scope-toggle{
  width:28px;height:28px;border-radius:8px;
  background:var(--surface);
  border:1px solid color-mix(in srgb, var(--scope-accent) 35%, var(--border));
  color:color-mix(in srgb, var(--scope-accent) 80%, var(--text));
  cursor:pointer;font-size:13px;font-weight:700;line-height:1;
  display:flex;align-items:center;justify-content:center;
  transition:background .12s, color .12s, border-color .12s;
}
.linear-scope-toggle:hover{
  background:color-mix(in srgb, var(--scope-accent) 12%, var(--surface));
  border-color:color-mix(in srgb, var(--scope-accent) 60%, var(--border));
  color:var(--scope-accent);
}
.linear-scope-body{
  display:flex;flex-direction:column;align-items:center;gap:0;width:100%;
  padding:14px 14px 18px;
}
.linear-scope-collapsed-hint{
  padding:14px 16px;color:var(--text3);font-size:12px;font-style:italic;
  text-align:center;
}

/* Pure visual connector from FROM card down to the scope box (no + button —
   insertion BEFORE the scope wouldn't make sense, since the scope wraps
   the route's whole processing block). Slight downward gradient + chevron
   visually anchors FROM → scope. */
.linear-rail.from-to-scope{height:18px;margin-top:2px;margin-bottom:-2px}
.linear-rail.from-to-scope span{
  background:linear-gradient(to bottom, rgba(99,102,241,.45), rgba(99,102,241,.55));
}

/* Branch row for choice / doTry — flex layout, equal columns, vertical
   separators between columns (rendered via background gradient on parent
   to avoid extra DOM). */
.linear-branch-row{
  display:flex;gap:14px;align-items:flex-start;justify-content:center;
  width:100%;flex-wrap:wrap;
}
.linear-branch-col{
  --branch-accent:#6b7280;
  flex:1 1 220px;min-width:200px;max-width:340px;
  display:flex;flex-direction:column;align-items:stretch;gap:0;
  padding:4px;border-radius:10px;
  background:color-mix(in srgb, var(--branch-accent) 4%, transparent);
  border:1px dashed color-mix(in srgb, var(--branch-accent) 35%, transparent);
}
.linear-branch-header{
  font-size:10px;font-weight:800;letter-spacing:.5px;
  padding:5px 10px;margin:0;border-radius:7px;
  background:color-mix(in srgb, var(--branch-accent) 20%, var(--surface));
  color:color-mix(in srgb, var(--branch-accent) 90%, var(--text));
  border:1px solid color-mix(in srgb, var(--branch-accent) 35%, transparent);
  text-align:center;text-transform:uppercase;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.linear-branch-body{display:flex;flex-direction:column;align-items:center;gap:0;padding:6px 0 2px}

/* Vertical connector — thin solid line + chevron arrowhead between
   consecutive cards in a column (read-only / test-pane mirror). The
   ".compact" variant in container/branch bodies is shorter. */
.linear-rail{display:flex;justify-content:center;align-items:center;height:22px;position:relative}
.linear-rail.compact{height:16px}
.linear-rail span{
  display:inline-block;width:2px;height:100%;
  background:linear-gradient(to bottom, rgba(99,102,241,.5), rgba(99,102,241,.7));
  border-radius:1px;
}
.linear-rail::after{
  content:'';position:absolute;left:50%;bottom:0;
  width:0;height:0;
  border-left:4px solid transparent;border-right:4px solid transparent;
  border-top:5px solid rgba(99,102,241,.55);
  transform:translateX(-50%);pointer-events:none;
}
.linear-rail.compact::after{border-left-width:3px;border-right-width:3px;border-top-width:4px}

/* Add (+) button between cards — also the visible connector "arrow" between
   adjacent steps. The vertical rail goes the full height of the .linear-add
   row; an SVG-style chevron is drawn at the bottom as a small downward
   arrowhead so the flow direction reads clearly. Karavan / iPaaS pattern:
   the line shows "data flows from this card to the next one". */
.linear-add{display:flex;justify-content:center;align-items:center;min-height:36px;padding:4px 0;position:relative}
.linear-add.compact{min-height:24px;padding:2px 0}
/* Rail — gradient line behind the + button, the visible connector between cards. */
.linear-add::before{
  content:'';position:absolute;left:50%;top:0;bottom:9px;width:2px;
  background:linear-gradient(to bottom, rgba(99,102,241,.30), rgba(99,102,241,.50));
  transform:translateX(-50%);border-radius:1px;pointer-events:none;
}
.linear-add.compact::before{bottom:6px}
/* Arrowhead — pure CSS triangle anchored to the bottom of the rail. */
.linear-add::after{
  content:'';position:absolute;left:50%;bottom:2px;
  width:0;height:0;
  border-left:4px solid transparent;border-right:4px solid transparent;
  border-top:5px solid rgba(99,102,241,.55);
  transform:translateX(-50%);pointer-events:none;
}
.linear-add.compact::after{bottom:0;border-left-width:3px;border-right-width:3px;border-top-width:4px}
.linear-add button{
  position:relative;z-index:1;
  width:22px;height:22px;border-radius:50%;
  border:1.5px dashed rgba(99,102,241,.55);
  background:var(--surface);color:#818cf8;
  cursor:pointer;font-size:13px;line-height:1;
  display:flex;align-items:center;justify-content:center;
  opacity:.55;
  transition:opacity .12s, background .12s, border-color .12s, color .12s, transform .12s;
}
.linear-add:hover button{opacity:1;background:rgba(99,102,241,.18);border-color:#6366f1;color:#4f46e5;transform:scale(1.08)}
.linear-add.compact button{width:18px;height:18px;font-size:11px}

/* Empty placeholder inside a container with no children yet. */
.linear-empty-placeholder{
  display:flex;flex-direction:column;align-items:center;gap:6px;
  padding:14px 12px;border:1px dashed var(--border);border-radius:10px;
  background:var(--surface2);width:100%;max-width:420px;
}
.linear-empty{
  width:100%;max-width:540px;margin:30px auto;text-align:center;
  padding:30px 18px;color:var(--text3);font-size:13px;
  border:2px dashed var(--border);border-radius:14px;background:var(--surface2);
}

/* ═══════════════════════════════════════════════════════════════════════
   iPaaS RICH-LOOK POLISH
   Subtle global upgrades to take the platform from "functional" to
   "premium iPaaS" without rewriting the whole UI: modern font stack,
   refined depth shadows, smooth transitions.
   ═══════════════════════════════════════════════════════════════════════ */
:root{
  /* Premium type stack: Inter (if available system-wide) -> system UI -> SF */
  --font-sans:'Inter','SF Pro Display',-apple-system,BlinkMacSystemFont,'Segoe UI Variable','Segoe UI',Roboto,'Helvetica Neue',sans-serif;
  --font-mono:'JetBrains Mono','SF Mono',ui-monospace,'Cascadia Code',Consolas,monospace;
  /* Premium shadow tokens — softer, multi-layer */
  --shadow-card-rest:0 1px 2px rgba(15,23,42,.05), 0 1px 1px rgba(15,23,42,.03);
  --shadow-card-hover:0 8px 24px -8px rgba(15,23,42,.16), 0 2px 6px rgba(15,23,42,.06);
  --shadow-card-active:0 12px 32px -10px rgba(99,102,241,.25), 0 4px 8px rgba(99,102,241,.08);
  --transition-base:cubic-bezier(.4,0,.2,1);
}
body{font-family:var(--font-sans);font-feature-settings:'cv11','ss01','cv02';text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}
code, pre, .swimlane-step-cfg, .linear-icon-sublabel{font-family:var(--font-mono)}
/* Slightly tighter card hover transition globally — feels more premium. */
.swimlane-step-box{transition:box-shadow .18s var(--transition-base), transform .15s var(--transition-base), border-color .15s var(--transition-base) !important}
.iw-intro{font-size:12.5px;color:var(--text2);background:var(--surface);border:1px solid var(--border);border-radius:10px;padding:12px 14px;margin-bottom:16px;line-height:1.55;display:flex;align-items:flex-start;gap:10px}
.iw-intro::before{content:'💡';font-size:14px;flex-shrink:0;margin-top:1px}

/* Connection slot cards in wizard */
.iw-slot{background:var(--surface);border:1px solid var(--border);border-radius:14px;margin-bottom:14px;overflow:hidden;transition:border-color .15s,box-shadow .15s}
.iw-slot.complete{border-color:rgba(22,163,74,.4);box-shadow:0 0 0 3px rgba(22,163,74,.06)}
.iw-slot-head{padding:13px 16px;display:flex;align-items:center;gap:12px;background:linear-gradient(135deg, var(--slot-tint, rgba(233,29,65,.05)), transparent 60%);border-bottom:1px solid var(--border)}
.iw-slot-icon{flex:0 0 38px;width:38px;height:38px;border-radius:10px;background:var(--slot-bg, rgba(233,29,65,.12));color:var(--slot-color, #e91d41);display:flex;align-items:center;justify-content:center;font-size:18px}
.iw-slot-title{font-weight:700;font-size:13.5px;color:var(--text);display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.iw-slot-pill{font-size:10px;font-weight:700;font-family:ui-monospace,monospace;background:var(--surface3);color:var(--text2);padding:1px 7px;border-radius:7px;border:1px solid var(--border);text-transform:lowercase}
.iw-slot-required{font-size:10px;font-weight:700;color:#dc2626;letter-spacing:.3px}
.iw-slot-desc{font-size:11.5px;color:var(--text3);margin-top:3px;line-height:1.5}
.iw-slot-status{margin-left:auto;font-size:11px;font-weight:600;color:var(--success);display:inline-flex;align-items:center;gap:5px;flex-shrink:0}

.iw-slot-body{padding:14px 16px}

/* ═══════════════════════════════════════════════════════════════════════
   TEST RUN — live side panel + per-card status badges + pulse animation
   ═══════════════════════════════════════════════════════════════════════ */

/* The right-side panel itself — most layout comes from inline styles in
   TestRunPanel; this gives it a subtle slide-in animation on open. */
.test-run-panel{
  animation: testPanelSlideIn .18s ease-out;
}
@keyframes testPanelSlideIn{
  from { transform: translateX(20px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

/* Pulse animation used for: RUNNING dot in the status pill, RUNNING badge
   on a step card, and the small dot next to the "🧪 Test" toolbar button
   while a run is in progress. */
@keyframes tlPulse{
  0%   { transform: scale(1);   opacity: 1;   }
  50%  { transform: scale(1.35); opacity: 0.55; }
  100% { transform: scale(1);   opacity: 1;   }
}

/* Live status badge on each step's icon card. Positioned in the bottom-
   right of the icon circle. Color-coded; pulses while RUNNING. */
.linear-run-badge{
  position:absolute;
  bottom:30px;   /* sits on the icon circle, just above the label */
  right:6px;
  min-width:18px;height:18px;border-radius:50%;
  display:inline-flex;align-items:center;justify-content:center;
  font-size:11px;font-weight:800;line-height:1;
  border:2px solid var(--surface);
  box-shadow:0 1px 4px rgba(0,0,0,.18);
  z-index:3;
}
.linear-run-badge.running{
  background:#6366f1;color:#fff;
  animation: tlPulse 1.2s infinite ease-in-out;
}
.linear-run-badge.success{ background:#16a34a;color:#fff; }
.linear-run-badge.failed { background:#ef4444;color:#fff; }
.linear-run-badge.failure{ background:#ef4444;color:#fff; }
.linear-run-badge.skipped{ background:#94a3b8;color:#fff; }
.linear-run-badge.pending{ background:var(--surface3);color:var(--text3); }

/* Embedded flow inside the Test Run panel — view-only mirror of the canvas,
   scaled ~30% smaller so the recursive tree fits the 480px panel width
   without horizontal scroll. Reuses every LinearStep style; only sizing +
   padding + gap are overridden. */
.embedded-flow{padding:4px 0;width:100%}
.embedded-flow .linear-icon-card{
  min-width:84px;max-width:200px;
  padding:5px 8px 6px;
  border-radius:10px;
}
.embedded-flow .linear-icon-circle{
  width:36px;height:36px;
  font-size:18px;
  border-width:1.5px;
}
.embedded-flow .linear-icon-label{
  font-size:10.5px;margin-top:4px;
  max-width:180px;
}
.embedded-flow .linear-icon-sublabel{
  font-size:9.5px;max-width:180px;
}
/* Run badge a touch smaller to match the scaled card. */
.embedded-flow .linear-run-badge{
  width:16px;height:16px;
  font-size:9.5px;bottom:24px;right:4px;
}
/* Eye button a touch smaller too. */
.embedded-flow .linear-eye-btn{
  width:20px;height:20px;
  font-size:10px;top:4px;left:4px;
}
/* Tighten vertical rhythm — connector rails between cards become shorter. */
.embedded-flow .linear-rail{height:10px}
.embedded-flow .linear-rail.compact{height:8px}
/* Container boxes for split/filter/choice/doTry inside the panel get a
   slimmer outline so they don't dominate the 480px column. */
.embedded-flow .linear-container-box{
  padding:18px 10px 10px;
  margin-top:3px;
}
.embedded-flow .linear-container-tag{
  font-size:8.5px;padding:2px 7px;
  top:-8px;left:14px;
}
/* Branch columns inside choice/doTry — tighter so they still fit when
   choice has 3 when-branches. Wrap to two rows if needed. */
.embedded-flow .linear-branch-col{
  flex:1 1 130px;min-width:120px;max-width:200px;
}
.embedded-flow .linear-branch-header{
  font-size:9px;padding:3px 7px;
}

/* 👁 Eye button — opens StepInspector with raw input/output. Sits in the
   top-left of the card so it doesn't collide with the status badge
   (bottom-right) or the hover-revealed move/delete actions (top-right).
   Always visible when run data exists (not hover-only) so users discover
   the affordance. */
.linear-eye-btn{
  position:absolute;top:6px;left:6px;
  width:24px;height:24px;border-radius:50%;
  border:1.5px solid var(--accent);
  background:var(--surface);
  color:var(--accent);
  cursor:pointer;font-size:12px;line-height:1;
  display:flex;align-items:center;justify-content:center;
  box-shadow:0 2px 6px rgba(0,0,0,.08);
  transition:transform .12s ease, box-shadow .15s ease, background .12s ease;
  z-index:4;padding:0;
}
.linear-eye-btn:hover{
  transform:scale(1.15);
  background: color-mix(in srgb, var(--accent) 14%, var(--surface));
  box-shadow:0 4px 10px color-mix(in srgb, var(--accent) 30%, transparent);
}

/* Card-level visual cues for run state. */
.linear-icon-card[data-run-status="PENDING"]{ opacity:0.55; }
.linear-icon-card[data-run-status="SKIPPED"]{ opacity:0.55; filter:saturate(0.5); }
.linear-icon-card[data-run-status="RUNNING"]{
  border-color:#6366f1 !important;
  box-shadow:0 0 0 3px rgba(99,102,241,.18), 0 6px 18px -6px rgba(99,102,241,.4);
}
.linear-icon-card[data-run-status="SUCCESS"]{
  border-color: rgba(22,163,74,.5) !important;
}
.linear-icon-card[data-run-status="FAILED"],
.linear-icon-card[data-run-status="FAILURE"]{
  border-color:#ef4444 !important;
  box-shadow:0 0 0 3px rgba(239,68,68,.15), 0 6px 18px -6px rgba(239,68,68,.4);
}
.iw-mode-toggle{display:inline-flex;background:var(--surface2);border:1px solid var(--border);border-radius:9px;padding:3px;margin-bottom:12px;gap:2px}
.iw-mode-btn{padding:5px 12px;border:none;background:none;cursor:pointer;font-size:12px;font-weight:600;color:var(--text2);border-radius:6px;transition:all .12s;display:inline-flex;align-items:center;gap:5px}
.iw-mode-btn:hover{color:var(--text)}
.iw-mode-btn.active{background:var(--surface);color:var(--text);box-shadow:0 1px 3px rgba(15,23,42,.08)}
.iw-mode-btn .count{font-size:10px;font-weight:700;color:var(--text3);background:var(--surface3);padding:0 6px;border-radius:8px}

.iw-field-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}
@media (max-width:640px){.iw-field-grid{grid-template-columns:1fr}}
.iw-field{display:flex;flex-direction:column;gap:4px}
.iw-field.full{grid-column:1 / -1}
.iw-field-label{font-size:11px;font-weight:600;color:var(--text2);display:flex;align-items:center;gap:6px}
.iw-field-label .req{color:#dc2626;font-weight:700}
.iw-field-input{width:100%;padding:8px 11px;border-radius:8px;border:1px solid var(--border);background:var(--surface2);color:var(--text);font-size:12.5px;box-sizing:border-box;outline:none;transition:border-color .12s,box-shadow .12s}
.iw-field-input:focus{border-color:var(--iw-accent, #e91d41);box-shadow:0 0 0 3px var(--iw-accent-tint, rgba(233,29,65,.12));background:var(--surface)}
.iw-field-input.secret{font-family:ui-monospace,monospace}
select.iw-field-input{appearance:none;-webkit-appearance:none;padding-right:40px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%231d252e' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m19 9l-7 6l-7-6'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 10px center;background-size:20px 20px}
.iw-field-secret{position:relative}
.iw-field-secret .eye{position:absolute;right:6px;top:50%;transform:translateY(-50%);background:none;border:none;color:var(--text3);cursor:pointer;font-size:13px;padding:4px}
.iw-field-secret .eye:hover{color:var(--text)}
.iw-field-help{font-size:10.5px;color:var(--text3);margin-top:2px;line-height:1.5}

.iw-footer{padding:14px 24px;border-top:1px solid var(--border);background:var(--surface);display:flex;align-items:center;gap:10px;flex-shrink:0}
.iw-footer-hint{font-size:11.5px;color:var(--text3);flex:1}
.iw-cta{padding:9px 20px;border-radius:10px;font-weight:700;font-size:13px;cursor:pointer;border:none;background:var(--iw-accent, #e91d41);color:#fff;display:inline-flex;align-items:center;gap:7px;transition:transform .12s,box-shadow .12s,opacity .15s}
.iw-cta:hover:not(:disabled){transform:translateY(-1px);box-shadow:0 6px 16px -4px rgba(233,29,65,.4)}
.iw-cta:disabled{opacity:.45;cursor:not-allowed}
.iw-cta.success{background:#16a34a}
.iw-cta.success:hover:not(:disabled){box-shadow:0 6px 16px -4px rgba(22,163,74,.4)}

.iw-cron-suggest{display:grid;grid-template-columns:repeat(auto-fill, minmax(200px, 1fr));gap:6px;margin-top:8px}
.iw-cron-pill{padding:7px 10px;border:1px solid var(--border);background:var(--surface);border-radius:8px;cursor:pointer;font-size:11px;text-align:left;transition:all .12s;font-family:inherit}
.iw-cron-pill:hover{border-color:var(--iw-accent, #e91d41);background:var(--surface2)}
.iw-cron-pill.active{border-color:var(--iw-accent, #e91d41);background:var(--iw-accent-tint, rgba(233,29,65,.08))}
.iw-cron-pill .label{font-weight:600;color:var(--text);display:block}
.iw-cron-pill .expr{font-family:ui-monospace,monospace;font-size:10.5px;color:var(--text3);margin-top:2px;display:block}

.iw-summary-card{background:var(--surface);border:1px solid var(--border);border-radius:12px;padding:14px 18px;margin-bottom:12px}
.iw-summary-row{display:flex;align-items:center;gap:12px;padding:8px 0;border-bottom:1px solid var(--border);font-size:12.5px}
.iw-summary-row:last-child{border-bottom:none}
.iw-summary-row .k{flex:0 0 130px;color:var(--text3);font-weight:600;text-transform:uppercase;font-size:10.5px;letter-spacing:.4px}
.iw-summary-row .v{flex:1;color:var(--text);font-weight:600}
.iw-warn-card{background:linear-gradient(135deg, rgba(245,158,11,.08), rgba(245,158,11,.02));border:1px solid rgba(245,158,11,.3);border-radius:10px;padding:11px 14px;font-size:12px;color:var(--text2);line-height:1.55;display:flex;align-items:flex-start;gap:10px}
.iw-warn-card::before{content:'⚠';font-size:15px;color:#d97706;flex-shrink:0;margin-top:-1px}

/* ===== Settings -> Performance ===== */
.perf-rows { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; }
.perf-rows > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 4px 0; border-bottom: 1px dashed var(--border); }
.perf-rows > div:last-child { border-bottom: none; }
.perf-rows > div > span { color: var(--text3); }
.perf-rows > div > strong { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }

/* ── Connection cards (Connections page redesign) ────────────────────────── */
.connection-grid{display:grid;gap:14px;grid-template-columns:repeat(auto-fill,minmax(320px,1fr))}
.conn-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);box-shadow:var(--shadow-sm);padding:14px 16px 12px;cursor:pointer;transition:box-shadow .18s,transform .18s,border-color .18s;display:flex;flex-direction:column;gap:10px;position:relative;min-height:130px}
.conn-card:hover{box-shadow:var(--shadow);transform:translateY(-1px);border-color:var(--border2)}
.conn-card-head{display:flex;align-items:center;gap:12px}
.conn-card-logo{width:48px;height:48px;border-radius:12px;background:var(--surface3);display:flex;align-items:center;justify-content:center;flex:0 0 48px;overflow:hidden}
.conn-card-headtext{flex:1;min-width:0}
.conn-card-name{font-weight:700;font-size:14px;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.conn-card-sub{display:flex;align-items:center;gap:6px;margin-top:3px;flex-wrap:wrap}
.conn-card-sub-sep{color:var(--text3);font-size:11px}
.conn-card-sub-adapter{font-size:11.5px;color:var(--text2);font-weight:500}
.pill-mini{font-size:10.5px;padding:1px 7px;border-radius:10px;background:var(--surface3);border:1px solid var(--border);color:var(--text2);font-weight:600;display:inline-flex;align-items:center;gap:3px;white-space:nowrap}
.conn-card-url{font-size:11.5px;color:var(--text2);background:var(--surface2);border:1px dashed var(--border);border-radius:6px;padding:5px 8px;font-family:ui-monospace,Consolas,monospace;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.conn-card-foot{display:flex;align-items:center;gap:8px;justify-content:space-between;flex-wrap:wrap}
.conn-card-tested{font-size:11.5px;line-height:1.2}
.conn-card-actions{display:flex;gap:8px;align-items:center}
.conn-card-msg{font-size:11.5px;color:var(--success);background:rgba(22,163,74,.08);border:1px solid rgba(22,163,74,.25);border-radius:6px;padding:5px 9px;line-height:1.35;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.conn-card-msg.err{color:var(--error);background:rgba(220,38,38,.08);border-color:rgba(220,38,38,.3)}
@media(max-width:600px){.connection-grid{grid-template-columns:1fr}}
