:root {
  --bg: #e8eaed;
  --panel: #ffffff;
  --panel-alt: #f5f6f7;
  --ink: #111111;
  --muted: #62666c;
  --line: #d9e0e8;
  --line-strong: #b8c2cf;
  --blue: #171717;
  --blue-dark: #000000;
  --green: #444444;
  --red: #1f1f1f;
  --amber: #777777;
  --shadow: 0 18px 44px rgba(17, 17, 17, 0.1);
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

body {
  overflow: hidden;
}

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

button {
  border: 0;
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.hidden {
  display: none !important;
}

h1,
h2,
p {
  margin: 0;
}

.app-shell {
  height: 100vh;
  display: grid;
  grid-template-rows: 64px 1fr;
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
}

.auth-card {
  width: min(100%, 380px);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.auth-brand {
  margin-bottom: 18px;
}

.auth-title {
  font-size: 22px;
  margin-bottom: 6px;
}

.auth-subtitle {
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.auth-submit {
  width: 100%;
  margin-top: 4px;
}

.auth-status {
  min-height: 18px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.auth-status.error {
  color: var(--red);
}

.auth-status.success {
  color: var(--green);
}

.topbar {
  display: grid;
  grid-template-columns: minmax(220px, 330px) minmax(120px, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  z-index: 5;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.mark {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-weight: 850;
}

h1 {
  font-size: 18px;
  line-height: 1.1;
}

.brand p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.job-status {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--line-strong);
}

.status-dot.running {
  background: var(--amber);
}

.status-dot.stopping {
  background: var(--amber);
}

.status-dot.done {
  background: var(--green);
}

.status-dot.failed {
  background: var(--red);
}

.status-dot.stopped {
  background: var(--red);
}

.top-actions,
.account-chip {
  display: flex;
  align-items: center;
  gap: 8px;
}

.account-chip {
  padding: 4px 6px 4px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 12px;
}

.account-email {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 760;
}

.account-quota {
  color: var(--muted);
  white-space: nowrap;
}

.primary-btn,
.secondary-btn,
.link-btn,
.segment,
.tab {
  min-height: 36px;
  border-radius: 8px;
  font-weight: 750;
}

.primary-btn {
  min-width: 112px;
  padding: 0 18px;
  background: var(--blue);
  color: #fff;
  box-shadow: 0 10px 24px rgba(17, 17, 17, 0.18);
}

.primary-btn:hover {
  background: var(--blue-dark);
}

.secondary-btn {
  padding: 0 14px;
  border: 1px solid var(--line);
  background: #fff;
  color: #222;
}

.secondary-btn:hover,
.link-btn:hover,
.segment:hover,
.tab:hover {
  background: #eef2f7;
}

.secondary-btn.danger {
  border-color: var(--line-strong);
}

.link-btn {
  min-height: 28px;
  padding: 0 8px;
  background: transparent;
  color: var(--blue);
  font-size: 12px;
}

.link-btn.danger {
  color: var(--red);
}

.full-btn {
  width: 100%;
}

.workspace {
  min-height: 0;
  display: grid;
}

.run-panel {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(190px, 28vh) auto auto 1fr;
  background: var(--bg);
}

.compose-panel {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

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

.segmented {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-alt);
}

.segmented.compact {
  width: 240px;
  flex: 0 0 auto;
}

.segment {
  background: transparent;
  color: var(--muted);
}

.segment.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(17, 17, 17, 0.08);
}

.watch-controls {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-alt);
}

.watch-api-row,
.watch-settings-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(150px, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.selected-api {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 12px;
}

.prompt-field {
  display: grid;
  min-height: 0;
  gap: 8px;
}

.prompt-field span,
.field span,
.check-row span {
  color: #343434;
  font-size: 13px;
  font-weight: 700;
}

.prompt {
  width: 100%;
  min-height: 0;
  resize: none;
  padding: 13px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  line-height: 1.5;
  outline: none;
}

.prompt:focus,
.input:focus,
.textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.12);
}

.attach-row {
  display: grid;
  grid-template-columns: auto auto minmax(100px, 1fr);
  align-items: start;
  gap: 10px;
}

.drop-zone {
  display: grid;
  min-height: 78px;
  place-items: center;
  padding: 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
  font-weight: 700;
}

.drop-zone.inline {
  min-height: 36px;
  min-width: 120px;
  padding: 0 12px;
}

.drop-zone.dragging {
  border-color: var(--blue);
  background: #d6d9de;
  color: var(--blue-dark);
}

.drop-zone input {
  display: none;
}

.runs-strip {
  display: grid;
  gap: 8px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-alt);
}

.runs-strip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.runs-list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.run-chip {
  display: grid;
  grid-template-columns: auto minmax(110px, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 7px;
  min-width: 180px;
  max-width: 260px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.run-chip.active {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 2px rgba(17, 17, 17, 0.08);
}

.run-chip-status {
  grid-row: 1 / span 2;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line-strong);
}

.run-chip-status.running,
.run-chip-status.queued,
.run-chip-status.stopping {
  background: var(--amber);
}

.run-chip-status.done {
  background: var(--green);
}

.run-chip-status.failed,
.run-chip-status.stopped {
  background: var(--red);
}

.run-chip-title,
.run-chip-meta {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.run-chip-title {
  font-size: 12px;
  font-weight: 800;
}

.run-chip-meta {
  color: var(--muted);
  font-size: 11px;
}

.result-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.tab {
  padding: 0 14px;
  background: transparent;
  color: var(--muted);
}

.tab.active {
  background: #eef2f7;
  color: var(--ink);
}

.result-body {
  min-height: 0;
  overflow: hidden;
  padding: 18px;
}

.result-pane {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: auto;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  color: #111;
  font-family: "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.settings-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(15, 23, 42, 0.22);
}

.settings-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 21;
  width: min(560px, 100vw);
  overflow: auto;
  padding: 16px;
  border-left: 1px solid var(--line);
  background: #eceef1;
  box-shadow: -18px 0 44px rgba(17, 17, 17, 0.16);
}

.drawer-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 14px;
  padding: 4px 2px 12px;
  border-bottom: 1px solid var(--line);
}

.drawer-head h2 {
  color: var(--ink);
  font-size: 20px;
  text-transform: none;
}

.drawer-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.panel-section {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 6px 18px rgba(17, 17, 17, 0.04);
}

.panel-section + .panel-section {
  margin-top: 12px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

h2 {
  font-size: 13px;
  line-height: 1.2;
  color: #111;
  text-transform: uppercase;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.input,
.textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

.input {
  height: 38px;
  padding: 0 10px;
}

.textarea {
  min-height: 92px;
  resize: vertical;
  padding: 10px;
  line-height: 1.45;
}

.textarea.small {
  min-height: 76px;
}

.business-context {
  min-height: 150px;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-height: 30px;
  margin-bottom: 8px;
}

.check-row input {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  margin-top: 2px;
}

.warning-row {
  padding: 10px;
  border: 1px solid #b9bec5;
  border-radius: 8px;
  background: #dde0e4;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.file-list {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.compact-list {
  max-height: 88px;
  overflow: auto;
}

.file-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 760;
}

.file-size {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.remove-file {
  min-height: 28px;
  padding: 0 8px;
  border-radius: 7px;
  background: #f4f6f8;
  color: var(--red);
  font-size: 12px;
  font-weight: 800;
}

.api-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.api-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.api-name {
  font-weight: 800;
}

.api-meta,
.api-about {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.api-actions {
  display: flex;
  align-items: flex-start;
  gap: 4px;
}

.files-pane,
.images-pane,
.videos-pane,
.profiles-pane,
.docs-pane,
.visuals-pane {
  display: block;
  font-family: inherit;
  white-space: normal;
}

.images-pane,
.videos-pane,
.profiles-pane,
.docs-pane,
.visuals-pane {
  padding: 0;
}

.image-analysis-layout,
.video-analysis-layout {
  min-height: 100%;
  display: grid;
  grid-template-columns: minmax(230px, 330px) 1fr;
}

.image-analysis-list,
.video-analysis-list {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 10px;
  border-right: 1px solid var(--line);
  background: #f8fafc;
}

.image-analysis-card,
.video-analysis-card {
  display: grid;
  grid-template-columns: 72px 1fr;
  grid-template-rows: auto 1fr;
  gap: 6px 10px;
  width: 100%;
  min-height: 92px;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.image-analysis-card:hover,
.image-analysis-card.active,
.video-analysis-card:hover,
.video-analysis-card.active {
  border-color: var(--line);
  background: #fff;
  box-shadow: 0 2px 8px rgba(17, 17, 17, 0.08);
}

.image-analysis-card img,
.image-placeholder,
.video-placeholder {
  grid-row: 1 / span 2;
  width: 72px;
  aspect-ratio: 1;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #d7dade;
}

.video-placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.image-card-name,
.video-card-name {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-card-text,
.video-card-text {
  overflow: hidden;
  display: -webkit-box;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.image-analysis-detail,
.video-analysis-detail,
.profile-detail {
  min-width: 0;
  overflow: auto;
  padding: 20px;
  background: #fff;
}

.image-detail-head,
.video-detail-head,
.profile-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.image-detail-head h2,
.video-detail-head h2,
.profile-detail-head h2 {
  color: var(--ink);
  font-size: 18px;
  text-transform: none;
}

.image-detail-head p,
.video-detail-head p,
.profile-detail-head p {
  margin-top: 5px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-file-link,
.profile-actions a {
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.detail-file-link:hover,
.profile-actions a:hover {
  background: #eef2f7;
}

.image-detail-preview {
  display: block;
  width: min(100%, 860px);
  max-height: 460px;
  margin: 16px 0;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.video-detail-preview {
  display: block;
  width: min(100%, 860px);
  max-height: 520px;
  margin: 16px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111;
}

.image-description,
.video-description,
.profile-markdown {
  max-width: 980px;
  color: #111;
  font-size: 14px;
  line-height: 1.65;
}

.image-description h3,
.video-description h3,
.image-notes-field span,
.video-notes-field span {
  display: block;
  margin: 16px 0 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.image-description p,
.image-description ul,
.video-description p,
.video-description ul,
.profile-markdown p,
.profile-markdown ul {
  margin: 0 0 10px;
}

.image-description ul,
.video-description ul,
.profile-markdown ul {
  padding-left: 20px;
}

.image-notes-field,
.video-notes-field {
  display: block;
  max-width: 980px;
}

.image-notes-field textarea,
.video-notes-field textarea {
  min-height: 126px;
}

.image-note-actions,
.video-note-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

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

.download-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
  background: #fff;
}

.download-link:hover {
  border-color: var(--blue);
}

.download-path {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 760;
}

.download-size {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
}

.profiles-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.profiles-layout {
  min-height: calc(100% - 61px);
  display: grid;
  grid-template-columns: minmax(220px, 300px) 1fr;
}

.profiles-list {
  min-height: 0;
  overflow: auto;
  padding: 10px;
  border-right: 1px solid var(--line);
  background: #f8fafc;
}

.profile-row {
  display: grid;
  width: 100%;
  gap: 4px;
  padding: 10px;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.profile-row:hover,
.profile-row.active {
  background: #fff;
  box-shadow: 0 2px 8px rgba(17, 17, 17, 0.08);
}

.profile-title {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-meta {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: flex-end;
}

.profile-markdown {
  padding: 18px 0 28px;
}

.profile-editor {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.document-editor {
  min-height: 420px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  line-height: 1.45;
  resize: vertical;
}

.profile-markdown h2,
.profile-markdown h3,
.profile-markdown h4 {
  margin: 18px 0 8px;
  color: var(--ink);
  text-transform: none;
}

.profile-empty {
  display: grid;
  min-height: 100%;
  place-items: center;
  background: #fff;
}

.visuals-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.visuals-toolbar p {
  max-width: 760px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  text-align: right;
}

.artifact-list {
  display: grid;
  gap: 14px;
  padding: 14px;
}

.artifact-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.artifact-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.artifact-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
}

.artifact-head p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.artifact-head span {
  max-width: 260px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  text-align: right;
  overflow-wrap: anywhere;
}

.artifact-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(320px, 1.15fr);
  gap: 14px;
  padding: 14px;
}

.artifact-block + .artifact-block {
  margin-top: 14px;
}

.artifact-block h4 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 13px;
}

.artifact-table-wrap {
  overflow-x: auto;
}

.artifact-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 13px;
}

.artifact-table th,
.artifact-table td {
  padding: 8px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.artifact-table th {
  background: var(--panel-alt);
  color: var(--ink);
  font-weight: 800;
}

.artifact-chart {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111;
}

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

  .app-shell {
    min-height: 100vh;
    height: auto;
  }

  .topbar {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px 12px;
  }

  .top-actions,
  .compose-head,
  .attach-row {
    width: 100%;
  }

  .top-actions,
  .compose-head {
    flex-wrap: wrap;
  }

  .attach-row,
  .watch-api-row,
  .watch-settings-row,
  .two-col,
  .image-analysis-layout,
  .video-analysis-layout,
  .profiles-layout,
  .artifact-grid {
    grid-template-columns: 1fr;
  }

  .segmented.compact {
    width: 100%;
  }

  .run-panel {
    min-height: 780px;
  }

  .result-body,
  .compose-panel {
    padding: 12px;
  }

  .image-analysis-list,
  .video-analysis-list,
  .profiles-list {
    max-height: 260px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .image-detail-head,
  .video-detail-head,
  .profile-detail-head {
    display: grid;
  }

  .profile-actions {
    justify-content: flex-start;
  }

  .visuals-toolbar,
  .artifact-head {
    display: grid;
  }

  .visuals-toolbar p,
  .artifact-head span {
    max-width: none;
    text-align: left;
  }
}

/* Grayscale neumorphic skin for the planner dashboard */
:root {
  --bg: #e8eaed;
  --panel: #eceef1;
  --panel-alt: #f5f6f7;
  --panel-inset: #dde0e4;
  --ink: #111111;
  --muted: #62666c;
  --line: #cfd3d8;
  --line-strong: #b9bec5;
  --blue: #171717;
  --blue-dark: #000000;
  --green: #444444;
  --red: #1f1f1f;
  --amber: #777777;
  --shadow: 10px 10px 24px rgba(163, 170, 178, 0.72), -10px -10px 24px rgba(255, 255, 255, 0.92);
  --shadow-soft: 6px 6px 14px rgba(163, 170, 178, 0.5), -6px -6px 14px rgba(255, 255, 255, 0.86);
  --shadow-inset: inset 5px 5px 12px rgba(163, 170, 178, 0.54), inset -5px -5px 12px rgba(255, 255, 255, 0.9);
  --shadow-pressed: inset 3px 3px 8px rgba(163, 170, 178, 0.58), inset -3px -3px 8px rgba(255, 255, 255, 0.92);
  color-scheme: light;
}

html,
body {
  background: linear-gradient(145deg, #f6f7f8 0%, #e8eaed 44%, #dadddf 100%);
  color: var(--ink);
}

.auth-gate {
  background: linear-gradient(145deg, #f6f7f8 0%, #e8eaed 52%, #dadddf 100%);
}

.app-shell {
  height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 64px minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  background: transparent;
}

.topbar,
.auth-card,
.settings-drawer,
.run-panel,
.result-pane,
.panel-section {
  border: 1px solid rgba(255, 255, 255, 0.74);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.topbar {
  grid-template-columns: minmax(220px, 330px) minmax(120px, 1fr) auto;
  min-height: 0;
  gap: 16px;
  padding: 0 16px;
  border-radius: 8px;
}

.auth-card {
  background: linear-gradient(145deg, #f7f8f9, #e3e6ea);
}

.brand h1,
h1,
.auth-title,
.drawer-head h2,
.image-detail-head h2,
.video-detail-head h2,
.profile-detail-head h2,
.profile-markdown h2,
.profile-markdown h3,
.profile-markdown h4 {
  color: var(--ink);
}

.brand p,
.job-status,
.account-quota,
.auth-subtitle,
.auth-status,
.hint,
.file-size,
.api-meta,
.api-about,
.download-size,
.image-card-text,
.video-card-text,
.profile-meta {
  color: var(--muted);
}

.auth-status.error,
.link-btn.danger,
.remove-file {
  color: var(--ink);
}

.auth-status.success {
  color: #3d3d3d;
}

.mark {
  width: 36px;
  height: 36px;
  border: 1px solid #000;
  border-radius: 8px;
  background: #111;
  color: #fff;
  box-shadow: 4px 4px 10px rgba(163, 170, 178, 0.54), -4px -4px 10px rgba(255, 255, 255, 0.9);
}

.job-status,
.account-chip,
.segmented,
.drop-zone,
.prompt,
.input,
.textarea {
  border: 1px solid rgba(185, 190, 197, 0.84);
  background: var(--panel-inset);
  box-shadow: var(--shadow-inset);
}

.job-status,
.account-chip {
  min-height: 34px;
  padding: 0 10px;
  border-radius: 8px;
}

.status-dot {
  border: 1px solid rgba(0, 0, 0, 0.24);
  box-shadow: var(--shadow-soft);
}

.status-dot.running {
  background: #777;
}

.status-dot.stopping {
  background: #777;
}

.status-dot.done {
  background: #444;
}

.status-dot.failed,
.status-dot.stopped {
  background: #111;
}

.primary-btn,
.secondary-btn,
.link-btn,
.segment,
.tab,
.remove-file,
.detail-file-link,
.profile-actions a,
.download-link {
  transition: background 0.16s ease, box-shadow 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.primary-btn {
  min-width: 112px;
  padding: 0 18px;
  border: 1px solid #000;
  background: #111;
  color: #fff;
  box-shadow: 7px 7px 15px rgba(163, 170, 178, 0.68), -7px -7px 15px rgba(255, 255, 255, 0.9);
}

.primary-btn:hover {
  background: #000;
}

.primary-btn:active,
.secondary-btn:active,
.segment.active,
.tab.active {
  transform: translateY(1px);
  box-shadow: var(--shadow-pressed);
}

.secondary-btn,
.segment,
.tab,
.remove-file,
.detail-file-link,
.profile-actions a {
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: var(--panel);
  color: var(--ink);
  box-shadow: var(--shadow-soft);
}

.secondary-btn:hover,
.link-btn:hover,
.segment:hover,
.tab:hover,
.remove-file:hover,
.detail-file-link:hover,
.profile-actions a:hover {
  background: var(--panel-alt);
}

.link-btn {
  color: var(--ink);
}

.workspace {
  min-height: 0;
  display: grid;
}

.run-panel {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(190px, 28vh) auto auto minmax(0, 1fr);
  overflow: hidden;
  border-radius: 8px;
}

.compose-panel {
  border: 0;
  border-bottom: 1px solid rgba(185, 190, 197, 0.78);
  background: transparent;
  box-shadow: none;
}

.compose-head h2,
h2 {
  color: var(--ink);
  letter-spacing: 0;
}

.prompt-field span,
.field span,
.check-row span {
  color: #343434;
}

.prompt,
.input,
.textarea {
  color: var(--ink);
}

.prompt::placeholder,
.input::placeholder,
.textarea::placeholder {
  color: #777b80;
}

.prompt:focus,
.input:focus,
.textarea:focus {
  border-color: #111;
  box-shadow: var(--shadow-inset), 0 0 0 3px rgba(0, 0, 0, 0.08);
}

.drop-zone {
  border-style: dashed;
  color: var(--muted);
}

.drop-zone.dragging {
  border-color: #111;
  background: #d6d9de;
  color: var(--ink);
}

.result-tabs {
  gap: 6px;
  padding: 10px 14px;
  border: 0;
  border-bottom: 1px solid rgba(185, 190, 197, 0.78);
  background: transparent;
  box-shadow: none;
}

.tab {
  flex: 0 0 auto;
  color: var(--muted);
}

.tab.active,
.segment.active {
  border-color: rgba(185, 190, 197, 0.84);
  background: var(--panel-inset);
  color: var(--ink);
}

.result-body {
  padding: 16px;
  background: transparent;
}

.result-pane {
  border-color: rgba(255, 255, 255, 0.74);
  background: linear-gradient(145deg, #f7f8f9, #e3e6ea);
  color: #111;
}

.settings-overlay {
  background: rgba(0, 0, 0, 0.32);
}

.settings-drawer {
  border-color: rgba(255, 255, 255, 0.74);
  background: var(--panel);
}

.drawer-head,
.panel-section,
.warning-row,
.profiles-toolbar,
.image-detail-head,
.video-detail-head,
.profile-detail-head,
.image-detail-preview,
.video-detail-preview,
.image-analysis-card img,
.image-placeholder,
.video-placeholder {
  border-color: var(--line);
}

.panel-section {
  background: linear-gradient(145deg, #f7f8f9, #e3e6ea);
}

.warning-row {
  background: var(--panel-inset);
  box-shadow: var(--shadow-inset);
}

.file-item,
.api-item,
.download-link,
.artifact-card,
.profile-row,
.image-analysis-card,
.video-analysis-card {
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.profile-row,
.image-analysis-card,
.video-analysis-card {
  border-color: transparent;
}

.profile-row:hover,
.profile-row.active,
.image-analysis-card:hover,
.image-analysis-card.active,
.video-analysis-card:hover,
.video-analysis-card.active {
  border-color: rgba(185, 190, 197, 0.84);
  background: var(--panel-inset);
  box-shadow: var(--shadow-pressed);
}

.file-name,
.api-name,
.download-path,
.artifact-head h3,
.artifact-block h4,
.image-card-name,
.video-card-name,
.profile-title,
.image-description h3,
.video-description h3,
.image-notes-field span,
.video-notes-field span {
  color: var(--ink);
}

.image-analysis-list,
.video-analysis-list,
.profiles-list {
  border-color: var(--line);
  background: var(--panel-inset);
  box-shadow: var(--shadow-inset);
}

.image-analysis-detail,
.video-analysis-detail,
.profile-detail,
.profile-empty,
.docs-pane,
.visuals-pane {
  background: var(--panel);
}

.image-placeholder,
.video-placeholder,
.image-detail-preview {
  background: #d7dade;
}

.video-detail-preview,
.artifact-chart {
  background: #111;
}

.image-description,
.video-description,
.profile-markdown,
.profile-editor {
  color: #191919;
}

.download-link,
.detail-file-link,
.profile-actions a {
  color: var(--ink);
}

.artifact-head,
.visuals-toolbar,
.artifact-table th,
.artifact-table td,
.artifact-chart {
  border-color: var(--line);
}

.artifact-table th {
  background: var(--panel-inset);
}

.blob-onboarding {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(232, 234, 237, 0.92);
  backdrop-filter: blur(18px);
}

.blob-onboarding-card {
  position: relative;
  width: min(100%, 760px);
  min-height: 312px;
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 8px;
  background: linear-gradient(145deg, #f8f9fa, #e2e5e9);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.15),
    0 0 0 1px rgba(180, 186, 194, 0.34),
    0 20px 70px rgba(56, 98, 170, 0.14);
  overflow: hidden;
}

.blob-glow {
  position: absolute;
  inset: 18px;
  border-radius: 8px;
  pointer-events: none;
  box-shadow:
    0 0 54px rgba(74, 105, 170, 0.18),
    0 0 72px rgba(190, 150, 110, 0.14);
}

.blob-title-row,
.blob-compose {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
}

.blob-title-row {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}

.blob-mark {
  display: inline-grid;
  min-width: 54px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: #111;
  color: #fff;
  font-size: 13px;
  font-weight: 850;
}

.blob-skip {
  min-width: 104px;
}

.blob-onboarding-card h2 {
  position: relative;
  z-index: 1;
  margin-bottom: 18px;
  font-size: 34px;
  line-height: 1.08;
  letter-spacing: 0;
}

.blob-prompt-field {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
}

.blob-prompt-field span {
  color: #2b2d30;
  font-size: 18px;
  font-weight: 760;
  line-height: 1.35;
}

.blob-business-input {
  width: 100%;
  min-height: 128px;
  resize: vertical;
  padding: 16px;
  border: 1px solid rgba(185, 190, 197, 0.72);
  border-radius: 8px;
  outline: none;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  box-shadow: var(--shadow-inset);
  line-height: 1.48;
}

.blob-business-input:focus {
  border-color: #111;
  box-shadow: var(--shadow-inset), 0 0 0 3px rgba(0, 0, 0, 0.08);
}

.blob-compose {
  gap: 10px;
  margin-top: 14px;
}

.blob-icon-btn {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 8px;
  background: linear-gradient(145deg, #f9fafb, #dfe3e8);
  color: #111;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  font-size: 28px;
  font-weight: 360;
  line-height: 1;
}

.blob-icon-btn:hover {
  box-shadow: var(--shadow-pressed);
}

.blob-icon-btn input {
  display: none;
}

.blob-file-list {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  gap: 8px;
  overflow-x: auto;
}

.blob-file-empty {
  align-self: center;
  color: var(--muted);
  font-size: 13px;
}

.blob-file-chip {
  display: grid;
  min-width: 130px;
  max-width: 220px;
  min-height: 42px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: var(--shadow-soft);
  text-align: left;
}

.blob-file-chip span,
.blob-file-chip small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.blob-file-chip small {
  color: var(--muted);
  font-size: 11px;
}

.blob-create-btn {
  flex: 0 0 auto;
  min-height: 42px;
}

.blob-status {
  position: relative;
  z-index: 1;
  min-height: 20px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.blob-status.error {
  color: var(--red);
}

.blob-status.success {
  color: var(--green);
}

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

  .app-shell {
    min-height: 100vh;
    height: auto;
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(780px, 1fr);
    gap: 10px;
    padding: 10px;
  }

  .topbar {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px;
  }

  .top-actions,
  .account-chip,
  .compose-head,
  .attach-row {
    width: 100%;
    flex-wrap: wrap;
  }

  .account-chip {
    justify-content: space-between;
  }

  .watch-api-row,
  .watch-settings-row {
    grid-template-columns: 1fr;
  }

  .run-panel {
    min-height: 780px;
    grid-template-rows: minmax(260px, auto) auto auto minmax(420px, 1fr);
  }

  .result-tabs {
    overflow-x: auto;
  }

  .blob-onboarding {
    align-items: start;
    padding: 14px;
  }

  .blob-onboarding-card {
    min-height: 0;
    padding: 20px;
  }

  .blob-onboarding-card h2 {
    font-size: 26px;
  }

  .blob-prompt-field span {
    font-size: 16px;
  }

  .blob-compose {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .blob-file-list {
    order: 3;
    flex-basis: 100%;
  }

  .blob-create-btn {
    flex: 1 1 180px;
  }
}

/* Clean black theme */
:root {
  --bg: #000000;
  --panel: #0b0b0b;
  --panel-alt: #121212;
  --panel-inset: #050505;
  --ink: #ffffff;
  --muted: #a7a7a7;
  --line: #2a2a2a;
  --line-strong: #4a4a4a;
  --blue: #ffffff;
  --blue-dark: #e8e8e8;
  --green: #d9d9d9;
  --red: #d9d9d9;
  --amber: #bdbdbd;
  --shadow: none;
  --shadow-soft: none;
  --shadow-inset: none;
  --shadow-pressed: none;
  color-scheme: dark;
}

* {
  scrollbar-color: #3a3a3a #000;
}

html,
body,
.auth-gate,
.app-shell,
.workspace,
.run-panel,
.profile-empty {
  background: #000;
  color: var(--ink);
}

body {
  color: var(--ink);
}

.app-shell {
  gap: 12px;
  padding: 12px;
}

.topbar,
.auth-card,
.settings-drawer,
.run-panel,
.result-pane,
.panel-section,
.blob-onboarding-card,
.file-item,
.api-item,
.download-link,
.artifact-card,
.run-chip,
.selected-api,
.profile-row,
.image-analysis-card,
.video-analysis-card,
.blob-file-chip {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: none;
  color: var(--ink);
}

.topbar,
.auth-card,
.settings-drawer,
.run-panel,
.result-pane,
.panel-section,
.blob-onboarding-card {
  border-radius: 8px;
}

.compose-panel,
.runs-strip,
.result-tabs,
.watch-controls,
.segmented,
.image-analysis-list,
.video-analysis-list,
.profiles-list,
.image-analysis-detail,
.video-analysis-detail,
.profile-detail,
.docs-pane,
.visuals-pane,
.artifact-table th,
.warning-row {
  border-color: var(--line);
  background: var(--panel-alt);
  box-shadow: none;
}

.result-body,
.compose-panel,
.result-tabs {
  background: transparent;
}

.settings-overlay,
.blob-onboarding {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: none;
}

.mark,
.blob-mark,
.primary-btn {
  border: 1px solid #fff;
  background: #fff;
  color: #000;
  box-shadow: none;
}

.primary-btn:hover {
  background: #e8e8e8;
}

.secondary-btn,
.link-btn,
.segment,
.tab,
.remove-file,
.detail-file-link,
.profile-actions a,
.blob-icon-btn {
  border: 1px solid var(--line);
  background: #000;
  color: var(--ink);
  box-shadow: none;
}

.secondary-btn:hover,
.link-btn:hover,
.segment:hover,
.tab:hover,
.remove-file:hover,
.detail-file-link:hover,
.profile-actions a:hover,
.download-link:hover,
.run-chip:hover,
.profile-row:hover,
.image-analysis-card:hover,
.video-analysis-card:hover {
  border-color: var(--line-strong);
  background: var(--panel-alt);
  box-shadow: none;
}

.segment.active,
.tab.active,
.run-chip.active,
.profile-row.active,
.image-analysis-card.active,
.video-analysis-card.active {
  border-color: #fff;
  background: var(--panel-alt);
  color: var(--ink);
  box-shadow: none;
  transform: none;
}

.account-chip,
.job-status,
.prompt,
.input,
.textarea,
.blob-business-input,
.drop-zone {
  border: 1px solid var(--line-strong);
  background: var(--panel-inset);
  color: var(--ink);
  box-shadow: none;
}

.prompt::placeholder,
.input::placeholder,
.textarea::placeholder,
.blob-business-input::placeholder {
  color: #777;
}

.prompt:focus,
.input:focus,
.textarea:focus,
.blob-business-input:focus {
  border-color: #fff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.14);
}

.drop-zone.dragging {
  border-color: #fff;
  background: var(--panel-alt);
  color: var(--ink);
}

input,
select,
textarea {
  background: var(--panel-inset);
  color: var(--ink);
}

select option {
  background: #0b0b0b;
  color: #fff;
}

input[type="checkbox"] {
  accent-color: #fff;
}

h1,
h2,
h3,
h4,
.auth-title,
.drawer-head h2,
.brand h1,
.compose-head h2,
.prompt-field span,
.field span,
.check-row span,
.file-name,
.api-name,
.download-path,
.artifact-head h3,
.artifact-block h4,
.image-card-name,
.video-card-name,
.profile-title,
.image-description h3,
.video-description h3,
.image-notes-field span,
.video-notes-field span,
.image-detail-head h2,
.video-detail-head h2,
.profile-detail-head h2 {
  color: var(--ink);
}

.brand p,
.job-status,
.account-quota,
.auth-subtitle,
.auth-status,
.hint,
.file-size,
.api-meta,
.api-about,
.download-size,
.image-card-text,
.video-card-text,
.profile-meta,
.artifact-head p,
.artifact-head span,
.visuals-toolbar p,
.blob-file-empty,
.blob-file-chip small,
.blob-status {
  color: var(--muted);
}

.auth-status.error,
.auth-status.success,
.link-btn.danger,
.remove-file,
.blob-status.error,
.blob-status.success {
  color: var(--ink);
}

.result-pane,
.image-description,
.video-description,
.profile-markdown,
.profile-editor,
.artifact-table,
.artifact-table th,
.artifact-table td {
  color: var(--ink);
}

.image-placeholder,
.video-placeholder,
.image-detail-preview,
.video-detail-preview,
.artifact-chart {
  border-color: var(--line);
  background: #000;
}

.status-dot,
.run-chip-status {
  border: 1px solid var(--line-strong);
  background: #5a5a5a;
  box-shadow: none;
}

.status-dot.running,
.status-dot.stopping,
.run-chip-status.running,
.run-chip-status.queued,
.run-chip-status.stopping {
  background: #d7d7d7;
}

.status-dot.done,
.run-chip-status.done {
  background: #ffffff;
}

.status-dot.failed,
.status-dot.stopped,
.run-chip-status.failed,
.run-chip-status.stopped {
  background: #8f8f8f;
}

.blob-glow {
  display: none;
}

@media (max-width: 920px) {
  .app-shell {
    padding: 8px;
  }
}
