:root {
  --bg: #f4f2ea;
  --ink: #1f2c2b;
  --muted: #4a5f5d;
  --card: #fffdf8;
  --line: #d5d1c4;
  --accent: #0f766e;
  --accent-2: #ea580c;
  --ok: #166534;
  --warn: #9a3412;
  --error: #991b1b;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "IBM Plex Sans", sans-serif;
}

body {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

.bg-shape {
  position: fixed;
  z-index: 0;
  border-radius: 999px;
  filter: blur(2px);
}

.bg-shape-a {
  width: 380px;
  height: 380px;
  background: linear-gradient(140deg, #f97316 0%, #fb7185 100%);
  opacity: 0.18;
  top: -120px;
  left: -80px;
}

.bg-shape-b {
  width: 420px;
  height: 420px;
  background: linear-gradient(140deg, #14b8a6 0%, #84cc16 100%);
  opacity: 0.15;
  right: -120px;
  bottom: -130px;
}

.layout {
  position: relative;
  z-index: 1;
  max-width: 1000px;
  margin: 0 auto;
  padding: 32px 18px 48px;
}

.hero {
  margin-bottom: 20px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-weight: 600;
}

h1 {
  margin: 0;
  font-family: "Fraunces", serif;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  line-height: 1.1;
}

.lead {
  margin: 12px 0 0;
  color: var(--muted);
  max-width: 780px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 10px 30px rgba(20, 28, 28, 0.07);
  margin-bottom: 16px;
}

form {
  display: grid;
  gap: 14px;
}

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

.field span {
  font-size: 0.92rem;
  color: var(--muted);
}

input[type="url"],
input[type="text"],
input[type="file"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
  font: inherit;
}

input[type="url"]:focus,
input[type="text"]:focus,
input[type="file"]:focus {
  outline: 2px solid rgba(15, 118, 110, 0.2);
  border-color: var(--accent);
}

.row {
  display: flex;
  align-items: center;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 0.95rem;
}

.advanced {
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
}

.advanced summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 500;
}

.advanced-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

button[type="submit"] {
  border: 0;
  border-radius: 12px;
  padding: 11px 14px;
  font: inherit;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(90deg, var(--accent), #0e9f96);
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

button[type="submit"]:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(15, 118, 110, 0.25);
}

button[disabled] {
  opacity: 0.6;
  cursor: wait;
  transform: none;
  box-shadow: none;
}

.status {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.92rem;
  display: none;
}

.status.show {
  display: block;
}

.status.loading {
  color: var(--muted);
  background: #f6f7f4;
  border: 1px solid var(--line);
}

.status.ok {
  color: var(--ok);
  background: #ecfdf3;
  border: 1px solid #bbf7d0;
}

.status.error {
  color: var(--error);
  background: #fef2f2;
  border: 1px solid #fecaca;
}

.progress {
  margin-top: 10px;
  position: relative;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f2f4ef;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), #0ea5a1);
  transition: width 0.35s ease;
}

.progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.78rem;
  color: #153a37;
  font-weight: 600;
}

.result h2 {
  margin: 0 0 8px;
  font-family: "Fraunces", serif;
}

.summary {
  color: var(--muted);
  margin-bottom: 10px;
}

.result-actions {
  margin-bottom: 12px;
}

#download-excel-btn {
  border: 1px solid #d1e7e5;
  border-radius: 10px;
  padding: 9px 12px;
  font: inherit;
  font-weight: 600;
  color: #0c4f4a;
  background: #e7f6f5;
  cursor: pointer;
}

#download-excel-btn:hover {
  background: #d7f0ee;
}

#download-excel-btn[disabled] {
  opacity: 0.6;
  cursor: wait;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  max-height: 360px;
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 640px;
}

th,
td {
  border-bottom: 1px solid #ece8dd;
  text-align: left;
  padding: 8px 10px;
  vertical-align: top;
  font-size: 0.88rem;
}

th {
  position: sticky;
  top: 0;
  background: #f8f6ef;
  color: #35514f;
}

td {
  white-space: pre-wrap;
}

.hidden {
  display: none;
}

@media (max-width: 760px) {
  .layout {
    padding: 20px 12px 36px;
  }

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