/* ============================================================================
   KKS AI / DUBFLOW — CINEMATIC CONTROL ROOM  v3
   A new visual direction: nocturne plum, ultraviolet, coral and acid-lime.
   Desktop application navigation is re-composed as a horizontal studio rail.
   All existing React routes, state, controls, and API behavior remain intact.
   ============================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=DM+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&family=Padauk:wght@400;700&display=swap');

:root {
  color-scheme: dark;
  --kks-bg: #0b0711;
  --kks-bg-2: #110b19;
  --kks-panel: #171020;
  --kks-panel-2: #20142b;
  --kks-panel-3: #281a36;
  --kks-ink: #f7f0ff;
  --kks-copy: #c9b8d7;
  --kks-muted: #8b789b;
  --kks-line: rgba(220, 190, 255, .14);
  --kks-line-strong: rgba(220, 190, 255, .26);
  --kks-violet: #a977ff;
  --kks-violet-hot: #c45cff;
  --kks-coral: #ff6482;
  --kks-lime: #d9ff58;
  --kks-success: #83e8ae;
  --kks-danger: #ff708f;
  --kks-radius: 10px;
  --kks-radius-lg: 16px;
  --kks-shadow: 0 18px 60px rgba(0, 0, 0, .34);
  --kks-font: 'DM Sans', 'Padauk', 'Segoe UI', sans-serif;
  --kks-display: 'Space Grotesk', 'Padauk', 'Segoe UI', sans-serif;
  --kks-mono: 'JetBrains Mono', 'Padauk', monospace;
}

* { box-sizing: border-box; }
html, body {
  min-height: 100%;
  background: var(--kks-bg) !important;
  color: var(--kks-ink) !important;
  font-family: var(--kks-font) !important;
  -webkit-font-smoothing: antialiased !important;
  text-rendering: optimizeLegibility;
}
body {
  background:
    radial-gradient(ellipse at 11% 3%, rgba(136, 65, 200, .17), transparent 31%),
    radial-gradient(ellipse at 96% 7%, rgba(255, 79, 127, .10), transparent 28%),
    linear-gradient(145deg, #0b0711 0%, #100a18 48%, #0a0810 100%) !important;
  background-attachment: fixed !important;
}
body::before {
  content: '' !important;
  display: block !important;
  position: fixed !important;
  inset: 0 !important;
  z-index: 0 !important;
  pointer-events: none !important;
  opacity: .15 !important;
  background-image: linear-gradient(rgba(202, 169, 255, .08) 1px, transparent 1px), linear-gradient(90deg, rgba(202, 169, 255, .08) 1px, transparent 1px) !important;
  background-size: 48px 48px !important;
  mask-image: linear-gradient(to bottom, black, transparent 82%) !important;
}
#root { min-height: 100vh; position: relative; z-index: 1; background: transparent !important; }
#root > div.min-h-screen { min-height: 100vh !important; color: var(--kks-ink) !important; background: transparent !important; font-family: var(--kks-font) !important; }

/* Type system */
h1, h2, h3, h4, h5, h6 {
  color: var(--kks-ink) !important;
  font-family: var(--kks-display) !important;
  letter-spacing: -.045em !important;
  line-height: 1.12 !important;
  text-transform: none !important;
}
p, label, li, small, input, textarea, select, button { font-family: var(--kks-font) !important; }
code, pre, [class*="font-mono"] { font-family: var(--kks-mono) !important; }
[class~="text-white"]:not(button):not(svg) { color: var(--kks-ink) !important; }
[class~="text-gray-100"], [class~="text-gray-200"], [class~="text-slate-100"], [class~="text-slate-200"], [class~="text-zinc-100"], [class~="text-zinc-200"] { color: var(--kks-ink) !important; }
[class~="text-gray-300"], [class~="text-slate-300"], [class~="text-zinc-300"] { color: var(--kks-copy) !important; }
[class~="text-gray-400"], [class~="text-slate-400"], [class~="text-zinc-400"], [class~="text-gray-500"], [class~="text-slate-500"], [class~="text-zinc-500"] { color: var(--kks-muted) !important; }
[class~="text-amber-300"], [class~="text-amber-400"], [class~="text-amber-500"], [class~="text-yellow-400"] { color: var(--kks-lime) !important; }
[class~="text-blue-300"], [class~="text-blue-400"], [class~="text-indigo-400"], [class~="text-sky-400"] { color: #c39aff !important; }
[class~="text-emerald-300"], [class~="text-emerald-400"], [class~="text-green-400"] { color: var(--kks-success) !important; }
[class~="text-rose-300"], [class~="text-rose-400"], [class~="text-red-400"] { color: var(--kks-danger) !important; }
[class~="uppercase"] { text-transform: none !important; letter-spacing: -.01em !important; }
[class~="tracking-widest"], [class~="tracking-wider"] { letter-spacing: .055em !important; }
[class~="font-black"] { font-weight: 750 !important; }

/* Global surface translation: eliminate the previous light-green look. */
#root [class*="bg-[#0A0A0B]"], #root [class*="bg-[#08090C]"], #root [class*="bg-[#090B10]"],
#root [class*="bg-[#0D0F15]"], #root [class*="bg-[#0F0F11]"], #root [class*="bg-[#0E0E10]"],
#root [class*="bg-[#0F0F"]], #root [class*="bg-[#121215]"], #root [class*="bg-[#12151F]"],
#root [class*="bg-[#141416]"], #root [class*="bg-slate-950"], #root [class*="bg-slate-900"] {
  background-color: var(--kks-panel) !important;
  background-image: none !important;
  color: var(--kks-ink) !important;
}
#root [class*="bg-slate-800"], #root [class*="bg-slate-850"], #root [class*="bg-gray-800"], #root [class*="bg-black/40"], #root [class*="bg-black/30"] {
  background-color: var(--kks-panel-2) !important;
  background-image: none !important;
}
#root [class*="bg-blue-950"], #root [class*="bg-purple-950"], #root [class*="bg-indigo-950"] {
  background-color: rgba(117, 67, 160, .20) !important;
}
#root [class*="bg-amber-500/10"], #root [class*="bg-blue-600/10"], #root [class*="bg-indigo-600/10"] {
  background-color: rgba(169, 119, 255, .15) !important;
}
#root [class*="border-white/5"], #root [class*="border-white/10"], #root [class*="border-white/15"] { border-color: var(--kks-line) !important; }
#root [class*="border-blue-500"], #root [class*="border-amber-500"] { border-color: rgba(169, 119, 255, .48) !important; }
#root [class*="border-rose-500"] { border-color: rgba(255, 100, 130, .42) !important; }
#root [class*="shadow-2xl"], #root [class*="shadow-xl"], #root [class*="shadow-lg"] { box-shadow: var(--kks-shadow) !important; }

