:root {
  color-scheme: dark;
  --sidebar-width: clamp(360px, 27vw, 440px);
  --sidebar-collapsed-width: 44px;
  --bg-0: #0f1115;
  --bg-1: #13161d;
  --bg-2: #171b22;
  --panel: #171b22;
  --panel-strong: #1d222b;
  --line: #2a303a;
  --line-strong: #3a414d;
  --text: #e8ebf0;
  --muted: #98a2b3;
  --accent: #7cb8ff;
  --accent-2: #5dd8b0;
  --success: #55c07c;
  --warn: #d6a04e;
  --danger: #d96a61;
  --shadow: none;
  --radius: 12px;
  --radius-sm: 8px;
  --font-ui: 'Inter', 'Avenir Next', 'Segoe UI', Arial, sans-serif;
  --font-brand:
    'JetBrains Mono', 'SFMono-Regular', 'Cascadia Mono', 'Liberation Mono',
    monospace;
  --font-control: 'Inter', 'Avenir Next', 'Segoe UI', Arial, sans-serif;
  --font-mono:
    'SFMono-Regular', 'Cascadia Mono', 'JetBrains Mono', 'Liberation Mono',
    monospace;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font-ui);
  overflow: hidden;
  background: var(--bg-0);
}

body.access-page {
  overflow: auto;
  background: var(--bg-0);
}

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

a:hover {
  color: var(--accent);
}

code,
pre {
  font-family: var(--font-mono);
}

pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

button,
input,
textarea,
select {
  font: inherit;
}

.shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  height: 100vh;
  min-height: 0;
  overflow: hidden;
  transition: grid-template-columns 220ms ease;
}

@media (min-width: 861px) {
  body.sidebar-collapsed .shell {
    grid-template-columns: var(--sidebar-collapsed-width) minmax(0, 1fr);
  }
}

.shell--single {
  grid-template-columns: minmax(0, 1fr);
}

.sidebar {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100vh;
  padding: 16px 14px 20px;
  background: var(--bg-1);
  border-right: 1px solid var(--line);
  overflow: hidden;
  overscroll-behavior: contain;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease;
}

.sidebar-scroll {
  display: grid;
  gap: 16px;
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 8px;
  padding-bottom: 8px;
  scrollbar-gutter: stable;
}

@media (min-width: 861px) {
  body.sidebar-collapsed .sidebar {
    padding: 0;
    overflow: hidden;
    border-right: 1px solid var(--line);
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 28%),
      linear-gradient(180deg, rgba(19, 22, 29, 0.98), rgba(17, 20, 26, 0.98));
    box-shadow:
      inset -1px 0 0 rgba(255, 255, 255, 0.02),
      8px 0 18px rgba(3, 6, 12, 0.12);
  }

  body.sidebar-collapsed .sidebar > :not(.sidebar-collapse-tab) {
    opacity: 0;
    transform: translateX(-14px);
    pointer-events: none;
    will-change: transform, opacity;
    transition:
      opacity 180ms ease,
      transform 220ms ease;
  }

  body.sidebar-collapsed .sidebar-scroll {
    overflow: hidden;
  }
}

