:root {
  color: #0f172a;
  background: #edf3f8;
  font-family: Avenir Next, Trebuchet MS, Segoe UI, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
}

a {
  color: #0369a1;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button,
input,
select {
  font: inherit;
}

.app {
  max-width: 1420px;
  margin: 0 auto;
  padding: 26px 24px 42px;
}

.mode-badge {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  color: #334155;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(8px);
}

.mode-badge:hover {
  background: #ffffff;
}

.mode-badge.cloud {
  border-color: #bae6fd;
  color: #075985;
}

.mode-badge.local {
  border-color: #bbf7d0;
  color: #166534;
}

.mode-icon,
.mode-icon svg {
  width: 17px;
  height: 17px;
}

.mode-icon svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mode-menu {
  position: fixed;
  top: 56px;
  left: 14px;
  z-index: 21;
  display: grid;
  gap: 8px;
  width: 230px;
  padding: 10px;
  border: 1px solid #d6e2ec;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.16);
}

.mode-menu-title {
  color: #334155;
  font-size: 13px;
  font-weight: 800;
}

.mode-menu button {
  min-height: 34px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #f8fafc;
  color: #0f172a;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}

.mode-menu button:disabled {
  color: #94a3b8;
  cursor: not-allowed;
}

.mode-menu-status {
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.mode-menu-note {
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
}

.topbar {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 24px;
  text-align: center;
}

.brand {
  display: grid;
  gap: 8px;
  justify-items: center;
}

.header-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.header-logo {
  width: auto;
  height: 56px;
  object-fit: contain;
  filter: drop-shadow(0 8px 18px rgba(15, 23, 42, 0.12));
  transform: translate(8.5px, -11.5px);
}

.title {
  margin: 0;
  font-size: 52px;
  line-height: 1;
  letter-spacing: 0.035em;
  color: #071f1a;
  text-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
}

.header-title {
  font-weight: 800;
}

.subtitle {
  margin: 0;
  text-align: center;
  color: #475569;
  font-size: 18px;
  font-weight: 700;
}

.control-button {
  min-width: 250px;
  height: 58px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  font-weight: 800;
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.16);
}

.control-button.start,
.control-button.resume {
  background: #15803d;
}

.control-button.pause {
  background: #b91c1c;
}

.control-button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.grid {
  display: grid;
  grid-template-columns: minmax(320px, 390px) minmax(0, 1fr);
  gap: 18px;
}

.panel {
  background: linear-gradient(180deg, #ffffff, #f9fcff);
  border: 1px solid #d6e2ec;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.panel h2 {
  margin: 0 0 12px;
  font-size: 17px;
}

.config-title {
  text-align: center;
  font-size: 20px;
  letter-spacing: 0.04em;
}

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

.form-row label {
  color: #334155;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.form-row input,
.form-row select {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  padding: 9px 10px;
  background: #fff;
  color: #0f172a;
}

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

.open-path-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #9fcbba;
  border-radius: 7px;
  padding: 0 12px;
  min-height: 34px;
  background: #e9f8f0;
  color: #14532d;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
}

.open-path-button:hover {
  background: #d8f3e4;
  text-decoration: none;
}

.mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 14px 0 16px;
}

.mode-tabs button {
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  padding: 9px 8px;
  background: #fff;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.mode-tabs button.active {
  border-color: #16a34a;
  background: #e9f8f0;
  color: #14532d;
}

.advanced-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid #b7d6c7;
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 14px;
  background: linear-gradient(180deg, #f1fbf6, #e7f7ef);
  color: #14532d;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.reset-advanced-button {
  width: 100%;
  border: 1px solid #fecaca;
  border-radius: 7px;
  padding: 8px 10px;
  margin-top: 8px;
  background: linear-gradient(180deg, #fff1f2, #ffe4e6);
  color: #991b1b;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.reset-advanced-button:hover {
  background: #fee2e2;
}

.advanced-content {
  margin-top: 14px;
}

.config-section {
  border-top: 1px solid #e2e8f0;
  padding-top: 14px;
  margin-top: 14px;
}

.config-section h3 {
  margin: 0 0 12px;
  color: #0f172a;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
}

.advanced-section {
  border-top: 1px solid #e2e8f0;
  padding-top: 0;
  margin-top: 10px;
}

.advanced-section summary {
  cursor: pointer;
  list-style: none;
  padding: 12px 0;
  color: #0f172a;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
}

.advanced-section summary::-webkit-details-marker {
  display: none;
}

.advanced-section summary::after {
  content: "Show";
  float: right;
  color: #64748b;
  font-size: 11px;
  letter-spacing: 0;
  text-transform: none;
}

.advanced-section[open] summary::after {
  content: "Hide";
}

.advanced-section-body {
  padding-bottom: 4px;
}

.inline-help {
  margin: -2px 0 12px;
  border-left: 3px solid #9fcbba;
  border-radius: 7px;
  padding: 8px 10px;
  background: #f5fbf8;
  color: #526174;
  font-size: 12px;
  line-height: 1.45;
}

.section-help {
  margin: 8px 0 10px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.4;
}

.help-link {
  display: block;
  margin-top: 14px;
  border: 1px solid #d6e2ec;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fbfdff;
  color: #0369a1;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
  text-decoration: none;
}

.help-link:hover {
  background: #eef7ff;
}

.stage-mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.stage-mode-tabs button {
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  padding: 9px 8px;
  background: #fff;
  color: #334155;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.stage-mode-tabs button.active {
  border-color: #16a34a;
  background: #e9f8f0;
  color: #14532d;
}

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

.resume-availability-button {
  width: 100%;
  margin-top: 10px;
  border: 1px solid #facc15;
  border-radius: 7px;
  padding: 9px 10px;
  background: #fef9c3;
  color: #713f12;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.resume-availability-button:hover {
  background: #fef08a;
}

.resume-option {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid #d6e2ec;
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.resume-option.active {
  border-color: #16a34a;
  background: #f0fbf5;
}

.resume-option b {
  display: block;
  color: #0f172a;
  font-size: 13px;
}

.resume-option small {
  display: block;
  margin-top: 4px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.4;
}

.resume-select {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  padding: 9px 10px;
  background: #fff;
  color: #0f172a;
}

.resume-meta {
  border: 1px solid #d6e2ec;
  border-radius: 8px;
  padding: 10px;
  background: #fbfdff;
  color: #334155;
  font-size: 12px;
  line-height: 1.6;
}

.end-run-button {
  width: 100%;
  margin-top: 16px;
  border: 1px solid #fecaca;
  border-radius: 7px;
  padding: 8px 10px;
  background: #fff1f2;
  color: #991b1b;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.end-run-button:hover {
  background: #fee2e2;
}

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

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

.stage-check {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  font-size: 13px;
  color: #334155;
}

.stage-check.top-stage {
  font-weight: 900;
  color: #0f172a;
}

.substage-list {
  display: grid;
  gap: 8px;
  margin: -2px 0 4px 24px;
  border-left: 2px solid #d6e2ec;
  padding-left: 12px;
}

.main-stack {
  display: grid;
  gap: 18px;
}

.status-line {
  color: #334155;
  font-size: 14px;
  text-align: center;
}

.eta-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.eta-card {
  border: 1px solid #d8e4ef;
  border-radius: 8px;
  padding: 12px;
  text-align: center;
  background: #fff;
}

.eta-label {
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.eta-value {
  margin-top: 6px;
  font-size: 22px;
  font-weight: 800;
}

.current-stage {
  justify-self: center;
  text-align: center;
  font-size: 24px;
  font-weight: 800;
  min-width: min(420px, 100%);
  white-space: nowrap;
}

.process-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  margin-top: 18px;
}

.pulse-rail {
  width: 100%;
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(22, 163, 74, 0.05), rgba(22, 163, 74, 0.95), rgba(22, 163, 74, 0.05));
  box-shadow: 0 0 18px rgba(22, 163, 74, 0.32);
  opacity: 0.28;
}

.process-stage.active .pulse-rail {
  animation: greenResonance 1.55s ease-in-out infinite;
}

.message-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 12px;
}

.message-row .process-mark {
  justify-self: end;
}

.message-row .process-mark.mirror {
  justify-self: start;
}

.message {
  text-align: center;
  color: #0b3b66;
  font-size: 17px;
  font-weight: 800;
}

.process-mark {
  display: grid;
  grid-template-columns: repeat(3, 6px);
  gap: 4px;
  align-items: end;
  height: 18px;
  opacity: 0.34;
}

.process-mark i {
  display: block;
  width: 6px;
  height: 7px;
  border-radius: 2px;
  background: #16a34a;
  box-shadow: 0 0 10px rgba(22, 163, 74, 0.38);
}

.message-row.active .process-mark {
  opacity: 1;
}

.message-row.active .process-mark i {
  animation: rigorStep 1.05s ease-in-out infinite;
}

.message-row.active .process-mark i:nth-child(2) {
  animation-delay: 0.16s;
}

.message-row.active .process-mark i:nth-child(3) {
  animation-delay: 0.32s;
}

.process-mark.mirror i:nth-child(1) {
  animation-delay: 0.32s;
}

.process-mark.mirror i:nth-child(2) {
  animation-delay: 0.16s;
}

.detail {
  margin-top: 5px;
  text-align: center;
  color: #64748b;
  font-size: 13px;
}

.bar {
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: #dbe6ef;
}

.bar-fill {
  height: 100%;
  width: 0;
  background: #0ea5e9;
  transition: width 160ms ease;
}

.bar-fill.success {
  background: #16a34a;
}

.bar-fill.warning {
  background: #d97706;
}

.bar-fill.danger {
  background: #dc2626;
}

.current-bar {
  margin: 14px 0 6px;
}

@keyframes greenResonance {
  0%, 100% {
    opacity: 0.22;
    transform: scaleX(0.82);
    filter: saturate(0.88);
  }
  50% {
    opacity: 1;
    transform: scaleX(1);
    filter: saturate(1.35);
  }
}

@keyframes rigorStep {
  0%, 100% {
    height: 7px;
    opacity: 0.42;
  }
  50% {
    height: 18px;
    opacity: 1;
  }
}

.stage-progress {
  display: grid;
  gap: 9px;
}

.progress-context {
  margin-bottom: 2px;
  color: #14532d;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-align: center;
  text-transform: uppercase;
}

.stage-row {
  display: grid;
  grid-template-columns: minmax(180px, 280px) minmax(100px, 1fr) minmax(110px, 180px);
  gap: 12px;
  align-items: center;
}

.stage-name {
  font-size: 13px;
  font-weight: 800;
}

.stage-status {
  text-align: right;
  font-size: 12px;
  font-weight: 800;
  color: #475569;
}

.stage-status.success {
  color: #166534;
}

.stage-status.warning {
  color: #92400e;
}

.stage-status.danger {
  color: #991b1b;
}

.preview-frame,
.report-frame {
  width: 100%;
  border: 1px solid #d6e2ec;
  border-radius: 8px;
  background: #fff;
}

.preview-frame {
  height: 620px;
}

.preview-scale-shell {
  position: relative;
  width: 100%;
  overflow: hidden;
  border: 1px solid #d6e2ec;
  border-radius: 8px;
  background: #fff;
}

.preview-scale-inner {
  position: absolute;
  top: 0;
  left: 50%;
  transform-origin: top center;
}

.preview-frame.scaled {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
}

.report-frame {
  height: 760px;
}

.preview-image {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  border: 1px solid #d6e2ec;
  border-radius: 8px;
}

.preview-video {
  display: block;
  width: 100%;
  max-height: 620px;
  object-fit: contain;
  border: 1px solid #d6e2ec;
  border-radius: 8px;
  background: #020617;
}

.segmentation-complete-card {
  display: grid;
  gap: 10px;
  place-items: center;
  min-height: 260px;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 20%, rgba(22, 163, 74, 0.16), transparent 42%),
    linear-gradient(180deg, #f8fffb, #ffffff);
  color: #14532d;
  text-align: center;
}

.segmentation-complete-title {
  font-size: 22px;
  font-weight: 900;
}

.segmentation-complete-detail {
  color: #466557;
  font-weight: 700;
}

.segmentation-complete-card code {
  max-width: 100%;
  overflow-wrap: anywhere;
  border-radius: 7px;
  padding: 8px 10px;
  background: #edf7f1;
  color: #164e2c;
  font-size: 12px;
}

.empty {
  padding: 28px 10px;
  color: #64748b;
  text-align: center;
}

.link-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-bottom: 10px;
  font-size: 13px;
}

.summary-log {
  max-height: 220px;
  overflow: auto;
  border: 1px solid #d6e2ec;
  border-radius: 8px;
  background: #fbfdff;
  padding: 10px;
  font: 12px/1.55 Menlo, Consolas, monospace;
  white-space: pre-wrap;
}

.error {
  border-color: #fecaca;
  color: #991b1b;
  background: #fff7f7;
}

.chat-widget {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 80;
  font-family: inherit;
}

.chat-launcher {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #a7c8ba;
  border-radius: 8px;
  padding: 11px 14px;
  background: #f7fffb;
  color: #0f3b2b;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.16);
}

.chat-launcher:hover {
  background: #ecfbf3;
}

.chat-launcher-icon {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: #14532d;
  color: #fff;
  font-size: 11px;
  letter-spacing: 0;
}

.chat-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  width: min(410px, calc(100vw - 28px));
  height: min(620px, calc(100vh - 44px));
  overflow: hidden;
  border: 1px solid #c7d8d1;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.22);
}

