:root {
  --bg: #090a0d;
  --panel: #121419;
  --ink: #f3f4f6;
  --muted: #9da3af;
  --line: #252c37;
  --line-soft: #1c2330;
  --accent: #ffffff;
  --accent-ink: #0f1012;
  --accent-rgb: 255, 255, 255;
  --danger: #ff7676;
  --ok: #9ce3bc;
  --shadow: 0 24px 44px rgba(0, 0, 0, 0.45);
  --radius-lg: 22px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100dvh;
  min-height: 100dvh;
  color: var(--ink);
  background: radial-gradient(circle at top left, #161921 0%, #090a0d 46%);
  font-family: "Manrope", sans-serif;
}

body {
  position: relative;
  overflow: hidden;
}

.bg-blur {
  position: fixed;
  width: 560px;
  height: 560px;
  border-radius: 50%;
  filter: blur(90px);
  z-index: 0;
  pointer-events: none;
}

.bg-blur-a {
  top: -230px;
  left: -180px;
  background: rgba(255, 255, 255, 0.1);
}

.bg-blur-b {
  right: -220px;
  bottom: -280px;
  background: rgba(255, 255, 255, 0.07);
}

.app,
.login-shell {
  position: relative;
  z-index: 1;
}

.app {
  width: 100%;
  max-width: none;
  height: 100%;
  min-height: 100%;
  margin: 0;
  padding: 6px 8px 8px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.topbar {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo-wrap {
  width: clamp(82px, 8vw, 126px);
  min-width: clamp(82px, 8vw, 126px);
  padding: 4px;
  border-radius: 14px;
  border: 1px solid rgba(var(--accent-rgb), 0.28);
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.08), transparent 56%),
    rgba(12, 16, 24, 0.72);
}

.brand-copy {
  min-width: 0;
}

.brand-logo {
  width: 100%;
  max-height: clamp(78px, 8vw, 122px);
  height: auto;
  display: block;
  object-fit: contain;
}

.brand-subtitle {
  margin-top: 4px;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 800;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
}

h1 {
  margin-top: 4px;
  font-size: clamp(1.3rem, 2vw, 2.05rem);
}

.workspace {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
  min-height: 0;
  height: 100%;
  transition: grid-template-columns 320ms cubic-bezier(0.22, 1, 0.36, 1), gap 260ms ease;
}

.workspace.sidebar-collapsed {
  grid-template-columns: 94px minmax(0, 1fr);
}

.panel {
  background: linear-gradient(160deg, rgba(19, 22, 28, 0.97), rgba(14, 17, 23, 0.97));
  border: 1px solid rgba(121, 134, 157, 0.16);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.34);
}

.panel-head h2,
.panel-head h3 {
  font-size: 1.04rem;
}

.panel-head p {
  margin: 5px 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100%;
  min-height: 0;
  max-height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  overflow: visible;
  transition: padding 260ms cubic-bezier(0.22, 1, 0.36, 1), transform 260ms ease;
}

.nav-menu {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  max-height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding-right: 2px;
}

.nav-stages {
  display: grid;
  gap: 8px;
}

.nav-config-wrap {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid #2b3240;
  display: grid;
  gap: 8px;
}

.nav-item {
  width: 100%;
  border: 1px solid rgba(124, 138, 162, 0.24);
  border-radius: 12px;
  background: #131821;
  color: var(--ink);
  padding: 10px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-family: inherit;
  transition: all 200ms ease;
}

.nav-item.is-active {
  border-color: var(--accent);
  background: linear-gradient(140deg, #1a202c, #151922);
  box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.15);
}

.nav-icon {
  width: 26px;
  height: 26px;
  border: 1px solid rgba(127, 141, 165, 0.38);
  border-radius: 8px;
  background: #171e2a;
  color: #dce4f3;
  display: grid;
  place-items: center;
  flex: 0 0 26px;
}

.nav-icon svg {
  width: 14px;
  height: 14px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-item.is-active .nav-icon {
  border-color: rgba(var(--accent-rgb), 0.72);
  background: #202938;
  color: var(--accent);
}

.nav-title {
  display: block;
  font-size: 0.9rem;
  line-height: 1.2;
  font-weight: 700;
  transition: opacity 160ms ease, transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.nav-item.nav-stage {
  display: flex;
}

.nav-stage-group {
  display: grid;
  gap: 6px;
}

.nav-stage-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
}

.nav-stage-row .nav-item.nav-stage {
  min-width: 0;
}

.nav-stage-count {
  margin-left: auto;
  border: 1px solid rgba(145, 159, 182, 0.34);
  border-radius: 999px;
  padding: 1px 8px;
  min-width: 26px;
  text-align: center;
  font-size: 0.72rem;
  color: #d7dfef;
}

.nav-item.is-active .nav-stage-count {
  border-color: rgba(var(--accent-rgb), 0.62);
  color: var(--accent);
}

.nav-stage-toggle {
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  padding: 0;
  display: grid;
  place-items: center;
}

.nav-stage-toggle svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-stage-toggle.is-open {
  border-color: rgba(var(--accent-rgb), 0.72);
  color: var(--accent);
}

.nav-thread-list {
  margin-left: 16px;
  display: grid;
  gap: 6px;
}

.nav-item.nav-thread {
  padding: 8px 10px;
  gap: 8px;
  border-radius: 10px;
  background: #101722;
}

.nav-thread-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  border: 1px solid rgba(158, 174, 199, 0.52);
  background: rgba(151, 168, 194, 0.22);
  flex: 0 0 8px;
}

.nav-item.nav-thread.is-active .nav-thread-dot {
  border-color: rgba(var(--accent-rgb), 0.82);
  background: rgba(var(--accent-rgb), 0.62);
}