/* ============================================================================
   SIGN-IN: asymmetrical split-screen cinematic cover + compact access panel
   ============================================================================ */
#root > div.min-h-screen:not([class*="md:flex-row"]) {
  display: grid !important;
  grid-template-columns: minmax(0, 1.12fr) minmax(390px, .88fr) !important;
  align-items: stretch !important;
  justify-content: stretch !important;
  gap: clamp(28px, 5vw, 84px) !important;
  padding: clamp(22px, 4.8vw, 76px) clamp(22px, 6vw, 100px) !important;
  position: relative !important;
  overflow: hidden !important;
  background:
    radial-gradient(ellipse at 12% 12%, rgba(169, 119, 255, .17), transparent 36%),
    radial-gradient(ellipse at 88% 84%, rgba(255, 100, 130, .12), transparent 34%),
    #0b0711 !important;
}
#root > div.min-h-screen:not([class*="md:flex-row"])::before {
  content: 'KKS AI\A \A Every scene.\A Another voice.' !important;
  white-space: pre-wrap !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-self: stretch !important;
  min-width: 0 !important;
  grid-column: 1 !important;
  grid-row: 1 !important;
  padding: clamp(36px, 5vw, 82px) !important;
  border: 1px solid rgba(220, 190, 255, .16) !important;
  border-radius: 20px !important;
  color: #f7f0ff !important;
  font-family: var(--kks-display) !important;
  font-size: clamp(38px, 5vw, 72px) !important;
  font-weight: 700 !important;
  letter-spacing: -.065em !important;
  line-height: 1.16 !important;
  text-align: left !important;
  background:
    radial-gradient(circle at 72% 24%, rgba(195, 121, 255, .30), transparent 20%),
    radial-gradient(circle at 22% 82%, rgba(255, 100, 130, .18), transparent 24%),
    linear-gradient(145deg, rgba(41, 24, 59, .96), rgba(17, 10, 27, .98) 65%, rgba(29, 14, 38, .96)) !important;
  box-shadow: inset 0 1px rgba(255,255,255,.05), 0 24px 90px rgba(0,0,0,.26) !important;
  position: relative !important;
  overflow: hidden !important;
  z-index: 0 !important;
}
#root > div.min-h-screen:not([class*="md:flex-row"])::after {
  content: '' !important;
  position: absolute !important;
  z-index: 0 !important;
  pointer-events: none !important;
  left: clamp(90px, 14vw, 230px) !important;
  bottom: clamp(56px, 10vh, 120px) !important;
  width: clamp(150px, 23vw, 330px) !important;
  aspect-ratio: 1 !important;
  border-radius: 50% !important;
  border: 1px solid rgba(217,255,88,.35) !important;
  box-shadow: 0 0 0 22px rgba(217,255,88,.035), 0 0 0 54px rgba(217,255,88,.025), inset 0 0 70px rgba(196,92,255,.12) !important;
  background: repeating-radial-gradient(circle, transparent 0 16px, rgba(195,154,255,.12) 17px 18px, transparent 19px 36px) !important;
}
#root > div.min-h-screen:not([class*="md:flex-row"]) > .w-full.max-w-md {
  grid-column: 2 !important;
  grid-row: 1 !important;
  align-self: center !important;
  justify-self: center !important;
  width: min(100%, 480px) !important;
  max-width: 480px !important;
  padding: clamp(28px, 3.4vw, 48px) !important;
  border: 1px solid rgba(220, 190, 255, .20) !important;
  border-radius: 18px !important;
  background: linear-gradient(155deg, rgba(34, 22, 47, .97), rgba(19, 12, 29, .98)) !important;
  box-shadow: 0 30px 90px rgba(0,0,0,.48), inset 0 1px rgba(255,255,255,.055) !important;
  z-index: 2 !important;
}
#root > div.min-h-screen:not([class*="md:flex-row"]) > .w-full.max-w-md > div:first-child { margin-bottom: 30px !important; text-align: left !important; }
#root > div.min-h-screen:not([class*="md:flex-row"]) > .w-full.max-w-md > div:first-child > div:first-child {
  width: 54px !important; height: 54px !important; border-radius: 14px !important;
  background: linear-gradient(135deg, rgba(169,119,255,.28), rgba(255,100,130,.18)) !important;
  border: 1px solid rgba(195,154,255,.35) !important; color: var(--kks-violet) !important;
}
#root > div.min-h-screen:not([class*="md:flex-row"]) > .w-full.max-w-md > div:first-child h1 { font-size: 31px !important; margin-top: 13px !important; }
#root > div.min-h-screen:not([class*="md:flex-row"]) > .w-full.max-w-md > div:first-child p { color: var(--kks-muted) !important; font-size: 11px !important; letter-spacing: .02em !important; }
#root > div.min-h-screen:not([class*="md:flex-row"]) > .w-full.max-w-md > div:nth-child(2) {
  padding: 4px !important; gap: 4px !important; border-radius: 9px !important;
  background: #0d0815 !important; border: 1px solid var(--kks-line) !important;
}
#root > div.min-h-screen:not([class*="md:flex-row"]) > .w-full.max-w-md > div:nth-child(2) button { border-radius: 6px !important; min-height: 39px !important; }
#root > div.min-h-screen:not([class*="md:flex-row"]) > .w-full.max-w-md input {
  min-height: 48px !important; border-radius: 8px !important; background: #0e0916 !important;
  border: 1px solid rgba(220,190,255,.17) !important; color: var(--kks-ink) !important;
  font-size: 13px !important; box-shadow: inset 0 1px 3px rgba(0,0,0,.28) !important;
}
#root > div.min-h-screen:not([class*="md:flex-row"]) > .w-full.max-w-md input:focus { border-color: var(--kks-violet) !important; box-shadow: 0 0 0 3px rgba(169,119,255,.13) !important; }
#root > div.min-h-screen:not([class*="md:flex-row"]) > .w-full.max-w-md label { color: var(--kks-copy) !important; font-size: 10px !important; }
#root > div.min-h-screen:not([class*="md:flex-row"]) > .w-full.max-w-md form > div:nth-last-child(1) {
  background: rgba(169,119,255,.075) !important; border: 1px solid rgba(169,119,255,.19) !important;
  border-radius: 8px !important;
}
#root > div.min-h-screen:not([class*="md:flex-row"]) > .w-full.max-w-md form button[type="submit"] {
  min-height: 52px !important; border-radius: 8px !important; color: #160c22 !important;
  background: linear-gradient(105deg, #bd8aff, #ff7a9a) !important;
  box-shadow: 0 10px 28px rgba(178,104,255,.22) !important; font-size: 11px !important;
}
#root > div.min-h-screen:not([class*="md:flex-row"]) > .w-full.max-w-md > div:last-child { border-color: var(--kks-line) !important; color: var(--kks-muted) !important; }

