/* NoUp - shared design system */
:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --border: #dfe3e8;
  --text: #1a1d21;
  --text-dim: #5b6470;
  --accent: #0b6e4f;
  --accent-hover: #095c42;
  --accent-soft: #e6f2ed;
  --danger: #b3261e;
  --radius: 10px;
  --maxw: 880px;
  --font: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Hiragino Kaku Gothic ProN",
          "Hiragino Sans", Meiryo, "Noto Sans JP", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171a;
    --surface: #1c2024;
    --surface-2: #23282d;
    --border: #333a41;
    --text: #e8eaed;
    --text-dim: #9aa4b0;
    --accent: #3fb98c;
    --accent-hover: #55c99e;
    --accent-soft: #16302a;
    --danger: #f2857d;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.75;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--accent); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ---------- header ---------- */
header.site {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
header.site .wrap {
  display: flex; align-items: center; gap: 16px;
  height: 60px;
}
.logo {
  font-weight: 800; font-size: 19px; letter-spacing: .02em;
  text-decoration: none; color: var(--text); white-space: nowrap;
}
.logo span { color: var(--accent); }
.logo small {
  display: block; font-size: 10px; font-weight: 600;
  color: var(--text-dim); letter-spacing: 0; line-height: 1;
}
header.site nav { margin-left: auto; }
header.site nav a {
  margin-left: 18px; font-size: 14px; text-decoration: none; color: var(--text-dim);
}
header.site nav a:hover { color: var(--accent); }

/* ---------- privacy badge ---------- */
.badge-privacy {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: 999px; padding: 5px 14px;
  font-size: 13px; font-weight: 700;
}

/* ---------- hero / headings ---------- */
main { padding: 32px 0 64px; }
h1 { font-size: 27px; line-height: 1.45; margin: 14px 0 10px; letter-spacing: .01em; }
h2 { font-size: 20px; margin: 40px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
h3 { font-size: 16px; margin: 24px 0 8px; }
.lead { color: var(--text-dim); font-size: 15px; margin: 0 0 24px; }

/* ---------- tool card ---------- */
.tool {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px; margin: 24px 0;
}

.drop {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 44px 20px; text-align: center; cursor: pointer;
  background: var(--surface-2); transition: border-color .15s, background .15s;
}
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop strong { display: block; font-size: 16px; margin-bottom: 4px; }
.drop span { color: var(--text-dim); font-size: 13px; }
.drop input[type=file] { display: none; }

/* ---------- file list ---------- */
ul.files { list-style: none; padding: 0; margin: 18px 0 0; }
ul.files li {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 12px; margin-bottom: 8px;
  font-size: 14px;
}
ul.files .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
ul.files .sz { color: var(--text-dim); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
ul.files button {
  background: none; border: none; color: var(--text-dim); cursor: pointer;
  font-size: 16px; padding: 2px 6px; line-height: 1;
}
ul.files button:hover { color: var(--danger); }
ul.files .mv { font-size: 13px; }

/* ---------- controls ---------- */
.row { display: flex; flex-wrap: wrap; gap: 14px 20px; align-items: flex-end; margin-top: 18px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 13px; font-weight: 600; color: var(--text-dim); }
.field input[type=text], .field input[type=number], .field select {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 7px;
  padding: 8px 10px; font-size: 14px; font-family: inherit; min-width: 150px;
}
.field input[type=range] { width: 200px; accent-color: var(--accent); }
.hint { font-size: 12px; color: var(--text-dim); margin-top: 4px; }

.btn {
  background: var(--accent); color: #fff; border: none;
  border-radius: 8px; padding: 12px 26px;
  font-size: 15px; font-weight: 700; font-family: inherit; cursor: pointer;
  transition: background .15s;
}
.btn:hover:not(:disabled) { background: var(--accent-hover); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-sub {
  background: none; color: var(--text-dim);
  border: 1px solid var(--border); padding: 10px 18px; font-weight: 600;
}
.btn-sub:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; align-items: center; }

/* ---------- status ---------- */
.status { margin-top: 14px; font-size: 14px; min-height: 22px; }
.status.err { color: var(--danger); font-weight: 600; }
.status.ok { color: var(--accent); font-weight: 600; }

/* ---------- results ---------- */
.results { margin-top: 18px; display: none; }
.results.on { display: block; }
.results ul.files li { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 26%, transparent); }
.results a.dl {
  background: var(--accent); color: #fff; text-decoration: none;
  padding: 6px 14px; border-radius: 6px; font-size: 13px; font-weight: 700; white-space: nowrap;
}
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; margin-top: 12px; }
.thumbs figure { margin: 0; text-align: center; }
.thumbs img { width: 100%; border: 1px solid var(--border); border-radius: 6px; background: #fff; }
.thumbs figcaption { font-size: 11px; color: var(--text-dim); margin-top: 4px; }

/* ---------- tool index grid ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin: 24px 0; }
.grid a {
  display: block; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; text-decoration: none; color: var(--text);
  transition: border-color .15s, transform .12s;
}
.grid a:hover { border-color: var(--accent); transform: translateY(-2px); }
.grid a b { display: block; font-size: 15px; margin-bottom: 5px; }
.grid a span { font-size: 13px; color: var(--text-dim); line-height: 1.6; }

/* ---------- FAQ / prose ---------- */
.prose p, .prose li { font-size: 15px; }
details {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 14px 18px; margin-bottom: 10px;
}
details summary { cursor: pointer; font-weight: 700; font-size: 15px; }
details p { margin: 10px 0 0; font-size: 14px; color: var(--text-dim); }

table.spec { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 14px; }
table.spec th, table.spec td { border: 1px solid var(--border); padding: 9px 12px; text-align: left; }
table.spec th { background: var(--surface-2); width: 34%; font-weight: 700; }

/* ---------- footer ---------- */
footer.site {
  border-top: 1px solid var(--border); background: var(--surface);
  padding: 28px 0; margin-top: 48px; font-size: 13px; color: var(--text-dim);
}
footer.site nav a { color: var(--text-dim); margin-right: 18px; text-decoration: none; }
footer.site nav a:hover { color: var(--accent); }
footer.site .copy { margin-top: 14px; }

/* ---------- misc ---------- */
.noscript {
  background: #fff3cd; color: #664d03; border: 1px solid #ffe69c;
  padding: 14px; border-radius: 8px; font-size: 14px;
}
.breadcrumb { font-size: 13px; color: var(--text-dim); }
.breadcrumb a { color: var(--text-dim); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }

@media (max-width: 600px) {
  h1 { font-size: 22px; }
  header.site nav a { margin-left: 12px; font-size: 13px; }
  .logo { font-size: 17px; }
  .field input[type=range] { width: 150px; }
  main { padding: 22px 0 40px; }
}