.nav-thread-label {
  min-width: 0;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-thread-count {
  margin-left: auto;
  font-size: 0.72rem;
  color: #a9b5ca;
}

.nav-thread-create {
  width: 100%;
  border: 1px dashed rgba(131, 145, 170, 0.44);
  border-radius: 10px;
  background: rgba(16, 23, 34, 0.86);
  color: #d5def0;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 7px 10px;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}

.nav-thread-create:hover,
.nav-thread-create:focus-visible {
  border-color: rgba(var(--accent-rgb), 0.72);
  color: var(--accent);
  outline: none;
}

.nav-item.nav-config {
  margin-top: 0;
}

.sidebar-footer {
  border-top: 1px solid #2b3240;
  padding-top: 12px;
  display: grid;
  gap: 10px;
  transition: opacity 180ms ease, transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.sidebar .sidebar-logout-icon-btn {
  display: none;
}

.sidebar-toggle-btn,
.sidebar-toggle-btn.icon-only-btn {
  position: absolute;
  right: -16px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  border-radius: 999px;
  z-index: 4;
  padding: 0;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 14px rgba(3, 8, 15, 0.34);
}

.sidebar-toggle-btn svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.workspace.sidebar-collapsed .sidebar {
  padding: 12px 10px;
}

.workspace.sidebar-collapsed .sidebar .panel-head,
.workspace.sidebar-collapsed .sidebar-footer,
.workspace.sidebar-collapsed .sidebar .nav-title {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-8px);
}

.workspace.sidebar-collapsed .sidebar .panel-head,
.workspace.sidebar-collapsed .sidebar-footer {
  display: none;
}

.workspace.sidebar-collapsed .sidebar .sidebar-logout-icon-btn {
  display: grid;
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 12px;
}

.workspace.sidebar-collapsed .sidebar .sidebar-logout-icon-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.workspace.sidebar-collapsed .sidebar .nav-title {
  display: none;
}

.workspace.sidebar-collapsed .sidebar .nav-menu {
  margin-top: 0;
  gap: 10px;
  align-items: center;
  padding-right: 0;
  overflow-x: hidden;
}

.workspace.sidebar-collapsed .sidebar .nav-stage-group {
  width: 100%;
  display: flex;
  justify-content: center;
}

.workspace.sidebar-collapsed .sidebar .nav-stage-row {
  width: 100%;
  display: flex;
  justify-content: center;
}

.workspace.sidebar-collapsed .sidebar .nav-item {
  width: 58px;
  min-height: 50px;
  padding: 10px;
  border-radius: 14px;
  justify-content: center;
  gap: 0;
}

.workspace.sidebar-collapsed .sidebar .nav-icon {
  width: 100%;
  height: 100%;
  flex: 1 1 auto;
  border: none;
  background: transparent;
  border-radius: 0;
  color: #e3ebfa;
}

.workspace.sidebar-collapsed .sidebar .nav-icon svg {
  width: 19px;
  height: 19px;
}

.workspace.sidebar-collapsed .sidebar .nav-item.is-active .nav-icon {
  border: none;
  background: transparent;
  color: var(--accent);
}

.workspace.sidebar-collapsed .sidebar .nav-item.nav-config {
  margin-top: 0;
}

.workspace.sidebar-collapsed .sidebar .nav-config-wrap {
  margin-top: auto;
  padding-top: 10px;
  width: 100%;
}

.workspace.sidebar-collapsed .sidebar .nav-stage-toggle,
.workspace.sidebar-collapsed .sidebar .nav-thread-list {
  display: none !important;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #161d29;
  border: 1px solid #394254;
  font-weight: 800;
  font-size: 0.88rem;
  color: #f4f6fb;
}

.sidebar-user-name {
  font-size: 0.9rem;
  line-height: 1.2;
}

.sidebar-version {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-refresh,
.sidebar-logout {
  width: 100%;
}

.work-area {
  min-width: 0;
  height: 100%;
  min-height: 0;
}

.mode-view {
  display: none;
}

.mode-view.is-active {
  display: block;
  height: 100%;
  min-width: 0;
  min-height: 0;
}

.config-panel {
  height: 100%;
  min-height: 0;
  overflow: auto;
}

.prompt-preview {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0f1319;
  padding: 12px;
  white-space: pre-wrap;
  font-size: 0.83rem;
  line-height: 1.45;
}

.chat-panel {
  height: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto auto;
  column-gap: 10px;
  gap: 8px;
  transition: grid-template-columns 280ms cubic-bezier(0.22, 1, 0.36, 1), column-gap 280ms cubic-bezier(0.22, 1, 0.36, 1);
}

.chat-header {
  grid-column: 1 / -1;
  grid-row: 1;
}

.flow-strip {
  grid-column: 1 / -1;
  grid-row: 2;
}

.artifact-live {
  grid-column: 1 / -1;
  grid-row: 3;
}

.chat-zone {
  grid-column: 1;
  grid-row: 4;
}

.attachments {
  grid-column: 1;
  grid-row: 5;
}

.chat-composer {
  grid-column: 1;
  grid-row: 6;
}

.thread-history-panel {
  grid-column: 2;
  grid-row: 4 / 7;
  position: relative;
  width: 280px;
  min-width: 280px;
  max-width: 280px;
  min-height: 0;
  border: 1px solid rgba(118, 132, 157, 0.24);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(16, 22, 34, 0.96), rgba(10, 14, 23, 0.96)),
    radial-gradient(circle at 20% 0%, rgba(255, 255, 255, 0.08), transparent 48%);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  transition:
    border-color 220ms ease,
    box-shadow 220ms ease,
    transform 280ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 220ms ease;
}

.thread-history-head {
  padding: 10px 52px 10px 10px;
  border-bottom: 1px solid rgba(124, 138, 162, 0.24);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.thread-history-copy {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.thread-history-copy strong {
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.thread-history-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 26px;
  height: 56px;
  min-width: 26px;
  border-radius: 999px;
  border-color: rgba(122, 136, 162, 0.28);
  background: rgba(18, 26, 40, 0.48);
  color: #b8c4d9;
  opacity: 0.88;
  z-index: 3;
  transition: opacity 180ms ease, background 180ms ease, border-color 180ms ease;
}

.thread-history-toggle:hover,
.thread-history-toggle:focus-visible {
  opacity: 1;
  background: rgba(24, 34, 51, 0.78);
  border-color: rgba(156, 172, 198, 0.42);
}

.thread-history-toggle svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.thread-history-create {
  width: 34px;
  height: 34px;
  min-width: 34px;
  grid-column: auto;
  padding: 0;
}

.thread-history-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, 34px);
  justify-content: end;
  gap: 8px;
}

.thread-history-clear {
  width: 34px;
  height: 34px;
  min-width: 34px;
  padding: 0;
}

.thread-history-list {
  min-height: 0;
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px 10px 10px;
  scrollbar-width: auto;
  scrollbar-color: rgba(146, 161, 188, 0.58) rgba(14, 21, 33, 0.22);
}

.thread-history-list::-webkit-scrollbar {
  width: 12px;
}

.thread-history-list::-webkit-scrollbar-track {
  background: rgba(14, 21, 33, 0.22);
  border-radius: 999px;
}

.thread-history-list::-webkit-scrollbar-thumb {
  background: rgba(146, 161, 188, 0.58);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.thread-history-list::-webkit-scrollbar-thumb:hover {
  background: rgba(176, 191, 220, 0.74);
  border: 2px solid transparent;
  background-clip: padding-box;
}

.thread-history-list.has-overflow {
  border-right: 1px solid rgba(120, 136, 163, 0.26);
}

.thread-history-panel.has-thread-overflow::after {
  content: "";
  position: absolute;
  top: 70px;
  right: 1px;
  bottom: 12px;
  width: 2px;
  border-radius: 999px;
  background: rgba(158, 175, 204, 0.24);
  pointer-events: none;
}

.thread-history-item {
  flex: 0 0 auto;
  width: 100%;
  min-height: 58px;
  border: 1px solid rgba(123, 137, 162, 0.32);
  border-radius: 12px;
  background: #121a27;
  color: var(--ink);
  padding: 0;
  text-align: left;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 0;
  gap: 0;
  font-family: inherit;
  overflow: hidden;
}

.thread-history-item-avatar {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid rgba(138, 152, 177, 0.38);
  background: #172133;
  display: grid;
  place-items: center;
  color: #d7e1f2;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.thread-history-item-select {
  width: 100%;
  min-height: 58px;
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
  padding: 9px 10px;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  align-items: center;
  column-gap: 8px;
  row-gap: 5px;
  font-family: inherit;
}

.thread-history-item-delete {
  width: 34px;
  height: 100%;
  min-height: 58px;
  border: none;
  background: rgba(16, 22, 34, 0.45);
  color: #d2dced;
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, background 160ms ease, color 160ms ease;
}

.thread-history-item-actions {
  display: grid;
  grid-template-columns: 34px 34px 34px;
  align-items: stretch;
  align-self: stretch;
}

.thread-history-item-transfer {
  width: 34px;
  height: 100%;
  min-height: 58px;
  border: none;
  background: rgba(16, 22, 34, 0.45);
  color: #d2dced;
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, background 160ms ease, color 160ms ease;
}

.thread-history-item-rename {
  width: 34px;
  height: 100%;
  min-height: 58px;
  border: none;
  background: rgba(16, 22, 34, 0.45);
  color: #d2dced;
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, background 160ms ease, color 160ms ease;
}

.thread-history-item-transfer svg,
.thread-history-item-rename svg,
.thread-history-item-delete svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.thread-history-item-transfer:hover,
.thread-history-item-transfer:focus-visible {
  background: rgba(106, 188, 255, 0.18);
  color: #def5ff;
  outline: none;
}

.thread-history-item-rename:hover,
.thread-history-item-rename:focus-visible {
  background: rgba(var(--accent-rgb), 0.22);
  color: #fff3fc;
  outline: none;
}

.thread-history-item-delete:hover,
.thread-history-item-delete:focus-visible {
  background: rgba(226, 96, 110, 0.2);
  color: #ffd6dc;
  outline: none;
}

.thread-history-item:hover .thread-history-item-transfer,
.thread-history-item:focus-within .thread-history-item-transfer,
.thread-history-item.is-active .thread-history-item-transfer,
.thread-history-item:hover .thread-history-item-rename,
.thread-history-item:focus-within .thread-history-item-rename,
.thread-history-item.is-active .thread-history-item-rename,
.thread-history-item:hover .thread-history-item-delete,
.thread-history-item:focus-within .thread-history-item-delete,
.thread-history-item.is-active .thread-history-item-delete {
  opacity: 1;
  pointer-events: auto;
}

.thread-history-item:hover,
.thread-history-item:focus-visible {
  border-color: rgba(var(--accent-rgb), 0.62);
  outline: none;
}

.thread-history-item:focus-within {
  border-color: rgba(var(--accent-rgb), 0.62);
  box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.16);
}

.thread-history-item.is-active {
  border-color: rgba(var(--accent-rgb), 0.78);
  box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.18);
  background: linear-gradient(145deg, #162134, #131c2c);
}

.thread-history-item-top {
  display: flex;
  align-items: center;
  gap: 0;
  min-width: 0;
}

.thread-history-item-label {
  min-width: 0;
  font-size: 0.83rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.thread-history-item-meta {
  grid-column: 2;
  color: #aeb9cf;
  font-size: 0.7rem;
  display: grid;
  gap: 2px;
}

.thread-history-item-id {
  display: block;
  max-width: 170px;
  font-family: "Space Grotesk", "Manrope", sans-serif;
  letter-spacing: 0.02em;
  color: #c6d2e8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.thread-history-item-updated {
  display: block;
}

.chat-panel.thread-history-collapsed {
  grid-template-columns: minmax(0, 1fr) 60px;
}

.chat-panel.thread-history-collapsed .thread-history-panel {
  transform: translateX(0);
  width: 60px;
  min-width: 60px;
  max-width: 60px;
}

.thread-history-panel.is-collapsed .thread-history-copy,
.thread-history-panel.is-collapsed .thread-history-actions,
.thread-history-panel.is-collapsed .thread-history-item-top,
.thread-history-panel.is-collapsed .thread-history-item-meta {
  display: none;
}

.thread-history-panel.is-collapsed .thread-history-head {
  grid-template-columns: 1fr;
  justify-items: center;
  padding: 8px;
}

.thread-history-panel.is-collapsed .thread-history-list {
  padding: 8px;
  gap: 6px;
}

.thread-history-panel.is-collapsed .thread-history-item {
  width: 42px;
  height: 42px;
  grid-template-columns: 1fr;
  place-items: center;
  padding: 0;
  justify-self: center;
}

.thread-history-panel.is-collapsed .thread-history-item-select {
  width: 100%;
  height: 100%;
  grid-template-columns: 1fr;
  place-items: center;
  padding: 0;
}

.thread-history-panel.is-collapsed .thread-history-item-delete {
  display: none;
}

.thread-history-panel.is-collapsed .thread-history-item-transfer,
.thread-history-panel.is-collapsed .thread-history-item-rename,
.thread-history-panel.is-collapsed .thread-history-item-actions {
  display: none;
}

.thread-history-panel.is-collapsed .thread-history-item-avatar {
  width: 24px;
  height: 24px;
}

.chat-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.chat-header h2 {
  margin-top: 4px;
  font-size: clamp(1.2rem, 1.8vw, 1.55rem);
}

.chat-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.icon-only-btn {
  width: 42px;
  height: 42px;
  padding: 0;
  display: grid;
  place-items: center;
}

.icon-only-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.prompt-btn {
  white-space: nowrap;
}

.chat-options-shell {
  position: relative;
}

.chat-options-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(240px, 74vw);
  border: 1px solid rgba(120, 136, 165, 0.42);
  border-radius: 12px;
  background: linear-gradient(160deg, rgba(16, 23, 35, 0.98), rgba(12, 18, 29, 0.98));
  box-shadow:
    0 16px 34px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  padding: 6px;
  display: grid;
  gap: 2px;
  z-index: 50;
}

.chat-options-item {
  width: 100%;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  text-align: left;
  font: inherit;
  font-size: 0.87rem;
  font-weight: 700;
  padding: 9px 10px;
  cursor: pointer;
}

.chat-options-item:hover,
.chat-options-item:focus-visible {
  background: rgba(72, 88, 116, 0.38);
  outline: none;
}

.chat-options-item.is-danger {
  color: #f6c9ce;
}

.chat-options-item.is-danger:hover,
.chat-options-item.is-danger:focus-visible {
  background: rgba(128, 46, 60, 0.34);
}

.artifact-live {
  border: 1px solid rgba(130, 144, 168, 0.28);
  border-radius: 14px;
  padding: 10px;
  background: linear-gradient(160deg, rgba(17, 24, 35, 0.95), rgba(13, 19, 29, 0.95));
}

.artifact-live-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.artifact-live-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.artifact-live-head strong {
  font-size: 0.88rem;
}

.artifact-live-toggle {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
}

.artifact-live-toggle svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.artifact-live-meta {
  color: var(--muted);
  font-size: 0.76rem;
}

.artifact-live-body {
  margin-top: 8px;
  display: grid;
  gap: 8px;
}

.artifact-live.is-collapsed .artifact-live-body {
  display: none;
}

.artifact-empty {
  margin: 0;
  border: 1px dashed rgba(120, 134, 158, 0.42);
  border-radius: 10px;
  padding: 8px 10px;
  color: var(--muted);
  font-size: 0.8rem;
}

.chat-zone {
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
  border: 1px solid rgba(118, 132, 157, 0.24);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(17, 23, 34, 0.96), rgba(10, 15, 24, 0.96)),
    radial-gradient(circle at 14% 0%, rgba(255, 255, 255, 0.08), transparent 45%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    inset 0 -80px 120px rgba(4, 8, 16, 0.45);
  overflow: hidden;
}

.chat-zone-head {
  padding: 10px 12px;
  border-bottom: 1px solid #293141;
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #c4ccda;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.chat-zone-head-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-zone-head-action {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
}

.chat-zone-head-action svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chat-log {
  padding: 12px;
  min-height: 0;
  height: 100%;
  max-height: none;
  min-width: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  align-content: flex-start;
  gap: 10px;
}

.chat-day-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px 0;
  color: #97a3b9;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.chat-day-divider::before,
.chat-day-divider::after {
  content: "";
  flex: 1 1 auto;
  border-top: 1px solid rgba(122, 136, 161, 0.35);
}

.chat-day-divider span {
  white-space: nowrap;
}

.chat-message {
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
}

.chat-message.user {
  justify-content: flex-end;
  flex-direction: row;
}

.chat-message.user .bubble {
  order: 2;
}

.chat-message.user .bubble-avatar {
  order: 1;
}

.chat-message.assistant .bubble {
  order: 1;
}

.chat-message.assistant .bubble-avatar {
  order: 2;
}

.bubble-avatar {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border: 1px solid rgba(113, 129, 154, 0.52);
  background: #111828;
  color: #d8deea;
}

.bubble-avatar svg {
  width: 16px;
  height: 16px;
  display: block;
}

.bubble-avatar svg path,
.bubble-avatar svg circle,
.bubble-avatar svg rect {
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bubble-avatar.assistant {
  background: #121a2a;
  color: #c3d0e7;
}

.bubble-avatar.user {
  background: rgba(var(--accent-rgb), 0.15);
  color: rgba(var(--accent-rgb), 0.95);
}

.bubble {
  display: block;
  width: auto;
  max-width: 92%;
  height: auto;
  flex: 0 1 auto;
  white-space: normal;
  word-break: break-word;
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 0.86rem;
  line-height: 1.35;
}

.bubble.user {
  margin-left: 0;
  max-width: min(80%, 760px);
  border: 1px solid rgba(140, 156, 186, 0.5);
  background: linear-gradient(180deg, #1c2b42, #182538);
}

.bubble.assistant {
  margin-right: 0;
  width: auto;
  max-width: 92%;
  border: 1px solid rgba(102, 115, 138, 0.38);
  background: #141a24;
}

.bubble-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bubble-mainline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  column-gap: 8px;
  max-width: 100%;
}

.bubble-text {
  white-space: normal;
  min-width: 0;
  display: block;
}

.bubble-markdown {
  display: block;
}

.bubble-markdown p {
  margin: 0;
}

.bubble-markdown p:last-child {
  display: block;
}

.bubble-meta {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  margin: 0;
}

.bubble-time {
  font-size: 0.68rem;
  color: #9aa5ba;
  letter-spacing: 0.01em;
  line-height: 1;
  transform: translateY(1px);
  white-space: nowrap;
}

.bubble-markdown .bubble-heading {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.bubble-markdown .bubble-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
}

.bubble-markdown .bubble-list.ordered {
  list-style: decimal;
}

.bubble-markdown code {
  font-family: "SFMono-Regular", "Menlo", "Monaco", "Consolas", "Liberation Mono", monospace;
  font-size: 0.78rem;
  background: rgba(31, 41, 59, 0.82);
  border: 1px solid rgba(113, 132, 165, 0.4);
  border-radius: 6px;
  padding: 1px 6px;
}

.bubble-markdown pre {
  margin: 0;
  padding: 10px;
  border-radius: 10px;
  background: rgba(10, 15, 25, 0.94);
  border: 1px solid rgba(96, 116, 150, 0.34);
  overflow: auto;
}

.bubble-markdown pre code {
  border: none;
  background: transparent;
  padding: 0;
  font-size: 0.75rem;
  line-height: 1.45;
}

.bubble-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.bubble-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 280px;
  font-size: 0.8rem;
}

.bubble-table th,
.bubble-table td {
  border: 1px solid rgba(114, 132, 162, 0.42);
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
}

.bubble-table th {
  background: rgba(26, 35, 52, 0.92);
  font-weight: 800;
}

.bubble-table td {
  background: rgba(14, 20, 31, 0.72);
}

.bubble.is-thinking {
  opacity: 0.95;
}

.is-thinking-row .bubble-avatar {
  opacity: 0.92;
}

.thinking-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.bubble-spinner {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid rgba(182, 196, 221, 0.35);
  border-top-color: rgba(var(--accent-rgb), 0.9);
  animation: bubble-spin 760ms linear infinite;
}

@keyframes bubble-spin {
  to {
    transform: rotate(360deg);
  }
}

.bubble-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

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

.bubble-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  border: 1px solid rgba(126, 144, 173, 0.48);
  border-radius: 10px;
  background: rgba(17, 25, 38, 0.9);
  color: #e7edf8;
  padding: 6px 10px;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
}

.bubble-action-btn:hover,
.bubble-action-btn:focus-visible {
  border-color: rgba(var(--accent-rgb), 0.58);
  background: rgba(var(--accent-rgb), 0.1);
  outline: none;
}

.bubble-action-icon {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.bubble-action-icon svg {
  width: 14px;
  height: 14px;
  display: block;
}

.bubble-action-icon svg path {
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bubble-attachment {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
  padding: 5px 8px;
  border-radius: 10px;
  border: 1px solid rgba(126, 144, 173, 0.5);
  background: rgba(25, 35, 52, 0.64);
  color: inherit;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.1;
}

.bubble-attachment-icon {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  opacity: 0.92;
}

.bubble-attachment-icon svg {
  width: 14px;
  height: 14px;
  display: block;
}

.bubble-attachment-icon svg path {
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bubble-attachment-name {
  min-width: 0;
  max-width: min(260px, 48vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.attachment-chip {
  border: 1px solid #3f4757;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.77rem;
  background: #151b25;
}

.chat-composer {
  border: 1px solid rgba(118, 132, 157, 0.26);
  border-radius: 14px;
  background: #0f1319;
  padding: 8px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.clip-btn,
.ghost-btn,
.primary-btn {
  border-radius: 12px;
  border: none;
  font-family: inherit;
  font-weight: 800;
  font-size: 0.88rem;
  cursor: pointer;
}

.clip-btn {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(120, 134, 157, 0.34);
  background: #181d26;
  color: var(--ink);
  font-size: 1.15rem;
}

.drive-btn {
  font-size: 0;
}

.drive-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.send-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  padding: 0;
  display: grid;
  place-items: center;
}

.send-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.send-btn.is-sending {
  opacity: 0.74;
}

.composer-input {
  width: 100%;
  min-width: 0;
  resize: none;
  border: 1px solid rgba(118, 132, 157, 0.3);
  border-radius: 10px;
  background: #10141a;
  color: var(--ink);
  padding: 10px;
  font-family: inherit;
  font-size: 0.9rem;
  min-height: 44px;
  max-height: 130px;
}

.composer-input:focus {
  border-color: var(--accent);
  outline: 1px solid rgba(var(--accent-rgb), 0.32);
}

.ghost-btn {
  background: #181d26;
  border: 1px solid rgba(120, 134, 157, 0.3);
  color: var(--ink);
  padding: 10px 12px;
}

.ghost-btn.danger {
  border-color: rgba(193, 128, 140, 0.42);
  background: #20151a;
  color: #ffd9df;
}

.primary-btn {
  background: var(--accent);
  color: var(--accent-ink);
  padding: 10px 14px;
  box-shadow: 0 8px 18px rgba(var(--accent-rgb), 0.18);
}

.primary-btn:hover,
.primary-btn:focus-visible {
  filter: brightness(1.05);
}

.config-note {
  margin: 12px 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.config-actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.config-actions .ghost-btn,
.config-actions .primary-btn {
  padding: 9px 12px;
}

.config-hub-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.config-hub-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  text-align: left;
  width: 100%;
  min-height: 110px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(118, 132, 157, 0.24);
  background: linear-gradient(180deg, rgba(24, 30, 40, 0.92), rgba(16, 20, 27, 0.92));
  color: var(--ink);
  overflow: hidden;
}

.config-hub-card.is-active {
  border-color: rgba(var(--accent-rgb), 0.42);
  box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.16), 0 18px 36px rgba(0, 0, 0, 0.18);
}

.config-hub-card:disabled {
  opacity: 0.46;
  cursor: not-allowed;
}

.config-hub-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid rgba(118, 132, 157, 0.24);
  background: rgba(255, 255, 255, 0.03);
}

.config-hub-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.config-hub-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.config-hub-copy strong {
  font-size: 1rem;
}

.config-hub-copy span {
  font-size: 0.86rem;
  line-height: 1.35;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.drive-open-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.drive-open-btn svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.openclaw-admin-list {
  display: grid;
  gap: 12px;
}

.openclaw-admin-toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

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

.openclaw-runtime-card {
  border: 1px solid rgba(118, 132, 157, 0.2);
  border-radius: 14px;
  background: rgba(19, 24, 33, 0.72);
  padding: 12px 14px;
  display: grid;
  gap: 6px;
}

.openclaw-admin-item {
  border: 1px solid rgba(118, 132, 157, 0.24);
  border-radius: 14px;
  background: #131821;
  padding: 14px;
}

.openclaw-admin-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.openclaw-admin-item-head .primary-btn {
  flex: 0 0 auto;
}

.openclaw-admin-item .config-item-meta + .config-item-meta {
  margin-top: 4px;
}

.openclaw-log-preview {
  margin: 12px 0 0;
  border: 1px solid rgba(118, 132, 157, 0.2);
  border-radius: 14px;
  background: rgba(8, 10, 14, 0.92);
  color: #d7deeb;
  font-size: 0.78rem;
  line-height: 1.45;
  padding: 12px 14px;
  min-height: 120px;
  max-height: 220px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 880px) {
  .openclaw-runtime-grid {
    grid-template-columns: 1fr;
  }
}

.config-view-panel {
  margin-top: 14px;
  display: grid;
  gap: 14px;
  border: 1px solid rgba(118, 132, 157, 0.24);
  border-radius: 18px;
  background: rgba(16, 20, 27, 0.72);
  padding: 16px;
}

.config-view-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.config-view-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.config-inline-flow {
  border: 1px solid rgba(118, 132, 157, 0.2);
  border-radius: 16px;
  background: rgba(10, 14, 20, 0.72);
  padding: 14px;
  overflow: auto hidden;
}

.config-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid rgba(118, 132, 157, 0.2);
  border-radius: 16px;
}

.config-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  background: rgba(12, 16, 22, 0.82);
}

.config-table th,
.config-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(118, 132, 157, 0.14);
  text-align: left;
  vertical-align: top;
}

.config-table th {
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #aeb9ce;
  background: rgba(18, 23, 31, 0.95);
}

.config-table td {
  font-size: 0.86rem;
}

.config-table tbody tr:last-child td {
  border-bottom: 0;
}

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

.icon-action-btn,
.user-action-btn {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid rgba(118, 132, 157, 0.28);
  background: rgba(20, 26, 35, 0.88);
  color: var(--text);
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease, opacity 160ms ease;
  padding: 0;
}

.icon-action-btn:hover:not(:disabled),
.user-action-btn:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.38);
  background: rgba(28, 35, 46, 0.96);
  transform: translateY(-1px);
}