/* ============================================================================
   APP SHELL: replace the old vertical sidebar with a horizontal studio rail
   ============================================================================ */
#root > div.min-h-screen[class*="md:flex-row"] {
  display: flex !important;
  flex-direction: column !important;
  min-height: 100vh !important;
  background: transparent !important;
}
#root > div.min-h-screen[class*="md:flex-row"] > div[class*="w-64"][class*="flex-col"] {
  display: flex !important;
  position: sticky !important;
  top: 0 !important;
  left: auto !important;
  inset: auto !important;
  transform: none !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  height: auto !important;
  min-height: 82px !important;
  max-height: 104px !important;
  flex: 0 0 auto !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 18px !important;
  padding: 10px clamp(16px, 3vw, 42px) !important;
  background: rgba(15, 9, 22, .93) !important;
  border: 0 !important;
  border-bottom: 1px solid rgba(220,190,255,.16) !important;
  box-shadow: 0 10px 40px rgba(0,0,0,.28) !important;
  backdrop-filter: blur(22px) saturate(125%) !important;
  z-index: 50 !important;
}
#root > div.min-h-screen[class*="md:flex-row"] > div[class*="w-64"][class*="flex-col"] > div:first-child {
  display: flex !important; flex-direction: row !important; align-items: center !important;
  width: 184px !important; min-width: 184px !important; height: auto !important; min-height: 0 !important;
  padding: 8px 12px 8px 0 !important; border: 0 !important; background: transparent !important;
}
#root > div.min-h-screen[class*="md:flex-row"] > div[class*="w-64"][class*="flex-col"] > div:first-child > div:first-child {
  display: flex !important; flex-direction: row !important; align-items: center !important;
  justify-content: flex-start !important; gap: 10px !important; width: 100% !important; min-width: 0 !important;
}
#root > div.min-h-screen[class*="md:flex-row"] > div[class*="w-64"][class*="flex-col"] > div:first-child > div:first-child > div:first-child {
  width: 42px !important; min-width: 42px !important; height: 42px !important; border-radius: 12px !important;
  display: flex !important; align-items: center !important; justify-content: center !important;
  background: linear-gradient(145deg, #c08aff, #ff6482) !important; color: #170c22 !important;
  box-shadow: 0 6px 22px rgba(185,112,255,.25) !important;
}
#root > div.min-h-screen[class*="md:flex-row"] > div[class*="w-64"][class*="flex-col"] > div:first-child h1,
#root > div.min-h-screen[class*="md:flex-row"] > div[class*="w-64"][class*="flex-col"] > div:first-child span { white-space: nowrap !important; }
#root > div.min-h-screen[class*="md:flex-row"] > div[class*="w-64"][class*="flex-col"] > div:first-child h1 { color: var(--kks-ink) !important; font-size: 14px !important; }
#root > div.min-h-screen[class*="md:flex-row"] > div[class*="w-64"][class*="flex-col"] > div:first-child span { color: var(--kks-violet) !important; }
#root > div.min-h-screen[class*="md:flex-row"] > div[class*="w-64"][class*="flex-col"] nav {
  flex: 1 1 auto !important; min-width: 0 !important; height: auto !important; max-height: 74px !important;
  display: flex !important; flex-direction: row !important; align-items: center !important;
  justify-content: center !important; gap: 5px !important; padding: 0 !important; margin: 0 !important;
  overflow-x: auto !important; overflow-y: hidden !important; scrollbar-width: none !important;
}
#root > div.min-h-screen[class*="md:flex-row"] > div[class*="w-64"][class*="flex-col"] nav::-webkit-scrollbar { display: none !important; }
#root > div.min-h-screen[class*="md:flex-row"] > div[class*="w-64"][class*="flex-col"] nav button {
  width: auto !important; min-width: max-content !important; min-height: 43px !important;
  flex: 0 0 auto !important; display: flex !important; align-items: center !important;
  gap: 9px !important; padding: 9px 13px !important; border-radius: 7px !important;
  background: transparent !important; border: 1px solid transparent !important;
  color: var(--kks-muted) !important; text-align: left !important; box-shadow: none !important;
}
#root > div.min-h-screen[class*="md:flex-row"] > div[class*="w-64"][class*="flex-col"] nav button:hover {
  background: rgba(195,154,255,.09) !important; border-color: rgba(195,154,255,.13) !important; color: var(--kks-ink) !important;
}
#root > div.min-h-screen[class*="md:flex-row"] > div[class*="w-64"][class*="flex-col"] nav button[class*="bg-blue-600/10"],
#root > div.min-h-screen[class*="md:flex-row"] > div[class*="w-64"][class*="flex-col"] nav button[class*="border-blue-500"] {
  background: linear-gradient(110deg, rgba(169,119,255,.18), rgba(255,100,130,.075)) !important;
  border: 1px solid rgba(190,146,255,.28) !important; color: #ead9ff !important;
  box-shadow: inset 0 -2px 0 var(--kks-violet) !important;
}
#root > div.min-h-screen[class*="md:flex-row"] > div[class*="w-64"][class*="flex-col"] nav button svg { color: #b89ad4 !important; }
#root > div.min-h-screen[class*="md:flex-row"] > div[class*="w-64"][class*="flex-col"] nav button[class*="bg-blue-600/10"] svg { color: #d5b3ff !important; }
#root > div.min-h-screen[class*="md:flex-row"] > div[class*="w-64"][class*="flex-col"] nav button p:first-child,
#root > div.min-h-screen[class*="md:flex-row"] > div[class*="w-64"][class*="flex-col"] nav button p { color: inherit !important; font-size: 10px !important; font-weight: 700 !important; letter-spacing: .01em !important; white-space: nowrap !important; }
#root > div.min-h-screen[class*="md:flex-row"] > div[class*="w-64"][class*="flex-col"] nav button p + p { display: none !important; }
#root > div.min-h-screen[class*="md:flex-row"] > div[class*="w-64"][class*="flex-col"] > div:last-child {
  width: 300px !important; min-width: 275px !important; max-width: 330px !important;
  flex: 0 0 auto !important; margin: 0 !important; padding: 0 0 0 14px !important;
  border: 0 !important; border-left: 1px solid var(--kks-line) !important;
  background: transparent !important;
}
#root > div.min-h-screen[class*="md:flex-row"] > div[class*="w-64"][class*="flex-col"] > div:last-child > div { margin: 0 !important; }
#root > div.min-h-screen[class*="md:flex-row"] > div[class*="w-64"][class*="flex-col"] > div:last-child > div:first-child {
  display: flex !important; flex-direction: row !important; align-items: center !important; gap: 8px !important;
}
#root > div.min-h-screen[class*="md:flex-row"] > div[class*="w-64"][class*="flex-col"] > div:last-child > div:first-child > div:first-child { flex: 1 1 auto !important; min-width: 0 !important; }
#root > div.min-h-screen[class*="md:flex-row"] > div[class*="w-64"][class*="flex-col"] > div:last-child > div:first-child > button { width: auto !important; min-width: 76px !important; white-space: nowrap !important; padding: 8px 10px !important; }
#root > div.min-h-screen[class*="md:flex-row"] > div[class*="w-64"][class*="flex-col"] > div:last-child [class*="bg-gradient-to-r"] > div:nth-child(2) p:last-child,
#root > div.min-h-screen[class*="md:flex-row"] > div[class*="w-64"][class*="flex-col"] > div:last-child [class*="bg-gradient-to-r"] > div:nth-child(3) { display: none !important; }
#root > div.min-h-screen[class*="md:flex-row"] > div[class*="w-64"][class*="flex-col"] > div:last-child [class*="bg-gradient-to-r"] {
  padding: 8px 10px !important; border-radius: 7px !important; background: rgba(169,119,255,.08) !important;
}
#root > div.min-h-screen[class*="md:flex-row"] > div[class*="w-64"][class*="flex-col"] > div:last-child button { border-radius: 6px !important; }

