:root {
  color-scheme: dark;
  --bg: #08090d;
  --panel: #111318;
  --panel-strong: #181b22;
  --line: #2b2f3a;
  --line-strong: #454a58;
  --text: #f4f7fb;
  --muted: #a3a9b7;
  --soft: #d2d6df;
  --accent: #5865f2;
  --accent-strong: #6d77f5;
  --accent-soft: rgba(88, 101, 242, 0.14);
  --accent-ink: #ffffff;
  --danger: #ff6b7a;
  --warning: #ffd166;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  background: #090b10;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
}

button,
input,
a {
  font: inherit;
}

a {
  color: inherit;
}

.shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 32px;
}

.workspace {
  width: min(880px, calc(100vw - 64px));
}

.mast {
  margin-bottom: 22px;
}

.eyebrow,
.result-kicker {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(1.85rem, 4vw, 3.1rem);
  line-height: 1;
  letter-spacing: 0;
}

.lede {
  max-width: 620px;
  margin: 16px 0 0;
  color: var(--soft);
  font-size: 1.1rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.upload-panel,
.result-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.upload-panel {
  padding: 18px;
}

.dropzone {
  display: grid;
  min-height: 230px;
  cursor: pointer;
  place-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: #151820;
  color: var(--soft);
  text-align: center;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.dropzone:hover,
.dropzone.is-dragging {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.drop-icon {
  display: inline-grid;
  width: 58px;
  height: 58px;
  place-items: center;
  margin-bottom: 16px;
  border: 1px solid rgba(88, 101, 242, 0.5);
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
}

.drop-icon svg {
  width: 30px;
  height: 30px;
}

.drop-title,
.drop-meta {
  display: block;
}

.drop-title {
  color: var(--text);
  font-size: 1.3rem;
  font-weight: 800;
}

.drop-meta {
  margin-top: 8px;
  color: var(--muted);
}

.selected-head,
.actions,
.result-panel,
.result-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.selected-head {
  justify-content: space-between;
  min-height: 48px;
  margin-top: 16px;
  color: var(--soft);
  font-weight: 700;
}

.file-list {
  display: grid;
  gap: 10px;
  max-height: 250px;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.file-item {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
}

.file-item > svg {
  color: var(--accent);
}

.file-info {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.file-name {
  overflow: hidden;
  color: var(--text);
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.actions {
  margin-top: 18px;
}

.primary-button,
.ghost-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: 8px;
  padding: 0 16px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 850;
  text-decoration: none;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease, opacity 140ms ease;
}

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

.primary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

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

.ghost-button {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
}

.primary-button:disabled,
.ghost-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

.primary-button:disabled {
  background: #242834;
  color: #808899;
}

.compact {
  min-height: 38px;
  padding: 0 13px;
}

.icon-only {
  width: 40px;
  padding: 0;
}

.meter {
  position: relative;
  flex: 1;
  min-width: 90px;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.meter span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 180ms ease;
}

.status {
  min-height: 24px;
  margin: 12px 0 0;
  color: var(--muted);
}

.status[data-type="success"] {
  color: var(--accent);
}

.status[data-type="error"] {
  color: var(--danger);
}

.status[data-type="pending"] {
  color: var(--warning);
}

.result-panel {
  justify-content: space-between;
  margin-top: 18px;
  padding: 18px;
}

.result-panel a:not(.ghost-button) {
  display: block;
  max-width: min(560px, 78vw);
  overflow: hidden;
  color: var(--text);
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.share-workspace {
  width: min(760px, calc(100vw - 64px));
}

.shared-file {
  grid-template-columns: 24px minmax(0, 1fr) auto;
}

.empty-state {
  display: grid;
  min-height: 220px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
}

.empty-state svg {
  width: 42px;
  height: 42px;
  color: var(--danger);
}

@media (max-width: 680px) {
  .shell {
    align-items: start;
    padding: 22px 14px;
  }

  .workspace,
  .share-workspace {
    width: calc(100vw - 28px);
  }

  .dropzone {
    min-height: 190px;
  }

  .selected-head,
  .actions,
  .result-panel,
  .result-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .selected-head {
    align-items: flex-start;
  }

  .primary-button,
  .ghost-button {
    width: 100%;
  }

  .icon-only {
    width: 44px;
  }

  .file-item {
    grid-template-columns: 24px minmax(0, 1fr) auto;
  }

  .result-panel a:not(.ghost-button) {
    max-width: 100%;
  }
}
