:root {
  --bg-1: #fff5e8;
  --bg-2: #ffe0b5;
  --panel: rgba(255, 255, 255, 0.85);
  --ink: #1e2330;
  --muted: #5b6170;
  --accent: #ff6f3c;
  --accent-strong: #dd4f1f;
  --line: #ffd5bf;
  --ok: #117a48;
  --warn: #9b5f00;
  --error: #ad2222;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Plus Jakarta Sans", sans-serif;
  color: var(--ink);
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 20%, #fff 0%, transparent 42%),
    radial-gradient(circle at 90% 0%, #ffd2b5 0%, transparent 35%),
    linear-gradient(135deg, var(--bg-1), var(--bg-2));
}

.shell {
  width: min(960px, 92vw);
  margin: 2.2rem auto 3rem;
  display: grid;
  gap: 1.1rem;
}

.hero h1 {
  margin: 0.3rem 0;
  font-size: clamp(1.7rem, 3vw, 2.6rem);
  line-height: 1.2;
}

.eyebrow {
  display: inline-block;
  margin: 0;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: #7d2f14;
}

.subtext {
  color: var(--muted);
  margin: 0.2rem 0 0;
}

.hero-steps {
  margin: 0.9rem 0 0;
  padding-left: 1.1rem;
  color: #573525;
}

.hero-steps li + li {
  margin-top: 0.25rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1rem;
  backdrop-filter: blur(6px);
  box-shadow: 0 10px 30px rgba(221, 79, 31, 0.08);
}

.mode-picker {
  display: flex;
  gap: 0.8rem;
  margin-bottom: 0.9rem;
}

.mode-picker label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 0.9rem;
}

.dropzone {
  border: 2px dashed #ffb895;
  border-radius: 14px;
  padding: 2rem 1rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.8);
  transition: border-color 140ms ease, transform 140ms ease, background 140ms ease;
  cursor: pointer;
}

.dropzone.drag-active {
  border-color: var(--accent-strong);
  background: #fff2ea;
  transform: translateY(-1px);
}

.drop-title {
  margin: 0;
  font-weight: 800;
}

.drop-desc {
  margin: 0.35rem 0 0;
  color: var(--muted);
}

.toolbar {
  margin-top: 0.9rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
}

.upload-loader {
  margin-top: 0.85rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.9rem;
  color: #7e2507;
}

.upload-loader[hidden] {
  display: none !important;
}

/* CSS loader style inspired by css-loaders.com */
.loader {
  width: 24px;
  padding: 4px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--accent);
  --mask:
    conic-gradient(#0000 10%, #000),
    linear-gradient(#000 0 0) content-box;
  -webkit-mask: var(--mask);
  mask: var(--mask);
  -webkit-mask-composite: source-out;
  mask-composite: subtract;
  animation: loader-spin 1s linear infinite;
}

@keyframes loader-spin {
  to {
    transform: rotate(1turn);
  }
}

button {
  border: 0;
  border-radius: 10px;
  padding: 0.62rem 0.95rem;
  font-weight: 700;
  font-family: "Plus Jakarta Sans", sans-serif;
  cursor: pointer;
}

button:disabled {
  opacity: 0.52;
  cursor: not-allowed;
}

button.primary {
  background: var(--accent);
  color: #fff;
}

button.primary:hover:not(:disabled) {
  background: var(--accent-strong);
}

button.ghost {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
}

.selected-list,
.result-list {
  margin-top: 0.8rem;
  display: grid;
  gap: 0.55rem;
}

.file-item,
.result {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
}

.file-item .name,
.result .title {
  margin: 0;
  font-weight: 700;
}

.file-item .meta {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.result a {
  display: block;
  margin: 0.45rem 0 0.55rem;
  color: #003f8f;
  text-decoration: none;
  word-break: break-all;
  font-family: "Space Mono", monospace;
  font-size: 0.78rem;
}

.copy-btn {
  background: #fff4ee;
  color: #7e2507;
  border: 1px solid #ffc6aa;
  padding: 0.4rem 0.65rem;
  border-radius: 8px;
  font-size: 0.8rem;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.wa-btn {
  background: #25d366;
  color: #073b1f;
  border: 1px solid #15b850;
  padding: 0.4rem 0.65rem;
  border-radius: 8px;
  font-size: 0.8rem;
}

.wa-btn:hover {
  background: #19bf57;
}

.wa-btn:focus-visible,
.copy-btn:focus-visible {
  outline: 2px solid #0f7a3a;
  outline-offset: 2px;
}

.result.error {
  border-color: #f1b8b8;
  background: #fff7f7;
}

.error-text {
  color: var(--error);
  margin: 0.5rem 0 0;
}

.status {
  margin: 0.75rem 0 0;
  font-size: 0.93rem;
}

.status[data-type="ok"] {
  color: var(--ok);
}

.status[data-type="warn"] {
  color: var(--warn);
}

.status[data-type="error"] {
  color: var(--error);
}

.empty {
  margin: 0;
  color: var(--muted);
}

.results-panel h2 {
  margin: 0;
}

.results-hint {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 640px) {
  .toolbar {
    justify-content: stretch;
  }

  .toolbar button {
    width: 100%;
  }

  .mode-picker {
    flex-direction: column;
    align-items: stretch;
  }

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

  .result-actions button {
    width: 100%;
  }
}
