:root {
  color-scheme: dark;
  --bg: #050505;
  --sidebar: #090909;
  --panel: #101114;
  --panel-soft: #18191d;
  --panel-hover: #202125;
  --text: #f4f4f5;
  --muted: #a2a2aa;
  --muted-soft: #74747c;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --accent: #f2f2f2;
  --accent-ink: #101010;
  --good: #7ee0a9;
  --warn: #e7b75f;
  --info: #77adff;
  --bad: #ff807a;
  --shadow: 0 18px 55px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

[hidden] {
  display: none !important;
}

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

button {
  cursor: pointer;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.app-shell {
  display: grid;
  grid-template-columns: 212px minmax(0, 1fr) 380px;
  grid-template-rows: 64px minmax(0, 1fr);
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  background: var(--bg);
}

.app-shell.admin-mode {
  grid-template-columns: 212px minmax(0, 1fr) 360px;
}

.app-shell.admin-mode .workspace-stage {
  grid-column: 2;
  padding-inline: 24px;
  align-items: stretch;
}

.app-shell.admin-mode .widget-rail {
  grid-column: 3;
}

.sidebar {
  position: relative;
  grid-column: 1;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  border-right: 1px solid var(--line);
  background: var(--bg);
  padding: 14px 12px;
}

.sidebar-brand {
  display: grid;
  gap: 2px;
  padding: 6px 8px 18px;
}

.sidebar-brand strong {
  font-size: 1rem;
}

.sidebar-brand span,
.sidebar-footer span {
  color: var(--muted);
  font-size: 0.78rem;
}

.sidebar-nav {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  gap: 8px;
}

.nav-item {
  position: relative;
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 13px;
  background: var(--panel);
  color: var(--muted);
  box-shadow: none;
  font-size: 0.86rem;
  font-weight: 720;
  text-align: left;
  transition:
    background 140ms ease,
    border-color 140ms ease,
    color 140ms ease;
}

.nav-item:hover,
.nav-item.active {
  border-color: var(--line-strong);
  background: var(--panel-hover);
  color: var(--text);
}

.nav-item.active {
  z-index: 2;
  box-shadow:
    inset 3px 0 0 var(--info),
    0 10px 28px rgba(0, 0, 0, 0.28);
}

.nav-item.active::after {
  display: none;
}

.nav-item[data-panel="logs"] {
  margin-top: auto;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding: 10px 8px 4px;
}

.sign-out-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 8px;
  background: transparent;
  color: var(--bad);
  font-size: 0.72rem;
}

.sign-out-button:hover {
  border-color: rgba(255, 128, 122, 0.42);
  background: rgba(255, 128, 122, 0.09);
  color: var(--bad);
}

.avatar-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #5f5f66;
}

.avatar-initial {
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  color: var(--text);
  font-size: 0.75rem;
  font-weight: 780;
  text-transform: uppercase;
  background: #3a3a3f;
  background-position: center;
  background-size: cover;
}

.sidebar-footer div {
  display: grid;
  gap: 1px;
}

.sidebar-footer strong {
  font-size: 0.82rem;
}

.workspace-stage {
  grid-column: 2;
  grid-row: 2;
  min-height: 0;
  height: 100%;
  padding: 32px 32px 56px;
  overflow: auto;
}

.sidebar,
.workspace-stage,
.widget-rail {
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.26) transparent;
}

.sidebar::-webkit-scrollbar,
.workspace-stage::-webkit-scrollbar,
.widget-rail::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

.sidebar::-webkit-scrollbar-thumb,
.workspace-stage::-webkit-scrollbar-thumb,
.widget-rail::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
}

.sidebar::-webkit-scrollbar-track,
.workspace-stage::-webkit-scrollbar-track,
.widget-rail::-webkit-scrollbar-track {
  background: transparent;
}

.topbar {
  grid-column: 1 / -1;
  grid-row: 1;
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
  height: 64px;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 5, 5, 0.96);
  padding: 0 18px;
}

.topbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--text);
  font-size: 1rem;
  font-weight: 760;
}

.brand-logo {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border-radius: 8px;
  object-fit: cover;
}

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

.account-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px 0 7px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
  font-weight: 660;
}

.account-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.account-status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted-soft);
  box-shadow: 0 0 0 3px rgba(116, 116, 124, 0.12);
}

.account-status.online {
  color: var(--good);
}

.account-status.online::before {
  background: var(--good);
  box-shadow: 0 0 0 3px rgba(126, 224, 169, 0.13);
}

.account-status.offline {
  color: var(--bad);
}

.account-status.offline::before {
  background: var(--bad);
  box-shadow: 0 0 0 3px rgba(255, 128, 122, 0.13);
}

.account-button:hover {
  border-color: var(--line-strong);
  background: var(--panel-hover);
}

.backend-pill {
  min-width: 178px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

.backend-pill.ok {
  border-color: rgba(126, 224, 169, 0.25);
  color: var(--good);
}

.backend-pill.error {
  border-color: rgba(255, 128, 122, 0.28);
  color: var(--bad);
}

.workspace-view {
  display: block;
  min-height: calc(100vh - 128px);
}

.workspace-view[hidden] {
  display: none !important;
}

.chat-stage {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.assistant-thread {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  width: min(760px, 100%);
  height: 100%;
  min-height: 0;
  max-height: min(760px, 100%);
}

.assistant-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 0 6px 22px;
  text-align: left;
}

.assistant-header h1 {
  margin-bottom: 0;
}

.assistant-messages {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px 6px 18px;
  scrollbar-gutter: stable;
}

.chat-message {
  width: fit-content;
  max-width: min(680px, 90%);
  border-radius: 16px;
  padding: 10px 13px;
  background: rgba(255, 255, 255, 0.045);
}

.chat-message.user {
  justify-self: end;
  background: rgba(255, 255, 255, 0.11);
}

.chat-message strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
  font-size: 0.78rem;
}

.chat-message p {
  margin: 0;
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.task-progress-message {
  max-width: min(720px, 92%);
}

.task-progress-foldout {
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.18);
}

.task-progress-foldout summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
}

.task-progress-foldout summary::-webkit-details-marker {
  display: none;
}

.task-progress-foldout summary span {
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 700;
}

.task-progress-foldout summary small {
  color: var(--muted);
  font-size: 0.72rem;
  white-space: nowrap;
}

