:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-muted: #f0f4f7;
  --text: #172033;
  --muted: #617084;
  --border: #dce3ea;
  --accent: #117865;
  --accent-dark: #0b5f50;
  --accent-soft: #e3f3ef;
  --warning: #9c5c15;
  --danger: #b73535;
  --shadow: 0 16px 34px rgba(32, 47, 66, 0.08);
  --radius: 8px;
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
}

button,
input {
  font: inherit;
}

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
  min-width: 0;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 24px 18px;
  background: #101824;
  color: #f4f8fb;
  min-width: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
  font-weight: 720;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  color: #65d6bd;
  background: rgba(255, 255, 255, 0.07);
}

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

.nav-list a,
.docs-link {
  text-decoration: none;
}

.nav-list a {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  color: #b8c4d1;
  font-size: 14px;
  font-weight: 640;
}

.nav-list a:hover,
.nav-list a:focus-visible {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}

.sidebar-note {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 9px;
  color: #a9b7c6;
  font-size: 13px;
  line-height: 1.35;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 99px;
  background: #65d6bd;
  box-shadow: 0 0 0 4px rgba(101, 214, 189, 0.12);
  flex: 0 0 auto;
}

.workspace {
  width: min(1180px, 100%);
  min-width: 0;
  margin: 0 auto;
  padding: 32px;
}

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

.topbar h1,
.panel h2 {
  margin: 0;
  letter-spacing: 0;
}

.topbar h1 {
  font-size: 38px;
  line-height: 1.05;
}

.topbar p,
.panel p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.docs-link,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
}

.docs-link {
  flex: 0 0 auto;
  color: var(--accent-dark);
  background: var(--accent-soft);
}

.docs-link:hover,
.button:hover {
  transform: translateY(-1px);
}

.notice {
  padding: 13px 16px;
  margin-bottom: 18px;
  border: 1px solid #ead6ad;
  border-radius: 8px;
  color: #644016;
  background: #fff8e8;
  line-height: 1.45;
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(360px, 1.1fr);
  gap: 18px;
  min-width: 0;
}

.panel {
  margin-bottom: 18px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  min-width: 0;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.panel h2 {
  font-size: 19px;
  line-height: 1.2;
}

.mode-chip,
.count,
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 760;
}

.mode-chip {
  color: var(--accent-dark);
  background: var(--accent-soft);
}

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

.file-drop {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 198px;
  padding: 22px;
  border: 1.5px dashed #b9c8d5;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fafc 100%);
  text-align: center;
  cursor: pointer;
}

.file-drop input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.file-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 8px;
  color: var(--accent);
  background: var(--accent-soft);
}

.file-icon svg {
  width: 24px;
  height: 24px;
}

.file-main {
  font-size: 18px;
  font-weight: 780;
}

.file-sub {
  max-width: 100%;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.field {
  display: grid;
  gap: 7px;
  color: #2c3848;
  font-size: 13px;
  font-weight: 700;
}

input[type="text"],
input[type="file"] {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
}

input[type="text"] {
  min-height: 42px;
  padding: 0 12px;
}

input[type="file"] {
  padding: 10px;
  font-size: 13px;
}

.mini-file {
  display: grid;
  gap: 8px;
  padding: 11px;
  border: 1px dashed #b9c8d5;
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
}

.mini-file input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.mini-file span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 760;
}

.mini-file small {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.button.primary {
  color: #ffffff;
  background: var(--accent);
}

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

.button.secondary,
.button.ghost {
  color: var(--text);
  background: #ffffff;
  border-color: var(--border);
}

.button.secondary:hover,
.button.ghost:hover {
  border-color: #b9c8d5;
  background: var(--surface-muted);
}

.button.danger {
  min-height: 30px;
  padding: 0 10px;
  color: var(--danger);
  background: #fff3f3;
  border-color: #f0caca;
  font-size: 12px;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
  transform: none;
}

.status-line {
  min-height: 20px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.status-line.error {
  color: var(--danger);
}

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

.asset-form {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfcfd;
}

.asset-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 780;
}

.count {
  color: #2f536b;
  background: #e8eef4;
}

.asset-list {
  display: grid;
  gap: 8px;
  min-height: 38px;
  max-height: 210px;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.asset-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
}

.asset-name {
  min-width: 0;
  font-size: 13px;
  font-weight: 680;
  overflow-wrap: anywhere;
}

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

.table-wrap {
  overflow-x: auto;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 790px;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

th {
  color: #47576a;
  background: #f6f8fa;
  font-size: 12px;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

.file-cell {
  display: grid;
  gap: 4px;
}

.job-id {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.badge.queued {
  color: #5b4a11;
  background: #fff2bf;
}

.badge.processing {
  color: #16476f;
  background: #dff0ff;
}

.badge.done {
  color: #0b614d;
  background: #dff5ee;
}

.badge.failed {
  color: #8e2222;
  background: #ffe0e0;
}

.download-link {
  color: var(--accent-dark);
  font-weight: 760;
  text-decoration: none;
}

.download-link:hover {
  text-decoration: underline;
}

.error-text {
  max-width: 280px;
  color: var(--danger);
  font-size: 12px;
  overflow-wrap: anywhere;
}

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

pre {
  margin: 0;
  min-height: 112px;
  padding: 14px;
  overflow-x: auto;
  border: 1px solid #cbd7e1;
  border-radius: 8px;
  color: #d8e4ef;
  background: #101824;
  font-size: 12px;
  line-height: 1.5;
}

.empty {
  padding: 10px 0;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 16px;
  }

  .nav-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .sidebar-note {
    margin-top: 0;
  }

  .workspace {
    padding: 22px 16px;
  }

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

@media (max-width: 660px) {
  .topbar h1 {
    font-size: 30px;
  }

  .topbar,
  .panel-header,
  .asset-columns {
    grid-template-columns: 1fr;
    display: grid;
  }

  .docs-link,
  .button {
    width: 100%;
  }

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

  .panel {
    padding: 16px;
  }
}
