/* Patchbay + Botlet Multi-Bot SaaS Design System */
:root {
  --bg: #1e1f22;
  --bg-2: #2b2d31;
  --bg-3: #313338;
  --bg-4: #3f4147;
  --text: #f2f3f5;
  --muted: #b5bac1;
  --faint: #80848e;
  --blurple: #5865f2;
  --blurple-2: #4752c4;
  --green: #23a55a;
  --yellow: #f0b232;
  --pink: #eb459f;
  --blue: #00a8fc;
  --red: #ef4444;
  --display: "Outfit", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --body: "Noto Sans", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 1.04rem/1.62 var(--body); -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
a { color: #a5b0ff; text-underline-offset: 3px; }
a:hover { color: #fff; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; border-radius: 6px; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--blurple); color: #fff; padding: 10px 16px; z-index: 999; border-radius: 8px; }
.skip:focus { left: 8px; }
.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.wrap-wide { width: min(100% - 2 * clamp(12px, 2.5vw, 28px), 1440px); margin-inline: auto; }

h1, h2, h3, h4 { font-family: var(--display); font-weight: 800; line-height: 1.08; letter-spacing: -0.02em; margin: 0; }
h1 { font-size: clamp(2.25rem, 4.8vw, 3.75rem); max-width: 17ch; }
h2 { font-size: clamp(1.65rem, 3.2vw, 2.45rem); max-width: 24ch; }
h3 { font-size: 1.22rem; letter-spacing: -0.01em; }
p { margin: 0 0 1em; max-width: 66ch; }
.lede { font-size: 1.16rem; color: var(--muted); max-width: 54ch; }
code, kbd { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .88em; background: var(--bg-4); padding: .15em .45em; border-radius: 5px; color: #e2e8f0; }
kbd { border: 1px solid rgba(255,255,255,.15); box-shadow: inset 0 -1px 0 rgba(0,0,0,.35); font-weight: 700; }

/* Header */
.site-header { padding-block: 14px; position: sticky; top: 0; z-index: 40; background: rgba(30,31,34,.92); backdrop-filter: blur(12px); border-bottom: 1px solid rgba(255,255,255,.06); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 800 1.38rem/1 var(--display); color: var(--text); text-decoration: none; letter-spacing: -0.02em; }
.brand:hover { color: #fff; }
.brand-mark { width: 38px; height: auto; transition: transform .3s cubic-bezier(.3,1.8,.5,1); }
.brand:hover .brand-mark { transform: rotate(-10deg) scale(1.1); }
.nav { display: flex; gap: clamp(10px, 2vw, 20px); align-items: center; flex-wrap: wrap; }
.nav a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: .94rem; padding: 6px 2px; }
.nav a:hover, .nav a[aria-current="page"] { color: #fff; }
.nav a.btn { color: #fff; }
.cmdk-trigger {
  display: inline-flex; align-items: center; gap: 8px;
  background: #141518; color: var(--muted); border: 1px solid var(--bg-4);
  border-radius: 999px; padding: 7px 13px; font: 600 .84rem/1 var(--body);
  cursor: pointer; transition: border-color .15s, color .15s;
}
.cmdk-trigger:hover { border-color: var(--blurple); color: #fff; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; font: 700 .98rem/1 var(--body); padding: 14px 22px; border-radius: 999px; border: 0; background: var(--blurple); color: #fff; text-decoration: none; cursor: pointer; transition: background .15s, transform .15s, border-color .15s; }
.btn:hover { background: var(--blurple-2); color: #fff; transform: translateY(-1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn.ghost { background: var(--bg-4); color: #fff; }
.btn.ghost:hover { background: #4e5058; transform: translateY(-1px); }
.btn.emerald { background: var(--green); color: #fff; }
.btn.emerald:hover { background: #1d8a4b; }
.btn.danger { background: rgba(239,68,68,.18); color: #f87171; border: 1px solid rgba(239,68,68,.45); }
.btn.danger:hover { background: #ef4444; color: #fff; }
.btn.small { padding: 9px 16px; font-size: .88rem; }
.btn.xs { padding: 6px 12px; font-size: .8rem; border-radius: 8px; }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }

/* Hero */
.hero { position: relative; overflow: hidden; padding-block: clamp(28px, 5vw, 58px) clamp(44px, 6vw, 84px); }
.hero::before { content: ""; position: absolute; inset: -20% -10% auto 30%; height: 90%; background: radial-gradient(closest-side, rgba(88,101,242,.35), transparent 70%); pointer-events: none; }
.hero .wrap { position: relative; display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.12fr); gap: clamp(24px, 4vw, 52px); align-items: center; }
.hero .lede { margin-top: 18px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 22px; }
.chip { font: 600 .82rem/1 var(--body); color: var(--muted); background: var(--bg-2); border: 1px solid var(--bg-4); padding: 7px 12px; border-radius: 999px; }
@media (max-width: 960px) { .hero .wrap { grid-template-columns: 1fr; } }

/* Mock server window (Hero Demo) */
.stage { position: relative; padding-top: 128px; }
.mascot-wrap { position: absolute; top: 0; left: 22px; z-index: 3; width: 144px; display: flex; align-items: flex-end; }
.mascot-wrap .bf { width: 144px; flex: none; margin-bottom: -6px; }
.mascot-wrap .bubble { position: absolute; left: 142px; top: 4px; width: max-content; max-width: 230px; margin: 0; }
.mascot-wrap .bubble::after { content: ""; position: absolute; left: -9px; bottom: 14px; border: 9px solid transparent; border-right-color: #fff; border-left: 0; }
.stage .app { position: relative; z-index: 2; }
.app { display: grid; grid-template-columns: 58px 182px minmax(0, 1fr); background: var(--bg-3); border-radius: 16px; overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.06); min-height: 420px; }
.rail { background: var(--bg); padding: 12px 0; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.srv { width: 40px; height: 40px; border-radius: 50%; background: var(--bg-3); display: grid; place-items: center; font: 800 .92rem var(--display); color: var(--muted); cursor: pointer; position: relative; transition: border-radius .15s, background .15s, color .15s; border: 0; }
.srv:hover, .srv.me, .srv.active { background: var(--blurple); color: #fff; border-radius: 14px; }
.srv.me { background: transparent; }
.srv.me .bf { width: 34px; }
.srv.a { background: #3b5bdb55; } .srv.b { background: #23a55a44; } .srv.c { background: #eb459f44; }
.side { background: var(--bg-2); padding: 14px 10px; display: flex; flex-direction: column; gap: 4px; }
.side-title { font: 800 .96rem var(--display); padding: 2px 8px 12px; margin: 0; border-bottom: 1px solid var(--bg); max-width: none; }
.side-h { font: 700 .7rem/1 var(--body); color: var(--faint); letter-spacing: .06em; text-transform: uppercase; margin: 12px 8px 6px; max-width: none; }
.chan { color: var(--faint); font-weight: 600; font-size: .9rem; padding: 4px 8px; border-radius: 6px; }
.chan.on { background: var(--bg-4); color: #fff; }
.tog { --c: var(--blurple); display: flex; align-items: center; gap: 8px; width: 100%; background: transparent; border: 0; color: var(--muted); text-decoration: none; font: 600 .88rem var(--body); padding: 5px 6px; border-radius: 8px; cursor: pointer; text-align: left; }
.tog:hover { background: var(--bg-3); color: #fff; }
.tog .av { width: 26px; height: 26px; display: block; flex: none; }
.tog .tn { flex: 1; }
.sw { width: 30px; height: 18px; border-radius: 999px; background: var(--bg-4); position: relative; flex: none; transition: background .2s; }
.sw::after { content: ""; position: absolute; left: 3px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: #fff; transition: transform .2s; }
.tog[aria-pressed="true"] { color: #fff; }
.tog[aria-pressed="true"] .sw { background: var(--green); }
.tog[aria-pressed="true"] .sw::after { transform: translateX(12px); }
.chat { display: flex; flex-direction: column; min-width: 0; }
.chat-head { padding: 12px 16px; font: 700 .95rem var(--body); border-bottom: 1px solid var(--bg); display: flex; gap: 8px; align-items: center; }
.chat-head span { color: var(--faint); font-size: 1.2rem; }
.msgs { flex: 1; padding: 14px 16px; height: 316px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; scrollbar-width: thin; scrollbar-color: var(--bg) transparent; }
.msg { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 12px; animation: pop .25s ease-out both; }
@keyframes pop { from { opacity: 0; transform: translateY(8px); } }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font: 800 .95rem var(--display); color: #fff; }
.avatar.botface { background: none; }
.avatar .bf { width: 100%; }
.who { font-size: .94rem; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.who b { font-weight: 700; }
.who time { font-size: .72rem; color: var(--faint); }
.tag { font: 700 .62rem/1 var(--body); background: var(--blurple); color: #fff; padding: 3px 5px; border-radius: 4px; letter-spacing: .02em; }
.msg p { margin: 2px 0 0; font-size: .94rem; line-height: 1.45; color: #dbdee1; max-width: none; }
.msg .cmd { color: #a5b0ff; background: rgba(88,101,242,.18); padding: 1px 5px; border-radius: 4px; font-weight: 600; }
.embed { --c: var(--blurple); margin-top: 6px; border-left: 4px solid var(--c); background: var(--bg-2); border-radius: 4px 8px 8px 4px; padding: 10px 14px; max-width: 420px; }
.embed b { display: block; font-size: .92rem; margin-bottom: 3px; color: #fff; }
.embed span { display: block; font-size: .86rem; line-height: 1.45; color: var(--muted); }
.composer { margin: 0 16px 16px; background: var(--bg-4); border-radius: 10px; padding: 11px 14px; color: var(--faint); font-size: .9rem; }
@media (max-width: 640px) {
  .app { grid-template-columns: 1fr; }
  .rail { display: none; }
  .side { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px; }
  .side .side-title, .side .side-h, .side .chan { display: none; }
  .tog { width: auto; background: var(--bg-3); }
  .msgs { height: 260px; }
  .mascot-wrap { width: 106px; } .mascot-wrap .bf { width: 106px; } .mascot-wrap .bubble { left: 104px; } .stage { padding-top: 96px; }
}

/* Sections */
section { padding-block: clamp(44px, 6vw, 84px); }
.band { background: var(--bg-2); }
.section-head { margin-bottom: 32px; }
.section-head p { margin-top: 12px; color: var(--muted); }
.answer { background: var(--bg-3); border: 1px solid var(--bg-4); border-left: 5px solid var(--blurple); border-radius: 12px; padding: 20px 24px; max-width: 820px; }
.band .answer { background: var(--bg); border-color: var(--bg-4); border-left-color: var(--blurple); }
.answer h2 { font: 800 1.05rem/1.2 var(--display); letter-spacing: 0; margin-bottom: 8px; max-width: none; color: #a5b0ff; }
.answer p { font-size: 1.08rem; margin: 0; color: var(--text); }

/* Bot cards & Fleet catalog */
.bot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(275px, 1fr)); gap: 16px; }
.bot-card { --c: var(--blurple); display: flex; flex-direction: column; gap: 12px; background: var(--bg-2); border: 1px solid var(--bg-4); border-radius: 16px; padding: 22px; color: var(--text); text-decoration: none; transition: transform .15s, border-color .15s, background .15s; position: relative; }
.band .bot-card { background: var(--bg); }
.bot-card:hover { transform: translateY(-3px); border-color: var(--c); color: var(--text); background: var(--bg-3); }
.bot-top { display: flex; align-items: center; gap: 12px; }
.bot-av { width: 54px; height: 54px; background: none; border-radius: 0; display: block; position: relative; flex: none; }
.bot-av svg { width: 100%; height: auto; }
.bot-av::after { content: ""; position: absolute; right: -2px; bottom: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--green); border: 3px solid var(--bg-2); }
.bot-card:hover .bf { transform: rotate(-7deg) scale(1.08); }
.bot-name { font: 800 1.22rem/1.15 var(--display); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bot-cat { font-size: .84rem; color: var(--faint); font-weight: 600; }
.bot-desc { color: var(--muted); font-size: .93rem; line-height: 1.5; margin: 0; flex: 1; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { font: 600 .78rem/1 ui-monospace, Menlo, Consolas, monospace; color: #c9cdfb; background: rgba(88,101,242,.2); padding: 6px 9px; border-radius: 6px; }
.perm-badge { font: 600 .72rem/1 ui-monospace, Menlo, Consolas, monospace; color: var(--muted); background: #141518; border: 1px solid var(--bg-4); padding: 4px 8px; border-radius: 6px; }

/* Steps & Columns */
.steps { list-style: none; counter-reset: s; padding: 0; margin: 0; display: grid; gap: 14px; max-width: 780px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 48px 1fr; gap: 18px; padding: 20px; background: var(--bg-3); border-radius: 14px; align-items: start; border: 1px solid var(--bg-4); }
.band .steps li { background: var(--bg); }
.steps li::before { content: counter(s); width: 44px; height: 44px; border-radius: 50%; background: var(--blurple); display: grid; place-items: center; font: 800 1.2rem var(--display); color: #fff; }
.steps h3 { margin-bottom: 4px; }
.steps p { margin: 0; color: var(--muted); }
.cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 3vw, 36px); }
.cols h3 { margin-bottom: 8px; }
.cols p { color: var(--muted); margin: 0; }
.cols > div { padding-top: 18px; border-top: 3px solid var(--blurple); }
@media (max-width: 760px) { .cols { grid-template-columns: 1fr; } }

/* FAQ */
.faq { display: grid; gap: 10px; max-width: 820px; }
.faq details { background: var(--bg-3); border-radius: 12px; border: 1px solid var(--bg-4); }
.band .faq details { background: var(--bg); }
.faq summary { cursor: pointer; list-style: none; padding: 18px 52px 18px 22px; font: 700 1.02rem/1.4 var(--body); position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 20px; top: 50%; transform: translateY(-50%); font: 700 1.5rem/1 var(--body); color: #a5b0ff; }
.faq details[open] summary::after { content: "–"; }
.faq .a { padding: 0 22px 20px; color: var(--muted); }
.faq .a p:last-child { margin-bottom: 0; }

/* Pricing */
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.plan { background: var(--bg-2); border: 1px solid var(--bg-4); border-radius: 18px; padding: 28px 26px 30px; display: flex; flex-direction: column; }
.plan.feat { background: linear-gradient(180deg, #3a42a3, #2b2f7a); border-color: var(--blurple); box-shadow: 0 20px 60px rgba(88,101,242,.3); }
.plan .price { font: 800 3rem/1 var(--display); margin: 16px 0 4px; letter-spacing: -0.03em; }
.plan .price small { font: 600 1rem var(--body); letter-spacing: 0; color: var(--muted); }
.plan ul { list-style: none; padding: 0; margin: 18px 0 26px; display: grid; gap: 10px; flex: 1; }
.plan li { padding-left: 26px; position: relative; color: var(--text); font-size: .95rem; }
.plan li::before { content: "✓"; position: absolute; left: 0; color: var(--green); font-weight: 800; }
.plan.feat .btn { background: #fff; color: #2b2f7a; }
@media (max-width: 860px) { .plans { grid-template-columns: 1fr; } }

/* Bot detail page */
.bot-hero { padding-block: clamp(26px, 4vw, 48px) 22px; position: relative; overflow: hidden; }
.bot-hero::before { content: ""; position: absolute; inset: -40% 40% auto -10%; height: 140%; background: radial-gradient(closest-side, rgba(88,101,242,.22), transparent 70%); pointer-events: none; }
.bot-hero .wrap { position: relative; }
.crumbs { font-size: .9rem; color: var(--faint); margin-bottom: 18px; }
.crumbs a { color: var(--muted); }
.bot-title { display: flex; align-items: flex-end; gap: 22px; flex-wrap: wrap; }
.bot-title .bot-av, .bot-title .bot-av.big { width: clamp(92px, 13vw, 122px); height: auto; }
.bot-title .bot-av::after { display: none; }
.bot-title h1 { max-width: 18ch; }
.bubble { position: relative; background: #fff; color: #1e1f22; font: 700 .95rem/1.3 var(--body); border-radius: 16px; padding: 10px 16px; margin: 0 0 12px; max-width: 28ch; box-shadow: 0 6px 20px rgba(0,0,0,.35); width: fit-content; }
.bot-title .bubble::after { content: ""; position: absolute; left: -9px; bottom: 12px; border: 9px solid transparent; border-right-color: #fff; border-left: 0; }
.feature-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.feature-list li { padding: 18px 20px; background: var(--bg-2); border-radius: 14px; color: var(--muted); border: 1px solid var(--bg-4); }
.feature-list strong { display: block; font: 800 1.08rem var(--display); color: var(--text); margin-bottom: 4px; }
@media (max-width: 760px) { .feature-list { grid-template-columns: 1fr; } }
.cmds { display: flex; flex-wrap: wrap; gap: 10px; padding: 0; list-style: none; margin: 0; }
.cmds li { font: 700 .95rem/1 ui-monospace, Menlo, Consolas, monospace; background: rgba(88,101,242,.2); color: #c9cdfb; padding: 11px 15px; border-radius: 8px; }

/* CTA + Footer */
.cta { background: linear-gradient(135deg, #4752c4, #5865f2 55%, #7a5cf2); }
.cta h2 { max-width: 20ch; }
.cta p { color: #e6e8ff; }
.cta .btn { background: #fff; color: #3b44b3; }
.cta .btn:hover { background: #eef; color: #3b44b3; }
.cta .btn.ghost { background: rgba(0,0,0,.25); color: #fff; }
.cta .btn.ghost:hover { background: rgba(0,0,0,.4); }
.cta-in { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 32px; align-items: center; }
.cta-art { width: clamp(130px, 18vw, 200px); }
.cta-art .bf { filter: drop-shadow(0 12px 24px rgba(0,0,0,.3)); }
@media (max-width: 640px) { .cta-in { grid-template-columns: 1fr; } .cta-art { width: 120px; order: -1; } }
.four { display: flex; align-items: center; gap: clamp(20px, 5vw, 56px); flex-wrap: wrap; }
.four-art { width: clamp(130px, 22vw, 220px); }

.site-footer { background: #111214; color: var(--faint); padding-block: 52px 36px; font-size: .93rem; border-top: 1px solid rgba(255,255,255,.05); }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.foot-grid { display: grid; grid-template-columns: 1.3fr repeat(3, 1fr); gap: 28px; }
.foot-grid h2 { font: 800 .94rem/1 var(--display); color: var(--text); margin-bottom: 14px; letter-spacing: 0; }
.foot-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.fine { margin-top: 34px; padding-top: 20px; border-top: 1px solid #2b2d31; font-size: .84rem; max-width: none; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
@media (max-width: 760px) { .foot-grid { grid-template-columns: 1fr 1fr; } }

/* Characters */
.bf { display: block; overflow: visible; width: 100%; height: auto; transition: transform .25s cubic-bezier(.3,1.6,.5,1); }
.bf-eye { transform-box: fill-box; transform-origin: center; animation: blink 4.6s infinite; animation-delay: var(--d, 0s); }
@keyframes blink { 0%, 91%, 100% { transform: scaleY(1); } 94.5% { transform: scaleY(.08); } }
.bf-ant { transform-origin: 60px 24px; animation: sway 2.2s ease-in-out infinite alternate; }
@keyframes sway { from { transform: rotate(-11deg); } to { transform: rotate(11deg); } }
.bf-bulb { animation: glow 1.1s ease-in-out infinite alternate; }
@keyframes glow { from { opacity: .55; } to { opacity: 1; } }
.mouth-o { display: none; }
.bf.talk .mouth-o { display: inline; }
.bf.talk .mouth-smile { display: none; }
.bf.wave { animation: bob 2.6s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-8px) rotate(2deg); } }
.bf.dizzy { animation: dizzy 3s ease-in-out infinite; }
@keyframes dizzy { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }

/* Featured Live Bot Showcase */
.featured-bot {
  background: var(--bg-2); border: 1px solid var(--bg-4); border-radius: 18px;
  padding: clamp(24px, 3.8vw, 36px); display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, .85fr);
  gap: clamp(22px, 3.5vw, 38px); align-items: center;
  box-shadow: 0 24px 64px rgba(0,0,0,.42);
}
@media (max-width: 860px) { .featured-bot { grid-template-columns: 1fr; } }

.live-pill {
  display: inline-flex; align-items: center; gap: 8px;
  font: 700 .74rem/1 var(--body); background: rgba(35,165,90,.16);
  color: #4ade80; border: 1px solid rgba(35,165,90,.42);
  padding: 6px 12px; border-radius: 999px; text-transform: uppercase; letter-spacing: .05em;
}
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }

.badge-live { font: 700 .7rem/1 var(--body); background: rgba(35,165,90,.16); color: #4ade80; border: 1px solid rgba(35,165,90,.4); padding: 5px 9px; border-radius: 999px; letter-spacing: .04em; text-transform: uppercase; display: inline-flex; align-items: center; gap: 5px; }
.badge-fleet { font: 700 .68rem/1 var(--body); background: rgba(88,101,242,.18); color: #a5b0ff; border: 1px solid rgba(88,101,242,.42); padding: 5px 9px; border-radius: 999px; letter-spacing: .04em; text-transform: uppercase; }
.badge-warn { font: 700 .68rem/1 var(--body); background: rgba(240,178,50,.16); color: #fbbf24; border: 1px solid rgba(240,178,50,.4); padding: 5px 9px; border-radius: 999px; letter-spacing: .04em; text-transform: uppercase; }
.badge-danger { background: rgba(239,68,68,.18); color: #f87171; border-color: rgba(239,68,68,.42); }

/* Modals (Auth + Command Palette) */
dialog.auth-modal, dialog.cmdk-modal {
  background: var(--bg-2); color: var(--text); border: 1px solid var(--bg-4);
  border-radius: 18px; padding: 28px; width: min(92vw, 460px);
  box-shadow: 0 32px 96px rgba(0,0,0,.82);
}
dialog.cmdk-modal { width: min(94vw, 620px); padding: 0; overflow: hidden; }
dialog.auth-modal::backdrop, dialog.cmdk-modal::backdrop { background: rgba(10,11,13,.78); backdrop-filter: blur(6px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.modal-close { background: var(--bg-3); color: var(--muted); border: 1px solid var(--bg-4); border-radius: 8px; width: 34px; height: 34px; cursor: pointer; display: grid; place-items: center; padding: 0; }
.modal-close:hover { background: var(--bg-4); color: #fff; }
.oauth-stack { display: grid; gap: 10px; margin: 20px 0; }
.oauth-btn { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; min-height: 48px; padding: 12px 18px; border-radius: 10px; font: 700 .95rem/1 var(--body); cursor: pointer; transition: background .15s, transform .15s; text-decoration: none; }
.oauth-btn svg { width: 20px; height: 20px; flex: none; }
.oauth-btn.discord { background: var(--blurple); color: #fff; border: 1px solid var(--blurple); }
.oauth-btn.discord:hover { background: var(--blurple-2); transform: translateY(-1px); }
.oauth-btn.google { background: #fff; color: #1e1f22; border: 1px solid #dcdfe4; }
.oauth-btn.google:hover { background: #f2f3f5; transform: translateY(-1px); }
.auth-divider { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; margin: 18px 0; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--bg-4); }

/* Command Palette (Ctrl+K) */
.cmdk-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--bg-4); background: #141518; }
.cmdk-head input { flex: 1; background: transparent; border: 0; color: #fff; font: 600 1.02rem var(--body); outline: none; }
.cmdk-list { max-height: 380px; overflow-y: auto; padding: 10px; display: grid; gap: 4px; }
.cmdk-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 14px; border-radius: 10px; background: transparent; border: 0;
  color: var(--text); font: 600 .92rem var(--body); text-align: left; cursor: pointer; width: 100%;
  text-decoration: none;
}
.cmdk-item:hover, .cmdk-item.active { background: rgba(88,101,242,.22); color: #fff; }
.cmdk-item .cmdk-cat { font-size: .74rem; color: var(--muted); background: var(--bg-3); padding: 4px 8px; border-radius: 6px; text-transform: uppercase; letter-spacing: .04em; }

/* Dyno-Style Availability & Shard Matrix */
.status-legend { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; margin: 16px 0 22px; font-size: .92rem; font-weight: 600; }
.legend-item { display: inline-flex; align-items: center; gap: 8px; }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; }
.legend-dot.op { background: #23a55a; box-shadow: 0 0 8px rgba(35,165,90,.6); }
.legend-dot.part { background: #f0b232; }
.legend-dot.maj { background: #ef4444; }
.shard-lookup { max-width: 400px; margin-bottom: 26px; }
.shard-lookup input { width: 100%; background: #141518; color: var(--text); border: 1px solid var(--bg-4); border-radius: 8px; padding: 12px 14px; font: 600 .94rem var(--body); }
.shard-service-head { margin-bottom: 14px; }
.shard-service-head h3 { font-size: 1.32rem; margin-bottom: 4px; }
.shard-service-head .count { color: #23a55a; font: 800 1.04rem var(--display); }
.shard-service-head .sub { color: var(--faint); font-size: .85rem; margin-top: 2px; }
.shard-matrix { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 6px; }
.shard-cell {
  position: relative; height: 42px; background: #141518; border: 1px solid rgba(35,165,90,.28);
  border-radius: 6px; color: #23a55a; font: 700 .85rem/1 ui-monospace, Menlo, Consolas, monospace;
  display: grid; place-items: center; cursor: pointer; user-select: none; transition: background .12s, border-color .12s;
}
.shard-cell:hover, .shard-cell.active { background: rgba(35,165,90,.16); border-color: #23a55a; color: #fff; z-index: 4; }
.shard-cell.highlight { background: rgba(88,101,242,.24); border-color: var(--blurple); color: #fff; box-shadow: 0 0 0 2px rgba(88,101,242,.4); }
.shard-tooltip {
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  background: #23252a; border: 1px solid var(--bg-4); border-radius: 8px; padding: 10px 12px;
  width: max-content; min-width: 190px; box-shadow: 0 14px 36px rgba(0,0,0,.65);
  font: 500 .78rem/1.45 var(--body); color: var(--muted); pointer-events: none; opacity: 0; visibility: hidden; transition: opacity .12s;
}
.shard-tooltip b { color: #fff; display: block; margin-bottom: 2px; font-weight: 700; }
.shard-cell:hover .shard-tooltip, .shard-cell:focus-visible .shard-tooltip { opacity: 1; visibility: visible; }

/* ============================================================================
   DISCORD-NATIVE 3-COLUMN SAAS SHELL (/app/, /dashboard/)
   ============================================================================ */
.saas-shell {
  display: grid;
  grid-template-columns: 72px 256px minmax(0, 1fr);
  min-height: calc(100vh - 70px);
  background: var(--bg-3);
  border-top: 1px solid rgba(255,255,255,.04);
}
@media (max-width: 1024px) {
  .saas-shell { grid-template-columns: 64px 210px minmax(0, 1fr); }
}
@media (max-width: 780px) {
  .saas-shell { grid-template-columns: 1fr; }
}

/* Column 1: Far-left Discord Server Rail */
.saas-rail {
  background: #111214;
  padding: 14px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  border-right: 1px solid rgba(255,255,255,.04);
}
@media (max-width: 780px) {
  .saas-rail { flex-direction: row; padding: 10px 16px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--bg-4); }
}
.rail-btn {
  width: 48px; height: 48px; border-radius: 50%; background: var(--bg-2);
  border: 0; color: var(--text); font: 800 .95rem var(--display);
  display: grid; place-items: center; cursor: pointer; position: relative;
  transition: border-radius .18s, background .18s, color .18s;
  text-decoration: none; flex: none;
}
.rail-btn::before {
  content: ""; position: absolute; left: -12px; width: 4px; height: 0;
  border-radius: 0 4px 4px 0; background: #fff; transition: height .18s;
}
.rail-btn:hover { border-radius: 16px; background: var(--blurple); color: #fff; }
.rail-btn:hover::before { height: 20px; }
.rail-btn.active { border-radius: 16px; background: var(--blurple); color: #fff; }
.rail-btn.active::before { height: 36px; }
.rail-btn .unread-dot {
  position: absolute; right: -2px; bottom: -2px; width: 14px; height: 14px;
  border-radius: 50%; background: var(--green); border: 3px solid #111214;
}
.rail-sep { width: 32px; height: 2px; background: var(--bg-4); border-radius: 2px; margin: 2px 0; }

/* Column 2: Server Navigation & Module Sidebar */
.saas-side {
  background: var(--bg-2);
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255,255,255,.05);
}
.saas-side-head {
  padding: 16px 18px;
  border-bottom: 1px solid rgba(0,0,0,.25);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.saas-side-head h2 { font: 800 1.04rem/1.2 var(--display); color: #fff; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.saas-side-nav { padding: 12px 10px; display: flex; flex-direction: column; gap: 3px; flex: 1; overflow-y: auto; }
.side-cat { font: 800 .7rem/1 var(--body); color: var(--faint); text-transform: uppercase; letter-spacing: .07em; padding: 12px 10px 5px; }
.side-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; padding: 9px 11px; border-radius: 8px; border: 0;
  background: transparent; color: var(--muted); font: 600 .9rem var(--body);
  cursor: pointer; text-align: left; text-decoration: none; transition: background .12s, color .12s;
}
.side-item:hover { background: var(--bg-3); color: var(--text); }
.side-item[aria-selected="true"], .side-item.active { background: rgba(88,101,242,.22); color: #fff; }
.side-item .side-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); flex: none; }
.saas-user-bar {
  background: #232428; padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border-top: 1px solid rgba(255,255,255,.04);
}
.saas-user-info { display: flex; align-items: center; gap: 10px; min-width: 0; }
.saas-user-av { width: 34px; height: 34px; border-radius: 50%; background: var(--blurple); color: #fff; font: 800 .88rem var(--display); display: grid; place-items: center; flex: none; }
.saas-user-meta { min-width: 0; }
.saas-user-meta b { display: block; font-size: .86rem; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.saas-user-meta span { display: block; font-size: .72rem; color: #4ade80; }

/* Column 3: Main SaaS Content Canvas */
.saas-main {
  padding: clamp(20px, 3vw, 34px);
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
  padding-bottom: 110px; /* space for sticky save bar */
}
.saas-topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding-bottom: 18px; border-bottom: 1px solid var(--bg-4);
}
.saas-topbar h1 { font-size: clamp(1.55rem, 2.6vw, 2.05rem); max-width: none; }

/* Stat Cards & Panels */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: 12px; }
.stat-card { background: var(--bg-2); border: 1px solid var(--bg-4); border-radius: 12px; padding: 16px 18px; }
.stat-card .lbl { font-size: .73rem; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.stat-card .val { font: 800 1.48rem/1.2 var(--display); color: #fff; margin-top: 6px; }
.stat-card .sub { font-size: .78rem; color: var(--muted); margin-top: 4px; }
.dash-panel { background: var(--bg-2); border: 1px solid var(--bg-4); border-radius: 16px; padding: 24px; display: flex; flex-direction: column; gap: 20px; }

/* Forms, Channel/Role/Member Pickers */
.field-group { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 700; font-size: .88rem; color: var(--text); }
.field .hint { font-size: .76rem; color: var(--faint); }
.field input[type="text"], .field input[type="email"], .field input[type="number"], .field select, .field textarea {
  background: #141518; color: var(--text); border: 1px solid var(--bg-4); border-radius: 8px;
  padding: 10px 13px; font: 600 .92rem var(--body); min-height: 44px;
}
.field textarea { min-height: 86px; resize: vertical; line-height: 1.45; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: 2px solid var(--blurple); outline-offset: 1px; }

.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #141518; padding: 13px 16px; border-radius: 10px; border: 1px solid var(--bg-4); }
.switch-row label { font-weight: 600; font-size: .92rem; cursor: pointer; }
.switch-row input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--blurple); cursor: pointer; flex: none; }

/* Interactive Discord Channel / Role / Member Pickers */
.picker-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px; background: #141518; border: 1px solid var(--bg-4); border-radius: 10px; min-height: 48px; align-items: center; }
.discord-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 6px;
  font: 600 .84rem/1 var(--body); background: rgba(88,101,242,.2); color: #dee0fc; border: 1px solid rgba(88,101,242,.38);
}
.discord-chip.role { background: rgba(35,165,90,.18); color: #86efac; border-color: rgba(35,165,90,.4); }
.discord-chip.member { background: rgba(235,69,159,.18); color: #f9a8d4; border-color: rgba(235,69,159,.4); }
.discord-chip button { background: none; border: 0; color: inherit; cursor: pointer; font-weight: 800; padding: 0 2px; font-size: .9rem; opacity: .75; }
.discord-chip button:hover { opacity: 1; }

/* Live Discord Embed Previewer */
.embed-builder-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 22px; align-items: start; }
@media (max-width: 920px) { .embed-builder-grid { grid-template-columns: 1fr; } }
.discord-preview-box {
  background: #313338; border: 1px solid var(--bg-4); border-radius: 14px; padding: 18px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
.discord-preview-msg { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; }
.discord-embed-card {
  margin-top: 8px; background: #2b2d31; border-left: 4px solid #5865f2;
  border-radius: 4px 8px 8px 4px; padding: 14px 16px; max-width: 460px;
  box-shadow: 0 4px 12px rgba(0,0,0,.22);
}
.discord-embed-card .emb-author { font-size: .78rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.discord-embed-card .emb-title { font: 800 1rem/1.3 var(--display); color: #fff; margin-bottom: 6px; }
.discord-embed-card .emb-desc { font-size: .9rem; color: #dbdee1; line-height: 1.5; white-space: pre-wrap; }
.discord-embed-card .emb-footer { font-size: .75rem; color: var(--faint); margin-top: 10px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,.06); display: flex; justify-content: space-between; }
.color-swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.color-swatch { width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; transition: transform .12s; }
.color-swatch:hover, .color-swatch.active { transform: scale(1.15); border-color: #fff; }

/* Sticky Unsaved Changes Bar (Discord-style) */
.unsaved-bar {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(140%);
  width: min(92vw, 760px); background: #111214; border: 1px solid var(--blurple);
  border-radius: 12px; padding: 12px 18px; display: flex; align-items: center; justify-content: space-between; gap: 14px;
  box-shadow: 0 20px 50px rgba(0,0,0,.75); z-index: 60;
  transition: transform .22s cubic-bezier(.22,1,.36,1);
}
.unsaved-bar.visible { transform: translateX(-50%) translateY(0); }
.unsaved-bar p { margin: 0; font-weight: 700; font-size: .92rem; color: #fff; }

/* Matrix & Data Tables */
.snap-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.snap-table th, .snap-table td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--bg-4); }
.snap-table th { color: var(--faint); font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.snap-table tr:hover td { background: rgba(255,255,255,.02); }

/* Onboarding Wizard (/login/) */
.wizard-steps { display: flex; gap: 10px; margin-bottom: 24px; flex-wrap: wrap; }
.wiz-pill { flex: 1; min-width: 160px; padding: 12px 14px; border-radius: 10px; background: #141518; border: 1px solid var(--bg-4); color: var(--muted); font: 700 .86rem var(--body); display: flex; align-items: center; gap: 10px; cursor: pointer; }
.wiz-pill.active { border-color: var(--blurple); background: rgba(88,101,242,.16); color: #fff; }
.wiz-pill span.num { width: 24px; height: 24px; border-radius: 50%; background: var(--bg-4); display: grid; place-items: center; font-size: .78rem; color: #fff; }
.wiz-pill.active span.num { background: var(--blurple); }
.preset-card { padding: 16px; border-radius: 12px; background: #141518; border: 1px solid var(--bg-4); cursor: pointer; transition: border-color .15s, background .15s; display: flex; flex-direction: column; gap: 6px; }
.preset-card:hover, .preset-card.selected { border-color: var(--blurple); background: rgba(88,101,242,.12); }

.toast-msg { padding: 12px 16px; border-radius: 10px; background: rgba(35,165,90,.16); border: 1px solid var(--green); color: #fff; font-weight: 600; font-size: .92rem; display: none; }
.toast-msg.show { display: block; }


/* Additional 3-Column Shell & Action Styles */
.dash-bot-pane { display: none; flex-direction: column; gap: 20px; }
.dash-bot-pane.active { display: flex; }

.action-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--bg-4);
  background: #141518; color: var(--text); font: 600 .84rem var(--body);
  cursor: pointer; transition: background .12s, border-color .12s, color .12s;
  text-align: left;
}
.action-btn:hover { background: var(--bg-3); border-color: rgba(255,255,255,.15); color: #fff; }
.action-btn.danger { border-color: rgba(239,68,68,.3); color: #fca5a5; }
.action-btn.danger:hover { background: rgba(239,68,68,.16); border-color: #ef4444; color: #fff; }
.action-btn code { font: 700 .76rem monospace; background: rgba(0,0,0,.35); padding: 2px 6px; border-radius: 4px; color: #a5b0ff; }

.saas-rail-item { position: relative; display: flex; align-items: center; justify-content: center; width: 100%; }
.saas-rail-item .rail-pill {
  position: absolute; left: 0; width: 4px; height: 0; border-radius: 0 4px 4px 0;
  background: #fff; transition: height .18s;
}
.saas-rail-item.active .rail-pill { height: 36px; }
.saas-rail-item:hover .rail-pill { height: 20px; }