.task-progress-foldout ol {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0 10px 10px 26px;
}

.task-progress-foldout li {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.task-progress-foldout li span {
  display: inline-block;
  min-width: 34px;
  color: var(--muted-strong);
  font-weight: 700;
}

.task-progress-foldout code {
  color: var(--text);
  font-family: inherit;
  font-size: 0.78rem;
}

.confirmation-message {
  border: 1px solid rgba(231, 183, 95, 0.18);
}

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

.workspace-header {
  width: min(880px, 100%);
  padding-top: 56px;
  margin-bottom: 20px;
}

.workspace-header h1 {
  margin-bottom: 12px;
  font-size: 1.72rem;
}

.workspace-header p:not(.eyebrow) {
  max-width: 680px;
  color: var(--muted);
  line-height: 1.55;
}

.task-flow-stage,
.worker-stage,
.logs-stage,
.profile-stage,
.api-market-stage,
.remote-storage-stage,
.filing-stage,
.admin-stage {
  width: min(980px, 100%);
}

.app-shell.admin-mode .admin-stage {
  width: 100%;
}

.app-shell.admin-mode .workspace-header p:not(.eyebrow) {
  max-width: 920px;
}

.workspace-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 50px;
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
}

.panel-title-row.compact {
  min-height: 42px;
  padding: 10px 12px;
}

.panel-title-row p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.worker-layout {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
}

.warn-text {
  color: var(--warn) !important;
}

.davinci-mcp-status-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  padding: 8px;
}

.davinci-mcp-summary-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.davinci-mcp-summary-pill,
.davinci-mcp-device-row {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.16);
  padding: 4px 7px;
}

.davinci-mcp-summary-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  gap: 5px;
  text-align: center;
  white-space: nowrap;
}

.davinci-mcp-summary-pill span,
.davinci-mcp-device-row small {
  display: inline;
  color: var(--muted);
  font-size: 0.62rem;
}

.davinci-mcp-summary-pill strong {
  color: var(--text);
  font-size: 0.68rem;
  white-space: nowrap;
}

.davinci-mcp-status-body {
  display: grid;
  gap: 6px;
  color: var(--muted);
}

.davinci-mcp-status-body a {
  color: var(--accent);
  text-decoration: none;
}

.davinci-mcp-device-list {
  display: grid;
  gap: 8px;
}

.davinci-mcp-device-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.worker-primary-panel {
  min-width: 0;
}

.worker-upload-panel {
  display: grid;
  gap: 10px;
}

.worker-upload-directory {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  padding: 10px 12px;
  color: var(--muted);
  font-size: 0.76rem;
}

.worker-upload-directory code {
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.worker-upload-test-notice {
  min-height: 18px;
  margin: 0 14px;
  color: var(--good);
  font-size: 0.76rem;
  font-weight: 760;
}

.worker-upload-result {
  margin: 0 14px 14px;
}

.upload-result-empty,
.upload-result-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  padding: 12px;
}

.upload-result-empty {
  color: var(--muted);
  font-size: 0.82rem;
}

.upload-result-card {
  display: grid;
  gap: 12px;
}

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

.upload-result-head > div {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.upload-result-head strong {
  color: var(--text);
  font-size: 0.95rem;
}

.upload-result-grid {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px 12px;
  align-items: baseline;
  border-top: 1px solid var(--line);
  padding-top: 10px;
  color: var(--muted);
  font-size: 0.76rem;
}

.upload-result-grid strong {
  overflow-wrap: anywhere;
  color: var(--text);
}

.worker-action-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
}

.worker-action-tile {
  display: grid;
  min-height: 66px;
  align-content: start;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--text);
  padding: 10px;
  text-align: left;
}

.worker-action-tile:hover {
  border-color: var(--line-strong);
  background: var(--panel-hover);
}

.worker-action-tile.primary-action {
  border-color: rgba(99, 211, 142, 0.42);
  background: rgba(99, 211, 142, 0.1);
}

.worker-action-tile.primary-action strong {
  color: var(--good);
}

.worker-action-tile.config-action {
  border-color: rgba(119, 173, 255, 0.34);
  background: rgba(119, 173, 255, 0.08);
}

.worker-action-tile.config-action strong {
  color: var(--info);
}

.worker-action-tile.config-action:hover {
  border-color: rgba(119, 173, 255, 0.52);
  background: rgba(119, 173, 255, 0.13);
}

.worker-action-tile strong {
  font-size: 0.8rem;
}

.worker-action-tile span {
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.35;
}

.scripts-layout {
  display: grid;
  gap: 16px;
}

.voice-clone-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
  gap: 14px;
  margin-bottom: 16px;
}

.voice-clone-status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
  padding: 0 14px 2px;
}

.voice-clone-status-grid article {
  min-height: 76px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  padding: 10px;
}

.voice-clone-status-grid span,
#voiceCloneResultPanel span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 760;
}

.voice-clone-status-grid strong {
  display: block;
  margin-top: 8px;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 0.9rem;
}

.voice-clone-task-flow-button {
  white-space: nowrap;
}

#voiceCloneResultPanel {
  display: grid;
  gap: 6px;
  line-height: 1.45;
}

.install-command-card {
  margin: 0 12px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.install-command-card pre {
  min-height: 100px;
  max-height: 180px;
}

.command-actions {
  display: inline-flex;
  justify-content: flex-end;
  gap: 8px;
}

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

.remote-storage-panel .catalog-grid {
  margin: 14px;
}

.script-upload-panel .profile-notice,
.remote-storage-panel .profile-notice {
  margin: 0 14px 14px;
}

.script-upload-panel .profile-notice:empty {
  display: none;
}

.api-manager-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
}

.api-manager-list {
  display: grid;
  gap: 14px;
}

.api-manager-toolbar p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.app-shell.admin-mode .admin-grid {
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
}

.admin-side-widget .summary-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.compact-detail-grid {
  gap: 8px;
}

.compact-detail-grid > div {
  padding: 12px;
}

.admin-only-shell {
  display: grid;
  gap: 14px;
  width: 100%;
}

.admin-hero-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px;
}

.admin-hero-panel p:last-child {
  margin: 8px 0 0;
  color: var(--muted);
}