/* Content canvas and workspace widths */
#root > div.min-h-screen[class*="md:flex-row"] > div[class*="flex-1"] {
  width: 100% !important; min-width: 0 !important; min-height: calc(100vh - 82px) !important;
  background: transparent !important;
}
#root div[class*="max-w-7xl"] {
  width: min(100% - clamp(28px, 5vw, 80px), 1580px) !important;
  max-width: 1580px !important; padding-top: clamp(24px, 3vw, 44px) !important;
  padding-bottom: 58px !important;
}
#root div[class*="max-w-7xl"] > div:first-child[class*="bg-"] {
  position: relative !important; overflow: hidden !important;
  padding: clamp(24px, 3vw, 38px) !important;
  border: 1px solid rgba(195,154,255,.22) !important;
  border-radius: 13px !important;
  background:
    radial-gradient(ellipse at 84% 8%, rgba(255,100,130,.17), transparent 27%),
    radial-gradient(ellipse at 70% 110%, rgba(169,119,255,.18), transparent 35%),
    linear-gradient(115deg, #21152d 0%, #171020 62%, #25142b 100%) !important;
  box-shadow: 0 18px 52px rgba(0,0,0,.22) !important;
}
#root div[class*="max-w-7xl"] > div:first-child[class*="bg-"]::after {
  content: '' !important; position: absolute !important; right: -34px !important; top: -95px !important;
  width: 250px !important; height: 250px !important; border-radius: 50% !important;
  border: 1px solid rgba(217,255,88,.18) !important;
  box-shadow: 0 0 0 22px rgba(217,255,88,.025), 0 0 0 54px rgba(195,154,255,.025) !important;
  pointer-events: none !important;
}
#root div[class*="max-w-7xl"] > div:first-child h1,
#root div[class*="max-w-7xl"] > div:first-child h2 { color: var(--kks-ink) !important; font-size: clamp(24px, 2.2vw, 34px) !important; }
#root div[class*="max-w-7xl"] > div:first-child p { color: var(--kks-copy) !important; }