.workspace {
  min-width: 0;
  min-height: 0;
  height: 100vh;
  padding: 20px 22px 28px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

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

.access-card {
  width: min(560px, 100%);
  padding: 24px;
  display: grid;
  gap: 18px;
}

.access-brand {
  display: grid;
  place-items: center;
  gap: 9px;
  text-align: center;
  padding: 8px 0 4px;
}

.access-brand__mark {
  display: grid;
  place-items: center;
  width: 154px;
  height: 154px;
  border-radius: 30px;
  border: 1px solid rgba(152, 162, 179, 0.24);
  background: var(--bg-1);
  overflow: hidden;
  transition:
    box-shadow 900ms ease,
    border-color 900ms ease,
    transform 900ms ease;
}

.access-brand__mark img,
.access-brand__mark svg,
.brand__mark img,
.brand__mark svg {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.btn,
button,
.btn-tab,
.chip,
.tab,
.sidebar-section__titlebar,
.project-item__pin-btn,
.project-item__archive-btn,
.sidebar-collapse-tab,
.usage-range-toggle .chip {
  font-family: var(--font-control);
}

.access-brand__logo {
  overflow: visible;
}

.access-brand__node-glow {
  transition:
    opacity 720ms ease,
    filter 720ms ease;
  will-change: opacity, filter;
  opacity: 0.22;
  filter: blur(12px) saturate(1.08);
  transform-box: fill-box;
  transform-origin: center;
}

.access-brand__node {
  transition: filter 720ms ease;
  will-change: filter;
  opacity: 1;
  filter: drop-shadow(0 0 8px rgba(124, 184, 255, 0.12));
}

.access-brand__node-glow.is-active {
  animation: access-brand-glow-pulse 1.8s ease-in-out infinite;
  opacity: 1;
}

.access-brand__node.is-active {
  filter: drop-shadow(0 0 16px rgba(124, 184, 255, 0.5))
    drop-shadow(0 0 30px rgba(124, 184, 255, 0.18))
    drop-shadow(0 0 54px rgba(124, 184, 255, 0.08));
  animation: access-brand-node-pulse 1.8s ease-in-out infinite;
}

.access-page.access-login-pending .access-brand__node-glow {
  opacity: 0.28;
}

.access-page.access-login-pending .access-brand__node-glow.is-active {
  opacity: 1;
}

.access-page.access-login-pending .access-brand__node {
  transform-box: fill-box;
  transform-origin: center;
  filter: drop-shadow(0 0 10px rgba(124, 184, 255, 0.18))
    drop-shadow(0 0 20px rgba(124, 184, 255, 0.06));
}

.access-page.access-login-pending .access-brand__node.is-active {
  filter: drop-shadow(0 0 18px rgba(124, 184, 255, 0.78))
    drop-shadow(0 0 38px rgba(124, 184, 255, 0.24))
    drop-shadow(0 0 68px rgba(124, 184, 255, 0.08));
  animation: access-brand-node-pulse-active 1.5s ease-in-out infinite;
  transform: scale(1.04);
}

.access-page.access-login-pending .access-brand__mark {
  animation: access-brand-mark-breathe 3.6s ease-in-out infinite;
  border-color: rgba(124, 184, 255, 0.34);
  box-shadow:
    0 0 0 1px rgba(124, 184, 255, 0.22),
    0 0 18px rgba(124, 184, 255, 0.12),
    0 0 42px rgba(124, 184, 255, 0.05);
}

@keyframes access-brand-mark-breathe {
  0%,
  100% {
    border-color: rgba(124, 184, 255, 0.28);
    box-shadow:
      0 0 0 1px rgba(124, 184, 255, 0.18),
      0 0 14px rgba(124, 184, 255, 0.08),
      0 0 30px rgba(124, 184, 255, 0.03);
  }

  50% {
    border-color: rgba(124, 184, 255, 0.5);
    box-shadow:
      0 0 0 1px rgba(124, 184, 255, 0.36),
      0 0 24px rgba(124, 184, 255, 0.18),
      0 0 54px rgba(124, 184, 255, 0.08);
  }
}

@keyframes access-brand-node-pulse {
  0%,
  100% {
    filter: drop-shadow(0 0 16px rgba(124, 184, 255, 0.44))
      drop-shadow(0 0 30px rgba(124, 184, 255, 0.14))
      drop-shadow(0 0 54px rgba(124, 184, 255, 0.06));
  }

  50% {
    filter: drop-shadow(0 0 24px rgba(124, 184, 255, 0.72))
      drop-shadow(0 0 44px rgba(124, 184, 255, 0.24))
      drop-shadow(0 0 74px rgba(124, 184, 255, 0.12));
  }
}

@keyframes access-brand-glow-pulse {
  0%,
  100% {
    opacity: 0.72;
    filter: blur(12px) saturate(1.06);
  }

  50% {
    opacity: 1;
    filter: blur(18px) saturate(1.2);
  }
}

@keyframes access-brand-node-pulse-active {
  0%,
  100% {
    filter: drop-shadow(0 0 18px rgba(124, 184, 255, 0.78))
      drop-shadow(0 0 38px rgba(124, 184, 255, 0.24))
      drop-shadow(0 0 68px rgba(124, 184, 255, 0.08));
  }

  50% {
    filter: drop-shadow(0 0 24px rgba(124, 184, 255, 0.9))
      drop-shadow(0 0 46px rgba(124, 184, 255, 0.3))
      drop-shadow(0 0 82px rgba(124, 184, 255, 0.12));
  }
}

@media (prefers-reduced-motion: reduce) {
  .access-brand__node-glow,
  .access-brand__node,
  .access-page.access-login-pending .access-brand__node-glow,
  .access-page.access-login-pending .access-brand__node,
  .access-page.access-login-pending .access-brand__node-glow.is-active,
  .access-page.access-login-pending .access-brand__node.is-active,
  .access-page.access-login-pending .access-brand__mark {
    transition: none;
    animation: none;
  }
}

.access-brand h1 {
  font-family: var(--font-brand);
  font-weight: 600;
  font-size: clamp(2rem, 4.15vw, 2.4rem);
  letter-spacing: -0.018em;
  color: #e6edf3;
  margin-top: 0;
  margin-bottom: 0;
}

.access-brand p {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
}

.access-section {
  display: grid;
  gap: 14px;
}

.auth-mode-label {
  margin-bottom: -4px;
  font-family: var(--font-control);
  font-weight: 500;
  font-size: 0.8rem;
  letter-spacing: 0.065em;
  color: #8f99aa;
}

.access-status__label {
  color: #9ba5b7;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

.access-status-panel {
  display: grid;
  gap: 6px;
}

.access-status-panel__label {
  color: #8f99aa;
  font-family: var(--font-control);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.access-startup {
  display: grid;
  gap: 8px;
}

.access-startup__label {
  color: #9ba5b7;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.access-startup-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
}

.access-startup-step {
  position: relative;
  color: rgba(155, 165, 183, 0.8);
  font-family: var(--font-control);
  font-size: 0.92rem;
  line-height: 1.3;
  transition:
    color 220ms ease,
    opacity 220ms ease;
}

.access-startup-step.is-complete {
  color: #e6edf3;
  opacity: 1;
}

.access-startup-step.is-current {
  color: rgba(170, 181, 195, 0.95);
  animation: access-startup-step-breathe 2.8s ease-in-out infinite;
  animation-fill-mode: both;
}

@keyframes access-startup-step-breathe {
  0%,
  100% {
    color: rgba(148, 158, 174, 0.84);
  }

  50% {
    color: rgba(170, 181, 195, 0.95);
  }
}

@media (prefers-reduced-motion: reduce) {
  .access-startup-step.is-current {
    animation: none;
  }
}

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

.auth-tabs--outer,
.auth-tabs--inner {
  margin: 0;
}

.auth-panel--flat {
  padding: 0;
  border: 0;
  background: transparent;
}

.btn-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 10px;
  border: 0;
  border-bottom: 1px solid rgba(152, 162, 179, 0.28);
  border-radius: 0;
  background: transparent;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1;
  color: var(--muted);
}

.btn-tab:hover {
  border-bottom-color: rgba(124, 184, 255, 0.82);
  color: var(--text);
}

.btn-tab.is-active,
.btn-tab[aria-selected='true'] {
  border-bottom-color: var(--accent);
  color: var(--text);
}

.auth-method-panel .btn,
.access-stage .btn {
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.access-stage .btn {
  min-height: 40px;
}

.access-page .btn-primary {
  border-color: rgba(124, 184, 255, 0.64);
  color: #f3f7fc;
  box-shadow: inset 0 0 0 1px rgba(124, 184, 255, 0.08);
}

.access-page .btn-primary:hover {
  border-color: rgba(124, 184, 255, 1);
  box-shadow:
    inset 0 0 0 1px rgba(124, 184, 255, 0.16),
    0 0 18px rgba(124, 184, 255, 0.06);
}

.auth-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-1);
}

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

.access-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.access-actions .btn {
  justify-content: center;
}

.field__hint {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.settings-form {
  display: grid;
  gap: 14px;
}

.settings-wizard {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.settings-wizard__step {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-1);
}

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

.settings-wizard__step p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.btn-tab--compact {
  min-height: 30px;
  padding: 0 10px 6px;
  border-radius: 0;
  font-size: 0.82rem;
}

.access-status {
  min-height: 64px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-1);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.84rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.access-status::after {
  content: '';
  display: inline-block;
  width: 0.55em;
  height: 1em;
  vertical-align: -0.14em;
  margin-left: 0.2em;
  border-right: 1px solid rgba(232, 235, 240, 0.75);
  opacity: 0;
}

.access-status.is-live::after {
  opacity: 1;
  animation: access-status-cursor 1.05s steps(1) infinite;
}

@keyframes access-status-cursor {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0;
  }
}

@media (max-width: 720px) {
  .access-status-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  overflow: hidden;
}

.brand h1,
.topbar h1,
.card h2,
.card h3 {
  margin: 0;
  line-height: 1.12;
}

.brand h1 {
  font-family: var(--font-brand);
  font-size: 1.15rem;
}

h1 a[href='/'],
.btn[href='/'],
.topbar h1,
.access-brand h1 {
  font-family: var(--font-brand);
}

body[data-page='project'] .sidebar .brand h1 a[href='/'] {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.01);
  color: var(--text);
  font-size: 1.05rem;
  letter-spacing: -0.015em;
  line-height: 1;
  transition:
    border-color 180ms ease,
    color 180ms ease,
    background 180ms ease;
}

body[data-page='project'] .sidebar .brand h1 a[href='/']:hover {
  border-color: rgba(124, 184, 255, 0.5);
  color: #f1f5fb;
}

.eyebrow {
  color: var(--muted);
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.sidebar__cta {
  margin: 18px 0 24px;
}

.search-box {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.search-box label {
  color: #bfd0eb;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.search-help {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.sidebar-section {
  margin-bottom: 22px;
}

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

.sidebar-section--collapsed .project-list,
.sidebar-section--collapsed [data-sidebar-body] {
  display: none;
}

.sidebar-section__titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 0 0 8px;
  border: 0;
  border-bottom: 1px solid rgba(152, 162, 179, 0.28);
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  border-radius: 0;
  transition:
    border-color 120ms ease,
    background 120ms ease,
    color 120ms ease;
}

.sidebar-section__titlebar:hover {
  border-bottom-color: rgba(124, 184, 255, 0.82);
  background: transparent;
}

.sidebar-section__titlebar .sidebar-section__title {
  margin-bottom: 0;
}

.sidebar-section__title {
  margin-bottom: 10px;
  color: #bfd0eb;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sidebar-section__chevron {
  color: var(--muted);
  font-size: 0.9rem;
  transition: transform 140ms ease;
}

.sidebar-section--collapsed .sidebar-section__chevron {
  transform: rotate(-90deg);
}

.project-list,
.mini-list {
  display: grid;
  gap: 8px;
}

.project-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: start;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  transition:
    border-color 120ms ease,
    background 120ms ease;
  min-width: 0;
}

.project-item:hover,
.project-item--active {
  border-color: var(--accent);
  background: var(--panel-strong);
}

.project-item--active {
  border-color: rgba(85, 192, 124, 0.92);
}

.project-item--favorite {
  border-color: var(--line);
}

.project-item--favorite.project-item--active {
  border-color: rgba(85, 192, 124, 0.92);
}

.project-item__content {
  min-width: 0;
}

.project-item__link {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.project-item__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  flex-wrap: wrap;
}

.project-item__top strong {
  min-width: 0;
  flex: 1 1 auto;
  overflow-wrap: anywhere;
}

.project-item__sub,
.project-item__foot {
  color: var(--muted);
  font-size: 0.84rem;
  overflow-wrap: anywhere;
}

.project-item__pin-form {
  display: flex;
  align-items: flex-start;
}

.project-item__pin-btn {
  display: grid;
  place-items: center;
  width: 38px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid rgba(152, 162, 179, 0.28);
  border-radius: 0;
  background: transparent;
  color: var(--text);
}

.project-item__pin-btn:hover {
  border-bottom-color: rgba(124, 184, 255, 0.82);
  background: transparent;
}

.project-item--favorite .project-item__pin-btn {
  border-bottom-color: rgba(124, 184, 255, 0.82);
}

.project-item--favorite .project-item__pin-btn:hover {
  border-bottom-color: var(--accent);
}

.project-item__pin-icon {
  width: 16px;
  height: 16px;
  fill: currentColor;
  display: block;
}

.project-item__archive-form {
  display: flex;
  align-items: flex-start;
}

.project-item__archive-btn {
  padding: 0 10px 8px;
  border: 0;
  border-bottom: 1px solid rgba(152, 162, 179, 0.28);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-size: 0.78rem;
  line-height: 1;
  white-space: nowrap;
}

.project-item__archive-btn:hover {
  border-bottom-color: rgba(124, 184, 255, 0.82);
  background: transparent;
}

.project-summary,
.mini-list__item {
  display: grid;
  gap: 6px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

.project-summary span,
.mini-list__item span {
  color: var(--muted);
  font-size: 0.84rem;
}

.project-summary code {
  color: #dfe8f8;
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.topbar p {
  max-width: 72ch;
  margin: 8px 0 0;
  color: var(--muted);
}

.topbar__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
}

.topbar__logout-form {
  margin: 0;
}

.tabs {
  display: flex;
  gap: 10px;
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}

.tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 2px 8px;
  border-radius: 0;
  font-size: 0.96rem;
  color: var(--muted);
  border: 0;
  border-bottom: 1px solid transparent;
  line-height: 1;
  white-space: nowrap;
  transition:
    color 120ms ease,
    border-color 120ms ease;
}

.tab:hover,
.tab--active {
  color: var(--text);
  border-color: var(--accent);
  background: transparent;
}

.tab--active {
  border-bottom-color: var(--accent);
}

.grid {
  display: grid;
  gap: 16px;
}

.grid--hero {
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.9fr);
  margin-bottom: 16px;
}