.admin-action-row {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

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

.admin-metric {
  padding: 16px;
}

.admin-metric span {
  display: block;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 760;
}

.admin-metric strong {
  font-size: 1.8rem;
}

.catalog-card,
.admin-card {
  overflow: hidden;
}

.catalog-body {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.catalog-body > .status {
  justify-self: start;
  width: fit-content;
}

.catalog-facts {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 7px 10px;
  font-size: 0.78rem;
}

.catalog-facts span {
  color: var(--muted);
}

.catalog-facts strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-body p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.55;
}

.admin-card-body {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.admin-api-provider-status {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  white-space: normal;
}

.admin-api-provider-status > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.025);
}

.admin-api-provider-status span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted-soft);
  font-size: 0.66rem;
  font-weight: 760;
}

.admin-api-provider-status strong {
  color: var(--text);
  font-size: 1rem;
}

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

.admin-integration-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.025);
}

.admin-integration-row > div:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.admin-integration-row strong,
.admin-integration-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-integration-row strong {
  color: var(--text);
  font-size: 0.84rem;
}

.admin-integration-row small,
.admin-integration-category,
.admin-integration-meta span:first-child,
.admin-integration-credential {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
}

.admin-integration-category {
  color: var(--info);
}

.admin-integration-meta {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.admin-integration-credential {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 7px;
  background: rgba(0, 0, 0, 0.14);
  white-space: nowrap;
}

.admin-compact-card .panel-title-row {
  min-height: 38px;
  padding: 8px 10px;
}

.admin-compact-card .panel-title-row h2 {
  font-size: 0.96rem;
}

.admin-compact-card .admin-card-body {
  gap: 6px;
  padding: 8px 10px;
}

.admin-invite-card .admin-card-body {
  white-space: normal;
}

.admin-user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 8px;
  background: rgba(255, 255, 255, 0.025);
}

.admin-invite-form {
  display: grid;
  gap: 5px;
}

.admin-invite-card .admin-invite-form {
  gap: 5px;
}

.admin-invite-expiry-row,
.admin-invite-actions {
  display: grid;
  gap: 8px;
}

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

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

.admin-invite-form label {
  display: block;
  min-width: 0;
}

.admin-invite-form span {
  color: var(--muted);
  font-size: 0.72rem;
}

.admin-invite-form input,
.admin-invite-form input[readonly] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  font: inherit;
}

.admin-invite-card .admin-invite-form input,
.admin-invite-card .admin-invite-form input[readonly] {
  padding: 7px 8px;
  font-size: 0.78rem;
}

.admin-invite-card .mini-button {
  min-height: 32px;
  padding: 6px 9px;
  font-size: 0.76rem;
}

.admin-invite-list {
  display: grid;
  gap: 6px;
  max-height: 96px;
  overflow-y: auto;
}

.admin-invite-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 6px;
  background: rgba(255, 255, 255, 0.025);
}

.admin-invite-row > span:first-child {
  flex: 1;
  min-width: 0;
}

.admin-invite-row small {
  display: inline;
  margin-left: 8px;
  color: var(--muted);
  font-size: 0.68rem;
}

.admin-user-row span {
  color: var(--text);
}

.admin-user-row > span:first-child {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.admin-user-row.selected {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.055);
}

.admin-user-row small {
  display: inline;
  margin-left: 8px;
  color: var(--muted);
  font-size: 0.68rem;
}

.admin-user-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.panel-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.search-field input {
  min-width: 0;
  width: 180px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  padding: 0 10px;
  font-size: 0.78rem;
}

.search-field input:focus {
  outline: none;
  border-color: var(--line-strong);
}

.admin-user-search input {
  width: 160px;
}

.main-task-list {
  max-height: 62vh;
}

.worker-list-main {
  max-height: 58vh;
}

.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 8px;
}

.summary-metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.025);
}

.summary-metric span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 760;
  text-transform: uppercase;
}

.summary-metric strong {
  color: var(--text);
  font-size: 1.28rem;
}

.summary-metric.failed-metric strong,
.summary-metric.failed-metric span {
  color: var(--bad);
}

.summary-metric.cancelled-metric strong,
.summary-metric.cancelled-metric span {
  color: var(--warn);
}

.hero-composer {
  width: min(690px, 100%);
  margin-top: -40px;
  text-align: center;
}

.login-gate {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 177, 45, 0.1), transparent 34%),
    var(--bg);
}

.login-panel {
  width: min(430px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 24px;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 0 26px;
}

.login-logo {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
}

.login-brand div {
  display: grid;
  gap: 2px;
}

.login-brand strong {
  color: var(--text);
  font-size: 1.05rem;
}

.login-brand span {
  color: var(--muted);
  font-size: 0.78rem;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.025);
}

.auth-tab {
  min-height: 32px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.auth-tab.active {
  background: var(--panel-hover);
  color: var(--text);
}

.login-form {
  padding: 0;
}

.login-button {
  width: 100%;
  margin-top: 4px;
}

.login-notice {
  margin-top: 14px;
}

.link-button {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  margin-top: 10px;
  border: 0;
  border-radius: 6px;
  padding: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 680;
}

.link-button:hover {
  color: var(--text);
}

.profile-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 14px;
}

.profile-card {
  padding: 16px;
}

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

.profile-avatar {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  color: var(--text);
  font-size: 1.7rem;
  font-weight: 820;
  text-transform: uppercase;
  background: var(--panel-hover);
  background-position: center;
  background-size: cover;
}

.profile-identity p {
  margin: 5px 0 0;
  color: var(--muted);
}

.profile-form {
  display: grid;
  gap: 8px;
}

.profile-form label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 760;
  text-transform: uppercase;
}

.profile-form input {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  outline: none;
  background: #0b0b0c;
  color: var(--text);
}

.password-field {
  position: relative;
  display: grid;
}

.password-field input {
  padding-right: 42px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  transform: translateY(-50%);
}

.password-toggle:hover,
.password-toggle.active {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
}

.eye-icon {
  position: relative;
  width: 16px;
  height: 10px;
  border: 1.8px solid currentColor;
  border-radius: 999px / 700px;
}

.eye-icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  transform: translate(-50%, -50%);
}

.avatar-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.avatar-picker input[readonly] {
  color: var(--muted);
}