/* Panels, cards, lists, tables */
#root div[class*="rounded-2xl"][class*="border"], #root div[class*="rounded-xl"][class*="border"],
#root div[class*="rounded-lg"][class*="border"], #root section[class*="border"] {
  border-color: var(--kks-line) !important; border-radius: var(--kks-radius) !important;
  box-shadow: 0 8px 28px rgba(0,0,0,.17) !important;
}
#root div[class*="rounded-none"][class*="border"]:not([class*="fixed"]):not([class*="sticky"]) { border-radius: var(--kks-radius) !important; }
#root [class*="bg-[#0F0F11]"], #root [class*="bg-[#121215]"], #root [class*="bg-[#141416]"],
#root [class*="bg-slate-900"], #root [class*="bg-slate-800"] { border-color: var(--kks-line) !important; }
#root table { border-collapse: separate !important; border-spacing: 0 !important; background: transparent !important; }
#root thead { background: rgba(169,119,255,.10) !important; }
#root th { color: #d5b9ff !important; font-family: var(--kks-mono) !important; font-size: 10px !important; letter-spacing: .055em !important; }
#root td { color: var(--kks-copy) !important; border-color: var(--kks-line) !important; }
#root tr:hover td { background: rgba(195,154,255,.045) !important; }

/* Buttons and interactive states */
#root button { transition: background .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease, transform .18s ease !important; }
#root button[class*="bg-amber-500"], #root button[class*="bg-blue-600"], #root button[class*="bg-indigo-600"],
#root button[class*="bg-purple-600"], #root button[class*="from-blue-600"] {
  background: linear-gradient(105deg, #ae79ff, #e66bce) !important; background-image: linear-gradient(105deg, #ae79ff, #e66bce) !important;
  border: 1px solid rgba(219,190,255,.34) !important; border-radius: 7px !important;
  color: #170d22 !important; font-weight: 750 !important; box-shadow: 0 7px 24px rgba(169,119,255,.18) !important;
}
#root button[class*="bg-amber-500"]:hover, #root button[class*="bg-blue-600"]:hover,
#root button[class*="bg-purple-600"]:hover { filter: brightness(1.1) saturate(1.1) !important; transform: translateY(-1px) !important; }
#root button[class*="bg-rose-500"], #root button[class*="bg-rose-600"], #root button[class*="bg-red-600"] {
  background: rgba(255,100,130,.16) !important; border: 1px solid rgba(255,100,130,.34) !important;
  color: #ff8da5 !important; box-shadow: none !important;
}
#root button[class*="border-white/10"], #root button[class*="border-white/5"] { border-color: var(--kks-line) !important; }
#root button[class*="hover:bg-white/5"]:hover, #root button[class*="hover:bg-slate-800"]:hover { background: rgba(195,154,255,.10) !important; }
#root input, #root textarea, #root select {
  color: var(--kks-ink) !important; background: #100a18 !important;
  border: 1px solid rgba(220,190,255,.18) !important; border-radius: 7px !important;
  outline: none !important; box-shadow: inset 0 1px 3px rgba(0,0,0,.22) !important;
}
#root input:focus, #root textarea:focus, #root select:focus { border-color: var(--kks-violet) !important; box-shadow: 0 0 0 3px rgba(169,119,255,.12) !important; }
#root input::placeholder, #root textarea::placeholder { color: #79688a !important; opacity: 1 !important; }
#root input[type="checkbox"], #root input[type="radio"] { accent-color: var(--kks-violet) !important; }
#root [role="dialog"], #root [class*="fixed inset-0"] > div[class*="bg-"] {
  border-color: var(--kks-line) !important; background-color: var(--kks-panel) !important;
}
#root [class*="bg-emerald-950"] { background: rgba(42,115,82,.20) !important; }
#root [class*="bg-rose-950"] { background: rgba(135,37,66,.19) !important; }
#root [class*="bg-amber-950"] { background: rgba(147,108,32,.16) !important; }

