*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --ecomcine-surface-color: #111111;
  --ecomcine-surface-elevated: #171717;
  --ecomcine-surface-soft: #1e1e1e;
  --ecomcine-accent-color: #d4af37;
  --ecomcine-accent-soft: rgba(212, 175, 55, 0.12);
  --ecomcine-text-color: #f5f5f5;
  --ecomcine-muted-color: #b6b1a3;
  --ecomcine-border-color: rgba(212, 175, 55, 0.22);
  --bg: #0d0d0d;
  --surface: var(--ecomcine-surface-elevated);
  --surface-2: var(--ecomcine-surface-soft);
  --border: var(--ecomcine-border-color);
  --accent: var(--ecomcine-accent-color);
  --accent-soft: var(--ecomcine-accent-soft);
  --text: var(--ecomcine-text-color);
  --muted: var(--ecomcine-muted-color);
  --success: #57be7b;
  --warning: #f0b55c;
  --error: #e66b6b;
  --radius: 22px;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.4);
}

body {
  background:
    radial-gradient(circle at 50% -10%, rgba(212, 175, 55, 0.16), transparent 30%),
    radial-gradient(circle at 100% 0%, rgba(255, 255, 255, 0.04), transparent 24%),
    linear-gradient(180deg, #090909 0%, #111111 48%, #0c0c0c 100%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  min-height: 100vh;
  padding: 0 18px 72px;
}

#root {
  max-width: 980px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding-top: 42px;
}

.ecomcine-site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 12px 18px;
  background: rgba(17, 17, 17, 0.86);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(212, 175, 55, 0.18);
}

.ecomcine-site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.ecomcine-site-header-logo {
  display: inline-flex;
  align-items: center;
}

.ecomcine-site-header-logo img {
  display: block;
  max-height: 48px;
  width: auto;
}
.ecomcine-site-header-cta {
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}
.ecomcine-site-header-cta:hover {
  color: var(--accent);
}

.ecomcine-site-header-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid rgba(212, 175, 55, 0.34);
  background: rgba(212, 175, 55, 0.08);
}

.hero {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 10px 6px;
}

.hero h1 {
  font-size: clamp(2.3rem, 5vw, 4rem);
  line-height: 0.96;
  letter-spacing: -0.03em;
}

.hero p {
  color: var(--muted);
  font: 400 16px/1.7 "Segoe UI", sans-serif;
  max-width: 720px;
  margin: 0 auto;
}

.runtime-banner {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  font: 500 14px/1.5 "Segoe UI", sans-serif;
}

.runtime-banner.is-error {
  border-color: rgba(230, 107, 107, 0.65);
  background: rgba(230, 107, 107, 0.1);
  color: #ffd4d4;
}

.runtime-banner.is-success {
  border-color: rgba(87, 190, 123, 0.55);
  background: rgba(87, 190, 123, 0.08);
  color: #d7ffe3;
}

.card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0)),
    linear-gradient(180deg, rgba(212, 175, 55, 0.03), rgba(212, 175, 55, 0)),
    var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 34px;
  min-height: 460px;
  box-shadow: var(--shadow);
}

.view {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

[hidden] { display: none !important; }

.dropzone {
  border: 2px dashed var(--border);
  border-radius: 18px;
  padding: 46px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
  color: var(--muted);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.01));
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.dropzone:hover,
.dropzone.drag-over {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.dropzone-label {
  color: var(--text);
  font: 600 18px/1.45 "Segoe UI", sans-serif;
}

.dropzone-label .link {
  color: #eed07e;
  text-decoration: underline;
}

.dropzone-hint {
  font: 400 13px/1.5 "Segoe UI", sans-serif;
}

.file-info {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.file-name {
  flex: 1 1 280px;
  font: 600 15px/1.5 "Segoe UI", sans-serif;
  word-break: break-word;
}

.file-meta,
.section-label,
.progress-meta,
.progress-detail,
.btn-link,
.result-row-size,
.result-savings,
.active-notice,
.preset-label small {
  font-family: "Segoe UI", sans-serif;
}

.file-meta {
  color: var(--muted);
  font-size: 13px;
}

.section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.section-label {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.presets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.preset {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.025);
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.preset:hover {
  border-color: rgba(212, 175, 55, 0.55);
  background: rgba(212, 175, 55, 0.06);
  transform: translateY(-1px);
}

.preset input[type="radio"] {
  margin-top: 4px;
  accent-color: var(--accent);
}

.preset-label strong {
  display: block;
  font: 600 14px/1.4 "Segoe UI", sans-serif;
}

.preset-label small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.actions {
  display: flex;
  justify-content: flex-start;
}

.btn-primary,
.btn-secondary,
.btn-download,
.btn-link {
  font: 600 14px/1.2 "Segoe UI", sans-serif;
}

.btn-primary,
.btn-secondary,
.btn-download {
  border-radius: 10px;
  padding: 13px 18px;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.btn-primary {
  border: none;
  background: linear-gradient(135deg, #c46a2d 0%, #db8f56 100%);
  color: #fff;
  cursor: pointer;
}

.btn-primary:hover:not(:disabled),
.btn-secondary:hover,
.btn-download:hover {
  transform: translateY(-1px);
}

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-secondary {
  background: transparent;
  border: 1px solid rgba(212, 175, 55, 0.55);
  color: #eed07e;
  cursor: pointer;
}

.btn-secondary--sm {
  padding: 10px 14px;
  font-size: 13px;
}

.btn-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.35);
  color: #eed07e;
}

.btn-link {
  border: none;
  background: none;
  color: #eed07e;
  cursor: pointer;
  padding: 0;
}

.active-notice {
  color: var(--warning);
  font-size: 13px;
}

.retention-note {
  color: var(--muted);
  font: 400 12px/1.6 "Segoe UI", sans-serif;
}

.progress-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #c46a2d 0%, #f0b55c 100%);
  transition: width 0.25s ease;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.progress-detail {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.error-box {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(230, 107, 107, 0.6);
  background: rgba(230, 107, 107, 0.1);
  color: #ffd5d5;
  font: 500 13px/1.5 "Segoe UI", sans-serif;
}

.result-done-icon {
  width: 58px;
  height: 58px;
  align-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(87, 190, 123, 0.18);
  color: var(--success);
  font: 700 28px/1 "Segoe UI", sans-serif;
}

.result-title {
  text-align: center;
  font-size: 1.4rem;
}

.result-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.result-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.result-row-label {
  flex: 1 1 220px;
  font: 600 14px/1.4 "Segoe UI", sans-serif;
}

.result-row-size,
.result-savings {
  color: var(--muted);
  font-size: 13px;
}

.result-savings {
  text-align: center;
}

@media (max-width: 640px) {
  body { padding: 0 14px 56px; }
  #root { padding-top: 26px; }
  .card { padding: 22px 18px; }
  .actions { justify-content: stretch; }
  .btn-primary { width: 100%; }
  .ecomcine-site-header { padding: 10px 14px; }
  .ecomcine-site-header-inner {
    flex-wrap: wrap;
    justify-content: center;
  }
  .ecomcine-site-header-cta {
    width: 100%;
  }
}