.avatar-pick-button {
  min-height: 36px;
  border-radius: 8px;
  white-space: nowrap;
}

.profile-form input:focus {
  border-color: var(--line-strong);
}

.profile-submit {
  margin-top: 6px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 6px;
}

.filing-form {
  max-width: 760px;
  padding: 14px;
}

.site-filing-footer {
  position: fixed;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  max-width: calc(100vw - 32px);
  color: var(--muted-soft);
  font-size: 0.72rem;
  text-align: center;
  pointer-events: auto;
}

.site-filing-footer a,
.site-filing-footer span {
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}

.site-filing-footer a:hover {
  color: var(--muted);
}

.script-upload-form,
.worker-upload-test-form {
  display: grid;
  gap: 12px;
  margin: 14px 14px 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.script-upload-form label,
.worker-upload-test-form label,
.model-setting-row label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 760;
}

.script-upload-form input,
.script-upload-form select,
.script-upload-form textarea,
.worker-upload-test-form input,
.worker-upload-test-form select,
.remote-storage-form input,
.remote-storage-form select,
.inline-path-input,
.model-setting-row select {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  padding: 10px 11px;
}

.voice-clone-form {
  display: grid;
  gap: 12px;
  margin: 14px 14px 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.voice-clone-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 760;
}

.voice-clone-form input,
.voice-clone-form select,
.voice-clone-form textarea {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  padding: 10px 11px;
}

.script-upload-form textarea {
  min-height: 190px;
  resize: vertical;
  line-height: 1.45;
}

.voice-clone-form textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.45;
}

.voice-clone-form #voiceCloneTargetTextInput {
  min-height: 150px;
}

.script-picker {
  display: grid;
  gap: 8px;
}

.script-picker-row,
.voice-audio-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.voice-clone-options {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 10px;
}

.script-picker-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.script-review-result-box {
  min-height: 88px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
  color: var(--text);
  padding: 12px;
  line-height: 1.5;
}

.script-download-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 62px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
  padding: 10px 12px;
}

.script-download-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.script-download-title {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.script-download-title strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.embedded-panel {
  margin: 12px 14px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  padding: 8px;
}

.api-provider-editor {
  overflow: hidden;
}

.api-provider-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
}

.api-provider-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 760;
}

.api-provider-form input,
.api-provider-form select {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  padding: 10px 11px;
}

.form-grid.two-columns {
  display: grid;
  grid-template-columns: minmax(0, 180px) minmax(0, 1fr);
  gap: 10px;
}

.model-setting-row,
.script-record-main,
.script-record-actions,
.script-record-foot {
  display: flex;
  align-items: center;
  gap: 8px;
}

.model-setting-row {
  justify-content: flex-start;
  align-items: center;
  margin-bottom: 12px;
}

.model-setting-row label {
  flex: 0 0 auto;
}

.model-setting-row select {
  width: 180px;
  height: 30px;
  padding: 0 10px;
}

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

.script-record-row {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  padding: 9px 10px;
}

.compact-script-list .script-record-row {
  padding: 8px 9px;
}

.script-record-row.selected {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.055);
}

.remote-storage-layout {
  display: grid;
  gap: 16px;
}

.remote-storage-editor {
  display: grid;
  gap: 14px;
}

.remote-storage-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 12px;
  margin: 0 14px 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.remote-storage-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 760;
}

.remote-oauth-panel {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.025);
}

.remote-oauth-panel span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 780;
  text-transform: uppercase;
}

.remote-oauth-panel strong {
  display: block;
  color: var(--text);
  font-size: 0.92rem;
}

.remote-oauth-panel p {
  margin: 6px 0 0;
  color: var(--muted-soft);
  font-size: 0.78rem;
  line-height: 1.45;
}

.remote-oauth-session {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.025);
}

.remote-oauth-session span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 780;
}

.remote-oauth-session strong {
  display: block;
  color: var(--text);
  font-size: 1rem;
  letter-spacing: 0.08em;
}

.remote-oauth-session p {
  margin: 5px 0 0;
  color: var(--muted-soft);
  font-size: 0.76rem;
  line-height: 1.45;
}

.remote-oauth-links {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.ghost-link {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--text);
  font-size: 0.76rem;
  font-weight: 720;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.055);
}

.ghost-link:hover {
  border-color: var(--line-strong);
  background: var(--panel-hover);
}

.inline-path-input {
  width: min(220px, 34vw);
  height: 30px;
  padding: 0 10px;
}

.catalog-card.selected {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.045);
}

.remote-storage-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 3px 14px 10px;
}

.remote-storage-tab {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 760;
  cursor: pointer;
}

.remote-storage-tab.active {
  border-color: var(--line-strong);
  color: var(--text);
  background: var(--panel-hover);
}

.remote-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin: 2px 14px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 720;
}

.remote-breadcrumb button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 760;
  cursor: pointer;
}

.breadcrumb-separator {
  color: var(--faint);
}

.remote-file-window {
  min-height: 260px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
  padding: 12px;
}

.remote-empty-state {
  display: grid;
  place-content: center;
  min-height: 220px;
  color: var(--muted);
  text-align: center;
}

.remote-empty-state strong {
  color: var(--text);
  font-size: 1rem;
}

.remote-empty-state p {
  max-width: 520px;
  margin: 8px auto 0;
  line-height: 1.5;
}

.remote-file-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 90px auto;
  gap: 10px;
  align-items: center;
  min-height: 42px;
  border-bottom: 1px solid var(--line);
}

.remote-file-row:last-child {
  border-bottom: 0;
}

.remote-file-row span,
.remote-file-row small {
  color: var(--muted);
  font-size: 0.74rem;
}

.remote-file-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.remote-file-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.script-record-main {
  justify-content: space-between;
  align-items: flex-start;
}

.script-record-main div {
  display: grid;
  gap: 4px;
}

.script-record-row p {
  margin: 0;
  color: var(--text);
  font-size: 0.8rem;
  line-height: 1.45;
}

.script-record-row small,
.script-record-foot {
  color: var(--muted);
}

.script-record-foot {
  justify-content: flex-start;
  font-size: 0.76rem;
}

.script-record-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

mark {
  border-radius: 4px;
  background: rgba(255, 87, 87, 0.22);
  color: #ff8b8b;
  padding: 0 2px;
}

