:root {
  --blue: #1a73e8;
  --blue-dark: #1558b0;
  --green: #188038;
  --red: #d93025;
  --text: #202124;
  --muted: #5f6368;
  --line: #dadce0;
  --light: #f8f9fa;
  --blue-bg: #e8f0fe;
  --warning-bg: #fff7e0;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background: #f4f7fb;
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

.app-shell {
  width: min(900px, calc(100% - 32px));
  margin: 34px auto;
  padding: clamp(20px, 4vw, 36px);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.07);
}

.hero {
  max-width: 720px;
  margin: 0 auto 26px;
  text-align: center;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--blue-bg);
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 12px;
  color: var(--blue);
  font-size: clamp(28px, 5vw, 38px);
  line-height: 1.15;
}

h2 {
  margin: 0 0 14px;
  font-size: 18px;
}

.hero p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

.notice {
  margin: 22px 0;
  padding: 16px;
  border-left: 4px solid;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.58;
}

.notice-blue {
  border-color: var(--blue);
  background: var(--blue-bg);
  color: #1967d2;
}

.notice-warning {
  border-color: #f9ab00;
  background: var(--warning-bg);
  color: #5f4b00;
}

.upload-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 24px 0;
}

.drop-zone {
  min-height: 180px;
  padding: 28px 18px;
  border: 2px dashed var(--line);
  border-radius: 14px;
  background: var(--light);
  cursor: pointer;
  text-align: center;
  transition: 0.2s ease;
}

.drop-zone:hover,
.drop-zone:focus {
  border-color: var(--blue);
  background: #f1f6fe;
  outline: none;
}

.drop-zone.dragging {
  border-color: var(--blue);
  background: #e8f0fe;
}

.drop-zone.selected {
  border-color: var(--green);
  background: #f1f8f3;
}

.drop-icon {
  margin-bottom: 12px;
  font-size: 36px;
}

.drop-zone strong,
.drop-zone span {
  display: block;
}

.drop-zone strong {
  margin-bottom: 8px;
  font-size: 16px;
}

.drop-zone span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.settings-card,
.selection-summary,
.result-section {
  margin-top: 22px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
}

.field-label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 700;
}

.select-control {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  font-size: 15px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 16px;
  cursor: pointer;
  font-size: 14px;
}

.check-row input {
  width: 17px;
  height: 17px;
  accent-color: var(--blue);
}

.settings-help {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.primary-button,
.download-button {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  margin-top: 22px;
  padding: 14px 18px;
  border: 0;
  border-radius: 9px;
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  transition: 0.2s ease;
}

.primary-button {
  background: var(--blue);
  cursor: pointer;
}

.primary-button:hover:not(:disabled) {
  background: var(--blue-dark);
}

.primary-button:disabled {
  background: #9aa0a6;
  cursor: not-allowed;
}

.download-button {
  margin-top: 18px;
  background: var(--green);
}

.download-button:hover {
  background: #0f6f2f;
}

.progress-section {
  margin-top: 18px;
}

.progress-labels {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 14px;
}

.progress-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf0f2;
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
  transition: width 0.25s ease;
}

.status-message {
  min-height: 22px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  text-align: center;
}

.selection-summary {
  background: var(--light);
  color: #3c4043;
  font-size: 14px;
  line-height: 1.65;
}

.result-section {
  margin-top: 28px;
}

.result-section h2 {
  color: var(--green);
}

.result-info {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

#resultPreview {
  display: block;
  width: 100%;
  max-height: 460px;
  border-radius: 10px;
  background: #000000;
}

@media (max-width: 680px) {
  .app-shell {
    width: min(100% - 20px, 900px);
    margin: 10px auto;
    border-radius: 12px;
  }

  .upload-grid {
    grid-template-columns: 1fr;
  }

  .drop-zone {
    min-height: 150px;
  }
}