:root {
  --bg: #f7f7f5; --card: #ffffff; --ink: #1c1c1a; --muted: #6b6b66; --line: #e4e4df;
  --accent: #1f7a4d; --accent-ink: #ffffff; --accent-soft: #e6f2ec; --warn: #a3470f; --warn-soft: #fbeee4;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141413; --card: #1e1e1c; --ink: #ecece8; --muted: #a2a29b; --line: #34342f;
    --accent: #4cc38a; --accent-ink: #0d1f16; --accent-soft: #1d3328; --warn: #f0a36b; --warn-soft: #3a2619;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif; line-height: 1.55; word-break: keep-all; overflow-wrap: anywhere; }
.wrap { max-width: 920px; margin: 0 auto; padding: 0 16px; }
.top { border-bottom: 1px solid var(--line); background: var(--card); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 56px; gap: 12px; }
.logo { font-weight: 800; font-size: 20px; letter-spacing: -0.02em; }
.badge { font-size: 13px; color: var(--accent); background: var(--accent-soft); padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.hero { padding: 48px 0 24px; }
.hero h1 { font-size: clamp(28px, 5vw, 42px); line-height: 1.25; margin: 0 0 12px; letter-spacing: -0.03em; }
.hero em { font-style: normal; color: var(--accent); }
.sub { color: var(--muted); margin: 0; }
.drop { display: block; border: 2px dashed var(--line); background: var(--card); border-radius: var(--radius);
  padding: 40px 16px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.drop:hover, .drop:focus-visible, .drop.over { border-color: var(--accent); background: var(--accent-soft); outline: none; }
.drop-icon { font-size: 28px; color: var(--accent); }
.drop-main { font-weight: 700; font-size: 18px; margin-top: 6px; }
.drop-sub { color: var(--muted); font-size: 14px; margin-top: 4px; }
.bar { position: sticky; top: 0; z-index: 2; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between;
  background: var(--bg); padding: 16px 0; margin-top: 16px; border-bottom: 1px solid var(--line); }
.summary { font-weight: 600; }
.bar-actions { display: flex; gap: 8px; }
button { font: inherit; border-radius: 10px; padding: 9px 14px; cursor: pointer; border: 1px solid var(--line); background: var(--card); color: var(--ink); }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }
button:disabled { opacity: .45; cursor: not-allowed; }
button.ghost:hover, button.small:hover { border-color: var(--accent); }
button.small { padding: 5px 10px; font-size: 13px; }
.file { margin-top: 20px; }
.file h2 { font-size: 16px; margin: 0 0 8px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; word-break: break-all; }
.file h2 small { color: var(--muted); font-weight: 400; }
.msg { background: var(--warn-soft); color: var(--warn); border-radius: 10px; padding: 10px 14px; font-size: 14px; }
.msg.ok { background: var(--accent-soft); color: var(--accent); }
.tbl { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-top: 10px; overflow: hidden; }
.tbl.off { opacity: .5; }
.tbl-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tbl-head label { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-weight: 600; cursor: pointer; flex: 1; min-width: 160px; }
.tbl-head label b { white-space: nowrap; }
.tbl-head input { width: 18px; height: 18px; accent-color: var(--accent); }
.meta { color: var(--muted); font-size: 13px; font-weight: 400; }
.preview { overflow-x: auto; max-height: 260px; overflow-y: auto; }
.preview table { border-collapse: collapse; font-size: 13px; min-width: 100%; }
.preview td { border: 1px solid var(--line); padding: 5px 8px; white-space: nowrap; max-width: 240px; overflow: hidden; text-overflow: ellipsis; vertical-align: top; }
.preview td.num { text-align: right; font-variant-numeric: tabular-nums; }
.more { color: var(--muted); font-size: 12px; padding: 6px 14px; }
.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 40px 0 8px; }
.how div { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; gap: 10px; align-items: center; }
.how b { background: var(--accent); color: var(--accent-ink); width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; flex: none; }
.faq { margin: 24px 0; }
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-top: 8px; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq p { color: var(--muted); margin: 8px 0 0; }
.foot { color: var(--muted); font-size: 13px; padding-top: 16px; padding-bottom: 40px; }
@media (max-width: 640px) {
  .how { grid-template-columns: 1fr; }
  .badge { font-size: 12px; }
  .bar-actions { width: 100%; }
  .bar-actions button { flex: 1; }
}

/* ---- site layout ---- */
a { color: var(--accent); }
.logo { color: var(--ink); text-decoration: none; }
.nav { display: flex; gap: 16px; font-size: 14px; }
.nav a { color: var(--muted); text-decoration: none; }
.nav a:hover { color: var(--accent); }
.hero .badge { display: inline-block; margin-bottom: 14px; }
.tool-frame { display: block; width: 100%; height: 230px; border: 0; background: transparent; }
body.tool { background: transparent; padding: 2px; }
body.tool .bar { position: static; }
.prose, .faq, .guides-list { margin: 32px 0; }
.prose h2, .faq h2, .guides-list h2 { font-size: 20px; margin: 0 0 10px; }
.prose li { margin: 6px 0; }
code { background: var(--accent-soft); padding: 1px 5px; border-radius: 5px; font-size: .92em; }
.guides-list ul { padding-left: 18px; }
.guides-list li { margin: 6px 0; }
.foot { border-top: 1px solid var(--line); margin-top: 40px; padding: 20px 0 40px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 8px; }
.foot nav a { color: var(--muted); }
.ad-slot { margin: 24px 0; min-height: 100px; }
/* ---- articles ---- */
.article { max-width: 720px; padding-top: 32px; padding-bottom: 32px; }
.article h1 { font-size: clamp(24px, 4vw, 32px); line-height: 1.3; letter-spacing: -0.02em; margin: 8px 0 12px; }
.article h2 { font-size: 20px; margin: 32px 0 10px; }
.article h3 { font-size: 17px; margin: 22px 0 8px; }
.article p, .article li { font-size: 16px; }
.article .lead { color: var(--muted); font-size: 17px; }
.article .crumb { font-size: 13px; color: var(--muted); }
.article table { border-collapse: collapse; width: 100%; margin: 12px 0; font-size: 15px; }
.article th, .article td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.article th { background: var(--accent-soft); }
.callout { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 10px; padding: 14px 16px; margin: 20px 0; }
.cta { display: inline-block; background: var(--accent); color: var(--accent-ink); padding: 10px 16px; border-radius: 10px; text-decoration: none; font-weight: 700; }