.script-review-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.profile-notice {
  margin-top: 12px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--muted-soft);
  font-size: 0.74rem;
  font-weight: 760;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin-bottom: 26px;
  color: var(--text);
  font-size: 1.55rem;
  font-weight: 520;
  line-height: 1.25;
}

h2 {
  margin-bottom: 0;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 680;
}

h3 {
  margin-bottom: 0;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 680;
}

.composer-form {
  display: block;
  position: sticky;
  bottom: 0;
  z-index: 1;
  padding: 10px 4px 0;
  background: var(--bg);
}

.mention-popover {
  position: absolute;
  right: 10px;
  bottom: 62px;
  z-index: 8;
  display: grid;
  width: min(280px, calc(100vw - 32px));
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #15161a;
  box-shadow: var(--shadow);
  padding: 6px;
}

.mention-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  padding: 0 10px;
  background: transparent;
  color: var(--text);
  text-align: left;
  font-size: 0.8rem;
  font-weight: 720;
}

.mention-option:hover {
  background: rgba(255, 255, 255, 0.07);
}

.mention-option small {
  color: var(--muted);
  font-size: 0.68rem;
}

.composer {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #242424;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition:
    border-color 140ms ease,
    background 140ms ease,
    box-shadow 140ms ease;
}

.composer:focus-within {
  border-color: rgba(255, 255, 255, 0.2);
  background: #292929;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.04);
}

.composer textarea {
  width: 100%;
  min-height: 46px;
  max-height: 120px;
  border: 0;
  resize: none;
  padding: 13px 148px 13px 30px;
  background: transparent;
  color: var(--text);
  line-height: 1.45;
  outline: 0;
  box-shadow: none;
}

.composer textarea::placeholder,
input::placeholder {
  color: #8b8b90;
}

.composer-send-group {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.send-button {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: #6c6c70;
  color: #111;
  font-size: 1.28rem;
  font-weight: 850;
  line-height: 1;
}

.send-button:hover {
  background: var(--accent);
}

.send-button:disabled {
  cursor: not-allowed;
  background: #505055;
  color: rgba(0, 0, 0, 0.5);
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.switch input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
}

.switch-track {
  position: relative;
  width: 36px;
  height: 20px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.switch-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #c9c9ce;
  transition: transform 140ms ease;
}

.switch input:checked + .switch-track {
  background: rgba(242, 242, 242, 0.18);
}

.switch input:checked + .switch-track::after {
  transform: translateX(16px);
  background: #f5f5f5;
}

.compact-switch {
  font-size: 0.72rem;
  font-weight: 760;
  text-transform: uppercase;
}

.compact-switch .switch-track {
  width: 30px;
  height: 17px;
}

.compact-switch .switch-track::after {
  top: 2px;
  left: 2px;
  width: 11px;
  height: 11px;
}

.compact-switch input:checked + .switch-track::after {
  transform: translateX(13px);
}

.filing-title-row {
  align-items: center;
}

.notice {
  min-height: 24px;
  margin: 10px 8px 0;
  color: var(--muted-soft);
  font-size: 0.86rem;
  text-align: left;
}

.notice.error {
  color: var(--bad);
}

.notice.success {
  color: var(--good);
}

.notice.warn {
  color: var(--warn);
}

.widget-rail {
  grid-column: 3;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow-y: scroll;
  overscroll-behavior: contain;
  border-left: 1px solid var(--line);
  background: #080809;
  padding: 14px 14px 24px;
}

.widget-rail::after {
  content: "";
  display: block;
  flex: 0 0 42px;
}

.widget {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.widget-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  border-bottom: 1px solid var(--line);
  padding: 0 12px;
}

.widget-heading.compact {
  border-top: 1px solid var(--line);
}

.bad-text {
  color: var(--bad);
}

.good-text {
  color: var(--good);
}

.muted {
  color: var(--muted);
  font-size: 0.78rem;
}

.settings-panel {
  padding-bottom: 12px;
}

.setting-list {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.025);
}

.setting-copy {
  display: grid;
  gap: 4px;
}

.setting-copy strong {
  color: var(--text);
  font-size: 0.82rem;
}

.setting-copy small {
  color: var(--muted-soft);
  font-size: 0.72rem;
}

.rail-action-button {
  width: 100%;
}

.api-cost-panel {
  overflow: hidden;
}

.api-cost-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 12px 12px 8px;
}

.api-cost-summary div,
.api-cost-provider-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  padding: 9px;
}

.api-cost-summary span,
.api-cost-table-head,
.api-cost-provider-row span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 760;
}

.api-cost-summary span {
  display: block;
  margin-bottom: 6px;
}

.api-cost-summary strong,
.api-cost-provider-row strong {
  color: var(--text);
  font-size: 0.9rem;
}

.api-cost-table-head,
.api-cost-provider-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px minmax(76px, auto);
  align-items: center;
  gap: 8px;
}

.api-cost-table-head {
  padding: 4px 12px 6px;
}

.api-cost-provider-list {
  display: grid;
  gap: 7px;
  padding: 0 12px 8px;
}

.api-cost-status {
  justify-self: start;
}

.api-cost-status.available {
  color: var(--good);
}

.api-cost-status.billing_due,
.api-cost-status.error {
  color: var(--bad);
}

.api-cost-status.loading,
.api-cost-status.waiting {
  color: var(--warn);
}

.api-cost-refresh-meta {
  display: block;
  padding: 0 12px 12px;
  color: var(--muted);
  font-size: 0.68rem;
}

.storage-summary {
  display: grid;
  gap: 12px;
  padding: 12px;
}

.storage-meter {
  display: grid;
  gap: 8px;
}

.remote-storage-summary-list {
  display: grid;
  gap: 8px;
}

.remote-storage-usage-item {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px;
  background: rgba(255, 255, 255, 0.025);
}

.storage-meter-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--text);
  font-size: 0.8rem;
}

.storage-meter-row span {
  color: var(--muted);
  font-size: 0.74rem;
  white-space: nowrap;
}

.quota-bar {
  position: relative;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
}

.quota-bar span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(98, 220, 149, 0.95), rgba(111, 177, 255, 0.95));
  transition: width 180ms ease;
}

.quota-bar span.storage-ok {
  background: linear-gradient(90deg, rgba(98, 220, 149, 0.95), rgba(126, 224, 169, 0.82));
}

