:root {
  color-scheme: light;
  --bg: #f3efe7;
  --panel: rgba(255, 252, 246, 0.9);
  --text: #1e1a17;
  --muted: #6c625b;
  --accent: #ba4a00;
  --accent-strong: #8f2f00;
  --border: rgba(30, 26, 23, 0.08);
  --shadow: 0 18px 60px rgba(90, 53, 24, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Iowan Old Style", "Noto Serif SC", serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 180, 120, 0.3), transparent 30%),
    linear-gradient(180deg, #f7f2e8 0%, var(--bg) 100%);
}

.page {
  max-width: 980px;
  margin: 0 auto;
  padding: 48px 20px 80px;
}

.hero h1,
.card h2,
.chips-group h3 {
  font-family: "Avenir Next Condensed", "PingFang SC", sans-serif;
}

.hero {
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 12px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.8rem);
  line-height: 0.95;
}

.intro {
  max-width: 720px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

.panel,
.card {
  background: var(--panel);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.panel {
  padding: 24px;
}

.upload-form {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}

.upload-label {
  font-weight: 700;
}

input[type="file"] {
  flex: 1 1 280px;
  padding: 14px;
  border: 1px dashed rgba(30, 26, 23, 0.24);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
}

button {
  border: 0;
  border-radius: 999px;
  padding: 14px 24px;
  background: var(--accent);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease;
}

button:hover {
  background: var(--accent-strong);
  transform: translateY(-1px);
}

.message {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 14px;
}

.error {
  color: #8a2200;
  background: rgba(208, 67, 24, 0.1);
}

.results {
  display: grid;
  gap: 20px;
  margin-top: 24px;
}

.card {
  padding: 24px;
}

.card h2 {
  margin-top: 0;
  margin-bottom: 20px;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin: 0;
}

.meta-grid dt {
  color: var(--muted);
  font-size: 0.92rem;
}

.meta-grid dd {
  margin: 8px 0 0;
  font-weight: 700;
  word-break: break-word;
}

.chips-group + .chips-group {
  margin-top: 18px;
}

.chips-group h3 {
  margin: 0 0 10px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip,
.empty {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(186, 74, 0, 0.09);
}

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

.preview {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "SF Mono", "Monaco", monospace;
  font-size: 0.92rem;
  line-height: 1.65;
}

.sheet-id-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.sheet-id-row label {
  font-weight: 700;
  white-space: nowrap;
  color: var(--muted);
  font-size: 0.92rem;
}

.sheet-id-row input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid rgba(30, 26, 23, 0.2);
  border-radius: 8px;
  font-size: 0.95rem;
}

.btn-write {
  margin-top: 16px;
}

@media (max-width: 640px) {
  .page {
    padding-top: 32px;
  }

  .panel,
  .card {
    border-radius: 18px;
  }

  .upload-form {
    align-items: stretch;
  }

  button {
    width: 100%;
  }
}