/* Toasts, badges, progress bars */
#root [class*="animate-slide-in"] { border-radius: 8px !important; box-shadow: var(--kks-shadow) !important; }
#root [class*="bg-amber-500"]:not(button) { background-color: rgba(217,255,88,.16) !important; color: var(--kks-lime) !important; }
#root [class*="bg-blue-500"], #root [class*="bg-blue-400"] { background-color: var(--kks-violet) !important; }
#root [class*="bg-emerald-500"] { background-color: #57c98d !important; }
#root [class*="bg-rose-500"] { background-color: var(--kks-coral) !important; }
#root [class*="ring-blue"], #root [class*="ring-amber"] { --tw-ring-color: rgba(169,119,255,.45) !important; }

/* Mobile masthead + drawer: keep the existing mobile navigation behavior. */
#root > div.min-h-screen[class*="md:flex-row"] > div.md\:hidden,
#root > div.min-h-screen[class*="md:flex-row"] > div[class*="md:hidden"][class*="border-b"] {
  display: none !important; width: 100% !important; min-height: 62px !important;
  padding: 12px 16px !important; background: rgba(15,9,22,.96) !important;
  border-bottom: 1px solid var(--kks-line) !important; color: var(--kks-ink) !important;
}

/* Responsive composition */
@media (max-width: 1100px) and (min-width: 769px) {
  #root > div.min-h-screen[class*="md:flex-row"] > div[class*="w-64"][class*="flex-col"] { gap: 8px !important; padding-inline: 14px !important; }
  #root > div.min-h-screen[class*="md:flex-row"] > div[class*="w-64"][class*="flex-col"] > div:first-child { width: 145px !important; min-width: 145px !important; }
  #root > div.min-h-screen[class*="md:flex-row"] > div[class*="w-64"][class*="flex-col"] > div:last-child { width: 188px !important; min-width: 170px !important; }
  #root > div.min-h-screen[class*="md:flex-row"] > div[class*="w-64"][class*="flex-col"] nav button { padding-inline: 9px !important; gap: 6px !important; }
  #root > div.min-h-screen[class*="md:flex-row"] > div[class*="w-64"][class*="flex-col"] nav button p { font-size: 9px !important; }
}
@media (max-width: 768px) {
  body { background-attachment: scroll !important; }
  #root > div.min-h-screen[class*='md:flex-row'] > div[class*='md:hidden'][class*='border-b'] { display: flex !important; }
  #root > div.min-h-screen:not([class*="md:flex-row"]) {
    display: flex !important; flex-direction: column !important; justify-content: center !important;
    align-items: stretch !important; gap: 16px !important; padding: 16px !important;
  }
  #root > div.min-h-screen:not([class*="md:flex-row"])::before {
    display: flex !important; min-height: 148px !important; flex: 0 0 auto !important;
    padding: 22px 24px !important; border-radius: 14px !important;
    font-size: clamp(30px, 8vw, 42px) !important; line-height: 1.12 !important;
  }
  #root > div.min-h-screen:not([class*="md:flex-row"])::after { width: 105px !important; left: auto !important; right: 25px !important; bottom: auto !important; top: 34px !important; opacity: .55 !important; }
  #root > div.min-h-screen:not([class*="md:flex-row"]) > .w-full.max-w-md {
    align-self: stretch !important; width: 100% !important; max-width: 100% !important;
    padding: 22px !important; border-radius: 14px !important;
  }
  #root > div.min-h-screen:not([class*="md:flex-row"]) > .w-full.max-w-md > div:first-child { text-align: left !important; margin-bottom: 22px !important; }
  #root > div.min-h-screen[class*="md:flex-row"] > div[class*="w-64"][class*="flex-col"] {
    position: fixed !important; inset: 0 auto 0 0 !important; top: 0 !important; bottom: 0 !important;
    width: 286px !important; min-width: 286px !important; max-width: 86vw !important; height: 100vh !important;
    min-height: 100vh !important; max-height: 100vh !important; flex-direction: column !important;
    align-items: stretch !important; justify-content: flex-start !important; gap: 0 !important;
    padding: 0 !important; border-right: 1px solid var(--kks-line) !important; border-bottom: 0 !important;
    background: #110b19 !important; box-shadow: 20px 0 60px rgba(0,0,0,.46) !important;
  }
  #root > div.min-h-screen[class*="md:flex-row"] > div[class*="w-64"][class*="flex-col"] > div:first-child { width: 100% !important; min-width: 0 !important; padding: 18px !important; border-bottom: 1px solid var(--kks-line) !important; }
  #root > div.min-h-screen[class*="md:flex-row"] > div[class*="w-64"][class*="flex-col"] nav {
    flex: 1 1 auto !important; width: 100% !important; max-height: none !important; height: auto !important;
    flex-direction: column !important; align-items: stretch !important; justify-content: flex-start !important;
    padding: 16px 12px !important; overflow-y: auto !important; overflow-x: hidden !important; gap: 5px !important;
  }
  #root > div.min-h-screen[class*="md:flex-row"] > div[class*="w-64"][class*="flex-col"] nav button { width: 100% !important; justify-content: flex-start !important; min-height: 46px !important; padding: 10px 13px !important; }
  #root > div.min-h-screen[class*="md:flex-row"] > div[class*="w-64"][class*="flex-col"] nav button p + p { display: block !important; }
  #root > div.min-h-screen[class*="md:flex-row"] > div[class*="w-64"][class*="flex-col"] {
    transform: translateX(var(--tw-translate-x, 0)) !important;
  }
  #root > div.min-h-screen[class*="md:flex-row"] > div[class*="w-64"][class*="flex-col"] > div:last-child {
    width: auto !important; min-width: 0 !important; max-width: none !important; margin: 0 !important;
    padding: 14px !important; border-left: 0 !important; border-top: 1px solid var(--kks-line) !important;
  }
  #root > div.min-h-screen[class*="md:flex-row"] > div[class*="flex-1"] { min-height: calc(100vh - 62px) !important; }
  #root div[class*="max-w-7xl"] { width: calc(100% - 28px) !important; padding-top: 20px !important; }
}
@media (max-width: 390px) {
  #root > div.min-h-screen:not([class*="md:flex-row"]) > .w-full.max-w-md { padding: 18px !important; }
  #root > div.min-h-screen:not([class*="md:flex-row"])::before { min-height: 128px !important; }
}

/* Reduced motion / keyboard accessibility */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
:focus-visible { outline: 2px solid var(--kks-violet) !important; outline-offset: 2px !important; }
