:root {
  color-scheme: light;
  --bg: #f7f7f2;
  --surface: #ffffff;
  --surface-soft: #eef5f3;
  --text: #202321;
  --muted: #66716c;
  --line: #d8dfdb;
  --accent: #137a70;
  --accent-strong: #0f5f59;
  --accent-soft: #dff2ef;
  --warn: #ad4b2b;
  --warn-soft: #fde8df;
  --focus: rgba(19, 122, 112, 0.22);
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  padding: max(18px, env(safe-area-inset-top)) 0 max(24px, env(safe-area-inset-bottom)) 0;
}

button,
input,
select {
  font: inherit;
}

.shell {
  width: calc(100% - 28px);
  max-width: 760px;
  margin: 0 auto;
}

.masthead,
.section-head,
.code-row,
.link-row,
.code-form {
  display: flex;
  align-items: center;
}

.masthead,
.section-head {
  justify-content: space-between;
  gap: 16px;
}

.masthead {
  padding: 10px 0 18px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 14px;
  box-shadow: 0 10px 24px rgba(34, 46, 40, 0.05);
}

.upload-panel {
  border-top: 4px solid var(--accent);
}

.eyebrow,
h1,
h2,
h3,
p,
dl {
  margin: 0;
}

.eyebrow {
  color: var(--accent-strong);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin-top: 2px;
  font-size: clamp(2rem, 5vw, 3.3rem);
  line-height: 1.05;
}

h2 {
  font-size: 1.18rem;
  line-height: 1.25;
}

h3 {
  font-size: 1.06rem;
  line-height: 1.3;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #f5f7f6;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.status-pill.ready {
  background: var(--accent-soft);
  border-color: #b7ddd8;
  color: var(--accent-strong);
}

.status-pill.warn {
  background: var(--warn-soft);
  border-color: #f3c6b5;
  color: var(--warn);
}

.section-head {
  margin-bottom: 16px;
}

.file-drop {
  display: grid;
  gap: 8px;
  place-items: center;
  min-height: 148px;
  padding: 20px;
  border: 1px dashed #93b7b2;
  border-radius: 8px;
  background: var(--surface-soft);
  text-align: center;
  cursor: pointer;
}

.file-drop.dragging {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--focus);
}

.file-drop input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.file-drop-title {
  font-size: 1.08rem;
  font-weight: 800;
}

.muted,
.message,
dt {
  color: var(--muted);
}

.message {
  margin-top: 10px;
  line-height: 1.45;
}

.form-grid {
  display: grid;
  grid-template-columns: minmax(180px, 240px);
  gap: 12px;
  margin-top: 14px;
}

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

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

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 10px 12px;
}

input:focus,
select:focus,
button:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--focus);
}

.button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 800;
  cursor: pointer;
}

.button.primary {
  width: 100%;
  margin-top: 14px;
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.button.secondary {
  background: #f5f7f6;
  color: var(--text);
}

.button.compact {
  width: auto;
  min-height: 38px;
  padding-inline: 12px;
}

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

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

.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 160ms ease;
}

.share-details {
  display: grid;
  gap: 14px;
}

.share-details div {
  display: grid;
  gap: 6px;
}

dt {
  font-size: 0.84rem;
  font-weight: 700;
}

dd {
  margin: 0;
}

code {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f1f4f3;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 1rem;
  letter-spacing: 0.08em;
}

.code-row,
.link-row {
  gap: 8px;
}

.link-row input {
  flex: 1;
  min-width: 0;
}

.code-form {
  gap: 10px;
  align-items: end;
}

.code-field {
  flex: 1;
}

.download-card {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.download-card .button {
  margin-top: 12px;
}

@media (max-width: 620px) {
  .masthead,
  .section-head,
  .code-form,
  .code-row,
  .link-row {
    align-items: stretch;
    flex-direction: column;
  }

  .status-pill {
    align-self: flex-start;
  }

  .panel {
    padding: 16px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .button.compact,
  .code-form .button {
    width: 100%;
  }
}
