:root {
  --green: #1a8a3f;
  --green-dark: #146b31;
  --ink: #1c1f22;
  --muted: #5b6470;
  --border: #e2e6ea;
  --bg: #f7f8f9;
  --card: #ffffff;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #eef1f3;
    --muted: #a3adb8;
    --border: #2b3036;
    --bg: #14171a;
    --card: #1c2024;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--card);
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  background: var(--green);
  color: #fff;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 0.9rem;
}
.brand-name { font-weight: 600; }
.backlink { color: var(--muted); text-decoration: none; font-size: 0.85rem; }
.backlink:hover { color: var(--green); }

.wrap {
  max-width: 820px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}

.intro h1 { font-size: 1.6rem; margin-bottom: 8px; }
.intro p { color: var(--muted); }
.trust-line { font-size: 0.85rem; margin-top: 4px; }
.trust-line a { color: var(--green); }

.example { margin-top: 32px; }
.example h2 { font-size: 1.15rem; margin-bottom: 14px; }
.example-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 20px;
}
@media (max-width: 640px) {
  .example-grid { grid-template-columns: 1fr; }
}
.example-col {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
}
.example-label {
  display: block;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--green);
  margin-bottom: 8px;
}
.example-caption { color: var(--muted); font-size: 0.9rem; margin: 0; }
.example-output {
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  margin: 0;
}

.dropzone {
  margin-top: 24px;
  border: 2px dashed var(--border);
  border-radius: 14px;
  background: var(--card);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.dropzone.drag { border-color: var(--green); background: rgba(26,138,63,0.06); }

body.page-dragover::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  background: rgba(26, 138, 63, 0.08);
  border: 3px dashed var(--green);
}
.dz-inner svg { color: var(--muted); margin-bottom: 8px; }
.dz-inner p { margin: 4px 0; }
.dz-sub { color: var(--muted); font-size: 0.85rem; }

.status {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--muted);
}

.results { margin-top: 24px; display: flex; flex-direction: column; gap: 20px; }

.result-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 22px;
}

.result-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.result-head h3 { margin: 0; font-size: 1.05rem; }
.result-head .meta { color: var(--muted); font-size: 0.82rem; margin-top: 2px; }

.copy-btn {
  border: 1px solid var(--green);
  color: var(--green);
  background: transparent;
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
}
.copy-btn:hover { background: var(--green); color: #fff; }
.copy-btn.copied { background: var(--green); color: #fff; }

.output-box {
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  outline: none;
}

.warn-box {
  margin-top: 10px;
  font-size: 0.8rem;
  color: #a15c00;
}

.howto {
  margin-top: 48px;
  border-top: 1px solid var(--border);
  padding-top: 24px;
}
.howto h2 { font-size: 1.15rem; }
.howto ol { color: var(--muted); padding-left: 20px; }
.howto .disclaimer { font-size: 0.82rem; color: var(--muted); margin-top: 12px; }

.footer {
  text-align: center;
  padding: 24px;
  color: var(--muted);
  font-size: 0.82rem;
  border-top: 1px solid var(--border);
}
.footer a { color: var(--muted); }
