:root {
  color-scheme: light;
  --ink: #101417;
  --muted: #647078;
  --line: #d7dde1;
  --panel: #ffffff;
  --surface: #f5f7f8;
  --accent: #007f7a;
  --accent-strong: #005f5b;
  --accent-soft: #d8f3f0;
  --warn: #c85c2d;
  --good: #2f7d45;
  --shadow: 0 18px 60px rgba(16, 20, 23, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(0, 127, 122, 0.10), rgba(255, 255, 255, 0) 280px),
    var(--surface);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  width: min(100%, 760px);
  min-height: 100svh;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 16px max(26px, env(safe-area-inset-bottom));
}

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

.header-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  max-width: 50%;
}

.eyebrow,
.topbar h1,
.section-title h2,
.progress-meta,
.file-name,
.file-size,
.empty,
.status-pill,
.upload-status,
.picker strong,
.picker small {
  overflow-wrap: anywhere;
}

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

.topbar h1 {
  margin: 0;
  font-size: 3rem;
  line-height: 0.92;
  letter-spacing: 0;
}

.status-pill {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-align: right;
}

.status-pill.is-busy {
  color: var(--warn);
  border-color: rgba(200, 92, 45, 0.42);
}

.status-pill.is-done {
  color: var(--good);
  border-color: rgba(47, 125, 69, 0.42);
}

.logout-button {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--ink);
  cursor: pointer;
}

.upload-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 12px;
}

.upload-panel.is-dragging {
  border-color: var(--accent);
  background: linear-gradient(180deg, var(--accent-soft), var(--panel) 42%);
}

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

.picker {
  display: flex;
  min-height: 128px;
  align-items: center;
  gap: 14px;
  border: 1px dashed #9aa8af;
  border-radius: 8px;
  padding: 18px;
  background: #fbfcfd;
  cursor: pointer;
}

.picker-icon {
  display: grid;
  flex: 0 0 54px;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
}

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

.picker strong {
  display: block;
  color: var(--ink);
  font-size: 1.18rem;
  line-height: 1.05;
}

.picker small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.94rem;
}

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

.queue:empty {
  display: none;
}

.file-row,
.upload-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 10px;
}

.file-name {
  min-width: 0;
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 750;
}

.file-size,
.upload-status {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.progress-wrap {
  margin-top: 14px;
}

.progress-track {
  width: 100%;
  height: 14px;
  overflow: hidden;
  border-radius: 8px;
  background: #e2e8eb;
}

.progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #f2a33a);
  transition: width 140ms ease-out;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 50px;
  gap: 10px;
  margin-top: 12px;
}

.primary-button,
.ghost-button,
.icon-button {
  min-height: 50px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

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

.primary-button:not(:disabled):active,
.ghost-button:not(:disabled):active,
.icon-button:not(:disabled):active {
  transform: translateY(1px);
}

.primary-button:disabled,
.ghost-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.ghost-button,
.icon-button {
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
}

.uploads-section {
  margin-top: 22px;
}

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

.section-title h2 {
  margin: 0;
  font-size: 1.02rem;
  letter-spacing: 0;
}

.icon-button {
  width: 44px;
  min-height: 44px;
}

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

.upload-row {
  color: inherit;
  text-decoration: none;
}

.upload-row:hover {
  border-color: #aebac0;
}

.empty {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-weight: 700;
}

.login-shell {
  display: grid;
  align-content: center;
}

.login-panel {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 14px;
}

.field {
  display: grid;
  gap: 7px;
}

.field span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.field input {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 12px 13px;
  font-size: 1rem;
}

.field input:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(0, 127, 122, 0.18);
}

.form-error {
  border: 1px solid rgba(200, 92, 45, 0.36);
  border-radius: 8px;
  background: rgba(200, 92, 45, 0.08);
  color: var(--warn);
  padding: 10px 12px;
  font-size: 0.88rem;
  font-weight: 800;
}

@media (max-width: 420px) {
  .topbar h1 {
    font-size: 2.35rem;
  }

  .header-actions {
    max-width: 54%;
  }

  .status-pill {
    font-size: 0.76rem;
  }

  .picker strong {
    font-size: 1.08rem;
  }
}

@media (min-width: 720px) {
  .app-shell {
    padding-top: 34px;
  }

  .topbar h1 {
    font-size: 4.8rem;
  }

  .upload-panel {
    padding: 16px;
  }

  .picker {
    min-height: 150px;
    padding: 22px;
  }

  .picker strong {
    font-size: 1.45rem;
  }

  .login-panel {
    padding: 18px;
  }
}
