:root {
  color-scheme: light;
  --bg: #f4f6f2;
  --surface: #fffefa;
  --surface-soft: #eef3ef;
  --surface-warm: #fff7ec;
  --ink: #17201c;
  --muted: #5e6962;
  --line: #d3dbd1;
  --line-strong: #bac6bd;
  --champagne: #b7863d;
  --sage: #587468;
  --rose: #a24f61;
  --plum: #51435b;
  --sky: #315f8d;
  --focus: #245fd7;
  --shadow: 0 20px 58px rgba(23, 32, 28, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background:
    linear-gradient(135deg, rgba(88, 116, 104, 0.15) 0 24%, transparent 24% 100%),
    linear-gradient(315deg, rgba(81, 67, 91, 0.12) 0 20%, transparent 20% 100%),
    linear-gradient(180deg, #fbfcf8 0%, var(--bg) 48%, #edf3ef 100%);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  letter-spacing: 0;
}

body {
  min-height: 100vh;
  margin: 0;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(90deg, rgba(23, 32, 28, 0.045) 1px, transparent 1px),
    linear-gradient(180deg, rgba(23, 32, 28, 0.035) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.65), transparent 78%);
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.page-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 980px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  align-items: flex-start;
}

.upload-surface {
  width: 100%;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 254, 250, 0.98), rgba(249, 251, 247, 0.97)),
    var(--surface);
  box-shadow: var(--shadow);
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(112px, 148px);
  gap: 22px;
  align-items: start;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.headline-block {
  min-width: 0;
}

.event-side {
  display: grid;
  gap: 10px;
  justify-items: stretch;
}

.event-mark {
  display: grid;
  place-items: center;
  width: 100%;
  min-width: 112px;
  max-width: 148px;
  aspect-ratio: 1;
  justify-self: end;
  border: 1px solid rgba(23, 32, 28, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(135deg, var(--ink) 0 52%, var(--sage) 52% 100%);
  color: var(--surface);
  box-shadow: inset 0 0 0 1px rgba(255, 254, 250, 0.12);
}

.event-mark span,
.event-mark small {
  display: block;
  line-height: 1;
}

.event-mark span {
  font-size: 2.2rem;
  font-weight: 900;
}

.event-mark small {
  margin-top: 7px;
  color: #f2d296;
  font-size: 0.8rem;
  font-weight: 800;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--champagne);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: 3.25rem;
  line-height: 0.98;
  font-weight: 850;
}

h2 {
  margin-bottom: 5px;
  font-size: 1rem;
}

.event-message {
  max-width: 680px;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.status-pill {
  min-width: 0;
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid rgba(88, 116, 104, 0.34);
  border-radius: 8px;
  background: rgba(88, 116, 104, 0.11);
  color: #315046;
  text-align: center;
  font-size: 0.86rem;
  font-weight: 800;
}

.status-pill[data-state="closed"] {
  border-color: rgba(162, 79, 97, 0.36);
  background: rgba(162, 79, 97, 0.11);
  color: #7d3a49;
}

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

.guest-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 750;
}

.guest-form .wide {
  grid-column: 1 / -1;
}

input,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 254, 250, 0.98);
  color: var(--ink);
  padding: 12px 13px;
  outline: none;
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease,
    background 140ms ease;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus,
button:focus-visible {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(36, 95, 215, 0.18);
  outline: none;
}

.picker-panel {
  display: grid;
  grid-template-columns: auto auto minmax(180px, 1fr);
  gap: 12px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(88, 116, 104, 0.12), rgba(183, 134, 61, 0.12)),
    var(--surface-soft);
}

.primary-action,
.secondary-action,
.ghost-action,
.file-action {
  min-height: 42px;
  min-width: 0;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 10px 14px;
  font-weight: 820;
  line-height: 1.2;
}

.primary-action {
  background: var(--ink);
  color: var(--surface);
}

.primary-action:hover:not(:disabled) {
  background: #24352e;
}

.secondary-action {
  border-color: rgba(183, 134, 61, 0.48);
  background: var(--surface);
  color: #5e4219;
}

.secondary-action:hover:not(:disabled),
.ghost-action:hover:not(:disabled),
.file-action:hover:not(:disabled) {
  border-color: var(--line-strong);
  background: #f8fbf6;
}

.ghost-action,
.file-action {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.limit-text {
  min-width: 0;
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.queue-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin: 24px 0 12px;
}

#queueSummary {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.file-list {
  display: grid;
  gap: 10px;
  min-height: 86px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.file-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(112px, auto);
  gap: 12px;
  align-items: center;
  min-height: 96px;
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--champagne);
  border-radius: 8px;
  background: var(--surface);
}

.file-item[data-state="DONE"] {
  border-left-color: var(--sage);
  background: linear-gradient(90deg, rgba(88, 116, 104, 0.08), transparent 56%), var(--surface);
}

.file-item[data-state="VERIFYING"] {
  border-left-color: var(--sky);
}

.file-item[data-state="REJECTED"],
.file-item[data-state="FAILED_FINAL"],
.file-item[data-state="RETRYABLE"],
.file-item[data-state="RESUMABLE"],
.file-item[data-state="PAUSED_OFFLINE"],
.file-item[data-state="UPLOAD_CLOSED"] {
  border-left-color: var(--rose);
  background: linear-gradient(90deg, rgba(162, 79, 97, 0.08), transparent 56%), var(--surface);
}

.file-main {
  min-width: 0;
}

.file-title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.file-name {
  overflow-wrap: anywhere;
  line-height: 1.3;
}

.file-size,
.file-state {
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

.file-message {
  min-height: 22px;
  margin: 7px 0 10px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.35;
}

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

.progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--champagne), var(--sage), var(--sky));
  transition: width 180ms ease;
}

.file-actions {
  display: grid;
  gap: 9px;
  justify-items: end;
}

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

@media (max-width: 720px) {
  .page-shell {
    padding: 12px;
  }

  .upload-surface {
    padding: 18px;
  }

  .topbar,
  .guest-form,
  .picker-panel,
  .queue-header,
  .file-item,
  .file-title-row {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 2.38rem;
    line-height: 1.04;
  }

  .event-side {
    grid-template-columns: 78px minmax(82px, 112px);
    align-items: end;
    justify-content: start;
  }

  .event-mark {
    min-width: 78px;
    max-width: 78px;
  }

  .event-mark span {
    font-size: 1.55rem;
  }

  .event-mark small {
    font-size: 0.68rem;
  }

  .status-pill {
    align-self: end;
  }

  .primary-action,
  .secondary-action,
  .ghost-action,
  .file-action {
    width: 100%;
  }

  .file-actions {
    justify-items: stretch;
  }

  .file-size,
  .file-state {
    white-space: normal;
  }
}

@media (max-width: 390px) {
  .upload-surface {
    padding: 14px;
  }

  h1 {
    font-size: 2.05rem;
  }

  .event-side {
    grid-template-columns: 70px minmax(72px, 100px);
  }

  .event-mark {
    min-width: 70px;
    max-width: 70px;
  }
}