.chat-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px 12px;
  border-bottom: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #f8fffb, #edf8f2);
}

.chat-title {
  color: #06261d;
  font-size: 15px;
  font-weight: 900;
}

.chat-subtitle {
  margin-top: 3px;
  color: #526174;
  font-size: 12px;
  line-height: 1.35;
}

.chat-minimize {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid #c7d8d1;
  border-radius: 7px;
  background: #fff;
  color: #334155;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.chat-messages {
  display: grid;
  align-content: start;
  gap: 10px;
  overflow: auto;
  padding: 14px;
  background: #f8fbfa;
}

.chat-empty {
  border: 1px solid #d9e6df;
  border-radius: 8px;
  padding: 12px;
  background: #fff;
  color: #526174;
  font-size: 13px;
  line-height: 1.45;
}

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

.chat-suggestions button {
  border: 1px solid #d5e5dd;
  border-radius: 8px;
  padding: 9px 10px;
  background: #fff;
  color: #14532d;
  font-size: 12px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.chat-suggestions button:hover {
  background: #effaf4;
}

.chat-message {
  max-width: 92%;
  border: 1px solid #d9e6df;
  border-radius: 8px;
  padding: 10px 11px;
  background: #fff;
  color: #0f172a;
  font-size: 13px;
  line-height: 1.45;
}

.chat-message.user {
  justify-self: end;
  border-color: #b7d6c7;
  background: #eaf8f0;
}

.chat-message.assistant {
  justify-self: start;
}

.chat-message.error-message {
  border-color: #fecaca;
  background: #fff7f7;
  color: #991b1b;
}

.chat-message-body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.chat-message-meta {
  margin-top: 7px;
  color: #80909d;
  font-size: 10px;
  line-height: 1.3;
}

.chat-inline-error {
  border-top: 1px solid #fecaca;
  padding: 8px 12px;
  background: #fff7f7;
  color: #991b1b;
  font-size: 12px;
  line-height: 1.35;
}

.chat-input-row {
  padding: 12px;
  border-top: 1px solid #e2e8f0;
  background: #fff;
}

.chat-input-row textarea {
  width: 100%;
  min-height: 44px;
  max-height: 110px;
  resize: vertical;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 9px 10px;
  color: #0f172a;
  font: inherit;
  font-size: 13px;
  line-height: 1.35;
}

.chat-input-row textarea:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

@media (max-width: 980px) {
  .grid,
  .two,
  .eta-row {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: center;
    flex-direction: column;
  }

  .control-button {
    width: 100%;
  }

  .title {
    font-size: 38px;
  }

  .header-brand {
    gap: 10px;
  }

  .header-logo {
    height: 42px;
  }

  .process-stage {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .pulse-rail {
    display: none;
  }

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

  .stage-status {
    text-align: left;
  }

  .chat-widget {
    right: 12px;
    bottom: 12px;
    left: 12px;
  }

  .chat-launcher {
    width: 100%;
    justify-content: center;
  }

  .chat-panel {
    width: 100%;
    height: min(600px, calc(100vh - 24px));
  }
}

.cloud-dataset-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cloud-upload-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.cloud-upload-button {
  flex: 1 1 auto;
  min-width: 160px;
  padding: 9px 14px;
  border-radius: 8px;
  border: 1px solid #1e7d52;
  background: #1e7d52;
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
}

.cloud-upload-button.secondary {
  background: #ffffff;
  color: #1e7d52;
}

.cloud-upload-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.cloud-inline-help {
  font-size: 12px;
  color: #475569;
  line-height: 1.45;
}

.cloud-inline-help code {
  background: #eef5f0;
  padding: 1px 4px;
  border-radius: 4px;
  overflow-wrap: anywhere;
}

.cloud-progress {
  font-size: 13px;
  color: #06261d;
  background: #eef5f0;
  border: 1px solid #c7e3d3;
  border-radius: 6px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cloud-progress-line {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
}

.cloud-progress-percent {
  font-variant-numeric: tabular-nums;
}

.cloud-progress-bar {
  height: 8px;
  background: #d8eadd;
  border-radius: 4px;
  overflow: hidden;
}

.cloud-progress-bar.small {
  height: 5px;
}

.cloud-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #1e7d52, #38a374);
  transition: width 120ms ease-out;
}

.cloud-progress-bar-fill.success {
  background: linear-gradient(90deg, #15803d, #22c55e);
}

.cloud-progress-bar-fill.danger {
  background: linear-gradient(90deg, #b91c1c, #f87171);
}

.cloud-progress-bytes {
  font-size: 11px;
  color: #475569;
  font-variant-numeric: tabular-nums;
}

.cloud-progress-current {
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px dashed #c7e3d3;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cloud-progress-file {
  color: #06261d;
  overflow-wrap: anywhere;
  font-weight: 600;
}

.cloud-error {
  font-size: 13px;
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 6px;
  padding: 8px 10px;
}

.cloud-summary {
  font-size: 13px;
  color: #0f172a;
  background: #f8fcfa;
  border: 1px solid #d4e7dc;
  border-radius: 6px;
  padding: 8px 10px;
  overflow-wrap: anywhere;
}

.cloud-summary code {
  background: #eef5f0;
  padding: 1px 4px;
  border-radius: 4px;
}

.cloud-refresh-button {
  align-self: flex-start;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  font-size: 12px;
  cursor: pointer;
}

.cloud-refresh-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.cloud-dataset-row {
  display: flex;
  gap: 6px;
  align-items: stretch;
}

.cloud-dataset-row > select {
  flex: 1 1 auto;
}

.cloud-mini-button {
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  font-size: 12px;
  cursor: pointer;
}

.cloud-mini-button.primary {
  background: #1e7d52;
  color: #ffffff;
  border-color: #1e7d52;
}

.cloud-mini-button.danger {
  border-color: #fecaca;
  background: #fff7f7;
  color: #991b1b;
  font-weight: 700;
}

.cloud-mini-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.cloud-rename-row {
  display: flex;
  gap: 6px;
}

.cloud-rename-row > input {
  flex: 1 1 auto;
}

.cloud-browse {
  border: 1px solid #d4e7dc;
  border-radius: 6px;
  background: #f8fcfa;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cloud-browse-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.cloud-browse-path {
  font-family: Menlo, Consolas, monospace;
  font-size: 11px;
  color: #475569;
  overflow-wrap: anywhere;
}

.cloud-browse-up {
  align-self: flex-start;
  background: transparent;
  border: none;
  color: #0369a1;
  font-size: 12px;
  cursor: pointer;
  padding: 0;
}

.cloud-browse-folders {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cloud-browse-folder {
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  color: #15803d;
}

.cloud-browse-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.cloud-browse-table th,
.cloud-browse-table td {
  border-bottom: 1px solid #e2e8f0;
  padding: 4px 6px;
  text-align: left;
}

.cloud-browse-filename {
  overflow-wrap: anywhere;
}

.cloud-browse-size,
.cloud-browse-time {
  white-space: nowrap;
  color: #475569;
}

.cloud-browse-empty {
  font-size: 12px;
  color: #64748b;
  font-style: italic;
}

.cloud-run-status {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #c7e3d3;
  border-radius: 8px;
  background: #f4faf6;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cloud-run-status-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.cloud-run-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.cloud-run-status-sub {
  font-size: 12px;
  color: #475569;
}

.cloud-run-state {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fef9c3;
  color: #854d0e;
}

.cloud-run-state.state-running,
.cloud-task-state.state-running {
  background: #dbeafe;
  color: #1e40af;
}

.cloud-run-state.state-finished,
.cloud-task-state.state-finished {
  background: #dcfce7;
  color: #166534;
}

.cloud-run-state.state-cancelled,
.cloud-task-state.state-cancelled,
.cloud-run-state.state-crashed,
.cloud-task-state.state-crashed,
.cloud-run-state.state-failed,
.cloud-task-state.state-failed {
  background: #fee2e2;
  color: #991b1b;
}

.cloud-case-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.cloud-case-card {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  padding: 8px;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.cloud-case-card.selected {
  border-color: #1e7d52;
  box-shadow: 0 0 0 2px rgba(30, 125, 82, 0.12);
}

.cloud-case-card-head,
.cloud-case-detail-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.cloud-case-card-head b {
  overflow-wrap: anywhere;
}

.cloud-case-card-foot {
  color: #475569;
  font-size: 11px;
  overflow-wrap: anywhere;
}

.cloud-case-detail {
  border: 1px solid #c7e3d3;
  border-radius: 8px;
  background: #ffffff;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cloud-case-stage-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(86px, auto) minmax(70px, auto);
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.cloud-case-stage-name {
  font-weight: 700;
  color: #0f172a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cloud-case-stage-status {
  color: #475569;
  text-align: right;
}

.cloud-case-stage-status.success {
  color: #166534;
}

.cloud-case-stage-status.danger {
  color: #991b1b;
}

.cloud-case-timeline {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cloud-case-stage-pill {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  text-align: center;
  background: #e2e8f0;
  color: #475569;
  white-space: nowrap;
}

.cloud-case-stage-pill.tone-success {
  background: #dcfce7;
  color: #166534;
}

.cloud-case-stage-pill.tone-danger {
  background: #fee2e2;
  color: #991b1b;
}

.cloud-case-stage-pill.tone-running {
  background: #dbeafe;
  color: #1e40af;
}

.cloud-case-stage-pill.tone-neutral {
  background: #e2e8f0;
  color: #475569;
}

.cloud-case-stage-duration {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: #475569;
}

.cloud-case-summary {
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12px;
  border: 1px solid transparent;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cloud-case-summary.success {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}

.cloud-case-summary.failure {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.cloud-case-summary-detail {
  font-weight: 400;
}

.cloud-case-artifacts {
  border-top: 1px solid #e2e8f0;
  padding-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
}

.cloud-case-artifacts-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-weight: 700;
  color: #0f172a;
}

.cloud-case-artifacts-status {
  font-weight: 400;
  font-size: 11px;
  color: #475569;
}

.cloud-case-artifacts-status.error {
  color: #991b1b;
}

.cloud-case-artifacts-subhead {
  font-weight: 700;
  color: #0f172a;
  font-size: 12px;
  margin-top: 4px;
}

.cloud-case-artifacts-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cloud-case-artifacts-list li {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 2fr;
  align-items: center;
  gap: 8px;
}

.cloud-case-artifacts-label {
  color: #475569;
}

.cloud-case-artifacts-value {
  display: flex;
  align-items: center;
  min-width: 0;
}

.cloud-case-artifacts-path {
  font-size: 11px;
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  color: #0f172a;
  overflow-wrap: anywhere;
  word-break: break-all;
}

.cloud-case-artifacts-link {
  color: #1d4ed8;
  text-decoration: underline;
  overflow-wrap: anywhere;
  word-break: break-all;
}

.cloud-case-artifacts-link:hover {
  color: #1e3a8a;
}

.cloud-case-artifacts-missing {
  color: #64748b;
  font-style: italic;
  font-size: 11px;
}

.cloud-case-artifacts-logs {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cloud-case-artifacts-prefix {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 2fr;
  align-items: center;
  gap: 8px;
}

.cloud-case-artifacts-note {
  font-size: 11px;
  color: #64748b;
  font-style: italic;
}

.cloud-task-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cloud-task {
  border: 1px dashed #c7e3d3;
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cloud-task-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cloud-task-state {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  background: #fef9c3;
  color: #854d0e;
}

.cloud-task-detail {
  color: #06261d;
  overflow-wrap: anywhere;
}

.cloud-task-empty {
  font-size: 12px;
  color: #64748b;
  font-style: italic;
}