.quota-bar span.storage-high {
  background: linear-gradient(90deg, rgba(255, 128, 122, 0.95), rgba(231, 183, 95, 0.9));
}

.storage-meter small {
  color: var(--muted-soft);
  font-size: 0.7rem;
  line-height: 1.35;
}

.token-form {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.token-form label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 760;
  text-transform: uppercase;
}

.token-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

input[type="password"] {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: #0b0b0d;
  color: var(--text);
}

input[type="text"] {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: #0b0b0d;
  color: var(--text);
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.12);
  outline-offset: 2px;
}

.ghost-button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
  font-weight: 660;
}

.ghost-button:hover {
  border-color: var(--line-strong);
  background: var(--panel-hover);
}

.mini-button {
  min-height: 30px;
  border-radius: 8px;
  padding: 0 10px;
  font-size: 0.76rem;
}

.danger-button:hover {
  border-color: rgba(255, 128, 122, 0.34);
  background: rgba(255, 128, 122, 0.13);
  color: var(--bad);
}

.danger-button {
  border-color: rgba(255, 128, 122, 0.3);
  background: rgba(255, 128, 122, 0.08);
  color: var(--bad);
}

.warn-button {
  border-color: rgba(231, 183, 95, 0.32);
  background: rgba(231, 183, 95, 0.08);
  color: var(--warn);
}

.warn-button:hover {
  border-color: rgba(231, 183, 95, 0.5);
  background: rgba(231, 183, 95, 0.13);
  color: var(--warn);
}

.success-button {
  border-color: rgba(126, 224, 169, 0.32);
  background: rgba(126, 224, 169, 0.08);
  color: var(--good);
}

.success-button:hover {
  border-color: rgba(126, 224, 169, 0.48);
  background: rgba(126, 224, 169, 0.13);
  color: var(--good);
}

.config-button {
  border-color: rgba(119, 173, 255, 0.34);
  background: rgba(119, 173, 255, 0.08);
  color: var(--info);
}

.config-button:hover {
  border-color: rgba(119, 173, 255, 0.52);
  background: rgba(119, 173, 255, 0.13);
  color: var(--info);
}

.task-list {
  display: grid;
  gap: 6px;
  max-height: 250px;
  overflow: auto;
  padding: 8px;
}

.worker-form {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.worker-form-main {
  padding: 14px;
}

.worker-form label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 760;
  text-transform: uppercase;
}

.worker-token-once {
  margin: 0 12px 10px;
  border: 1px solid rgba(231, 183, 95, 0.35);
  border-radius: 8px;
  padding: 10px;
  background: rgba(231, 183, 95, 0.08);
  color: var(--warn);
  font-size: 0.75rem;
  overflow-wrap: anywhere;
}

.worker-token-once.success {
  border-color: rgba(106, 209, 159, 0.38);
  background: rgba(106, 209, 159, 0.1);
  color: var(--good);
}

.worker-token-once.error {
  border-color: rgba(239, 93, 93, 0.38);
  background: rgba(239, 93, 93, 0.1);
  color: var(--bad);
}

.worker-manual-copy {
  display: grid;
  gap: 8px;
}

.worker-manual-copy strong {
  color: var(--warn);
}

.worker-manual-copy span {
  color: var(--muted);
}

.worker-manual-command {
  width: 100%;
  min-height: 92px;
  resize: vertical;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.45);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.74rem;
  line-height: 1.55;
  outline: none;
}

.worker-manual-command:focus {
  border-color: rgba(106, 209, 159, 0.55);
  box-shadow: 0 0 0 2px rgba(106, 209, 159, 0.12);
}

.worker-list {
  display: grid;
  gap: 6px;
  max-height: 180px;
  overflow: auto;
  padding: 8px;
}

.worker-pending-list {
  padding: 8px 8px 0;
}

.worker-pending-card {
  display: grid;
  gap: 5px;
  border: 1px solid rgba(231, 183, 95, 0.28);
  border-radius: 8px;
  padding: 10px;
  background: rgba(231, 183, 95, 0.07);
}

.worker-pending-card strong {
  color: var(--warn);
  font-size: 0.78rem;
}

.worker-pending-card small {
  color: var(--muted);
  line-height: 1.5;
}

.worker-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.025);
}