.card--project-info {
  margin-bottom: 16px;
}

.openclaw-summary-card {
  grid-column: 1 / -1;
}

.grid--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 16px;
}

.openclaw-grid {
  margin-bottom: 16px;
}

.openclaw-control {
  display: grid;
  gap: 14px;
}

.openclaw-control__header-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.openclaw-control__notice {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--text);
  font-size: 0.88rem;
  line-height: 1.45;
}

.openclaw-control__notice--error {
  border-color: rgba(217, 106, 97, 0.4);
  color: #ffb6ae;
}

.openclaw-control__notice--ok {
  border-color: rgba(93, 216, 176, 0.32);
  color: #c8f6e5;
}

.openclaw-control__notice--warning {
  border-color: rgba(214, 160, 78, 0.35);
  color: #f2d2a2;
}

.openclaw-control__layout {
  display: grid;
  gap: 14px;
}

.openclaw-control__panel {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.openclaw-control__panel--summary {
  grid-template-rows: auto auto auto auto auto;
}

.openclaw-control__metrics {
  margin-bottom: 2px;
}

.openclaw-control__forms {
  display: grid;
  gap: 14px;
}

.mini-list--compact {
  gap: 8px;
}

.openclaw-control__layout {
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 1.05fr);
}

.openclaw-control__panel--summary {
  align-content: start;
}

