:root {
  --bg: #f6f7f8;
  --surface: #ffffff;
  --surface-2: #eef2f0;
  --text: #17211d;
  --muted: #60716a;
  --line: #dce4df;
  --accent: #1f8a70;
  --accent-dark: #156a55;
  --blue: #315fba;
  --amber: #9a6418;
  --danger: #b83b3b;
  --shadow: 0 16px 40px rgba(28, 39, 35, 0.08);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
}

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  font-size: 19px;
  font-weight: 760;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--accent);
  background: #e7f3ef;
  border: 1px solid #cce5dd;
  border-radius: 8px;
}

.brand-mark svg,
button svg,
.drop-icon svg,
.results-empty svg {
  width: 21px;
  height: 21px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  color: #225448;
  background: #e8f4ef;
  border: 1px solid #c9e2da;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 720;
}

.lock-dot {
  width: 8px;
  height: 8px;
  background: #1e9d79;
  border-radius: 999px;
  box-shadow: 0 0 0 3px rgba(31, 138, 112, 0.14);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 410px;
  gap: 18px;
  align-items: stretch;
}

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

.upload-panel,
.result-panel {
  min-height: 448px;
  padding: 22px;
}

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

h1,
h2 {
  margin: 0;
  font-weight: 780;
  line-height: 1.12;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(28px, 4vw, 44px);
}

h2 {
  font-size: 22px;
}

p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.upload-form {
  display: grid;
  gap: 14px;
}

.dropzone {
  display: grid;
  min-height: 210px;
  place-items: center;
  align-content: center;
  gap: 10px;
  padding: 24px;
  background: #fbfcfc;
  border: 1.5px dashed #b9c8c1;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.dropzone:hover,
.dropzone.drag-over {
  background: #f0f7f4;
  border-color: var(--accent);
}

.dropzone:active {
  transform: translateY(1px);
}

.dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.drop-icon {
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  color: var(--accent);
  background: #e6f3ef;
  border: 1px solid #c9e2da;
  border-radius: 8px;
}

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

.drop-title {
  font-size: 19px;
  font-weight: 760;
}

.drop-copy {
  color: var(--muted);
  font-size: 14px;
}

.queue {
  display: grid;
  gap: 8px;
}

.queue-row,
.result-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: #fbfcfc;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.queue-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.file-name {
  overflow: hidden;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-meta {
  color: var(--muted);
  font-size: 13px;
}

.progress-wrap {
  display: grid;
  gap: 8px;
}

.progress-line {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
}

.progress-line strong {
  color: var(--text);
}

.meter {
  height: 10px;
  overflow: hidden;
  background: #e6ece9;
  border-radius: 999px;
}

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

.primary-button,
.copy-button,
.link-button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 760;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.primary-button {
  width: 100%;
  min-height: 48px;
  color: #fff;
  background: var(--accent);
}

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

.primary-button:disabled {
  color: #8ea59a;
  background: #dfe8e3;
  cursor: not-allowed;
}

.copy-button,
.link-button {
  min-height: 34px;
  padding: 0 10px;
  color: #24352f;
  background: #f4f7f6;
  border: 1px solid var(--line);
}

.copy-button:hover,
.link-button:hover {
  background: #e9efec;
}

.link-button.danger,
.button.danger {
  color: #fff;
  background: var(--danger);
  border-color: var(--danger);
}

.button.secondary {
  color: var(--text);
  background: #f4f7f6;
  border: 1px solid var(--line);
}

.button {
  min-width: 112px;
  padding: 0 15px;
  color: #fff;
  background: var(--accent);
}

.results-empty {
  display: grid;
  min-height: 300px;
  place-items: center;
  color: #93a49d;
  background: #fbfcfc;
  border: 1px dashed #d5dfda;
  border-radius: 8px;
}

.results-empty svg {
  width: 44px;
  height: 44px;
}

.results {
  display: grid;
  gap: 12px;
}

.result-card h3 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 16px;
}

.link-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: end;
}

.link-field {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.link-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.link-field input {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  color: #26352f;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 10;
  max-width: min(420px, calc(100vw - 36px));
  padding: 12px 14px;
  color: #fff;
  background: #22352e;
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.mini-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.dialog {
  width: min(520px, 100%);
  padding: 24px;
}

.dialog dl {
  display: grid;
  gap: 10px;
  margin: 18px 0;
}

.dialog dl div {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 12px;
}

.dialog dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.dialog dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.dialog form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.eyeline {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 780;
}

@media (max-width: 900px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .upload-panel,
  .result-panel {
    min-height: auto;
  }
}

@media (max-width: 620px) {
  .shell {
    width: min(100% - 22px, 1180px);
    padding-top: 14px;
  }

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

  h1 {
    font-size: 31px;
  }

  .upload-panel,
  .result-panel {
    padding: 15px;
  }

  .dropzone {
    min-height: 180px;
  }

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