:root {
  color-scheme: light dark;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--tg-theme-secondary-bg-color, #f2f4f7);
  color: var(--tg-theme-text-color, #18212f);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  padding: max(16px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
}

.card {
  width: min(100%, 680px);
  margin: 0 auto;
  padding: 20px;
  border-radius: 18px;
  background: var(--tg-theme-bg-color, #fff);
  box-shadow: 0 8px 30px rgb(24 33 47 / 10%);
}

h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: 1.45rem; }
h2 { margin-bottom: 8px; font-size: 1rem; }

.eyebrow {
  margin-bottom: 6px;
  color: var(--tg-theme-hint-color, #64748b);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
}

.subtle, .footnote, .summary, .notice { color: var(--tg-theme-hint-color, #64748b); line-height: 1.5; }
.subtle { margin-bottom: 18px; }

button {
  width: 100%;
  min-height: 46px;
  border: 0;
  border-radius: 12px;
  padding: 11px 14px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

button:disabled { cursor: not-allowed; opacity: .48; }
.primary { background: var(--tg-theme-button-color, #2481cc); color: var(--tg-theme-button-text-color, #fff); }
.secondary { background: color-mix(in srgb, var(--tg-theme-button-color, #2481cc) 13%, transparent); color: var(--tg-theme-link-color, #2481cc); }
.finish { background: #137a44; color: #fff; }

.status-block {
  margin: 20px 0 16px;
  padding: 15px;
  border: 1px solid color-mix(in srgb, currentColor 12%, transparent);
  border-radius: 14px;
}

.summary { margin-bottom: 0; font-size: .91rem; }
.upload-progress { width: 100%; height: 8px; margin-top: 12px; accent-color: var(--tg-theme-button-color, #2481cc); }
.file-list { display: grid; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.file-row { display: grid; gap: 3px; padding: 10px; border-radius: 10px; background: color-mix(in srgb, currentColor 5%, transparent); }
.file-name { overflow: hidden; font-size: .92rem; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.file-detail { color: var(--tg-theme-hint-color, #64748b); font-size: .8rem; }
.is-uploaded { border-inline-start: 4px solid #18864b; }
.is-uploading { border-inline-start: 4px solid #d48a09; }
.is-failed { border-inline-start: 4px solid #ba3131; }

.actions { display: grid; gap: 9px; }
.notice { min-height: 3em; margin: 16px 0 8px; white-space: pre-line; }
.footnote { margin-bottom: 0; font-size: .8rem; }

@media (prefers-color-scheme: dark) {
  .finish { background: #279963; }
}
