/* ================= 基本 ================= */
:root {
  color-scheme: light;
  --bg: #FFFFFF;
  --ink: #111114;
  --acc: #E23E14;
  --tx: #2A2C30;
  --tx2: #6E6E6A;
  --line: #DEDEDA;
  --on-ink: #C9C9C5;
  --field: #6E6E6A;
  --band: #111114;
  --band-tx: #FFFFFF;
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #111114;
  --ink: #F5F5F3;
  --acc: #E23E14;
  --tx: #D6D7DA;
  --tx2: #9A9A96;
  --line: #33343A;
  --on-ink: #6E6E6A;
  --field: #9A9A96;
  --band: #FFFFFF;
  --band-tx: #111114;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--tx);
  font-family: 'Noto Sans JP', 'Noto Sans CJK JP', sans-serif;
  font-feature-settings: 'palt' 1;
  font-weight: 500;
  font-size: 16px;
  line-height: 1.9;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
h1, h2, h3 { color: var(--ink); margin-top: 0; }
h1 { font-size: clamp(28px, 5vw, 44px); font-weight: 900; letter-spacing: -0.02em; line-height: 1.25; }
h2 { font-size: 22px; font-weight: 900; letter-spacing: -0.02em; line-height: 1.35; }
h3 { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.5; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 8px; top: 8px; z-index: 99; background: var(--bg); padding: 8px 14px; outline: 2px solid var(--ink); outline-offset: 1px; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px 64px; }
.wrap--tool, .wrap--doc { max-width: 820px; }

/* ================= ヘッダー ================= */
.hd { position: sticky; top: 0; z-index: 40; background: var(--bg); border-bottom: 1px solid var(--line); }
.hd__in { max-width: 1040px; margin: 0 auto; padding: 10px 16px; display: flex; gap: 10px; align-items: center; }
.hd__logo { display: flex; align-items: center; font-weight: 900; letter-spacing: -0.02em; font-size: 18px; line-height: 1.25; color: var(--ink); text-decoration: none; white-space: nowrap; }
.hd__theme { margin-left: auto; }
.hd__theme { flex: none; min-width: 68px; justify-content: center; padding-left: 10px; padding-right: 10px; }
@media (max-width: 560px) {
  .hd__logo { font-size: 16px; }
  .hd__theme { min-width: 56px; }
}

/* ================= ヒーロー ================= */
.hero { text-align: center; padding: 46px 16px 30px; background: var(--bg); }
.hero__h { margin: 0 0 12px; }
.hero__p { max-width: 640px; margin: 0 auto 26px; color: var(--tx); font-size: 16px; line-height: 1.9; }
:is(textarea, input, select, button, a):focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }

/* ================= カテゴリ・リスト ================= */
.chips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin: 26px 0 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; background: var(--bg); border: 1px solid var(--field); font-size: 13px; font-weight: 700; text-decoration: none; color: var(--tx); }
.chip:hover { border-color: var(--ink); color: var(--ink); }
.sec { margin-top: 40px; }
.sec__h { display: flex; align-items: center; gap: 9px; margin: 0 0 12px; }
.sec__n { font-size: 12px; line-height: 1.4; letter-spacing: 0.12em; color: var(--tx2); font-weight: 700; }
.grid { display: grid; grid-template-columns: 1fr; gap: 0; }
.grid--sm { grid-template-columns: 1fr; }
.card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  background: var(--bg);
  text-decoration: none;
  color: var(--tx);
}
.card:hover .card__title { text-decoration: underline; text-underline-offset: 0.18em; }
.card[aria-disabled='true'] { cursor: default; opacity: 0.7; }
.card[aria-disabled='true']:hover .card__title { text-decoration: none; }
.card__no { min-width: 28px; color: var(--acc); font-size: 15px; font-weight: 900; line-height: 1; letter-spacing: 0.10em; font-variant-numeric: tabular-nums; }
.card__body { display: flex; flex-direction: column; min-width: 0; }
.card__title { font-weight: 700; font-size: 17px; line-height: 1.5; color: var(--ink); }
.card__desc { font-size: 13px; color: var(--tx2); line-height: 1.7; }
.card__fav {
  border: 1px solid var(--field);
  background: var(--bg);
  cursor: pointer;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  color: var(--tx2);
  padding: 8px 10px;
}
.card__fav[aria-pressed='true'] { background: var(--band); color: var(--band-tx); border-color: var(--band); }
.card__badges, .thead__badges { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 5px; }
.thead__badges { margin-top: 0; }
.badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--field);
  padding: 1px 7px;
  color: var(--tx2);
  background: var(--bg);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.10em;
  line-height: 1.5;
}
.badge--status { color: var(--ink); border-color: var(--ink); }
.pins { margin-top: 34px; }
.pins__h { color: var(--tx2); margin: 0 0 10px; font-size: 13px; font-weight: 700; letter-spacing: 0.12em; line-height: 1.4; }

