:root {
  --bg: #f4efe4;
  --panel: rgba(255, 250, 239, 0.82);
  --panel-border: rgba(38, 31, 17, 0.1);
  --text: #1e1911;
  --muted: #655947;
  --accent: #0f766e;
  --accent-soft: rgba(15, 118, 110, 0.14);
  --accent-warm: #b45309;
  --shadow: 0 24px 80px rgba(40, 31, 19, 0.12);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 16px;
  --font-body: "Sora", "Segoe UI", sans-serif;
  --font-display: "Space Grotesk", "Trebuchet MS", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(180, 83, 9, 0.15), transparent 28%),
    radial-gradient(circle at top right, rgba(15, 118, 110, 0.18), transparent 22%),
    linear-gradient(180deg, #f9f5ec 0%, var(--bg) 100%);
  color: var(--text);
  font-family: var(--font-body);
}

button,
input,
textarea {
  font: inherit;
}

.page-shell {
  position: relative;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0 48px;
}

.ambient {
  position: absolute;
  z-index: 0;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  filter: blur(18px);
  opacity: 0.4;
}

.ambient-left {
  top: 30px;
  left: -120px;
  background: rgba(180, 83, 9, 0.16);
}

.ambient-right {
  top: 220px;
  right: -140px;
  background: rgba(15, 118, 110, 0.18);
}

.hero,
.layout {
  position: relative;
  z-index: 1;
}

.hero {
  padding: 24px 0 28px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid rgba(30, 25, 17, 0.08);
  border-radius: 999px;
  background: rgba(255, 248, 236, 0.82);
  color: var(--muted);
  font-size: 0.85rem;
}

.hero h1,
.result-head h2 {
  margin: 16px 0 10px;
  font-family: var(--font-display);
  letter-spacing: -0.04em;
}

.hero h1 {
  max-width: 780px;
  font-size: clamp(2.4rem, 6vw, 4.8rem);
  line-height: 0.98;
}

.lead {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
}

.layout {
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  gap: 24px;
}

.panel {
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-xl);
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.form-panel,
.result-panel {
  padding: 22px;
}

.resolver-form {
  display: grid;
  gap: 18px;
}

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

.field span {
  font-size: 0.92rem;
  font-weight: 600;
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid rgba(30, 25, 17, 0.12);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.68);
  color: var(--text);
  padding: 14px 16px;
  outline: none;
  transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.field input:focus,
.field textarea:focus {
  border-color: rgba(15, 118, 110, 0.55);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.08);
  transform: translateY(-1px);
}

.advanced {
  padding: 14px 16px;
  border: 1px dashed rgba(30, 25, 17, 0.14);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.38);
}

.advanced summary {
  cursor: pointer;
  font-weight: 600;
}

.advanced[open] summary {
  margin-bottom: 14px;
}

.field-hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.primary-btn,
.download-all-btn,
.ghost-btn,
.download-btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

.primary-btn {
  padding: 14px 18px;
  background: linear-gradient(135deg, #115e59, #0f766e);
  color: white;
  font-weight: 700;
  box-shadow: 0 18px 35px rgba(15, 118, 110, 0.22);
}

.download-all-btn {
  padding: 10px 16px;
  background: linear-gradient(135deg, #b45309, #d97706);
  color: white;
  font-weight: 700;
  box-shadow: 0 14px 28px rgba(180, 83, 9, 0.2);
}

.ghost-btn {
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.5);
  color: var(--text);
  border: 1px solid rgba(30, 25, 17, 0.1);
}

.download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 14px;
  background: rgba(15, 118, 110, 0.12);
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.primary-btn:hover,
.download-all-btn:hover,
.ghost-btn:hover,
.download-btn:hover {
  transform: translateY(-1px);
}

.primary-btn:disabled,
.download-all-btn:disabled,
.ghost-btn:disabled,
.download-btn.disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
  box-shadow: none;
}

.status-card {
  margin-top: 18px;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, rgba(17, 94, 89, 0.1), rgba(180, 83, 9, 0.08));
}

.status-kicker {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.status-card p {
  margin: 0;
  line-height: 1.6;
}

.result-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.result-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.result-head h2 {
  margin-top: 12px;
  font-size: clamp(1.5rem, 3.2vw, 2.4rem);
}

.selection-copy {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.summary-card {
  padding: 16px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.52);
  border: 1px solid rgba(30, 25, 17, 0.08);
}

.summary-card span {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
}

.summary-card strong {
  display: block;
  margin-top: 10px;
  font-size: 1.4rem;
  font-family: var(--font-display);
}

.empty-state {
  margin-top: 18px;
  padding: 22px;
  border-radius: var(--radius-lg);
  border: 1px dashed rgba(30, 25, 17, 0.14);
  color: var(--muted);
  text-align: center;
}

.file-list {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.file-card {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(30, 25, 17, 0.08);
  background: rgba(255, 255, 255, 0.56);
}

.file-card.selected {
  border-color: rgba(15, 118, 110, 0.35);
  box-shadow: 0 16px 34px rgba(15, 118, 110, 0.08);
}

.thumb {
  height: 72px;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.14), rgba(180, 83, 9, 0.16)),
    rgba(255, 255, 255, 0.55);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 0.9rem;
  color: var(--muted);
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.type-chip {
  display: inline-flex;
  align-items: center;
  margin-bottom: 10px;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.type-chip.video,
.type-chip.audio,
.type-chip.image {
  color: var(--accent);
  background: var(--accent-soft);
}

.type-chip.doc,
.type-chip.file {
  color: var(--accent-warm);
  background: rgba(180, 83, 9, 0.12);
}

.file-name {
  margin: 0;
  font-size: 1rem;
  line-height: 1.4;
}

.file-meta,
.file-path {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
  word-break: break-word;
}

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

.select-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}

.select-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.helper-copy {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: right;
}

code {
  padding: 2px 6px;
  border-radius: 8px;
  background: rgba(30, 25, 17, 0.08);
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 24px;
  }

  .hero {
    padding-top: 10px;
  }

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

  .result-head {
    flex-direction: column;
  }

  .file-card {
    grid-template-columns: 1fr;
  }

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

  .helper-copy {
    text-align: left;
  }
}
