/*!****************************************************************************************************************************************************************************************************************************************************************!*\
  !*** css ./node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[13].oneOf[12].use[2]!./node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[13].oneOf[12].use[3]!./styles/globals.css ***!
  \****************************************************************************************************************************************************************************************************************************************************************/
@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Spectral:wght@400;600&display=swap");

:root {
  color-scheme: dark;
  --bg: #0f1115;
  --bg-2: #131722;
  --panel: rgba(255, 255, 255, 0.06);
  --panel-strong: rgba(255, 255, 255, 0.12);
  --text: #eef0f6;
  --muted: #aab0c2;
  --accent: #ffb347;
  --accent-2: #5ee1ff;
  --danger: #ff6b6b;
  --success: #7ef29d;
  --outline: rgba(255, 255, 255, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  background: radial-gradient(circle at 10% 20%, #1e2233 0%, transparent 45%),
    radial-gradient(circle at 90% 0%, #232a45 0%, transparent 55%),
    linear-gradient(160deg, #0c0f16 0%, #0f1115 40%, #0c0f16 100%);
  color: var(--text);
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font-family: inherit;
  color: inherit;
}

.container {
  width: min(1200px, 92vw);
  margin: 0 auto;
}

.glass {
  background: var(--panel);
  border: 1px solid var(--outline);
  border-radius: 18px;
  -webkit-backdrop-filter: blur(14px);
          backdrop-filter: blur(14px);
}

.card {
  padding: 24px;
}

.page {
  padding: 36px 0 64px;
}

.title {
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.subtitle {
  color: var(--muted);
  font-family: "Spectral", serif;
  font-size: 18px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(94, 225, 255, 0.12);
  border-radius: 999px;
  font-size: 12px;
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.grid {
  display: grid;
  grid-gap: 20px;
  gap: 20px;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.input,
.select,
.textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--outline);
  background: rgba(15, 17, 21, 0.7);
  color: var(--text);
}

.input.compact,
.select.compact {
  padding: 8px 10px;
  font-size: 13px;
}

.label {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
  display: block;
}

.button {
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: linear-gradient(120deg, var(--accent), #ff7c6b);
  color: #1b1a17;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.button.compact,
.select.compact {
  padding: 8px 12px;
  font-size: 13px;
}

.button.secondary {
  background: transparent;
  border: 1px solid var(--outline);
  color: var(--text);
}

.button.ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--muted);
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(255, 179, 71, 0.2);
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.brand:hover {
  opacity: 0.8;
}

.brand-logo {
  height: 44px;
  width: auto;
}

.brand-title {
  font-size: 18px;
  font-weight: 700;
}

.panel-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
}

.small {
  font-size: 12px;
  color: var(--muted);
}

.viewer {
  height: 460px;
  border-radius: 18px;
  background: radial-gradient(circle at 30% 20%, rgba(94, 225, 255, 0.15), transparent 40%),
    rgba(10, 12, 18, 0.7);
  border: 1px solid var(--outline);
  overflow: hidden;
}

.viewer-full {
  height: 100%;
}

.chat {
  max-height: none;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.chat::-webkit-scrollbar {
  width: 6px;
}

.chat::-webkit-scrollbar-track {
  background: transparent;
}

.chat::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.chat::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

.chat-bubble {
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  white-space: pre-wrap;
  word-wrap: break-word;
  font-size: 13px;
  line-height: 1.5;
  animation: fadeIn 0.3s ease-out;
}

.chat-bubble.user {
  background: linear-gradient(135deg, rgba(94, 225, 255, 0.15), rgba(94, 225, 255, 0.08));
  border: 1px solid rgba(94, 225, 255, 0.2);
  align-self: flex-end;
  border-radius: 14px 14px 4px 14px;
}

.chat-bubble.agent {
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px 14px 14px 4px;
}

.status {
  display: inline-flex;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--outline);
  color: var(--muted);
}

.status.success {
  color: var(--success);
  border-color: rgba(126, 242, 157, 0.3);
}

.status.error {
  color: var(--danger);
  border-color: rgba(255, 107, 107, 0.3);
}

@media (max-width: 900px) {
  .viewer {
    height: 320px;
  }
}

.dashboard-page {
  padding: 0;
  height: 100vh;
  overflow: hidden;
}

.dashboard-shell {
  height: 100vh;
  display: grid;
  grid-template-columns: 240px 1fr;
  overflow: hidden;
}

.sidebar {
  padding: 24px 16px;
  border-right: 1px solid var(--outline);
  background: rgba(8, 10, 16, 0.8);
  display: flex;
  flex-direction: column;
  gap: 20px;
  height: 100vh;
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  overflow-y: auto;
}

.sidebar-nav {
  display: grid;
  grid-gap: 10px;
  gap: 10px;
}

.dashboard-main {
  padding: 32px 28px 48px;
  overflow-y: auto;
  height: 100vh;
}

.mesh-page {
  padding: 0;
  height: 100vh;
  overflow: hidden;
}

.studio-shell {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.studio-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: rgba(10, 12, 16, 0.95);
  -webkit-backdrop-filter: blur(24px);
          backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--outline);
  flex-shrink: 0;
  position: relative;
  z-index: 20;
}

.studio-layout {
  display: grid;
  grid-template-columns: 380px 1fr 360px;
  height: 100%;
  overflow: hidden;
  position: relative;
}

.studio-sidebar {
  background: rgba(10, 12, 16, 0.95);
  -webkit-backdrop-filter: blur(24px);
          backdrop-filter: blur(24px);
  border-right: 1px solid var(--outline);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  z-index: 10;
}

.studio-sidebar.right {
  border-right: none;
  border-left: 1px solid var(--outline);
}

.sidebar-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--outline);
  flex-shrink: 0;
  background: rgba(10, 12, 16, 0.5);
}

.sidebar-content {
  flex: 1 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--outline);
  background: rgba(10, 12, 16, 0.95);
  flex-shrink: 0;
}

.studio-canvas {
  position: relative;
  width: 100%;
  height: 100%;
  background: #000; /* Fallback */
}

/* Floating overlay for internal tools (like transform gizmo toggles or surface info) */
.canvas-overlay {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 20;
}

@media (max-width: 1200px) {
  .studio-layout {
    grid-template-columns: 340px 1fr 0px; /* Hide right sidebar or make it overlay */
  }
  .studio-sidebar.right {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 320px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
  }
  .studio-sidebar.right.open {
    transform: translateX(0);
    box-shadow: -10px 0 30px rgba(0,0,0,0.5);
  }
}

@media (max-width: 900px) {
  .studio-layout {
    grid-template-columns: 100% 0 0; /* Stack on mobile usually, or just show config */
  }
  .studio-canvas {
    display: none; /* In simple mobile view, maybe hide canvas or toggle */
  }
}

/* Reset existing studio-body/canvas styles to avoid conflict */
.studio-body {
  flex: 1 1;
  overflow: hidden;
  position: relative;
}

.floating-panel {
  background: rgba(12, 15, 22, 0.76);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

.panel-stack {
  position: absolute;
  top: 16px;
  left: 16px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(360px, 92vw);
  z-index: 2;
  pointer-events: none;
}

.panel-stack > * {
  pointer-events: auto;
}

.panel-stack.right {
  left: auto;
  right: 16px;
  width: min(340px, 92vw);
}

.panel-scroll {
  max-height: calc(100vh - 180px);
  overflow: auto;
}

.tab-bar,
.tab-subnav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.tab {
  border: 1px solid var(--outline);
  border-radius: 999px;
  padding: 6px 12px;
  background: rgba(15, 17, 21, 0.6);
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}

.tab.active {
  border-color: rgba(94, 225, 255, 0.6);
  color: var(--accent-2);
}

/* Segmented control for sub-navigation (distinct from main tabs) */
.segmented-control {
  display: inline-flex;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  padding: 3px;
  margin-bottom: 16px;
  border: 1px solid var(--outline);
}

.segmented-control .segment {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  border: none;
  background: transparent;
  transition: all 0.15s ease;
}

.segmented-control .segment:hover {
  color: var(--text);
}

.segmented-control .segment.active {
  background: rgba(94, 225, 255, 0.15);
  color: var(--accent-2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.panel-content {
  display: grid;
  grid-gap: 12px;
  gap: 12px;
}

.panel-grid {
  display: grid;
  grid-gap: 12px;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.region-list {
  display: grid;
  grid-gap: 8px;
  gap: 8px;
}

.region-editor {
  display: grid;
  grid-gap: 10px;
  gap: 10px;
}

.list-item {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--outline);
  background: rgba(9, 12, 18, 0.6);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}

.list-item.active {
  border-color: rgba(94, 225, 255, 0.6);
  box-shadow: 0 10px 30px rgba(94, 225, 255, 0.12);
}

.region-grid {
  display: grid;
  grid-gap: 12px;
  gap: 12px;
}

.region-block {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--outline);
  background: rgba(9, 12, 18, 0.6);
  display: grid;
  grid-gap: 10px;
  gap: 10px;
}

.region-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  grid-gap: 8px;
  gap: 8px;
  align-items: center;
}

.region-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.section-title {
  margin: 18px 0 8px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-2);
}

.agent-panel {
  min-height: 320px;
}

@media (max-width: 1100px) {
  .panel-stack {
    width: min(320px, 92vw);
  }

  .panel-stack.right {
    width: min(300px, 92vw);
  }
}

@media (max-width: 900px) {
  .dashboard-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--outline);
  }

  .panel-stack.right {
    top: auto;
    bottom: 16px;
  }

  .panel-grid {
    grid-template-columns: 1fr;
  }

  .region-row {
    grid-template-columns: 1fr;
  }
}

/* Pulse animation for running indicators */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}

/* Fade in animation for chat bubbles */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Slide up animation */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Spin animation for loading indicators */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Fade in up animation for chat messages */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Bounce animation for loading dots */
@keyframes bounce {
  0%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-4px);
  }
}