.icon-action-btn svg,
.user-action-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-action-btn.is-danger,
.user-action-btn.danger {
  color: #f2b5b5;
}

.icon-action-btn.is-danger:hover:not(:disabled),
.user-action-btn.danger:hover:not(:disabled) {
  border-color: rgba(255, 111, 111, 0.4);
  background: rgba(60, 24, 24, 0.9);
}

.icon-action-btn.is-blocked,
.icon-action-btn:disabled,
.user-action-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none;
}

.config-pagination {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  color: var(--muted);
  font-size: 0.82rem;
}

.config-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 98px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(118, 132, 157, 0.28);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.config-status-badge.is-active {
  background: rgba(35, 92, 62, 0.22);
  border-color: rgba(98, 190, 139, 0.36);
  color: #cef2dd;
}

.config-status-badge.is-disabled {
  background: rgba(112, 33, 45, 0.22);
  border-color: rgba(210, 98, 116, 0.34);
  color: #ffd1d8;
}

.config-integrations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.config-integration-card {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(118, 132, 157, 0.24);
  border-radius: 16px;
  background: #131821;
  padding: 16px;
}

.config-integration-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid rgba(118, 132, 157, 0.24);
  background: rgba(255, 255, 255, 0.03);
}

.config-integration-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.config-integration-copy {
  display: grid;
  gap: 6px;
}