.openclaw-control__panel--actions {
  align-content: start;
}

.sidebar-section__title--inline {
  margin: 2px 0 6px;
}

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

.sidebar-collapse-tab {
  display: none;
}

@media (min-width: 861px) {
  .sidebar-collapse-tab {
    position: absolute;
    top: 16px;
    right: -1px;
    z-index: 2;
    display: inline-flex;
    place-items: center;
    width: 30px;
    height: 24px;
    padding-left: 5px;
    padding-right: 5px;
    border: 0;
    border-right-width: 0px;
    border-right-style: solid;
    border-radius: 0;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    overflow: visible;
    margin-right: 10px;
    transition:
      color 180ms ease,
      opacity 180ms ease,
      transform 220ms ease;
  }

  button.sidebar-collapse-tab:nth-child(1) {
    /* padding-left: 12px; */
    margin-left: 10px;
  }

  .sidebar-collapse-tab:hover {
    color: #f1f5fb;
    opacity: 1;
  }

  .sidebar-collapse-tab:focus-visible {
    outline: none;
  }

  .sidebar-collapse-tab__icon {
    position: relative;
    z-index: 1;
    display: block;
    width: 14px;
    height: 12px;
  }

  .sidebar-collapse-tab__icon span {
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    border-radius: 999px;
    background: #dbe7f9;
    opacity: 0.95;
    transform-origin: center;
    transition:
      transform 220ms ease,
      top 220ms ease,
      bottom 220ms ease,
      opacity 180ms ease,
      width 220ms ease;
  }

  .sidebar-collapse-tab__icon span:nth-child(1) {
    top: 0;
  }

  .sidebar-collapse-tab__icon span:nth-child(2) {
    top: 5px;
  }

  .sidebar-collapse-tab__icon span:nth-child(3) {
    bottom: 0;
  }

  .sidebar-collapse-tab__icon::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 5px;
    height: 2px;
    border-radius: 999px;
    background: #dbe7f9;
    opacity: 0;
    transform: scaleX(0.6);
    transform-origin: center;
    transition:
      transform 220ms ease,
      opacity 180ms ease;
  }

  body:not(.sidebar-collapsed) .sidebar-collapse-tab__icon span {
    opacity: 0;
    transform: scaleX(0.55);
  }

  body:not(.sidebar-collapsed) .sidebar-collapse-tab__icon::before {
    opacity: 0.95;
    transform: scaleX(1);
  }

  body.sidebar-collapsed .sidebar-collapse-tab {
    width: 30px;
    height: 24px;
    right: -1px;
    padding-left: 10px;
    padding-right: 5px;
    margin-right: 10px;
  }

  body.sidebar-collapsed .sidebar-collapse-tab__icon span {
    opacity: 0.95;
    transform: none;
    width: 100%;
    left: 0;
  }

  body.sidebar-collapsed .sidebar-collapse-tab__icon::before {
    opacity: 0;
    transform: scaleX(0.6);
  }
}

.chat-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}

.project-layout {
  display: block;
  min-width: 0;
  min-height: 0;
}

.project-layout__main {
  min-width: 0;
  display: grid;
  gap: 16px;
  padding-right: 0;
  min-height: 0;
}

body[data-active-tab='conversations'] .project-layout,
body[data-active-tab='main-agent'] .project-layout {
  height: 100%;
}