/* 特長 */
.feat { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; }
.feat__i { border-top: 1px solid var(--line); padding: 16px 0 0; }
.feat__i h3 { margin: 0 0 6px; }
.feat__i p { margin: 0; font-size: 16px; color: var(--tx); line-height: 1.9; }

/* ================= ツールページ ================= */
.crumb { display: flex; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--tx2); padding: 16px 0 8px; line-height: 1.7; }
.crumb a { color: var(--tx2); }
.thead { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.thead__h { margin: 4px 0 0; display: flex; align-items: center; gap: 10px; }
.thead__fav { margin-left: auto; border: 1px solid var(--field); background: var(--bg); padding: 7px 12px; font: inherit; font-size: 13px; font-weight: 700; color: var(--tx); cursor: pointer; }
.thead__fav[aria-pressed='true'] { background: var(--band); color: var(--band-tx); border-color: var(--band); }
.thead__d { color: var(--tx); font-size: 16px; line-height: 1.9; margin: 8px 0 20px; }
.tool { background: var(--bg); border: 1px solid var(--line); padding: 20px; }
.data-notice { margin: 12px 0 0; border-left: 4px solid var(--ink); }
.data-notice--external { border-left-color: var(--acc); }
.data-notice h2 { margin: 0 0 6px; font-size: 17px; }
.data-notice p { margin: 0; }
.data-notice p + p { margin-top: 6px; }

/* ================= フォーム部品 ================= */
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.row--end { justify-content: flex-end; }
.f { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.f--i { flex: 1 1 150px; margin-bottom: 0; }
.lb { font-size: 12px; color: var(--tx2); font-weight: 700; letter-spacing: 0.12em; line-height: 1.4; }
textarea, input[type='text'], input[type='number'], input[type='search'], input[type='url'], input[type='password'], select {
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  font-size: 16px;
  color: var(--tx);
  background: var(--bg);
  border: 1px solid var(--field);
}
textarea { min-height: 150px; resize: vertical; line-height: 1.9; }
textarea.mono, input.mono, .mono { font-family: ui-monospace, 'SFMono-Regular', Consolas, 'Courier New', monospace; }
:is(textarea, input, select):focus { border-color: var(--field); }
input[type='range'] { width: 100%; accent-color: var(--ink); }
input[type='color'] { width: 52px; height: 38px; padding: 2px; border: 1px solid var(--field); background: var(--bg); }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border: 1px solid var(--field);
  background: var(--bg);
  color: var(--tx);
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { border-color: var(--ink); color: var(--ink); }
.btn--p { background: var(--ink); border-color: var(--ink); color: var(--band-tx); }
.btn--s { padding: 7px 12px; font-size: 13px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.chk input { accent-color: var(--ink); width: 16px; height: 16px; }
.seg { display: inline-flex; border: 1px solid var(--field); background: var(--bg); gap: 0; flex-wrap: wrap; }
.seg button { border: 0; border-right: 1px solid var(--field); background: var(--bg); padding: 7px 14px; font: inherit; font-size: 13px; font-weight: 700; color: var(--tx2); cursor: pointer; }
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed='true'] { background: var(--ink); color: var(--band-tx); }
.drop { border: 2px dashed var(--field); padding: 30px 16px; text-align: center; color: var(--tx2); font-size: 13px; cursor: pointer; background: var(--bg); }
.drop:hover, .drop.on { border-color: var(--ink); color: var(--ink); }
.out { background: var(--bg); border: 1px solid var(--line); padding: 12px; font-size: 13px; line-height: 1.7; overflow: auto; white-space: pre-wrap; word-break: break-word; margin: 0; }
.out--big { font-size: 22px; font-weight: 700; text-align: center; padding: 18px; }
.note { font-size: 13px; color: var(--tx2); line-height: 1.7; margin: 6px 0 0; }
.err { color: var(--acc); font-size: 15px; font-weight: 700; min-height: 1.2em; margin: 8px 0 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.st { background: var(--bg); border-top: 1px solid var(--line); padding: 10px 12px; text-align: center; }
.st__n { font-size: 22px; font-weight: 700; line-height: 1.2; color: var(--ink); font-variant-numeric: tabular-nums; }
.st__l { font-size: 11px; color: var(--tx2); }
table.tb { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tb th, table.tb td { border-bottom: 1px solid var(--line); padding: 7px 8px; text-align: left; }
table.tb th { color: var(--tx2); font-weight: 700; }
table.tb td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ================= 旧ツール互換 ================= */
.pwlist, .imgs, .st-preview { display: grid; gap: 8px; margin-top: 10px; }
.pwi, .im, .pc, .diff {
  border: 1px solid var(--line);
  background: var(--bg);
  padding: 10px 12px;
}
.pwi { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; cursor: pointer; font: inherit; color: var(--tx); }
.pwi:hover { border-color: var(--ink); }
.pwi .mono { flex: 1; font-size: 15px; word-break: break-all; }
.pwi__c, .im__d { font-size: 13px; color: var(--tx2); flex: none; }
.sw { height: 90px; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700; letter-spacing: 0; margin-bottom: 14px; }
.prev { border: 1px solid var(--line); padding: 16px; margin-top: 10px; }
.pal__g { margin-bottom: 12px; }
.pal__r { display: flex; gap: 6px; margin-top: 5px; flex-wrap: wrap; }
.pal__c { width: 52px; height: 40px; border: 1px solid var(--field); cursor: pointer; padding: 0; }
.pal__c:hover { outline: 2px solid var(--ink); outline-offset: 1px; }
.im { display: flex; gap: 12px; align-items: center; }
.im img { width: 64px; height: 64px; object-fit: cover; flex: none; background: var(--line); }
.im__b { flex: 1; min-width: 0; }
.im__n { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar { position: relative; margin: 18px 0 34px; }
.bar__t { height: 10px; border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); background: var(--bg); }
.bar__p { position: absolute; top: -6px; transform: translateX(-50%); }
.bar__p span {
  display: block;
  background: var(--band);
  color: var(--band-tx);
  font-size: 11px;
  padding: 1px 7px;
  position: relative;
  top: -16px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.bar__p::after { content: ''; position: absolute; left: 50%; top: 0; transform: translateX(-50%); width: 3px; height: 22px; background: var(--ink); }
.bar__lb { display: flex; justify-content: space-between; font-size: 11px; color: var(--tx2); margin-top: 6px; }
.pc { margin-bottom: 12px; }
.pc__h { margin: 0 0 10px; font-size: 13px; color: var(--tx2); font-weight: 700; }
.pc .row { margin-bottom: 0; font-size: 14px; }
.pc__r { font-size: 19px; color: var(--ink); font-variant-numeric: tabular-nums; }
.pc .note { margin-top: 8px; }
.bits { display: flex; flex-wrap: wrap; gap: 2px; align-items: center; }
.bits__gap { width: 8px; }
.bit {
  width: 22px;
  height: 28px;
  border: 1px solid var(--field);
  background: var(--bg);
  color: var(--tx2);
  font: inherit;
  font-size: 12px;
  font-family: ui-monospace, Consolas, monospace;
  cursor: pointer;
  padding: 0;
}
.bit--on { background: var(--ink); border-color: var(--ink); color: var(--band-tx); font-weight: 700; }
.diff { margin-top: 14px; max-height: 60vh; overflow: auto; font-family: ui-monospace, Consolas, monospace; font-size: 13px; line-height: 1.65; }
.dl { display: flex; gap: 8px; padding: 0 10px; white-space: pre-wrap; word-break: break-word; }
.dl__s { flex: none; width: 12px; color: var(--tx2); user-select: none; }
.dl__t { flex: 1; min-width: 0; }
.dl--add, .dl--del { border-left: 3px solid var(--ink); }
.dl mark { background: var(--band); color: var(--band-tx); }
@media (max-width: 560px) { .bit { width: 17px; height: 24px; font-size: 11px; } .bits__gap { width: 5px; } }

/* ================= 記事部分 ================= */
.doc { margin-top: 34px; }
.doc h2 { margin: 0 0 12px; border-left: 4px solid var(--ink); padding-left: 10px; }
.doc h3 { margin: 20px 0 6px; }
.doc p, .doc li { font-size: 16px; color: var(--tx); line-height: 1.9; }
.doc__ol { padding-left: 22px; }
.doc__ol li { margin-bottom: 6px; }
.doc__h1 { margin: 8px 0 20px; }
.faq { margin: 0; }
.faq dt { font-weight: 700; font-size: 16px; margin-top: 14px; }
.faq dt::before { content: 'Q. '; color: var(--ink); }
.faq dd { margin: 4px 0 0; font-size: 16px; color: var(--tx); line-height: 1.9; }

/* ================= 広告枠 ================= */
.ad { margin: 24px auto; max-width: 1040px; padding: 0 16px; text-align: center; min-height: 100px; }
.ad__label { display: block; font-size: 10px; color: var(--tx2); letter-spacing: 0.12em; margin-bottom: 4px; }

/* ================= フッター ================= */
.ft { border-top: 1px solid var(--line); background: var(--bg); margin-top: 40px; }
.ft__in { max-width: 1040px; margin: 0 auto; padding: 26px 16px; }
.ft__nav { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; }
.ft__cr { font-size: 13px; color: var(--tx2); margin: 14px 0 0; line-height: 1.7; }

/* ================= トースト ================= */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 200;
  background: var(--band);
  color: var(--band-tx);
  padding: 10px 20px;
  font-size: 13px;
  line-height: 1.7;
  animation: tin 0.18s ease-out;
}
@keyframes tin { from { opacity: 0; transform: translate(-50%, 8px); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } html { scroll-behavior: auto; } }

/* ================= 投書箱のフォーム枠 ================= */
.formbox {
  margin: 20px 0 8px;
  padding: 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  overflow: hidden;
}
.formbox iframe { display: block; background: #FFFFFF; }