.worker-card-actions {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.worker-card span:first-child {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.worker-card strong {
  overflow: hidden;
  color: var(--text);
  font-size: 0.84rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.worker-card small {
  color: var(--muted-soft);
  font-size: 0.72rem;
}

.worker-card-hint {
  max-width: 360px;
  color: var(--muted-soft);
  font-size: 0.68rem;
  line-height: 1.35;
  white-space: normal;
}

.worker-card-identity,
.worker-card-logs {
  max-width: 420px;
  color: var(--muted-soft);
  font-size: 0.68rem;
  line-height: 1.4;
  white-space: normal;
}

.worker-card-logs {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.worker-card-feedback {
  max-width: 360px;
  color: var(--good);
  font-size: 0.68rem;
  font-weight: 760;
  line-height: 1.35;
  white-space: normal;
}

.worker-card-feedback.error {
  color: var(--bad);
}

.worker-mcp-panel .panel-title-row,
.admin-mcp-card .panel-title-row {
  min-height: 44px;
}

.admin-mcp-card .mini-button {
  width: auto;
  min-width: 0;
  padding-inline: 10px;
  white-space: nowrap;
}

.worker-mcp-status,
.admin-mcp-card .admin-card-body {
  display: grid;
  gap: 8px;
}

.davinci-mcp-status-card {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.davinci-mcp-status-card p,
.davinci-mcp-status-card small {
  margin: 0;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.45;
}

.davinci-mcp-device-list {
  display: grid;
  gap: 6px;
}

.davinci-mcp-device-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.025);
}

.davinci-mcp-device-row span:first-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.davinci-mcp-device-row strong,
.davinci-mcp-device-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.davinci-mcp-update {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 7px;
  font-size: 0.68rem;
  font-weight: 760;
}

.davinci-mcp-update.ok {
  border-color: rgba(126, 224, 169, 0.25);
  color: var(--good);
}

.davinci-mcp-update.warn {
  border-color: rgba(231, 183, 95, 0.32);
  color: var(--warn);
}

.admin-voice-clone-repo-card .admin-card-body {
  display: grid;
  gap: 6px;
}

.voice-clone-repo-status-card {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.voice-clone-repo-status-card p,
.voice-clone-repo-status-card small {
  margin: 0;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.45;
}

.voice-clone-repo-head {
  display: grid;
  grid-template-columns: minmax(72px, 1fr) repeat(2, minmax(88px, max-content));
  align-items: center;
  gap: 8px;
}

.voice-clone-repo-grid {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 5px 10px;
  font-size: 0.74rem;
}

.voice-clone-repo-grid span {
  color: var(--muted-soft);
}

.voice-clone-repo-grid strong {
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.worker-action-tile.danger-action {
  border-color: rgba(239, 93, 93, 0.42);
  background: rgba(239, 93, 93, 0.1);
}

.worker-action-tile.danger-action strong {
  color: var(--bad);
}

.worker-action-tile.danger-action:hover {
  border-color: rgba(239, 93, 93, 0.64);
  background: rgba(239, 93, 93, 0.15);
}

.widget:target,
[data-panel-target]:focus-within {
  border-color: var(--line-strong);
}

.task-card {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px;
  background: transparent;
  color: inherit;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
}

.task-card-main {
  min-width: 0;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

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

.task-cancel-button {
  align-self: start;
}

.task-card-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.task-card-title strong {
  color: var(--text);
  font-size: 0.86rem;
}

.task-worker-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 8px 0;
}

.task-worker-filter-button {
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  padding: 0 10px;
  font-size: 0.75rem;
  font-weight: 760;
}

.task-worker-filter-button.active,
.task-worker-filter-button:hover {
  border-color: var(--line-strong);
  color: var(--text);
  background: var(--panel-hover);
}

.status {
  border-radius: 999px;
  padding: 2px 7px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 760;
  white-space: nowrap;
}

.status.succeeded {
  color: var(--good);
}

.worker-card .status.online {
  color: var(--good);
}

.status.pending {
  color: var(--info);
}

.status.failed {
  color: var(--bad);
}

.worker-card .status.offline {
  color: var(--bad);
}

.status.running {
  color: var(--warn);
}

.status.partial_succeeded {
  color: var(--warn);
}

.status.waiting_confirmation {
  color: var(--warn);
}

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

.status.disabled {
  color: var(--muted-soft);
}

.task-detail-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.task-message {
  display: -webkit-box;
  overflow: hidden;
  margin: 0 0 8px;
  color: var(--text);
  font-size: 0.83rem;
  line-height: 1.42;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.task-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted-soft);
  font-size: 0.72rem;
}

.task-meta span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-panel {
  overflow: hidden;
}

.detail-grid {
  display: grid;
  gap: 8px;
  padding: 8px;
}

.davinci-context-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 8px 8px 0;
}

.davinci-context-tab {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 760;
}

.davinci-context-tab.active {
  border-color: var(--line-strong);
  background: var(--panel-hover);
  color: var(--text);
}

.davinci-context-list {
  display: grid;
  gap: 8px;
  padding: 8px;
}

.davinci-context-item {
  display: grid;
  gap: 4px;
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--text);
  text-align: left;
}

.davinci-context-item:hover,
.davinci-context-item.selected {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.055);
}

.davinci-context-item strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.82rem;
}

.davinci-context-item small {
  color: var(--muted);
  font-size: 0.7rem;
}

.inspector-summary,
.action-facts,
.detail-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.inspector-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
}

.inspector-summary h3 {
  margin: 3px 0 0;
  font-size: 1rem;
}

.action-facts {
  display: grid;
  overflow: hidden;
}

.task-detail-section {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  padding: 10px;
}

.current-task-detail,
.task-detail-card {
  display: grid;
  gap: 10px;
}

.task-detail-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  padding: 10px;
}

.task-detail-head h3 {
  margin: 4px 0 0;
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.25;
}

.task-error-box {
  border: 1px solid rgba(255, 113, 113, 0.28);
  border-radius: 8px;
  background: rgba(255, 113, 113, 0.08);
  color: var(--bad);
  padding: 9px 10px;
  font-size: 0.78rem;
  line-height: 1.55;
}

.task-detail-section h4 {
  margin: 0;
  color: var(--text);
  font-size: 0.82rem;
}

.fact-grid,
.task-output-list,
.capability-plan-list {
  display: grid;
  gap: 8px;
}

.capability-plan-card {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  padding: 10px;
}

.capability-step-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 760;
}

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

.capability-plan-head strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 0.8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.capability-plan-card small {
  display: block;
  margin-top: 5px;
  color: var(--muted-soft);
  font-size: 0.72rem;
}

.capability-plan-card code {
  display: block;
  overflow-wrap: anywhere;
  margin-top: 7px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.28);
  color: var(--text);
  padding: 7px 8px;
  font-size: 0.72rem;
}

.capability-arg-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.capability-arg-chips span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  padding: 3px 7px;
  font-size: 0.7rem;
  font-weight: 720;
}

.capability-step-reason {
  color: var(--bad) !important;
}

.fact-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 34px;
  border-bottom: 1px solid var(--line);
  padding: 8px 10px;
}

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

.fact-row span,
.detail-label {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 760;
  text-transform: uppercase;
}

.fact-row strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 660;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-output-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  padding: 10px;
}

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

.task-output-head strong {
  color: var(--text);
  font-size: 0.8rem;
}

.task-output-head span,
.task-output-card span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 760;
}

.task-output-card code {
  overflow-wrap: anywhere;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.28);
  color: var(--text);
  padding: 7px 8px;
  font-size: 0.72rem;
}

.render-output-grid {
  display: grid;
  grid-template-columns: minmax(52px, auto) minmax(0, 1fr);
  gap: 8px 10px;
  align-items: center;
}

.render-output-grid span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 760;
}

.render-output-grid strong,
.render-output-grid code {
  min-width: 0;
  overflow-wrap: anywhere;
}

.detail-item {
  padding: 10px;
}

.detail-label {
  margin-bottom: 5px;
}

.detail-value {
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 0.8rem;
  line-height: 1.4;
}

.json-block,
pre {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #050506;
  color: #e7e7eb;
  padding: 10px;
  font-size: 0.78rem;
  line-height: 1.5;
}