body[data-active-tab='conversations'] .project-layout__main,
body[data-active-tab='main-agent'] .project-layout__main {
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

@media (min-width: 861px) {
  .project-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--sidebar-width);
    gap: 16px;
    align-items: start;
    transition: grid-template-columns 180ms ease;
  }

  body.project-rail-collapsed .project-layout {
    grid-template-columns: minmax(0, 1fr) var(--sidebar-collapsed-width);
  }

  .project-rail {
    position: sticky;
    top: 0;
    width: 100%;
    height: calc(100vh - 40px);
    min-height: 0;
    padding: 12px;
    border-left: 1px solid var(--line);
    border-radius: 0;
    background: var(--panel);
    box-shadow: none;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 12px;
    overflow: hidden;
    z-index: 42;
    transform: none;
    transition: none;
  }

  .project-rail.sidebar-section--collapsed {
    transform: none;
  }

  .project-rail__body {
    display: grid;
    gap: 14px;
    min-height: 0;
    overflow: auto;
  }

  .project-rail__section {
    display: grid;
    gap: 10px;
  }

  .project-rail__header {
    justify-content: flex-end;
    text-align: right;
  }

  .project-rail__heading {
    display: grid;
    gap: 4px;
    justify-items: end;
    width: min(50%, 100%);
    margin-left: auto;
    text-align: right;
  }

  .project-rail__count {
    color: var(--muted);
    font-size: 0.78rem;
    letter-spacing: 0.02em;
    text-transform: lowercase;
  }

  .project-rail__toggle {
    position: absolute;
    top: 16px;
    left: -1px;
    right: auto;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    overflow: visible;
    transition:
      color 180ms ease,
      opacity 180ms ease,
      transform 220ms ease;
  }

  .project-rail__toggle:hover {
    color: #f1f5fb;
  }

  .project-rail__toggle:focus-visible {
    outline: none;
  }

  .project-rail__toggle .sidebar-collapse-tab__icon::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 5px;
    height: 2px;
    border-radius: 999px;
    background: #dbe7f9;
    opacity: 0;
    transform: scaleX(0.6);
    transform-origin: center;
    transition:
      transform 220ms ease,
      opacity 180ms ease;
  }

  .project-rail.sidebar-section--collapsed
    .project-rail__toggle
    .sidebar-collapse-tab__icon
    span {
    opacity: 0.95 !important;
    transform: none !important;
    width: 100% !important;
    left: 0 !important;
  }

  .project-rail.sidebar-section--collapsed
    .project-rail__toggle
    .sidebar-collapse-tab__icon::before {
    opacity: 0 !important;
    transform: scaleX(0.6) !important;
  }

  .project-rail:not(.sidebar-section--collapsed)
    .project-rail__toggle
    .sidebar-collapse-tab__icon
    span {
    opacity: 0 !important;
    transform: scaleX(0.55) !important;
  }

  .project-rail:not(.sidebar-section--collapsed)
    .project-rail__toggle
    .sidebar-collapse-tab__icon::before {
    opacity: 0.95 !important;
    transform: scaleX(1) !important;
  }

  .recent-files-shell--rail {
    margin-top: 0;
  }
}

.chat-panel {
  display: grid;
  gap: 16px;
  min-height: 0;
  grid-template-rows: auto minmax(320px, 1fr) auto;
}

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

.chat-panel__lede {
  margin: 6px 0 0;
  color: var(--muted);
}

.chat-thread {
  display: grid;
  gap: 14px;
  min-height: 320px;
  padding: 4px 0 10px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
}

.chat-row {
  display: flex;
  align-items: flex-end;
  gap: 0;
  width: 100%;
}

.chat-row__content {
  display: grid;
  gap: 6px;
}

.chat-row--outbound .chat-row__content {
  justify-items: end;
}

.chat-row__stamp {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
  padding: 0 6px;
}

.chat-row--outbound {
  justify-content: flex-end;
}

.chat-row--inbound {
  justify-content: flex-start;
}

.chat-bubble {
  display: grid;
  gap: 8px;
  max-width: min(720px, calc(100% - 50px));
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.chat-row--outbound .chat-bubble {
  border-color: rgba(93, 216, 176, 0.24);
}

.chat-row--inbound .chat-bubble {
  border-color: rgba(124, 184, 255, 0.22);
}

.chat-row--pending .chat-bubble {
  opacity: 0.72;
  border-style: dashed;
}

.chat-bubble__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 0.8rem;
}

.chat-bubble__role {
  color: var(--text);
  font-weight: 700;
}

.chat-bubble__direction {
  color: var(--accent);
}