.config-integration-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.icon-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.icon-choice {
  border: 1px solid rgba(124, 138, 162, 0.3);
  border-radius: 10px;
  background: #151b25;
  padding: 6px;
  cursor: pointer;
}

.icon-choice .nav-icon {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
}

.icon-choice.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.28);
}

.flow-overview {
  margin-top: 12px;
  border: 1px solid rgba(118, 132, 157, 0.24);
  border-radius: 14px;
  background:
    linear-gradient(160deg, rgba(17, 24, 36, 0.94), rgba(13, 18, 28, 0.94)),
    radial-gradient(circle at top right, rgba(var(--accent-rgb), 0.12), transparent 48%);
  padding: 12px;
}

.flow-head h4 {
  margin: 0;
  font-size: 0.95rem;
  font-family: "Space Grotesk", sans-serif;
}

.flow-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.flow-track {
  margin-top: 10px;
  padding: 4px 0 6px;
}

.flow-map-shell {
  border: 1px solid rgba(118, 132, 157, 0.2);
  border-radius: 14px;
  padding: 8px;
  background:
    linear-gradient(150deg, rgba(15, 22, 34, 0.95), rgba(11, 17, 27, 0.95)),
    radial-gradient(circle at top left, rgba(var(--accent-rgb), 0.13), transparent 52%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.flow-map {
  width: 100%;
  height: auto;
  display: block;
}

.flow-map-connector {
  fill: none;
  stroke: rgba(170, 185, 210, 0.78);
  stroke-width: 2.1;
}

.flow-map-connector-turn {
  stroke-dasharray: 2 0;
}

.flow-map-node rect {
  fill: url(#flowNodeFill);
  stroke: rgba(120, 136, 163, 0.35);
  stroke-width: 1.1;
}

.flow-map-node.is-decision rect {
  fill: rgba(41, 34, 49, 0.88);
  stroke: rgba(190, 163, 200, 0.48);
  stroke-dasharray: 5 4;
}

.flow-map-node.is-active-stage rect {
  stroke: rgba(var(--accent-rgb), 0.92);
  stroke-width: 1.5;
  filter: drop-shadow(0 0 7px rgba(var(--accent-rgb), 0.34));
}

.flow-map-step-dot {
  fill: rgba(19, 29, 44, 0.96);
  stroke: rgba(144, 162, 192, 0.52);
  stroke-width: 1;
}

.flow-map-step-index {
  fill: #d8e4f8;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.flow-map-stage-tag {
  fill: #d5deef;
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 800;
}

.flow-map-title-line {
  fill: #eef3ff;
  font-size: 0.86rem;
  font-weight: 800;
}

.flow-map-desc-line {
  fill: var(--muted);
  font-size: 0.72rem;
}

.flow-segment {
  display: flex;
  align-items: stretch;
  gap: 10px;
  flex: 0 0 auto;
}

.flow-node {
  width: 236px;
  border: 1px solid rgba(118, 132, 157, 0.28);
  border-radius: 13px;
  background: linear-gradient(150deg, #141c2a, #0f1622);
  padding: 11px 11px 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.flow-node.is-decision {
  border-style: dashed;
  background: linear-gradient(140deg, #222233, #171c29);
}

.flow-node.is-active-stage {
  border-color: rgba(var(--accent-rgb), 0.92);
  box-shadow:
    0 0 0 1px rgba(var(--accent-rgb), 0.28),
    0 10px 24px rgba(var(--accent-rgb), 0.14);
}

.flow-node-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.flow-node-icon.nav-icon {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border-radius: 7px;
  background: rgba(25, 35, 52, 0.9);
}

.flow-stage {
  display: inline-flex;
  align-items: center;
  padding: 3px 7px;
  border-radius: 999px;
  border: 1px solid rgba(142, 157, 183, 0.3);
  background: #1a2230;
  color: #d5deef;
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 800;
}

.flow-stage-control {
  background: #262029;
  border-color: rgba(188, 161, 191, 0.35);
  color: #f1deff;
}

.flow-node strong {
  display: block;
  margin-top: 9px;
  font-size: 0.9rem;
}

.flow-node p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.flow-arrow {
  position: relative;
  width: 24px;
  flex: 0 0 24px;
  align-self: center;
}

.flow-arrow > span {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(137, 152, 178, 0.2), rgba(137, 152, 178, 0.9));
}

.flow-arrow > span::after {
  content: "";
  position: absolute;
  right: 0;
  top: -3px;
  border-top: 3px solid transparent;
  border-bottom: 3px solid transparent;
  border-left: 5px solid rgba(137, 152, 178, 0.9);
}

.flow-empty {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.flow-strip {
  margin: 2px 0 6px;
  border: 1px solid rgba(118, 132, 157, 0.22);
  border-radius: 12px;
  background:
    linear-gradient(140deg, rgba(18, 25, 39, 0.92), rgba(13, 20, 32, 0.92)),
    radial-gradient(circle at left center, rgba(var(--accent-rgb), 0.18), transparent 55%);
  padding: 7px 9px;
}

.flow-strip-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}

.flow-strip-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.flow-strip-title {
  display: grid;
  gap: 1px;
}

.flow-strip-head strong {
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.flow-strip-head span {
  color: var(--muted);
  font-size: 0.7rem;
}

.flow-strip-open-btn {
  width: 36px;
  height: 36px;
}

.flow-strip-toggle-btn {
  width: 36px;
  height: 36px;
}

.flow-track-operacion {
  margin-top: 4px;
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  gap: 8px;
  overflow: visible;
  padding-bottom: 0;
  flex-wrap: wrap;
}

.flow-strip.is-collapsed .flow-track-operacion {
  display: none;
}

.stage-flow-segment {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.stage-flow-card {
  border: 1px solid rgba(124, 138, 162, 0.32);
  border-radius: 11px;
  background: #141b28;
  color: var(--ink);
  padding: 7px 9px;
  width: min(100%, 272px);
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}

.stage-flow-card:hover {
  border-color: rgba(var(--accent-rgb), 0.65);
}

.stage-flow-card.is-active {
  border-color: rgba(var(--accent-rgb), 0.9);
  background: linear-gradient(145deg, #1b2434, #161f2e);
  box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.2);
}

.stage-flow-icon.nav-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
}

.stage-flow-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.stage-flow-copy strong {
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: #bcc6d8;
  text-transform: uppercase;
}

.stage-flow-copy span {
  font-size: 0.78rem;
  line-height: 1.2;
  font-weight: 700;
}

.stage-flow-arrow {
  width: 20px;
  height: 1px;
  background: linear-gradient(90deg, rgba(132, 148, 176, 0.28), rgba(132, 148, 176, 0.9));
  position: relative;
}

.stage-flow-arrow::after {
  content: "";
  position: absolute;
  right: -1px;
  top: -3px;
  border-top: 3px solid transparent;
  border-bottom: 3px solid transparent;
  border-left: 5px solid rgba(132, 148, 176, 0.9);
}

.flow-track-full {
  margin-top: 10px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.config-list {
  margin-top: 12px;
  display: grid;
  gap: 10px;
  min-width: 0;
}

.config-item {
  border: 1px solid rgba(118, 132, 157, 0.24);
  border-radius: 12px;
  background: #0f1319;
  padding: 10px;
  overflow: hidden;
}

.config-item strong {
  display: block;
  margin-bottom: 6px;
  font-size: 0.9rem;
}

.config-item-meta {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.config-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.config-item-head strong {
  margin: 0;
}

.config-remove-btn {
  background: #20151a;
  border: 1px solid rgba(193, 128, 140, 0.4);
  color: #ffd9df;
  border-radius: 10px;
  padding: 6px 10px;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.78rem;
  cursor: pointer;
}

.config-grid {
  margin-top: 8px;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.config-field {
  display: grid;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--muted);
}

.config-field input,
.config-field select,
.config-field textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(118, 132, 157, 0.3);
  border-radius: 10px;
  background: #10141a;
  color: var(--ink);
  padding: 9px 10px;
  font-family: inherit;
  font-size: 0.85rem;
}

.config-field textarea {
  min-height: 90px;
  resize: vertical;
}

.config-field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.config-field-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.config-field-action-btn {
  min-height: 30px;
  padding: 6px 10px;
  font-size: 0.74rem;
}

.compact-icon-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.compact-icon-btn svg {
  width: 15px;
  height: 15px;
  display: block;
}

.icon-glyph {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 800;
  font-size: 0.86rem;
  line-height: 1;
}

.icon-glyph-italic {
  font-style: italic;
}

.config-section {
  display: grid;
  gap: 10px;
}

.config-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.config-grid.config-grid-users {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.config-user-card {
  background: linear-gradient(160deg, rgba(15, 19, 25, 0.98), rgba(11, 15, 22, 0.98));
}

.config-user-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(137, 151, 176, 0.28);
  background: rgba(18, 25, 37, 0.84);
  color: #dbe5f6;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

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

.stage-permission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}

.stage-permission-grid.is-disabled {
  opacity: 0.68;
}

.stage-permission-chip {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  column-gap: 10px;
  min-height: 72px;
  padding: 12px 14px;
  border: 1px solid rgba(118, 132, 157, 0.28);
  border-radius: 18px;
  background: #111722;
  color: #dbe3f2;
  cursor: pointer;
  font-size: 0.82rem;
  line-height: 1.35;
  overflow: hidden;
}

.stage-permission-chip input {
  margin: 0;
}

.stage-permission-chip span {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.stage-permission-chip.is-selected {
  border-color: rgba(var(--accent-rgb), 0.56);
  box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.14);
}

.config-inline-error {
  margin: 0;
  color: #ffc4cb;
  font-size: 0.82rem;
}

#save-config-btn {
  margin-top: 0;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  background: rgba(6, 8, 12, 0.68);
  backdrop-filter: blur(3px);
  padding: 20px;
}

.modal-backdrop:not([hidden]) {
  animation: modal-fade-in 200ms cubic-bezier(0.22, 1, 0.36, 1);
}

.modal-card {
  position: relative;
  width: min(760px, 94vw);
  max-height: 84vh;
  overflow: auto;
  border: 1px solid rgba(118, 132, 157, 0.26);
  border-radius: 20px;
  background: linear-gradient(160deg, rgba(18, 21, 28, 0.99), rgba(13, 16, 22, 0.99));
  box-shadow: var(--shadow);
  padding: 16px;
}

.modal-backdrop:not([hidden]) .modal-card {
  animation: modal-pop-in 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

.confirm-modal-card {
  width: min(520px, 94vw);
}

.confirm-modal-actions {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

@keyframes modal-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modal-pop-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.stage-modal-card {
  width: min(980px, 95vw);
}

.prompt-editor-modal-card {
  width: min(1180px, 96vw);
}

.prompt-editor-modal-card.is-fullscreen {
  width: min(1480px, 98vw);
  max-height: 94vh;
}

.thread-files-modal-card {
  width: min(1120px, 95vw);
}

.drive-modal-card {
  width: min(720px, 94vw);
}

.drive-connect-card {
  margin-top: 14px;
  border: 1px solid rgba(118, 132, 157, 0.3);
  border-radius: 14px;
  background: linear-gradient(145deg, #121927, #101721);
  padding: 16px;
  display: grid;
  gap: 14px;
}

.drive-search-field {
  max-width: 360px;
}

.drive-connect-state {
  display: grid;
  gap: 6px;
}

.drive-tenant-state {
  margin: 0;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.92rem;
}

.drive-folder-state {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.4;
  word-break: break-word;
}

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

.drive-connect-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.drive-connect-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.drive-status {
  margin: 12px 0 0;
  min-height: 19px;
  font-size: 0.83rem;
  color: var(--muted);
}

.drive-status[data-tone="ok"] {
  color: #c9f2d9;
}

.drive-status[data-tone="warn"] {
  color: #ffdfb3;
}

.drive-status[data-tone="error"] {
  color: #ffc3c9;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.modal-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.modal-copy {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.modal-loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  background: rgba(7, 10, 16, 0.72);
  backdrop-filter: blur(4px);
  border-radius: inherit;
}

.modal-loading-shell {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(118, 132, 157, 0.28);
  border-radius: 999px;
  padding: 12px 16px;
  background: rgba(17, 22, 31, 0.96);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.28);
}

.modal-loading-spinner {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-top-color: rgba(255, 255, 255, 0.92);
  animation: login-submit-spin 760ms linear infinite;
}

.ghost-btn.is-loading,
.primary-btn.is-loading {
  position: relative;
  pointer-events: none;
}

.ghost-btn.is-loading::before,
.primary-btn.is-loading::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  display: inline-block;
  animation: login-submit-spin 760ms linear infinite;
}

.stage-modal-body {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.prompt-editor-layout {
  margin-top: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  min-height: 520px;
}

.prompt-editor-field {
  min-width: 0;
}

.prompt-editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  min-height: 42px;
  border: 1px solid rgba(118, 132, 157, 0.3);
  border-radius: 12px 12px 0 0;
  background: #121824;
  padding: 8px 10px;
}

.prompt-editor-toolbar.ql-snow {
  border: 1px solid rgba(118, 132, 157, 0.3);
}

.prompt-editor-toolbar .ql-formats {
  margin-right: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.prompt-editor-toolbar .ql-picker,
.prompt-editor-toolbar .ql-picker-label,
.prompt-editor-toolbar .ql-picker-item,
.prompt-editor-toolbar .ql-stroke,
.prompt-editor-toolbar .ql-fill {
  color: #dce6f7;
  stroke: #dce6f7;
  fill: #dce6f7;
}

.prompt-editor-toolbar button,
.prompt-editor-toolbar .ql-picker-label {
  border-radius: 8px;
}

.prompt-editor-toolbar.ql-snow button {
  width: 30px;
  height: 30px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.prompt-editor-toolbar.ql-snow button svg {
  display: block;
  margin: 0 auto;
}

.prompt-editor-toolbar.ql-snow .ql-picker {
  display: inline-flex;
  align-items: center;
  height: 30px;
}

.prompt-editor-toolbar.ql-snow .ql-picker-label {
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.prompt-editor-toolbar.ql-snow .ql-picker-label svg {
  position: static;
  margin-left: 6px;
}

.prompt-editor-toolbar button:hover,
.prompt-editor-toolbar button:focus-visible,
.prompt-editor-toolbar .ql-picker-label:hover,
.prompt-editor-toolbar .ql-picker-label.ql-active,
.prompt-editor-toolbar button.ql-active {
  background: rgba(255, 255, 255, 0.08);
}

.prompt-editor-toolbar-actions {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.prompt-editor-status {
  color: var(--muted);
  font-size: 0.78rem;
  min-height: 18px;
}

.prompt-editor-surface {
  min-height: 520px;
  background: #10141a;
  border: 1px solid rgba(118, 132, 157, 0.3);
  border-top: none;
  border-radius: 0 0 12px 12px;
  overflow: hidden;
}

.prompt-editor-surface .ql-container {
  min-height: 520px;
  border: none;
  font-family: "Manrope", sans-serif;
  font-size: 0.94rem;
  line-height: 1.6;
  color: var(--ink);
}

.prompt-editor-surface .ql-editor {
  min-height: 520px;
  padding: 14px 16px 18px;
  color: var(--ink);
}

.prompt-editor-surface .ql-editor.ql-blank::before {
  color: rgba(189, 199, 216, 0.42);
  font-style: normal;
}

.prompt-editor-surface .ql-editor:focus {
  outline: none;
}

.prompt-editor-surface .ql-editor p,
.prompt-editor-surface .ql-editor ul,
.prompt-editor-surface .ql-editor ol,
.prompt-editor-surface .ql-editor blockquote,
.prompt-editor-surface .ql-editor h1,
.prompt-editor-surface .ql-editor h2,
.prompt-editor-surface .ql-editor h3,
.prompt-editor-surface .ql-editor h4,
.prompt-editor-surface .ql-editor h5,
.prompt-editor-surface .ql-editor h6 {
  margin: 0 0 0.8em;
}

.prompt-editor-surface .ql-editor ul,
.prompt-editor-surface .ql-editor ol {
  padding-left: 1.4em;
}

.prompt-editor-surface .ql-editor blockquote {
  border-left: 3px solid rgba(var(--accent-rgb), 0.55);
  padding-left: 12px;
  color: #d9e2f2;
}

.prompt-editor-surface .ql-editor code {
  border: 1px solid rgba(118, 132, 157, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  padding: 1px 6px;
  font-size: 0.84em;
}

.thread-files-layout {
  margin-top: 14px;
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 14px;
  min-height: 440px;
}

.thread-files-list-wrap,
.thread-files-preview-wrap {
  border: 1px solid rgba(122, 137, 166, 0.28);
  border-radius: 16px;
  background: rgba(11, 16, 24, 0.78);
  padding: 12px;
  min-width: 0;
}

.thread-files-list-wrap {
  display: grid;
  gap: 12px;
  align-content: start;
}

.thread-files-section {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.thread-files-list {
  display: grid;
  gap: 8px;
  max-height: 200px;
  overflow: auto;
  padding-right: 4px;
}

.thread-files-item {
  width: 100%;
  border: 1px solid rgba(118, 132, 157, 0.3);
  border-radius: 12px;
  background: #10161f;
  color: var(--text);
  padding: 10px 12px;
  display: grid;
  gap: 4px;
  text-align: left;
  cursor: pointer;
}

.thread-files-item-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 4px;
}

.drive-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: 24px;
}

.drive-breadcrumb-btn {
  border: 1px solid rgba(118, 132, 157, 0.3);
  border-radius: 999px;
  background: rgba(19, 24, 33, 0.9);
  color: var(--muted);
  padding: 4px 10px;
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
}

.drive-breadcrumb-btn.is-current {
  color: var(--ink);
  border-color: rgba(var(--accent-rgb), 0.4);
}

.drive-breadcrumb-sep {
  color: var(--muted);
  font-size: 0.8rem;
}

.thread-files-item-main {
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  text-align: left;
  font: inherit;
  cursor: pointer;
  display: grid;
  gap: 4px;
}

.thread-files-item-main:disabled {
  cursor: default;
  opacity: 1;
}

.thread-files-item-folder-note {
  color: var(--muted);
  font-size: 0.82rem;
}

.danger-icon-btn {
  color: #f3b0b0;
  border-color: rgba(239, 108, 108, 0.35);
}

.danger-icon-btn:hover,
.danger-icon-btn:focus-visible {
  color: #ffd5d5;
  border-color: rgba(239, 108, 108, 0.6);
  background: rgba(239, 108, 108, 0.12);
}

.thread-files-item:hover,
.thread-files-item:focus-visible,
.thread-files-item.is-active {
  border-color: rgba(var(--accent-rgb), 0.5);
  background: rgba(var(--accent-rgb), 0.08);
  outline: none;
}

.thread-files-item strong {
  font-size: 0.9rem;
  line-height: 1.25;
  word-break: break-word;
}

.thread-files-item-meta {
  color: var(--muted);
  font-size: 0.78rem;
}

.thread-files-empty {
  margin: 0;
  border: 1px dashed rgba(120, 134, 158, 0.42);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 0.84rem;
}

.thread-files-preview-wrap {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 10px;
}

.thread-files-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.thread-files-preview-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.thread-files-preview {
  margin: 0;
  min-height: 0;
  height: 100%;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.84rem;
}

.modal-field {
  display: grid;
  gap: 6px;
  color: #d8dee8;
  font-size: 0.86rem;
}

.modal-field input {
  border: 1px solid rgba(122, 137, 166, 0.35);
  border-radius: 10px;
  background: #0d121a;
  color: #f2f6ff;
  font-size: 0.92rem;
  padding: 11px 12px;
}

.modal-field select {
  border: 1px solid rgba(122, 137, 166, 0.35);
  border-radius: 10px;
  background: #0d121a;
  color: #f2f6ff;
  font-size: 0.92rem;
  padding: 11px 12px;
}

.modal-field input:focus {
  outline: 1px solid rgba(var(--accent-rgb), 0.35);
  border-color: rgba(var(--accent-rgb), 0.45);
}

.modal-field select:focus {
  outline: 1px solid rgba(var(--accent-rgb), 0.35);
  border-color: rgba(var(--accent-rgb), 0.45);
}

.user-stage-table-wrap {
  display: grid;
  gap: 10px;
}

.user-stage-table-wrap.is-disabled {
  opacity: 0.7;
}

.user-stage-table {
  min-width: 0;
}

.user-stage-table th:first-child,
.user-stage-table td:first-child {
  width: 92px;
  text-align: center;
}

.user-stage-table td:last-child,
.user-stage-table th:last-child {
  color: #9ca8bd;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.78rem;
}

.user-stage-table tr.is-selected td {
  background: rgba(var(--accent-rgb), 0.06);
}

.user-admin-modal-actions {
  justify-content: space-between;
  align-items: center;
}

.user-admin-modal-actions-left,
.user-admin-modal-actions-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.modal-actions-inline {
  display: flex;
  justify-content: flex-end;
}

.thread-transfer-list {
  display: grid;
  gap: 8px;
  max-height: 300px;
  overflow: auto;
  padding-right: 4px;
}

@media (max-width: 980px) {
  .prompt-editor-layout {
    grid-template-columns: minmax(0, 1fr);
    min-height: auto;
  }

  .prompt-editor-surface {
    min-height: 320px;
  }

}

.thread-transfer-option {
  width: 100%;
  border: 1px solid rgba(118, 132, 157, 0.3);
  border-radius: 12px;
  background: #10161f;
  color: var(--ink);
  text-align: left;
  padding: 10px 12px;
  cursor: pointer;
  display: grid;
  gap: 4px;
  transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.thread-transfer-option:hover,
.thread-transfer-option:focus-visible {
  border-color: rgba(var(--accent-rgb), 0.58);
  background: #121c2a;
  transform: translateY(-1px);
}

.thread-transfer-option.is-selected {
  border-color: rgba(var(--accent-rgb), 0.84);
  background: linear-gradient(150deg, rgba(var(--accent-rgb), 0.2), rgba(22, 31, 45, 0.94));
}

.thread-transfer-option-label {
  font-size: 0.9rem;
  font-weight: 800;
}

.thread-transfer-option-meta {
  font-size: 0.76rem;
  color: var(--muted);
}

.stage-widget {
  border: 1px solid rgba(118, 132, 157, 0.24);
  border-radius: 12px;
  background: #0f1319;
  padding: 12px;
}

.stage-widget-artifact {
  border-color: rgba(168, 193, 228, 0.35);
  background: linear-gradient(150deg, #121a27, #101622);
}

.stage-widget h4 {
  margin: 0;
  font-size: 0.9rem;
}

.stage-text {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.86rem;
}

.stage-kpi-grid {
  margin-top: 8px;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.stage-kpi-item {
  border: 1px solid rgba(118, 132, 157, 0.24);
  border-radius: 10px;
  background: #111723;
  padding: 8px 10px;
  display: grid;
  gap: 4px;
}

.stage-kpi-label {
  font-size: 0.74rem;
  color: var(--muted);
}

.stage-list {
  margin: 8px 0 0;
  padding-left: 18px;
  display: grid;
  gap: 5px;
  color: #d8dee8;
  font-size: 0.86rem;
}

.stage-empty {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.stage-table-wrap {
  margin-top: 8px;
  overflow: auto;
}

.stage-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 460px;
}

.stage-table th,
.stage-table td {
  border: 1px solid rgba(118, 132, 157, 0.24);
  padding: 7px 8px;
  text-align: left;
  font-size: 0.82rem;
  vertical-align: top;
}

.stage-table th {
  background: #161f2d;
  font-weight: 800;
}

.stage-markdown {
  margin: 8px 0 0;
  border: 1px solid rgba(118, 132, 157, 0.24);
  border-radius: 10px;
  background: #0f1319;
  padding: 10px;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "Manrope", sans-serif;
  font-size: 0.84rem;
  line-height: 1.45;
  color: #dde4f0;
}

body.modal-open {
  overflow: hidden;
}

.boot-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.boot-card {
  width: min(420px, 92vw);
  display: grid;
  justify-items: center;
  gap: 10px;
  border-radius: 22px;
  border: 1px solid rgba(118, 132, 157, 0.24);
  background: rgba(18, 20, 25, 0.92);
  padding: 28px 24px;
  box-shadow: var(--shadow);
  text-align: center;
}

.boot-card strong {
  font-size: 1.05rem;
}

.boot-card span {
  color: var(--muted);
  font-size: 0.88rem;
}

.boot-spinner {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-top-color: rgba(var(--accent-rgb), 0.92);
  animation: boot-spin 840ms linear infinite;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  animation: login-shell-fade-in 220ms ease-out both;
}

.login-card {
  width: min(440px, 95vw);
  border-radius: 24px;
  border: 1px solid rgba(118, 132, 157, 0.25);
  background: rgba(18, 20, 25, 0.95);
  padding: 24px;
  box-shadow: var(--shadow);
  animation: login-card-pop-in 340ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.login-hero {
  width: 100%;
  min-height: 116px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  border: 1px solid #303748;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.16), transparent 58%),
    linear-gradient(160deg, rgba(21, 24, 31, 0.98), rgba(12, 14, 18, 0.98));
  padding: 14px;
  margin-bottom: 14px;
}

.login-hero-logo {
  width: min(340px, 100%);
  height: 68px;
  object-fit: contain;
  animation: login-logo-glow 2s ease-in-out infinite;
}

.login-kicker {
  margin-top: 2px;
}

.login-client {
  margin-top: 4px;
}

.login-card h2 {
  margin: 6px 0 8px;
}

.login-copy {
  margin: 0 0 14px;
  color: var(--muted);
}

.login-form {
  display: grid;
  gap: 10px;
}

.login-submit-btn {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.login-submit-btn.is-loading {
  position: relative;
  pointer-events: none;
}

.login-submit-btn.is-loading::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid rgba(15, 16, 18, 0.35);
  border-top-color: rgba(15, 16, 18, 0.9);
  animation: login-submit-spin 760ms linear infinite;
}

.login-form label {
  display: grid;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 700;
}

.login-forgot {
  justify-self: end;
  color: var(--accent);
  font-size: 0.78rem;
  text-decoration: none;
  border-bottom: 1px dashed rgba(var(--accent-rgb), 0.45);
  padding-bottom: 2px;
}

.login-forgot:hover,
.login-forgot:focus-visible {
  filter: brightness(1.08);
  border-bottom-color: rgba(var(--accent-rgb), 0.8);
}

.login-form input {
  width: 100%;
  border: 1px solid rgba(118, 132, 157, 0.3);
  border-radius: 10px;
  padding: 10px;
  color: var(--ink);
  font-family: inherit;
  font-size: 0.9rem;
  background: #10141a;
}

.login-form input:focus {
  border-color: var(--accent);
  outline: 1px solid rgba(var(--accent-rgb), 0.32);
}

.login-hint {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.login-error {
  min-height: 1.2em;
  margin: 0;
  color: var(--danger);
  font-size: 0.82rem;
}

@keyframes login-submit-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes boot-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes login-shell-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes login-card-pop-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes login-logo-glow {
  0%,
  100% {
    filter: drop-shadow(0 0 0 rgba(255, 255, 255, 0));
  }
  50% {
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.2));
  }
}

html[data-profile="miacom"] .login-card {
  border-color: rgba(var(--accent-rgb), 0.3);
  background:
    linear-gradient(160deg, rgba(22, 26, 36, 0.9), rgba(18, 22, 30, 0.9)),
    rgba(18, 20, 25, 0.76);
  backdrop-filter: blur(4px);
  box-shadow:
    0 30px 60px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(var(--accent-rgb), 0.14);
}

html[data-profile="miacom"] .login-shell {
  background:
    linear-gradient(145deg, rgba(13, 16, 25, 0.65), rgba(22, 12, 22, 0.58)),
    url("assets/miacom-login-bg.jpeg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

html[data-profile="miacom"] .topbar {
  margin-bottom: 6px;
}

html[data-profile="miacom"] .brand-logo-wrap {
  width: clamp(78px, 7.4vw, 112px);
  min-width: clamp(78px, 7.4vw, 112px);
  padding: 3px;
  overflow: visible;
  border-color: rgba(var(--accent-rgb), 0.52);
  background:
    radial-gradient(circle at 50% 10%, rgba(var(--accent-rgb), 0.2), transparent 62%),
    linear-gradient(160deg, rgba(16, 21, 32, 0.96), rgba(10, 14, 22, 0.96));
}

html[data-profile="miacom"] .brand-logo {
  max-height: clamp(74px, 8vw, 110px);
  width: 100%;
  height: auto;
  aspect-ratio: auto;
  object-fit: contain;
  transform: none;
}

html[data-profile="miacom"] .login-hero {
  min-height: 132px;
  padding: 10px 12px;
  border-color: rgba(var(--accent-rgb), 0.28);
  background:
    radial-gradient(circle at 50% 0%, rgba(var(--accent-rgb), 0.22), transparent 62%),
    linear-gradient(160deg, rgba(21, 24, 31, 0.98), rgba(12, 14, 18, 0.98));
}

html[data-profile="miacom"] .login-hero-logo {
  width: min(220px, 100%);
  height: auto;
  max-height: 112px;
  border-radius: 14px;
  border: 1px solid rgba(var(--accent-rgb), 0.65);
  background:
    radial-gradient(circle at 50% 8%, rgba(var(--accent-rgb), 0.16), transparent 62%),
    linear-gradient(165deg, rgba(16, 22, 35, 0.98), rgba(9, 14, 24, 0.98));
  padding: 6px;
  object-fit: contain;
  box-shadow: 0 8px 20px rgba(var(--accent-rgb), 0.2);
}

html[data-profile="miacom"] body {
  background: radial-gradient(circle at top left, #3a465f 0%, #26334a 42%, #1a2435 100%);
}

html[data-profile="miacom"] .bg-blur-a {
  background: rgba(var(--accent-rgb), 0.2);
}

html[data-profile="miacom"] .bg-blur-b {
  background: rgba(170, 188, 220, 0.16);
}

html[data-profile="miacom"] .panel {
  background: linear-gradient(160deg, rgba(35, 45, 64, 0.97), rgba(27, 36, 52, 0.97));
  border-color: rgba(154, 171, 198, 0.28);
}

html[data-profile="miacom"] .sidebar-footer {
  border-top-color: rgba(147, 165, 194, 0.35);
}

html[data-profile="miacom"] .avatar {
  background: #24324a;
  border-color: rgba(170, 188, 216, 0.45);
}

html[data-profile="miacom"] .nav-item {
  background: linear-gradient(155deg, #1f2d45, #1a273c);
  border-color: rgba(152, 173, 207, 0.42);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

html[data-profile="miacom"] .nav-item:hover {
  background: linear-gradient(155deg, #273852, #21324a);
  border-color: rgba(188, 206, 235, 0.65);
}

html[data-profile="miacom"] .nav-item.is-active {
  background:
    radial-gradient(circle at 8% 50%, rgba(224, 32, 118, 0.2), transparent 36%),
    linear-gradient(140deg, #2b3d59, #24354f);
  border-color: rgba(224, 32, 118, 0.95);
  box-shadow:
    0 0 0 1px rgba(224, 32, 118, 0.26),
    0 8px 20px rgba(224, 32, 118, 0.22);
}

html[data-profile="miacom"] .nav-icon {
  background: #26354d;
  border-color: rgba(160, 178, 206, 0.46);
}

html[data-profile="miacom"] .nav-item.is-active .nav-icon {
  background: #2f3f5a;
}

html[data-profile="miacom"] .chat-zone {
  border-color: rgba(154, 177, 213, 0.45);
  background:
    linear-gradient(180deg, rgba(26, 38, 58, 0.98), rgba(19, 29, 45, 0.98)),
    radial-gradient(circle at 14% 0%, rgba(214, 225, 246, 0.16), transparent 48%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    inset 0 -90px 130px rgba(10, 16, 28, 0.48);
}

html[data-profile="miacom"] .chat-zone-head {
  border-bottom-color: rgba(154, 171, 198, 0.36);
  color: #f2f6ff;
  background: linear-gradient(180deg, rgba(37, 53, 81, 0.96), rgba(30, 44, 68, 0.94));
}

html[data-profile="miacom"] .bubble.user {
  background: linear-gradient(145deg, rgba(74, 52, 99, 0.95), rgba(61, 44, 82, 0.95));
  border-color: rgba(255, 145, 205, 0.75);
  color: #fff5fb;
}

html[data-profile="miacom"] .bubble.assistant {
  background: linear-gradient(150deg, rgba(41, 59, 88, 0.94), rgba(33, 48, 73, 0.94));
  border-color: rgba(165, 190, 228, 0.56);
  color: #f0f6ff;
  box-shadow: inset 3px 0 0 rgba(150, 182, 232, 0.42);
}

html[data-profile="miacom"] .chat-composer,
html[data-profile="miacom"] .config-item,
html[data-profile="miacom"] .stage-widget,
html[data-profile="miacom"] .stage-markdown,
html[data-profile="miacom"] .prompt-preview {
  background: #1b2740;
  border-color: rgba(163, 183, 215, 0.42);
}

html[data-profile="miacom"] .composer-input,
html[data-profile="miacom"] .config-field input,
html[data-profile="miacom"] .config-field select,
html[data-profile="miacom"] .config-field textarea,
html[data-profile="miacom"] .login-form input {
  background: #eef3ff;
  border-color: rgba(109, 138, 191, 0.88);
  color: #1d2b44;
}

html[data-profile="miacom"] .composer-input::placeholder,
html[data-profile="miacom"] .config-field input::placeholder,
html[data-profile="miacom"] .config-field textarea::placeholder,
html[data-profile="miacom"] .login-form input::placeholder {
  color: #54698f;
}

html[data-profile="miacom"] .composer-input:focus,
html[data-profile="miacom"] .config-field input:focus,
html[data-profile="miacom"] .config-field select:focus,
html[data-profile="miacom"] .config-field textarea:focus,
html[data-profile="miacom"] .login-form input:focus {
  border-color: #e02076;
  outline: 2px solid rgba(224, 32, 118, 0.36);
  outline-offset: 0;
}

html[data-profile="miacom"] .clip-btn,
html[data-profile="miacom"] .ghost-btn {
  background: linear-gradient(155deg, #32486f, #2a3e61);
  border: 1px solid rgba(180, 201, 233, 0.66);
  color: #f3f8ff;
  box-shadow: 0 8px 16px rgba(15, 24, 40, 0.35);
}

html[data-profile="miacom"] .clip-btn:hover,
html[data-profile="miacom"] .ghost-btn:hover {
  filter: brightness(1.08);
}

html[data-profile="miacom"] .clip-btn:focus-visible,
html[data-profile="miacom"] .ghost-btn:focus-visible {
  outline: 2px solid rgba(224, 32, 118, 0.38);
  outline-offset: 1px;
}

html[data-profile="miacom"] .primary-btn {
  background: linear-gradient(135deg, #ff3b94, #e02076);
  color: #ffffff;
  box-shadow:
    0 10px 22px rgba(224, 32, 118, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

html[data-profile="miacom"] .primary-btn:hover {
  filter: brightness(1.08);
}

html[data-profile="miacom"] .primary-btn:focus-visible {
  outline: 2px solid rgba(255, 121, 187, 0.75);
  outline-offset: 1px;
}

html[data-profile="miacom"] .chat-zone-head {
  background: linear-gradient(180deg, rgba(37, 53, 81, 0.96), rgba(30, 44, 68, 0.94));
}

html[data-profile="miacom"] .flow-overview,
html[data-profile="miacom"] .flow-strip {
  border-color: rgba(162, 185, 221, 0.45);
  background:
    linear-gradient(150deg, rgba(35, 48, 70, 0.96), rgba(27, 39, 59, 0.96)),
    radial-gradient(circle at top right, rgba(var(--accent-rgb), 0.14), transparent 52%);
}

html[data-profile="miacom"] .flow-strip-head strong {
  color: #f2f7ff;
}

html[data-profile="miacom"] .flow-strip-head span {
  color: #c8d8f3;
}

html[data-profile="miacom"] .stage-flow-card {
  background: linear-gradient(145deg, #22324d, #1c2b42);
  border-color: rgba(156, 179, 215, 0.52);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

html[data-profile="miacom"] .stage-flow-card.is-active {
  background:
    radial-gradient(circle at 8% 50%, rgba(224, 32, 118, 0.2), transparent 36%),
    linear-gradient(145deg, #2b3f5f, #253852);
  border-color: rgba(224, 32, 118, 0.9);
}

html[data-profile="miacom"] .attachment-chip {
  background: #243655;
  border-color: rgba(175, 197, 232, 0.62);
  color: #eef4ff;
}

html[data-profile="miacom"] .bubble.user .bubble-attachment {
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(255, 179, 224, 0.88);
  color: #fff5fc;
}

html[data-profile="miacom"] .bubble.assistant .bubble-attachment {
  background: rgba(24, 38, 60, 0.86);
  border-color: rgba(180, 205, 240, 0.72);
  color: #edf5ff;
}

html[data-profile="miacom"] .flow-map-shell {
  border-color: rgba(147, 165, 194, 0.34);
  background:
    linear-gradient(150deg, rgba(31, 42, 60, 0.94), rgba(25, 34, 49, 0.94)),
    radial-gradient(circle at top left, rgba(var(--accent-rgb), 0.15), transparent 55%);
}

html[data-profile="miacom"] .flow-map-node rect {
  fill: rgba(35, 47, 67, 0.96);
  stroke: rgba(158, 176, 204, 0.4);
}

html[data-profile="miacom"] .flow-map-node.is-decision rect {
  fill: rgba(59, 49, 68, 0.9);
}

html[data-profile="miacom"] .flow-map-step-dot {
  fill: rgba(38, 51, 73, 0.98);
  stroke: rgba(169, 188, 216, 0.62);
}

@media (max-width: 1220px) {
  body {
    overflow-y: auto;
  }

  .app {
    height: auto;
    min-height: 100dvh;
  }

  .workspace {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .workspace.sidebar-collapsed {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    overflow: visible;
    grid-template-rows: auto;
  }

  .sidebar-toggle-btn {
    display: none;
  }

  .sidebar-logout-icon-btn,
  .workspace.sidebar-collapsed .sidebar .sidebar-logout-icon-btn {
    display: none;
  }

  .workspace.sidebar-collapsed .sidebar .panel-head,
  .workspace.sidebar-collapsed .sidebar-footer,
  .workspace.sidebar-collapsed .sidebar .nav-title {
    opacity: 1;
    pointer-events: auto;
    transform: none;
    display: block;
  }

  .workspace.sidebar-collapsed .sidebar .nav-menu {
    margin-top: 12px;
    gap: 8px;
    align-items: stretch;
  }

  .nav-menu {
    max-height: none;
    overflow: visible;
  }

  .nav-config-wrap {
    margin-top: 0;
  }

  .workspace.sidebar-collapsed .sidebar .nav-item {
    width: 100%;
    min-height: 0;
    border-radius: 12px;
    justify-content: flex-start;
    padding: 10px;
  }

  .work-area {
    height: auto;
  }

  .mode-view.is-active,
  .chat-panel {
    height: auto;
  }

  .chat-panel {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto minmax(360px, 1fr) auto auto auto;
  }

  .thread-history-panel {
    grid-column: 1;
    grid-row: 5;
    width: auto;
    min-width: 0;
    max-width: 100%;
    max-height: 260px;
  }

  .attachments {
    grid-column: 1;
    grid-row: 6;
  }

  .chat-composer {
    grid-column: 1;
    grid-row: 7;
  }
}

@media (max-width: 980px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .brand-logo-wrap {
    width: min(138px, 52vw);
    min-width: 0;
  }

  html[data-profile="miacom"] .brand-logo-wrap {
    width: min(126px, 48vw);
  }

  .chat-composer {
    grid-template-columns: 44px 1fr;
  }

  .chat-composer .primary-btn {
    grid-column: 1 / -1;
  }

  .chat-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .chat-header-actions {
    width: 100%;
    display: flex;
    justify-content: flex-end;
  }

  .flow-node {
    width: 196px;
  }

  .stage-flow-card {
    min-width: 150px;
  }

  .flow-strip-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }
}