pre {
  min-height: 180px;
  max-height: 260px;
  margin: 8px;
  white-space: pre-wrap;
}

.empty-state {
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  padding: 18px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.02);
  font-size: 0.86rem;
}

.compact-empty {
  padding: 12px;
  font-size: 0.78rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 72px minmax(0, 1fr) 340px;
  }

  .nav-item {
    display: none;
  }

  .sidebar {
    align-items: center;
  }
  .nav-item {
    width: 40px;
  }
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr) 320px;
    grid-template-rows: auto auto minmax(0, 1fr);
    height: 100dvh;
    overflow: hidden;
  }

  .app-shell.admin-mode {
    grid-template-columns: minmax(0, 1fr) 320px;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .topbar {
    grid-column: 1 / -1;
    grid-row: 1;
    position: sticky;
    flex-wrap: wrap;
    min-height: 64px;
    height: auto;
    padding: 10px 12px;
  }

  .topbar-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .sidebar {
    grid-column: 1;
    grid-row: 2;
    flex-direction: row;
    align-items: center;
    min-height: 0;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 10px 12px;
  }

  .nav-item {
    display: initial;
  }

  .nav-item {
    width: auto;
    margin-right: 0;
    border-radius: 8px;
    white-space: nowrap;
  }

  .nav-item.active::after {
    display: none;
  }

  .sidebar-nav {
    display: flex;
    overflow-x: auto;
  }

  .workspace-stage {
    grid-column: 1;
    grid-row: 3;
    min-height: 0;
    height: 100%;
    padding: 24px 16px 34px;
  }

  .app-shell.admin-mode .workspace-stage {
    grid-column: 1;
    grid-row: 2;
    height: 100%;
  }

  .chat-stage {
    height: 100%;
    min-height: 0;
  }

  .workspace-header {
    padding-top: 22px;
  }

  .worker-layout {
    grid-template-columns: 1fr;
  }

  .worker-action-grid {
    grid-template-columns: 1fr;
  }

  .davinci-mcp-status-head {
    grid-template-columns: 1fr;
  }

  .worker-upload-directory {
    align-items: flex-start;
    flex-direction: column;
  }

  .profile-layout {
    grid-template-columns: 1fr;
  }

  .catalog-grid,
  .admin-grid,
  .admin-dashboard-grid {
    grid-template-columns: 1fr;
  }

  .admin-hero-panel {
    align-items: flex-start;
    flex-direction: column;
  }

  .widget-rail {
    grid-column: 2;
    grid-row: 3;
    min-height: 0;
    height: 100%;
    max-height: 100%;
    border-left: 1px solid var(--line);
    border-top: 0;
    padding: 12px 12px 24px;
  }

  .app-shell.admin-mode .widget-rail {
    grid-column: 2;
    grid-row: 2;
    height: 100%;
  }
}

@media (max-width: 720px) {
  .app-shell,
  .app-shell.admin-mode {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto;
    min-height: 100vh;
    height: auto;
    overflow-y: auto;
  }

  .app-shell.admin-mode {
    grid-template-rows: auto auto auto;
  }

  .workspace-stage,
  .app-shell.admin-mode .workspace-stage {
    grid-column: 1;
    grid-row: 3;
    min-height: 0;
    height: auto;
    padding: 16px 12px 18px;
  }

  .workspace-view {
    min-height: 0;
  }

  .chat-stage {
    place-items: stretch;
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .assistant-thread {
    grid-template-rows: auto auto auto auto;
    width: 100%;
    height: auto;
    min-height: 0;
    max-height: none;
  }

  .assistant-header {
    gap: 8px;
    padding: 0 2px 14px;
  }

  .assistant-messages {
    overflow: visible;
    padding: 2px 2px 10px;
    scrollbar-gutter: auto;
  }

  .app-shell.admin-mode .workspace-stage {
    grid-row: 2;
  }

  .widget-rail,
  .app-shell.admin-mode .widget-rail {
    grid-column: 1;
    grid-row: 4;
    height: auto;
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 12px 12px 14px;
  }

  .widget-rail::after {
    display: none;
  }

  .app-shell.admin-mode .widget-rail {
    grid-row: 3;
  }

  .voice-clone-layout,
  .voice-clone-options,
  .voice-clone-status-grid {
    grid-template-columns: 1fr;
  }

  .app-shell.mobile-chat-only {
    grid-template-rows: minmax(0, 1fr);
    min-height: 100dvh;
    height: 100dvh;
    overflow: hidden;
  }

  .app-shell.mobile-chat-only .topbar,
  .app-shell.mobile-chat-only .sidebar,
  .app-shell.mobile-chat-only .widget-rail {
    display: none;
  }

  .app-shell.mobile-chat-only .workspace-stage {
    grid-column: 1;
    grid-row: 1;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  }

  .app-shell.mobile-chat-only .chat-stage {
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  .app-shell.mobile-chat-only .assistant-thread {
    grid-template-rows: minmax(0, 1fr) auto auto;
    height: 100%;
    max-height: none;
  }

  .app-shell.mobile-chat-only .assistant-header {
    display: none;
  }

  .app-shell.mobile-chat-only .assistant-messages {
    overflow-y: auto;
    padding: 4px 2px 8px;
    scrollbar-gutter: auto;
  }

  .app-shell.mobile-chat-only .composer-form {
    padding: 8px 0 0;
    background: transparent;
  }
}

@media (max-width: 540px) {
  h1 {
    font-size: 1.28rem;
  }

  .topbar {
    align-items: flex-start;
  }

  .topbar-brand {
    flex: 1 1 100%;
    font-size: 0.92rem;
  }

  .brand-logo {
    width: 24px;
    height: 24px;
    border-radius: 7px;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .topbar-actions .ghost-button,
  .account-button {
    min-height: 30px;
  }

  .account-status {
    font-size: 0.68rem;
  }

  .backend-pill {
    min-width: 0;
  }

  .composer {
    border-radius: 999px;
  }

  .composer textarea {
    padding: 13px 64px 13px 20px;
  }

  .assistant-thread {
    height: auto;
    min-height: 0;
    max-height: none;
  }

  .app-shell.mobile-chat-only .assistant-thread {
    height: 100%;
    max-height: none;
  }

  .assistant-header {
    display: grid;
  }

  .composer-send-group {
    gap: 0;
  }

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