/* おてがるツール - 共通スタイル */

:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --border: #dfe3e8;
  --text: #1c1f23;
  --text-muted: #5c6670;
  --accent: #1f7a5a;
  --accent-hover: #176046;
  --accent-soft: #e6f2ed;
  --danger: #b3261e;
  --radius: 10px;
  --maxw: 860px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14171a;
    --surface: #1d2126;
    --surface-2: #262b31;
    --border: #343a41;
    --text: #e8eaed;
    --text-muted: #9aa4ae;
    --accent: #4bbd92;
    --accent-hover: #63cda4;
    --accent-soft: #1e2f2a;
    --danger: #f2b8b5;
  }
}

:root[data-theme="dark"] {
  --bg: #14171a;
  --surface: #1d2126;
  --surface-2: #262b31;
  --border: #343a41;
  --text: #e8eaed;
  --text-muted: #9aa4ae;
  --accent: #4bbd92;
  --accent-hover: #63cda4;
  --accent-soft: #1e2f2a;
  --danger: #f2b8b5;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP",
    "Yu Gothic UI", "Meiryo", sans-serif;
  font-size: 16px;
  line-height: 1.75;
}

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

/* ---- ヘッダー ---- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 56px;
}

.logo {
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.logo span { color: var(--accent); }

.site-header nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  margin-left: 16px;
}

.site-header nav a:hover { color: var(--accent); }

/* ---- パンくず ---- */
.breadcrumb {
  font-size: 13px;
  color: var(--text-muted);
  padding: 14px 0 0;
}

.breadcrumb a { color: var(--text-muted); }

/* ---- 見出し ---- */
h1 {
  font-size: 26px;
  line-height: 1.45;
  margin: 12px 0 8px;
  letter-spacing: 0.01em;
}

h2 {
  font-size: 20px;
  margin: 40px 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent-soft);
}

h3 { font-size: 16px; margin: 24px 0 8px; }

.lead {
  color: var(--text-muted);
  margin: 0 0 24px;
  font-size: 15px;
}

/* ---- ツール本体カード ---- */
.tool {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin: 0 0 8px;
}

.field { margin-bottom: 16px; }

label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}

input[type="text"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 16px;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}

textarea { min-height: 200px; resize: vertical; line-height: 1.7; }

input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: transparent;
}

input[type="range"] { width: 100%; accent-color: var(--accent); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 20px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
}

.btn:hover { background: var(--accent-hover); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-sub {
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.btn-sub:hover { background: var(--border); }

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

/* ---- ドロップゾーン ---- */
.drop {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 36px 16px;
  text-align: center;
  color: var(--text-muted);
  cursor: pointer;
  background: var(--bg);
}

.drop:hover, .drop.over {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.drop strong { display: block; font-size: 16px; color: var(--text); margin-bottom: 4px; }
.drop.over strong { color: var(--accent); }

/* ---- 結果表示 ---- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin: 16px 0 0;
}

.stat {
  background: var(--surface-2);
  border-radius: 8px;
  padding: 12px;
  text-align: center;
}

.stat .num {
  display: block;
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}

.stat .cap { font-size: 12px; color: var(--text-muted); }

.result-list { list-style: none; padding: 0; margin: 16px 0 0; }

.result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--surface-2);
  border-radius: 8px;
  margin-bottom: 8px;
  font-size: 14px;
}

.result-item img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--bg);
  flex-shrink: 0;
}

.result-item .meta { flex: 1; min-width: 0; }
.result-item .name { display: block; font-weight: 600; word-break: break-all; }
.result-item .size { color: var(--text-muted); font-size: 12px; }

.note {
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  padding: 12px 14px;
  font-size: 14px;
  margin: 20px 0;
}

.err { color: var(--danger); font-size: 14px; margin-top: 12px; }

/* ---- ツール一覧 ---- */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.tool-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-decoration: none;
  color: var(--text);
}

.tool-card:hover { border-color: var(--accent); background: var(--accent-soft); }
.tool-card .t { display: block; font-weight: 700; margin-bottom: 4px; }
.tool-card .d { display: block; font-size: 13px; color: var(--text-muted); line-height: 1.6; }

/* ---- FAQ ---- */
details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 8px;
}

summary { font-weight: 600; cursor: pointer; font-size: 15px; }
details p { margin: 10px 0 0; font-size: 14px; color: var(--text-muted); }

/* ---- フッター ---- */
.site-footer {
  margin-top: 56px;
  padding: 24px 0 40px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  color: var(--text-muted);
}

.site-footer a { color: var(--text-muted); margin-right: 14px; }

main { padding-bottom: 24px; }

@media (max-width: 600px) {
  h1 { font-size: 22px; }
  .tool { padding: 16px; }
  .drop { padding: 28px 12px; }
}