.chat-bubble__body {
  margin: 0;
  color: #f2f7ff;
  font-size: 0.96rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-bubble__body--preview {
  display: block;
}

.chat-bubble__body--full {
  padding-top: 4px;
}

.chat-bubble__details {
  display: grid;
  gap: 8px;
}

.chat-bubble__details--message {
  display: flex;
  flex-direction: column;
}

.chat-bubble__details--message .chat-bubble__body--full {
  order: 1;
}

.chat-bubble__details--message .chat-bubble__summary {
  order: 2;
  margin-top: 8px;
}

.chat-bubble__summary {
  color: var(--accent);
  cursor: pointer;
  font-size: 0.84rem;
  user-select: none;
  list-style: none;
}

.chat-bubble__summary::-webkit-details-marker {
  display: none;
}

.chat-bubble__details--error .chat-bubble__summary {
  color: #ffb6ae;
}

.chat-bubble__error {
  color: #ffb6ae;
  font-size: 0.88rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-composer {
  display: grid;
  gap: 14px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

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

.chat-composer__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.chat-rail {
  display: grid;
  gap: 16px;
  position: sticky;
  top: 24px;
}

/* Conversation views: fixed layout with scrollable message history and bottom composer */
body[data-active-tab='conversations'] .workspace,
body[data-active-tab='main-agent'] .workspace {
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
}

body[data-active-tab='conversations'] .chat-shell,
body[data-active-tab='main-agent'] .chat-shell {
  min-height: 0;
  height: 100%;
  margin-bottom: 0;
  align-items: stretch;
  flex: 1 1 auto;
}

body[data-active-tab='conversations'] .chat-panel,
body[data-active-tab='main-agent'] .chat-panel {
  min-height: 0;
  height: 100%;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

body[data-active-tab='conversations'] .chat-thread,
body[data-active-tab='main-agent'] .chat-thread {
  min-height: 0;
}

body[data-active-tab='conversations'] .chat-rail,
body[data-active-tab='main-agent'] .chat-rail {
  max-height: 100%;
  overflow: auto;
}

body[data-active-tab='overview'] .project-layout,
body[data-active-tab='workflows'] .project-layout,
body[data-active-tab='memory'] .project-layout,
body[data-active-tab='files'] .project-layout,
body[data-active-tab='logs'] .project-layout,
body[data-active-tab='settings'] .project-layout,
body[data-active-tab='conversations'] .project-layout,
body[data-active-tab='main-agent'] .project-layout {
  min-height: 0;
}

.sidebar-backdrop {
  display: none;
}

.sidebar-toggle {
  display: none;
}

.project-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 16px;
}

.main-column,
.side-column {
  min-width: 0;
  display: grid;
  gap: 16px;
}

.card {
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.card__header--compact {
  margin-bottom: 10px;
}

.card__header h2 {
  margin-top: 4px;
  font-size: 1.24rem;
}

.card__header--compact h2 {
  font-size: 1rem;
}

.lede {
  margin: 0 0 16px;
  color: var(--muted);
}

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

.metric-grid--compact {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.metric {
  display: grid;
  gap: 4px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

.metric strong {
  display: block;
  min-width: 0;
  font-size: clamp(1rem, 1.9vw, 1.45rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.metric span {
  color: var(--muted);
  font-size: 0.84rem;
}

.task-list,
.bullet-stack,
.artifact-list,
.log-list,
.workflow-list,
.timeline,
.agent-grid {
  display: grid;
  gap: 10px;
}

.task-list--stacked {
  gap: 12px;
}

.task-card {
  padding: 13px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.task-card--muted {
  border-color: var(--line);
  background: var(--panel);
}

.task-card strong {
  display: block;
  margin-bottom: 8px;
}

.task-card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.task-card li + li {
  margin-top: 6px;
}

.featured-project {
  margin-top: 14px;
  padding: 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.featured-project__title {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.featured-project p {
  margin: 8px 0 0;
  color: var(--muted);
}

.featured-project__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.84rem;
}

.card--usage {
  display: grid;
  gap: 14px;
}

.card--usage-island {
  margin-bottom: 16px;
}

.usage-range-toggle {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.usage-range-toggle .chip {
  padding: 0 10px 8px;
  min-height: 30px;
  cursor: pointer;
  border: 0;
  border-bottom: 1px solid rgba(152, 162, 179, 0.28);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.usage-range-toggle .chip:hover {
  border-bottom-color: rgba(124, 184, 255, 0.82);
  background: transparent;
}

.chip--active {
  border-bottom-color: rgba(124, 184, 255, 0.92);
  background: transparent;
  color: var(--text);
  box-shadow: none;
}

.usage-list {
  display: grid;
  gap: 10px;
}

.usage-section-divider {
  display: grid;
  gap: 8px;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.usage-row {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

.usage-row__meta {
  display: grid;
  gap: 4px;
}

.usage-row__meta strong a {
  color: var(--text);
}

.usage-row__meta span {
  color: var(--muted);
  font-size: 0.84rem;
}

.usage-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.86rem;
}

.usage-summary strong {
  color: var(--text);
}

.usage-chart {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 12px 12px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

.usage-chart--mini {
  padding: 10px 10px 8px;
}

.usage-chart__frame {
  position: relative;
}

.usage-chart svg {
  display: block;
  width: 100%;
  height: 148px;
}

.usage-chart--mini svg {
  height: 92px;
}

.usage-chart__line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.usage-chart--mini .usage-chart__line {
  stroke: var(--accent-2);
}

.usage-chart__axis-line {
  stroke: var(--line-strong);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.usage-chart__markers {
  position: absolute;
  inset: 0;
  height: 100%;
  width: 100%;
  pointer-events: none;
}

.usage-chart__point {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  transform: translate(-50%, -50%);
  box-sizing: border-box;
  background: var(--bg-0);
  border: 3px solid var(--accent);
}

.usage-chart--mini .usage-chart__point {
  width: 8px;
  height: 8px;
  border-width: 2px;
  border-color: var(--accent-2);
}

.usage-chart__hover-line {
  stroke: rgba(124, 184, 255, 0.38);
  stroke-dasharray: 4 4;
  stroke-width: 2;
}

.usage-chart__hover-point {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  transform: translate(-50%, -50%);
  box-sizing: border-box;
  background: var(--text);
  border: 3px solid var(--accent);
}

.usage-chart--mini .usage-chart__hover-point {
  width: 10px;
  height: 10px;
  border-width: 2px;
  border-color: var(--accent-2);
}

.usage-chart__overlay {
  cursor: crosshair;
}

.usage-chart__tooltip {
  position: absolute;
  z-index: 1;
  transform: translate(-50%, -100%);
  padding: 6px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--bg-2);
  color: var(--text);
  font-size: 0.76rem;
  line-height: 1.2;
  white-space: nowrap;
  pointer-events: none;
}

.usage-chart__axis {
  position: relative;
  width: 100%;
  height: 22px;
  margin-top: 2px;
}

.usage-chart__tick {
  position: absolute;
  bottom: 0;
  transform: translateX(-50%);
  min-width: 0;
  color: var(--muted);
  font-size: 0.72rem;
  text-align: center;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.usage-chart__tick--labelled {
  color: #cbd5e6;
}

.usage-chart__tick--active {
  color: var(--accent);
}

.usage-chart__tick::before {
  content: '';
  display: block;
  width: 1px;
  height: 6px;
  margin: 0 auto 4px;
  background: var(--line-strong);
}

.usage-chart__tick--labelled::before,
.usage-chart__tick--active::before {
  height: 8px;
}

.usage-chart__tick--active::before {
  background: var(--accent);
}

.usage-chart__tick--labelled:nth-child(3n)::before {
  background: var(--line-strong);
}

.usage-chart__tick--labelled:nth-child(3n).usage-chart__tick--active::before {
  background: var(--accent);
}

.usage-chart__empty {
  padding: 18px 12px;
  color: var(--muted);
  font-size: 0.86rem;
}

.bullet-stack__item {
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
}

.bullet-stack--compact .bullet-stack__item {
  padding: 10px 12px;
}

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

.agent-grid--compact {
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  margin-top: 14px;
}

.agent-card {
  display: grid;
  gap: 4px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

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

.field {
  display: grid;
  gap: 8px;
}

.field label {
  color: #c8d5e8;
  font-size: 0.9rem;
}

.field--full {
  grid-column: 1 / -1;
}

.stack {
  display: grid;
  gap: 12px;
}

.form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

input,
textarea,
select {
  width: 100%;
  padding: 11px 13px;
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--bg-1);
  outline: none;
  transition:
    border-color 120ms ease,
    box-shadow 120ms ease,
    background 120ms ease;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(124, 184, 255, 0.12);
  background: var(--bg-1);
}

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

.actions--chat {
  grid-column: 1 / -1;
  padding-top: 4px;
}

.btn,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  line-height: 1;
  color: var(--text);
  border: 1px solid rgba(152, 162, 179, 0.28);
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  transition:
    border-color 120ms ease,
    background 120ms ease,
    color 120ms ease,
    opacity 120ms ease;
}

.btn:hover,
button:hover {
  border-color: rgba(124, 184, 255, 0.82);
  background: transparent;
}

.btn:disabled,
button:disabled,
.btn.is-busy,
button.is-busy {
  cursor: not-allowed;
  opacity: 0.58;
  border-color: rgba(152, 162, 179, 0.18);
  background: transparent;
  color: var(--muted);
}

.btn:disabled:hover,
button:disabled:hover,
.btn.is-busy:hover,
button.is-busy:hover {
  border-color: rgba(152, 162, 179, 0.18);
  background: transparent;
}

.btn-primary {
  border-color: rgba(152, 162, 179, 0.28);
  background: transparent;
}

.btn-danger {
  border-color: rgba(152, 162, 179, 0.28);
  background: transparent;
}

.btn-block {
  width: 100%;
}

.badge,
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--text);
  font-size: 0.84rem;
  white-space: nowrap;
}

.badge-accent,
.chip-success {
  border-color: rgba(93, 216, 176, 0.34);
  background: rgba(93, 216, 176, 0.12);
}

.badge-neutral {
  color: #cad4e6;
}

.tag-row,
.state-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.status-list {
  display: grid;
  gap: 10px;
  margin: 0;
}

.status-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.status-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.status-row dt {
  color: var(--muted);
}

.status-row dd {
  margin: 0;
  text-align: right;
  word-break: break-word;
}

.mono-block {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.mono-block div {
  display: grid;
  gap: 6px;
}

.mono-block span {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mono-block code {
  color: #deebff;
  font-size: 0.8rem;
  word-break: break-all;
}

.timeline-item,
.workflow-row,
.artifact-item,
.log-item {
  padding: 13px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.artifact-item {
  display: grid;
  gap: 6px;
}

.artifact-item--button {
  width: 100%;
  cursor: pointer;
  text-align: left;
  appearance: none;
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    transform 160ms ease;
}

.artifact-item--button:hover,
.artifact-item--button.is-selected {
  border-color: rgba(124, 184, 255, 0.42);
  background: rgba(124, 184, 255, 0.08);
}

.recent-file-item.is-selected .recent-file-item__trigger {
  border-color: rgba(124, 184, 255, 0.42);
  background: rgba(124, 184, 255, 0.08);
}

.recent-files-shell {
  display: grid;
  gap: 12px;
}

.recent-files-shell--project {
  margin-top: 12px;
}

.recent-files-shell--project .recent-files-list--tiles {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  align-items: start;
}

.recent-files-shell--project
  .recent-files-list--tiles
  .recent-file-item__trigger {
  min-height: 100%;
}

.recent-files-list {
  margin: 0;
}

.recent-file-item {
  display: grid;
  gap: 0;
  overflow: hidden;
}

.recent-file-item__trigger {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  justify-items: start;
  text-align: left;
}

.recent-file-item__summary-left {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.recent-file-item__summary-right {
  display: grid;
  justify-items: end;
  align-content: start;
  gap: 6px;
  min-width: 60px;
  margin-left: auto;
}

.recent-file-item__status {
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.recent-file-item__name {
  color: var(--text);
  font-size: 0.98rem;
  line-height: 1.35;
}

.recent-file-item__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 0.82rem;
}

.recent-file-item__summary {
  color: #d7e4f8;
  font-size: 0.84rem;
  text-align: right;
}

.recent-file-item__chevron {
  justify-self: end;
  color: var(--muted);
  font-size: 0.88rem;
  transition:
    transform 180ms ease,
    color 180ms ease;
}

.recent-file-item.is-selected .recent-file-item__chevron {
  transform: rotate(180deg);
  color: var(--text);
}

.recent-file-item__detail {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-6px);
  transition:
    max-height 220ms ease,
    opacity 180ms ease,
    transform 220ms ease;
}

.recent-file-item.is-selected .recent-file-item__detail {
  opacity: 1;
  transform: translateY(0);
}

.recent-file-item__detail-panel {
  display: grid;
  gap: 10px;
  padding: 12px 14px 14px;
  border-top: 1px solid var(--line-strong);
  background: var(--bg-1);
}

.recent-file-item__detail-path {
  color: #dce5f4;
  font-size: 0.8rem;
  word-break: break-word;
}

.recent-file-item__detail-path--full {
  padding: 2px 0 0;
  font-size: 0.76rem;
  color: var(--muted);
}

.recent-file-item__detail-body {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.recent-file-item__detail-body--diff {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-2);
  color: #dce5f4;
  min-height: 220px;
  max-height: 420px;
  overflow: auto;
  white-space: pre-wrap;
}

.timeline-item {
  display: grid;
  gap: 10px;
}

.timeline-item--outbound {
  border-color: rgba(72, 215, 184, 0.24);
}

.timeline-item--inbound {
  border-color: rgba(105, 183, 255, 0.22);
}

.timeline-item__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 0.82rem;
}

.timeline-item__role {
  color: #f1f6ff;
  font-weight: 700;
}

.timeline-item__body {
  white-space: pre-wrap;
  word-break: break-word;
}

.timeline-item__error {
  color: #ff9a90;
}

.workflow-create {
  margin-bottom: 14px;
}

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

.workflow-row__copy {
  display: grid;
  gap: 6px;
}

.workflow-row__copy span {
  color: var(--muted);
  font-size: 0.84rem;
}

.workflow-row__form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.workflow-row__form select {
  min-width: 110px;
}

.log-item {
  display: grid;
  gap: 6px;
}

.artifact-item span,
.log-item__head span {
  color: var(--muted);
  font-size: 0.84rem;
}

.artifact-item code {
  color: #dce5f4;
  font-size: 0.8rem;
  word-break: break-word;
}

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

.log-item__body {
  color: #dfe7f5;
}

.log-item pre {
  padding-top: 8px;
  color: #b8c7db;
  font-size: 0.8rem;
}

.empty-state {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 10px;
  border: 1px dashed var(--line-strong);
  background: var(--bg-1);
  color: var(--muted);
}

.empty-state strong {
  color: var(--text);
}

.project-empty {
  padding: 12px 13px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  color: var(--muted);
  background: var(--bg-1);
}

.sidebar-loading {
  padding: 12px 13px;
  border: 1px dashed rgba(152, 162, 179, 0.18);
  border-radius: 10px;
  color: rgba(152, 162, 179, 0.78);
  background: rgba(19, 22, 29, 0.75);
}

.sidebar a {
  color: inherit;
}

@media (max-width: 1240px) {
  .shell {
    grid-template-columns: clamp(320px, 30vw, 380px) minmax(0, 1fr);
  }

  .chat-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .project-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 1040px) {
  .grid--hero,
  .grid--two {
    grid-template-columns: minmax(0, 1fr);
  }

  .openclaw-control__layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .chat-composer__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .access-actions {
    grid-template-columns: minmax(0, 1fr);
  }
}

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

  body[data-active-tab='conversations'],
  body[data-active-tab='main-agent'] {
    overflow: hidden;
  }

  body.sidebar-open {
    overflow: hidden;
  }

  .shell {
    grid-template-columns: minmax(0, 1fr);
    height: auto;
    overflow: visible;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(88vw, 390px);
    height: 100vh;
    max-width: 100vw;
    transform: translateX(-102%);
    transition: transform 180ms ease;
    z-index: 60;
    border-right: 1px solid var(--line);
    border-bottom: 0;
    box-shadow: none;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(3, 6, 12, 0.58);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
  }

  body.sidebar-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .workspace {
    padding: 18px 16px 28px;
    height: auto;
    overflow: visible;
  }

  .project-layout {
    display: block;
  }

  .project-rail {
    position: fixed;
    top: 12px;
    right: 0;
    height: calc(100dvh - 24px);
    width: min(88vw, 390px);
    transform: translateX(0);
  }

  .project-rail.sidebar-section--collapsed {
    position: fixed;
    right: -1px;
    width: min(88vw, 390px);
    height: calc(100dvh - 24px);
    top: 12px;
    transform: translateX(calc(100% - 44px));
  }

  .project-rail__toggle {
    top: 16px;
    left: -1px;
    width: 24px;
    height: 24px;
  }

  .project-layout__main {
    padding-right: 0;
  }

  body[data-active-tab='conversations'] .shell,
  body[data-active-tab='main-agent'] .shell {
    height: 100dvh;
    overflow: hidden;
  }

  body[data-active-tab='conversations'] .workspace,
  body[data-active-tab='main-agent'] .workspace {
    height: 100dvh;
    overflow: hidden;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    padding: 14px 14px calc(12px + env(safe-area-inset-bottom));
  }

  body[data-active-tab='conversations'] .topbar,
  body[data-active-tab='main-agent'] .topbar {
    margin-bottom: 12px;
    flex-direction: column;
    gap: 8px;
  }

  body[data-active-tab='conversations'] .topbar h1,
  body[data-active-tab='main-agent'] .topbar h1 {
    font-size: 1.6rem;
    line-height: 1.05;
  }

  body[data-active-tab='conversations'] .topbar p,
  body[data-active-tab='main-agent'] .topbar p,
  body[data-active-tab='conversations'] .topbar__logout-form,
  body[data-active-tab='main-agent'] .topbar__logout-form,
  body[data-active-tab='conversations'] .topbar__meta .chip,
  body[data-active-tab='main-agent'] .topbar__meta .chip {
    display: none;
  }

  body[data-active-tab='conversations'] .topbar__meta,
  body[data-active-tab='main-agent'] .topbar__meta {
    justify-content: flex-start;
    align-items: center;
    gap: 8px;
  }

  body[data-active-tab='conversations'] .tabs,
  body[data-active-tab='main-agent'] .tabs {
    margin-bottom: 12px;
    padding-bottom: 10px;
    overflow-x: visible;
    flex-wrap: wrap;
    row-gap: 8px;
  }

  body[data-active-tab='conversations'] .tab--utility,
  body[data-active-tab='main-agent'] .tab--utility {
    display: none;
  }

  body[data-active-tab='conversations'] .chat-shell,
  body[data-active-tab='main-agent'] .chat-shell {
    min-height: 0;
    height: 100%;
    margin-bottom: 0;
    align-items: stretch;
  }

  body[data-active-tab='conversations'] .chat-panel,
  body[data-active-tab='main-agent'] .chat-panel {
    min-height: 0;
    height: 100%;
    gap: 12px;
    grid-template-rows: auto minmax(0, 1fr) auto;
  }

  body[data-active-tab='conversations'] .chat-panel__header .eyebrow,
  body[data-active-tab='main-agent'] .chat-panel__header .eyebrow {
    display: none;
  }

  body[data-active-tab='conversations'] .chat-panel__header h2,
  body[data-active-tab='main-agent'] .chat-panel__header h2 {
    font-size: 1.3rem;
    line-height: 1.15;
  }

  body[data-active-tab='conversations'] .chat-thread,
  body[data-active-tab='main-agent'] .chat-thread {
    min-height: 0;
    padding: 4px 0 8px;
  }

  body[data-active-tab='conversations'] .chat-composer,
  body[data-active-tab='main-agent'] .chat-composer {
    position: sticky;
    bottom: 0;
    padding-top: 12px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
    background: var(--bg-0);
  }

  .chat-panel,
  .chat-rail {
    position: static;
  }

  .sidebar-toggle {
    display: inline-flex;
  }

  .sidebar-collapse-tab {
    display: none !important;
  }

  .topbar__meta {
    justify-content: flex-start;
  }

  .topbar {
    flex-direction: column;
  }

  .access-shell {
    padding: 16px;
  }

  .access-card {
    padding: 18px;
  }

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

  .status-row dd {
    text-align: left;
  }

  .workflow-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .workflow-row__form {
    flex-wrap: wrap;
  }

  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
