#app {
  --app-ink: #24202f;
  --app-muted: #777282;
  --app-line: #eae7ef;
  --app-violet: #7057e8;
  min-height: 100vh;
  background: #fff;
  color: var(--app-ink);
}

#app:not([hidden]) { display: flex; flex-direction: column; }
#app[hidden] { display: none; }

.app-header {
  height: 66px;
  min-height: 66px;
  padding: 0 32px;
  border-bottom: 1px solid var(--app-line);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.app-identity, .header-right { display: flex; align-items: center; }
.app-identity { gap: 13px; min-width: 0; }
.app-header .brand { font-size: 16px; letter-spacing: .08em; gap: 8px; }
.app-header .brandmark { width: 27px; height: 27px; }
.app-divider { color: #c4bfcb; font-size: 20px; font-weight: 300; margin: 0 5px; }
.app-workspace-name { font-size: 13px; font-weight: 650; white-space: nowrap; }
.workspace-icon { background: #f0ecff; color: var(--app-violet); }
.header-right { gap: 12px; }
.preview-badge { background: #f3f0ff; color: #6750d3; padding: 6px 10px; font-size: 11px; }
.avatar { background: var(--app-ink); color: #fff; border-radius: 50%; width: 30px; height: 30px; }

.app-tabs {
  min-height: 56px;
  display: flex;
  align-items: stretch;
  gap: 25px;
  padding: 0 32px;
  border-bottom: 1px solid var(--app-line);
  background: #fff;
  overflow-x: auto;
  scrollbar-width: thin;
}
.app-tabs button {
  position: relative;
  flex: 0 0 auto;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #6f6a7a;
  font-size: 13px;
  font-weight: 550;
  padding: 0 2px;
  white-space: nowrap;
}
.app-tabs button:hover, .app-tabs button.active { color: var(--app-ink); }
.app-tabs button.active { border-bottom-color: var(--app-violet); font-weight: 700; }
.app-tabs button:focus-visible, .context-sidebar button:focus-visible { outline: 2px solid var(--app-violet); outline-offset: -3px; }

.app-body { display: grid; grid-template-columns: 1fr; flex: 1; min-height: calc(100vh - 122px); }
.app-body.has-context { grid-template-columns: 224px minmax(0, 1fr); }
.context-sidebar {
  border-right: 1px solid var(--app-line);
  background: #fff;
  padding: 35px 17px;
}
.context-sidebar[hidden] { display: none; }
.context-title { color: #9992a4; font-size: 10px; font-weight: 800; letter-spacing: .12em; margin: 0 10px 15px; }
.context-sidebar nav { display: grid; gap: 3px; }
.context-sidebar button {
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--app-muted);
  text-align: left;
  font-size: 12px;
  padding: 10px 12px;
}
.context-sidebar button:hover { background: #f8f6fc; color: var(--app-ink); }
.context-sidebar button.active { background: #f0ecff; color: #654bd2; font-weight: 700; }

#app .content { width: 100%; max-width: 1200px; margin: 0 auto; padding: 48px 42px 90px; }
.app-body.has-context .content { max-width: 1270px; }
#app .page-top { border-bottom: 1px solid var(--app-line); padding-bottom: 26px; margin-bottom: 28px; align-items: center; }
#app .page-top h1 { font-size: 29px; font-weight: 700; margin-bottom: 6px; }
#app .page-top p { font-size: 13px; }
#app .panel, #app .stat { border-color: var(--app-line); border-radius: 11px; }
#app .panel-head { border-bottom-color: var(--app-line); }
#app .stat { min-height: 120px; }
#app .stat strong { color: var(--app-ink); }
#app .notice { background: #f8f6ff; border-color: #e6e0fa; color: #604bbe; }
#app .agent-row { border-bottom-color: var(--app-line); }
#app .agent-row:last-child { border-bottom: 0; }
#app .agent-row .pill { background: #f0ecff; color: #654bd2; }
#app .empty { padding: 64px 25px; }
#app .empty-icon { background: #f0ecff; color: var(--app-violet); }

@media (max-width: 800px) {
  .app-header { padding: 0 20px; }
  .app-tabs { padding: 0 20px; gap: 20px; }
  .app-body.has-context { display: block; }
  .context-sidebar { border-right: 0; border-bottom: 1px solid var(--app-line); padding: 13px 20px; }
  .context-title { display: none; }
  .context-sidebar nav { display: flex; gap: 6px; overflow-x: auto; }
  .context-sidebar button { flex: 0 0 auto; padding: 9px 12px; }
  #app .content { padding: 30px 20px 70px; }
}

@media (max-width: 480px) {
  .app-header .brand span, .app-divider, .preview-badge { display: none; }
  .app-header .workspace-icon { display: none; }
  .app-identity { gap: 10px; }
  .app-workspace-name { font-size: 12px; }
  #app .page-top { align-items: flex-start; }
  #app .page-top h1 { font-size: 25px; }
  #app .page-top .button { width: 100%; }
  #app .agent-row { flex-wrap: wrap; }
}
