:root {
  color-scheme: light;
  --bg: #f6f7f2;
  --panel: #ffffff;
  --ink: #18211b;
  --muted: #68736d;
  --line: #d9dfd7;
  --accent: #0f7b5c;
  --accent-strong: #0a6349;
  --accent-soft: #dff3eb;
  --warn: #b3432f;
  --shadow: 0 18px 60px rgba(24, 33, 27, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(135deg, rgba(15, 123, 92, 0.10), transparent 36%),
    linear-gradient(315deg, rgba(218, 172, 72, 0.14), transparent 34%),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

a {
  color: var(--accent-strong);
}

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

.workspace {
  display: grid;
  gap: 18px;
}

.workspace-tools {
  display: grid;
  gap: 18px;
}

.workspace-tools[hidden],
.auth-panel[hidden],
#logout-button[hidden] {
  display: none;
}

.masthead,
.auth-panel,
.upload-panel,
.result-panel,
.file-section {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px;
}

.account-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-width: 0;
}

#account-email {
  max-width: 240px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.eyebrow,
.label {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  font-size: clamp(2rem, 7vw, 4.4rem);
  line-height: 0.95;
}

h2 {
  font-size: 1.05rem;
}

.quiet-link {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  color: var(--muted);
  text-decoration: none;
}

.quiet-button {
  flex: 0 0 auto;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: #eef2ec;
  color: var(--ink);
  font-weight: 800;
}

.auth-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
}

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

.field-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.field-grid input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fbfcf8;
  color: var(--ink);
}

.field-grid input:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(15, 123, 92, 0.16);
}

.upload-panel {
  padding: 18px;
}

.drop-zone {
  display: grid;
  min-height: 230px;
  place-items: center;
  align-content: center;
  gap: 10px;
  border: 2px dashed #a9b9af;
  border-radius: 8px;
  background: #fbfcf8;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.drop-zone.has-file {
  border-style: solid;
  background: #f4fbf7;
}

.drop-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.drop-icon {
  width: 52px;
  height: 52px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  position: relative;
}

.drop-icon::before,
.drop-icon::after {
  position: absolute;
  content: "";
  background: var(--accent);
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.drop-icon::before {
  width: 22px;
  height: 2px;
}

.drop-icon::after {
  width: 2px;
  height: 22px;
}

.drop-title {
  max-width: min(540px, calc(100% - 24px));
  overflow-wrap: anywhere;
  text-align: center;
  font-size: 1.18rem;
  font-weight: 800;
}

.drop-meta,
.status,
.file-size {
  color: var(--muted);
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

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

.primary-button,
.secondary-button,
.copy-button {
  min-height: 44px;
  padding: 0 18px;
  font-weight: 800;
}

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

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

.secondary-button,
.copy-button,
.icon-button {
  background: #eef2ec;
  color: var(--ink);
}

.progress-wrap {
  height: 8px;
  margin-top: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7ece8;
}

.progress-bar {
  width: 0;
  height: 100%;
  background: var(--accent);
  transition: width 120ms ease;
}

.result-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
}

.result-panel[hidden],
.progress-wrap[hidden] {
  display: none;
}

#result-link {
  display: block;
  max-width: 720px;
  overflow-wrap: anywhere;
  font-weight: 800;
}

.file-section {
  padding: 18px;
}

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

.icon-button {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  font-size: 1.15rem;
}

.status {
  padding: 18px 0;
}

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

.file-list {
  display: grid;
  gap: 10px;
}

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

.file-name {
  overflow-wrap: anywhere;
  font-weight: 800;
}

.file-actions {
  display: flex;
  gap: 8px;
}

.mini-button {
  min-width: 40px;
  min-height: 36px;
  padding: 0 12px;
  background: #eef2ec;
  color: var(--ink);
  text-decoration: none;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  font-weight: 800;
}

@media (max-width: 680px) {
  .shell {
    width: min(100% - 20px, 1040px);
    padding: 20px 0;
  }

  .masthead,
  .result-panel,
  .actions,
  .account-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .field-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  #account-email {
    max-width: 100%;
  }

  .drop-zone {
    min-height: 190px;
  }

  .file-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .file-actions {
    width: 100%;
  }

  .mini-button {
    flex: 1;
  }
}
