:root {
  --bg: #faf7f2;
  --card: #fff;
  --ink: #1f2328;
  --muted: #63676e;
  --line: #e4dfd6;
  --accent: #c93f24; /* 白地・白文字のどちらでもコントラスト比 4.5 以上になる濃さ */
  --accent-ink: #fff;
  --accent-soft: #fbe9e4;
  --ok: #1d7a4c;
  /* 赤(--accent)は「いちばん押してほしいボタン」と「答えの数字」「注意」だけに使う。
     「いま選んである」しるし(切り替えボタン・チェック・つまみ・枠)は、こちらの濃い色にする */
  --sel: #2b2f36;
  --sel-ink: #fff;
  --radius: 12px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17181a;
    --card: #222427;
    --ink: #ecebe8;
    --muted: #a0a3a8;
    --line: #36383c;
    --accent: #ff7a5c;
    --accent-ink: #1a0f0c;
    --accent-soft: #3a231d;
    --ok: #58c48d;
    --sel: #e6e4df;
    --sel-ink: #17181a;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", Meiryo, sans-serif;
}
a { color: inherit; }
.wrap { max-width: 640px; margin: 0 auto; padding: 0 14px; }

/* ヘッダーは低く。入力欄を押し下げない */
.hd { border-bottom: 1px solid var(--line); }
.hd .wrap { display: flex; align-items: center; justify-content: space-between; height: 44px; }
.brand { font-weight: 700; text-decoration: none; letter-spacing: .02em; }
/* サイト名のしるし: 緑の十字。赤い十字は使わない */
.brand::before {
  content: ""; display: inline-block; width: 16px; height: 16px; margin-right: 7px;
  background: linear-gradient(#2c8351, #2c8351) center / 100% 34% no-repeat, linear-gradient(#2c8351, #2c8351) center / 34% 100% no-repeat;
}
.hd-nav { display: flex; }
.hd-nav a { font-size: 13px; color: var(--muted); text-decoration: none; padding: 12px 0 12px 14px; }

main.wrap { padding-bottom: 40px; }
h1 { font-size: 19px; line-height: 1.35; margin: 12px 0 10px; }
h2 { font-size: 16px; margin: 28px 0 8px; }
p { margin: 8px 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px; margin: 10px 0;
}

/* 入力 */
label.lb, .lb { display: block; font-size: 13px; color: var(--muted); margin: 0 0 4px; }
input[type="text"], input[type="date"], input[type="number"], select, textarea {
  width: 100%; min-height: 48px; padding: 10px 12px;
  font: inherit; font-size: 18px; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
  appearance: none; -webkit-appearance: none;
}
select {
  padding-right: 34px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 21px, calc(100% - 12px) 21px;
  background-size: 6px 6px; background-repeat: no-repeat;
}
::placeholder { color: var(--muted); opacity: .7; font-weight: 400; }
textarea { min-height: 180px; font-size: 16px; line-height: 1.6; resize: vertical; display: block; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible,
.seg input:focus-visible + span {
  outline: 2px solid var(--sel); outline-offset: 1px;
}
.row { display: flex; gap: 8px; align-items: end; }
.row > * { flex: 1; min-width: 0; }
.row > .fit { flex: 0 0 auto; }
.field { margin: 10px 0 0; }
.field:first-child { margin-top: 0; }
.unit { display: flex; align-items: center; gap: 6px; }
.unit > span { flex: 0 0 auto; color: var(--muted); }

/* 切り替えボタン(中身はラジオ) */
.seg { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--bg); }
.seg label { flex: 1; position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; }
.seg span {
  display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: 48px; padding: 4px 6px; font-size: 15px; cursor: pointer; user-select: none;
}
.seg label + label span { border-left: 1px solid var(--line); }
.seg span:has(small) { flex-direction: column; line-height: 1.3; }
.seg span small { font-size: 11px; font-weight: 400; opacity: .85; }
.seg input:checked + span { background: var(--sel); color: var(--sel-ink); font-weight: 700; }

/* 結果 */
.res { margin: 10px 0; }
.res-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 0; border-top: 1px solid var(--line);
}
.res-row:first-child { border-top: 0; padding-top: 0; }
.res-row:last-child { padding-bottom: 0; }
.res-k { flex: 0 0 auto; font-size: 13px; color: var(--muted); min-width: 4.5em; }
.res-v {
  flex: 1; min-width: 0; text-align: right; font-size: 20px; font-weight: 700;
  font-variant-numeric: tabular-nums; overflow-wrap: anywhere; line-height: 1.3;
}
.res-row.is-main .res-v { font-size: 30px; color: var(--main); }
.res-v.left { text-align: left; }
/* 手入力と一覧選択を1つの枠に入れる。左は打てる、右端の▼を押すと一覧が開く */
.combo {
  position: relative; flex: 1; min-width: 0; display: flex;
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
}
.combo input[type="text"] { border: 0; background: transparent; padding-right: 52px; }
.combo input[type="text"]:focus-visible { outline: 0; }
.combo:focus-within { outline: 2px solid var(--sel); outline-offset: 1px; }
.combo-btn {
  position: absolute; top: 0; right: 0; width: 52px; height: 100%;
  border: 0; background: transparent; border-radius: 0 10px 10px 0; cursor: pointer;
}
/* 一覧。枠と同じ幅から始めて、中身が長ければ左へ広げる */
.combo-list {
  position: absolute; top: calc(100% + 5px); right: -1px; z-index: 20;
  min-width: calc(100% + 2px); width: max-content; max-width: calc(100vw - 28px);
  max-height: 320px; overflow-y: auto; overscroll-behavior: contain;
  padding: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .18);
}
.combo-list button {
  display: block; width: 100%; min-height: 46px; padding: 0 14px;
  border: 0; border-radius: 7px; background: transparent;
  font-size: 17px; text-align: left; white-space: nowrap; cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.combo-list button:hover { background: var(--bg); }
.combo-list button.is-cur { background: var(--bg); font-weight: 700; box-shadow: inset 3px 0 0 var(--sel); }
.combo::after {
  content: ""; position: absolute; top: 8px; bottom: 8px; right: 0; width: 52px;
  border-left: 1px solid var(--line); pointer-events: none;
  background:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%) calc(50% - 3px) 55% / 6px 6px no-repeat,
    linear-gradient(135deg, var(--muted) 50%, transparent 50%) calc(50% + 3px) 55% / 6px 6px no-repeat;
}
.sub { margin: 4px 0 0; min-height: 1.6em; }
.chk { display: flex; align-items: center; gap: 8px; min-height: 48px; font-size: 15px; cursor: pointer; }
.chk input { width: 22px; height: 22px; margin: 0; accent-color: var(--sel); }
input[type="date"] { font-size: 16px; padding: 10px 8px; min-width: 0; }
.stats > .btn { font-size: 14px; }
.res-v small { font-size: 13px; font-weight: 400; color: var(--muted); margin-left: 2px; }
.err { color: var(--accent); font-size: 14px; font-weight: 400; }

button { font: inherit; color: inherit; }
.btn, .copy {
  min-height: 48px; padding: 0 14px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--line); background: var(--card);
}
.copy {
  flex: 0 0 auto; min-width: 0; min-height: 44px; padding: 0 6px; font-size: 12px; color: var(--muted);
  border-color: transparent; background: transparent; display: inline-flex; align-items: center; white-space: nowrap;
}
/* 紙が2枚重なった、コピーの印 */
.copy::before {
  content: ""; flex: 0 0 auto; width: 9px; height: 11px; margin: 0 8px 3px 0;
  border: 1.5px solid currentColor; border-radius: 2px; box-shadow: 3px 3px 0 -1.5px var(--card), 3px 3px 0 0 currentColor;
}
.copy:hover { color: var(--ink); background: var(--bg); }
.copy.is-done { color: var(--ok); }
.copy.is-done::before { width: 5px; height: 10px; margin: 0 9px 4px 3px; border-width: 0 2px 2px 0; border-radius: 0; box-shadow: none; transform: rotate(45deg); }

/* 数字のタイル(文字数など) */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 10px 0; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; }
.stat b { display: block; font-size: 20px; line-height: 1.25; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat span { display: block; font-size: 11px; color: var(--muted); line-height: 1.3; }
.stat.is-main { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; padding: 8px 10px; }
.stat.is-main b { font-size: 34px; color: var(--main); flex: 1; }
.stat.is-main span { font-size: 13px; }

/* 表 */
.tbl-wrap { overflow-x: auto; margin: 10px 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { padding: 8px 10px; text-align: left; border-top: 1px solid var(--line); white-space: nowrap; font-size: 15px; }
thead th { border-top: 0; font-size: 12px; color: var(--muted); font-weight: 400; position: sticky; top: 0; background: var(--card); }
td.num, th.num { text-align: right; }
td.ctr, th.ctr { text-align: center; }
td small { display: block; font-size: 12px; color: var(--muted); line-height: 1.4; }

/* 説明・関連 */
.notes { margin-top: 26px; font-size: 15px; }
.notes ul { padding-left: 1.2em; margin: 6px 0; }
.notes li { margin: 4px 0; }
.rel { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0; padding: 0; list-style: none; }
.rel a, .tool-list a, .tool-list .tl-card {
  display: flex; align-items: center; min-height: 48px; padding: 8px 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px; text-decoration: none;
}
.tool-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0; padding: 0; list-style: none; }
.tool-list li { min-width: 0; display: flex; }
.tool-list li > * { flex: 1; min-width: 0; }
.tool-list a { flex-direction: column; align-items: flex-start; justify-content: flex-start; padding: 10px 10px 9px; }
.tool-list a b { font-size: 15px; line-height: 1.35; overflow-wrap: anywhere; }
.tool-list small { color: var(--muted); font-size: 12px; line-height: 1.4; }
/* スマホの2列では、説明は2行までにする(カードの高さをそろえて、一覧を短くする) */
.tool-list a small:not(.is-live) { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 2px; }
/* ツールの絵。色は分類の色 */
.ti { flex: 0 0 auto; width: 26px; height: 26px; margin-bottom: 5px; color: var(--cat, var(--muted)); }
.tl-card > .ti { margin: 0 2px; }

/* ── ツールごとの部品 ── */
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, "Roboto Mono", monospace; }
code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .92em; background: var(--card); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; }
input.is-bad { border-color: var(--accent); }
.grow2 { flex: 2 !important; }
.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; font-size: 16px; }
.btn-main { background: var(--main); color: var(--main-ink); border-color: var(--main); font-weight: 700; }
.btn:disabled { opacity: .4; cursor: default; }
main > .seg, form > .seg:first-child { margin: 10px 0; }
textarea.short { min-height: 96px; }

/* 折り返して並ぶ選択ボタン(中身はラジオか、ふつうのボタン) */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.chips label { position: relative; }
.chips input { position: absolute; opacity: 0; inset: 0; margin: 0; }
.chips span, .chips button {
  display: flex; align-items: center; justify-content: center; min-height: 44px; min-width: 56px; padding: 0 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: 22px; font-size: 15px; cursor: pointer; user-select: none;
}
.chips input:checked + span { background: var(--sel); border-color: var(--sel); color: var(--sel-ink); font-weight: 700; }
.chips input:focus-visible + span { outline: 2px solid var(--sel); outline-offset: 1px; }

details > summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-size: 15px; color: var(--muted); }
details[open] > summary { color: var(--ink); }
.checks { margin-top: 6px; }
input[type="range"] { width: 100%; height: 44px; margin: 0; accent-color: var(--sel); }

/* 色コード */
.swatch-wrap { position: relative; display: block; text-align: center; }
.swatch {
  display: flex; align-items: center; justify-content: center; height: 96px; margin-bottom: 4px;
  border: 1px solid var(--line); border-radius: 10px; font-size: 22px; font-weight: 700;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
.swatch-wrap input[type="color"] { position: absolute; top: 0; left: 0; width: 100%; height: 96px; opacity: 0; cursor: pointer; padding: 0; border: 0; }

/* QRコード */
.qr-out { text-align: center; }
.qr-out img { display: block; width: 240px; height: 240px; margin: 4px auto 12px; image-rendering: pixelated; border-radius: 6px; }
.qr-out .btn { width: 100%; }

/* パスワード */
.pw { display: block; font-size: 22px; font-weight: 700; line-height: 1.5; overflow-wrap: anywhere; min-height: 66px; margin-bottom: 10px; }

/* タイマー */
.clock {
  text-align: center; font-size: 68px; font-weight: 700; line-height: 1.15; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums; margin: 6px 0 2px;
}
.clock.is-done { color: var(--accent); animation: blink 1s steps(2, start) 6; }
.clock-msg { text-align: center; min-height: 1.6em; margin: 0 0 8px; color: var(--accent); font-weight: 700; }
@keyframes blink { to { visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { .clock.is-done { animation: none; } }

textarea.mid { min-height: 132px; }
.btn.wide { width: 100%; }
.row.top { align-items: start; }
.sub-row { align-items: center; margin-top: 6px; min-height: 48px; }
p.err { color: var(--accent); }

/* くじ・抽選の結果 */
.picks { margin: 10px 0; padding: 0; list-style: none; counter-reset: pick; }
.picks li {
  counter-increment: pick; display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; margin-top: 6px; background: var(--accent-soft); border-radius: 10px;
  font-size: 20px; font-weight: 700; overflow-wrap: anywhere;
}
.picks li::before { content: counter(pick); flex: 0 0 auto; min-width: 1.6em; font-size: 13px; font-weight: 400; color: var(--muted); }
.picks.plain li { font-size: 16px; font-weight: 400; background: var(--card); border: 1px solid var(--line); }
.picks.plain li::before { content: none; }
.picks.plain li b { margin-right: 4px; }
.teams { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0; }
.team { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.team b { display: flex; justify-content: space-between; align-items: baseline; }
.team b small { font-weight: 400; color: var(--muted); font-size: 12px; }
.team ul { margin: 4px 0 0; padding: 0; list-style: none; }
.team li { padding: 3px 0; overflow-wrap: anywhere; }

/* ルーレット */
.wheel-card { text-align: center; }
.wheel-wrap { position: relative; width: 300px; height: 300px; margin: 14px auto 6px; }
.wheel-wrap canvas { display: block; width: 300px; height: 300px; }
.wheel-pin {
  position: absolute; top: -12px; left: 50%; margin-left: -11px; z-index: 1;
  border: 11px solid transparent; border-top: 20px solid var(--ink); border-bottom: 0;
}
.wheel-result { min-height: 46px; margin: 4px 0 10px; font-size: 16px; color: var(--muted); overflow-wrap: anywhere; }
.wheel-result.is-hit { font-size: 30px; font-weight: 700; line-height: 1.5; color: var(--main); }

/* あみだくじ */
.am-board { overflow-x: auto; margin: 10px 0; padding: 8px 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.am-board svg { display: block; margin: 0 auto; }
.am-line { stroke: var(--ink); stroke-width: 2; stroke-linecap: round; opacity: .55; }
.am-path { fill: none; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.am-name { cursor: pointer; }
.am-name rect { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1; }
.am-name.is-used rect { fill: var(--bg); stroke: var(--line); }
.am-name text, .am-res { text-anchor: middle; font-size: 12px; font-weight: 700; fill: var(--ink); }
.am-res { fill: var(--muted); }
.am-name:focus-visible { outline: 2px solid var(--sel); }

/* 世界時計 */
table.wc td { white-space: normal; padding: 8px; }
table.wc td small { white-space: nowrap; }
table.wc .wc-time { font-size: 20px; }
table.wc .wc-diff { font-size: 13px; color: var(--muted); white-space: nowrap; }
table.wc tr.is-base td { background: var(--bg); }
table.wc tr.is-base td:first-child { box-shadow: inset 3px 0 0 var(--sel); }
input[type="datetime-local"] { width: 100%; min-height: 48px; padding: 10px 8px; font: inherit; font-size: 16px; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; min-width: 0; }

/* 祝日・カレンダー */
.c-sun { color: #c9302c; }
.c-sat { color: #2a6fb5; }
/* カレンダーの日曜・祝日のマスは薄い赤、土曜のマスは薄い青(字が読める薄さにしてある) */
:root { --sun-bg: #fdeeee; --sat-bg: #eaf2fc; }
@media (prefers-color-scheme: dark) { .c-sun { color: #ff8a80; } .c-sat { color: #82b4ee; } :root { --sun-bg: #3a2424; --sat-bg: #1f2b3d; } }
.next-hol { text-align: center; }
.next-days { font-size: 22px; font-weight: 700; line-height: 1.2; }
.next-days b { font-size: 64px; color: var(--main); margin: 0 4px; font-variant-numeric: tabular-nums; }
.next-name { font-size: 22px; font-weight: 700; }
.cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-nav b { font-size: 18px; }
.cal-nav .btn { min-width: 52px; font-size: 22px; }
/* カレンダーは、縦と横の線を入れた格子にする */
table.cal { table-layout: fixed; border-collapse: collapse; border: 1px solid var(--line); }
table.cal th, table.cal td { text-align: center; padding: 0; height: 40px; border: 1px solid var(--line); font-size: 16px; position: static; }
table.cal thead th { font-size: 12px; height: 26px; }
table.cal td.c-sun { background: var(--sun-bg); }
table.cal td.c-sat { background: var(--sat-bg); }
table.cal td.is-hol { font-weight: 700; }
table.cal td.is-today { outline: 2px solid var(--ink); outline-offset: -3px; border-radius: 8px; }
.cal-names { margin: 8px 0 0; padding: 0; list-style: none; font-size: 14px; }
.cal-names li { padding: 3px 0; }
.cal-names b { display: inline-block; min-width: 6em; color: #c9302c; font-weight: 400; }
@media (prefers-color-scheme: dark) { .cal-names b { color: #ff8a80; } }
table.hol tr.is-past td { opacity: .45; }
table.hol tr.is-next td { background: var(--bg); font-weight: 700; }
table.hol tr.is-next td:first-child { box-shadow: inset 3px 0 0 var(--sel); }
.cal-year { display: grid; gap: 8px; }
.cal-year .card { margin: 0; }
.cal-year h3 { margin: 0 0 4px; font-size: 16px; }
.chips a, .chips .is-on {
  display: flex; align-items: center; justify-content: center; min-height: 44px; min-width: 56px; padding: 0 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: 22px; font-size: 15px; text-decoration: none;
}
.chips .is-on { background: var(--sel); border-color: var(--sel); color: var(--sel-ink); font-weight: 700; }
a.btn.wide { margin-top: 10px; }
@media (min-width: 560px) { .cal-year { grid-template-columns: 1fr 1fr; } }

/* マイページ */
.pin-row { margin: 10px 0 0; text-align: right; }
/* タイトルのすぐ下の「☆ マイページに追加」。星は黄色の中抜き、追加すると黄色の塗り */
h1:has(+ .pin-line) { margin-bottom: 0; }
.pin-line { margin: 0 0 6px; }
.pin { display: inline-flex; align-items: center; gap: 5px; min-height: 40px; padding: 0; border: 0; background: none; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; }
.pin-star { font-size: 19px; line-height: 1; color: #e0a800; }
.pin.is-on { color: var(--ink); font-weight: 700; }
/* カードの形はトップ(.tool-list)と同じ。その場で出す答え(今日の和暦など)だけ、説明の位置に少し目立つ字で出す */
.my-cards { margin: 12px 0; }
/* 編集画面の、追加ボタンつきのカード(形はトップのカードと同じ。右にボタンが付く) */
.tool-list .tl-card { gap: 10px; }
.tl-text { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.tl-card .btn { flex: 0 0 auto; min-width: 76px; padding: 0 10px; font-size: 14px; }
.tl-card .btn[data-act="add"] { border: 1px solid color-mix(in srgb, var(--ink) 60%, transparent); }
.tl-card.is-on { background: var(--bg); }
.tl-card .btn.is-added { background: var(--sel); border-color: var(--sel); color: var(--sel-ink); font-weight: 700; }
/* 追加ボタンつきの一覧は、ボタンのぶん幅が要るので、スマホでは1列 */
#others .tool-list { grid-template-columns: 1fr; }
.my-cards small.is-live { font-size: 15px; font-weight: 700; color: var(--ink); line-height: 1.5; }
.my-edit { margin: 8px 0; padding: 0; list-style: none; }
.my-edit li { display: flex; align-items: center; gap: 6px; padding: 6px 0; border-top: 1px solid var(--line); }
.my-edit li:first-child { border-top: 0; }
.my-edit li > span { flex: 1; min-width: 0; }
/* 選んだツールの一覧。カードの形はトップと同じで、順番が分かるように1列に並べる */
.tool-list.my-picked { grid-template-columns: 1fr; }
.my-picked .tl-card { gap: 6px; padding: 6px 8px 6px 2px; }
.my-picked .tl-card .btn { min-width: 44px; padding: 0 8px; }
.my-picked .my-none { padding: 8px 2px; }
/* つかんで並べ替える「≡」。指で触ったときにページがスクロールしないようにする */
.drag {
  flex: 0 0 auto; width: 44px; min-height: 48px; border: 0; background: none; color: var(--muted);
  font-size: 22px; line-height: 1; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none;
}
.my-picked li.is-drag { position: relative; z-index: 5; }
.my-picked li.is-drag .tl-card { box-shadow: 0 8px 22px rgba(0, 0, 0, .22); }
.my-picked li.is-drag .drag { cursor: grabbing; color: var(--ink); }
.my-edit li small { display: block; font-size: 12px; color: var(--muted); }
.my-edit .btn { flex: 0 0 auto; min-width: 48px; padding: 0 10px; font-size: 14px; }
input.small-input { font-size: 13px; }

.res-v.is-minus { color: #c9302c; }
.res-u { flex: 0 0 auto; color: var(--muted); font-size: 14px; min-width: 1.2em; }
table.wrap-cells td { white-space: normal; }
table.wrap-cells td:first-child { white-space: nowrap; }

/* 大きいカレンダー */
.cal-pick { display: flex; gap: 6px; flex: 1; margin: 0 8px; }
.cal-pick select { font-size: 17px; font-weight: 700; padding-left: 10px; }
.cal-wareki { text-align: center; margin: -2px 0 6px; min-height: 1.5em; }
table.cal.big td { height: 58px; vertical-align: top; padding: 5px 1px 2px; }
table.cal.big td b { display: block; font-size: 18px; font-weight: 400; line-height: 1.3; }
table.cal.big td.is-hol b { font-weight: 700; }
table.cal.big td small { display: block; font-size: 10px; line-height: 1.15; overflow-wrap: anywhere; }
table.cal.big td .sub-name { color: var(--muted); }
table.cal.big td.is-empty { background: none; }
.cal-year section[data-m] { cursor: pointer; }
@media (min-width: 560px) { table.cal.big td { height: 76px; } table.cal.big td small { font-size: 11px; } }
@media print {
  .hd, .ft, .pin-line, .pin-row, .notes, .rel, .seg, .cal-nav .btn, #today, h2, .chips, .cal-year, .ad { display: none !important; }
  body { background: #fff; } .card { border: 0; }
}

/* 六曜 */
.rk-name { font-size: 56px; font-weight: 700; line-height: 1.2; color: var(--main); }
h2.in-card { margin: 12px 0 0; font-size: 15px; }
.rk-next li { justify-content: space-between; }
/* 吉日カレンダー */
.kj-today { font-size: 30px; font-weight: 700; line-height: 1.3; color: var(--main); }
.kj-today.is-none { font-size: 18px; font-weight: 400; color: var(--ink); }
.kj-list li { justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.kj-list li small { color: var(--muted); font-size: 13px; margin-left: 4px; }
.kj-list li.is-today { border-color: var(--sel); border-width: 2px; }
.kj-tags { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.kj-tag { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 12px; font-weight: 700; line-height: 1.6; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.kj-tag.is-sub { background: transparent; border: 1px solid var(--line); color: var(--ink); font-weight: 400; }
.kj-tag.is-bad { background: transparent; border: 1px solid var(--line); color: var(--muted); font-weight: 400; }
.kj-dbl { font-size: 18px; font-weight: 700; margin: 4px 0 0; }
.rk-next li small { color: var(--muted); font-size: 13px; }
table.cal.big td.is-taian .sub-name { display: inline-block; padding: 1px 4px; border-radius: 4px; background: var(--accent); color: var(--accent-ink); font-weight: 700; }
table.rk-year th { white-space: nowrap; vertical-align: top; font-size: 14px; }
table.rk-year td { font-size: 12px; line-height: 1.7; vertical-align: top; padding: 8px 6px; }
table.rk-year td span { white-space: nowrap; margin-right: 4px; }
table.wrap-cells td small { display: block; font-size: 11px; color: var(--muted); font-weight: 400; }

/* 国番号 */
.cc-wrap { max-height: 430px; overflow-y: auto; }
table.cc td { white-space: normal; padding: 6px 8px; }
table.cc td small { display: block; font-size: 11px; color: var(--muted); }
table.cc td.num { font-size: 17px; font-weight: 700; white-space: nowrap; }
table.cc td.fit { width: 1%; padding-left: 0; }
table.cc .btn { min-height: 44px; padding: 0 10px; font-size: 13px; white-space: nowrap; }
table.cc tr.is-sep td { border-top: 3px double var(--line); }
table.cc tbody.is-filtered tr.is-sep td { border-top: 1px solid var(--line); }
.how-country { margin: 2px 0 10px; }

/* 市外局番 */
.sg-wrap { max-height: 520px; overflow-y: auto; }
table.sg td { white-space: normal; vertical-align: top; font-size: 13px; line-height: 1.5; padding: 8px; }
table.sg td.num { white-space: nowrap; text-align: left; width: 1%; }
table.sg td.num b { font-size: 19px; }
table.sg td.num small { display: block; font-size: 11px; color: var(--muted); }
table.sg th.num { text-align: left; }
#msg { font-weight: 700; }
table.sg tr.is-exact td { background: var(--bg); }
table.sg tr.is-exact td:first-child { box-shadow: inset 3px 0 0 var(--sel); }

/* 靴サイズ */
.tbl-wrap.flat { border: 0; margin: 12px 0 0; }
table.shoe-out th { font-size: 13px; font-weight: 400; color: var(--muted); white-space: nowrap; }
table.shoe-out tbody th { color: var(--ink); font-size: 14px; }
table.shoe-out td b { font-size: 19px; }
table.shoe td, table.shoe th { padding: 8px 4px; font-size: 12px; }
table.shoe th:first-child, table.shoe td:first-child { padding-left: 8px; }
table.shoe td:first-child { font-size: 15px; }

/* 画像 */
.file-pick { display: block; text-align: center; cursor: pointer; }
.file-pick input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-pick input:focus-visible + .btn { outline: 2px solid var(--ink); outline-offset: 2px; }
.file-pick .small { display: block; margin-top: 6px; overflow-wrap: anywhere; }
.res-v.sm { font-size: 16px; }
.res-row.is-main .res-v.sm { font-size: 19px; }
.img-preview { display: block; max-width: 100%; max-height: 420px; margin: 12px auto 0; border-radius: 8px; border: 1px solid var(--line);
  background: repeating-conic-gradient(#ddd 0% 25%, #fff 0% 50%) 50% / 16px 16px; }

.dl-list { display: grid; gap: 8px; margin-top: 8px; }
.dl-list a.btn.wide { margin-top: 0; min-height: 48px; padding: 6px 12px; text-align: center; overflow-wrap: anywhere; }

/* DNS */
.dns-rec { padding: 8px 0; border-top: 1px solid var(--line); }
.dns-rec:first-child { border-top: 0; padding-top: 0; }
.dns-rec h3 { margin: 0 0 4px; font-size: 16px; }
.dns-rec h3 small { margin-left: 8px; font-size: 12px; font-weight: 400; color: var(--muted); }
.dns-rec.is-none h3 { color: var(--muted); font-weight: 400; }
.dns-rec ul { margin: 0; padding: 0; list-style: none; }
.dns-rec li { display: flex; gap: 8px; align-items: baseline; justify-content: space-between; padding: 3px 0; }
.dns-rec li code { overflow-wrap: anywhere; background: none; border: 0; padding: 0; font-size: 14px; }
.dns-rec li small { flex: 0 0 auto; font-size: 11px; color: var(--muted); }
.dns-rec p { margin: 0; }
table.kv.wide { width: 100%; border: 0; }
table.kv.wide th { width: 9em; font-size: 13px; }
table.kv.wide td { overflow-wrap: anywhere; font-size: 14px; }

/* 郵便番号 */
.zp-list { margin: 8px 0 0; padding: 0; list-style: none; }
.zp-list li { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); }
.zp-main { flex: 1; min-width: 0; }
.zp-main b { display: block; font-size: 20px; font-variant-numeric: tabular-nums; }
.zp-main span { display: block; overflow-wrap: anywhere; }
.zp-main small { display: block; font-size: 11px; color: var(--muted); overflow-wrap: anywhere; }
.zp-btn { display: flex; flex-direction: column; gap: 4px; flex: 0 0 auto; }
.zp-btn .copy { min-height: 44px; }

/* 銀行コード */
.notice { margin: 8px 0; padding: 8px 12px; font-size: 13px; background: var(--accent-soft); border-radius: 10px; }
.bk-list { margin: 6px 0 0; padding: 0; list-style: none; }
.bk-pick { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 6px 4px; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; cursor: pointer; }
.bk-pick b { flex: 0 0 auto; font-size: 18px; font-variant-numeric: tabular-nums; }
.bk-pick span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.bk-pick small, .bk-head small { display: block; font-size: 11px; color: var(--muted); }
.bk-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.bk-head b { font-size: 20px; }

/* ── 分類の色 ──
   トップとマイページのカードの枠線、分類の見出しの印に使う。文字には使わない(色だけで区別させない)。
   分類を足したら、明るい画面用と暗い画面用の両方をここに足す */
[data-cat="money"] { --cat: #2e8b57; }
[data-cat="date"] { --cat: #c93f24; }
[data-cat="health"] { --cat: #6f8f1f; }
[data-cat="time"] { --cat: #b37800; }
[data-cat="unit"] { --cat: #2a6fb5; }
[data-cat="phone"] { --cat: #7b5cc4; }
[data-cat="kuji"] { --cat: #d0428a; }
[data-cat="net"] { --cat: #0f8b8d; }
[data-cat="file"] { --cat: #8a6a3f; }
@media (prefers-color-scheme: dark) {
  [data-cat="money"] { --cat: #5fc08a; }
  [data-cat="date"] { --cat: #ff7a5c; }
  [data-cat="health"] { --cat: #b3d15a; }
  [data-cat="time"] { --cat: #f0b840; }
  [data-cat="unit"] { --cat: #6fa8e8; }
  [data-cat="phone"] { --cat: #a890ee; }
  [data-cat="kuji"] { --cat: #f07ab4; }
  [data-cat="net"] { --cat: #4cc4c6; }
  [data-cat="file"] { --cat: #c9a26e; }
}
[data-cat] .tool-list a, [data-cat] .tool-list .tl-card, .tool-list li[data-cat] a, .tool-list li[data-cat] .tl-card { border: 2px solid var(--cat, var(--line)); }
section[data-cat] > h2 { display: flex; align-items: center; gap: 8px; }
section[data-cat] > h2::before { content: ""; flex: 0 0 auto; width: 12px; height: 12px; border-radius: 4px; background: var(--cat, var(--line)); }

/* 緯度経度 */
.geo-links { margin-top: 8px; }
.geo-links .btn { font-size: 13px; padding: 0 8px; min-height: 44px; text-align: center; }
.res-v.sm.mono { font-size: 14px; }

/* 読み取り(カメラ) */
.video-wrap { position: relative; margin-bottom: 10px; background: #000; border-radius: 10px; overflow: hidden; text-align: center; }
.video-wrap video { display: block; width: 100%; max-height: 60vh; object-fit: cover; }
.video-wrap span { position: absolute; left: 0; right: 0; bottom: 0; padding: 6px 8px; color: #fff; background: rgba(0, 0, 0, .55); }
.file-pick.inline { flex: 1; }
.file-pick.inline .btn { width: 100%; }
.scan-text { margin: 0 0 8px; padding: 10px; max-height: 240px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; }
.scan-hist { margin: 4px 0 0; padding: 0; list-style: none; font-size: 13px; color: var(--muted); }
.scan-hist li { padding: 4px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
/* バーコード作成 */
.bc-img { display: block; max-width: 100%; height: auto; margin: 4px auto 12px; image-rendering: pixelated; border-radius: 6px; }
/* 写真をPDFに */
.pp-thumb { flex: 0 0 auto; width: 48px; height: 48px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }

/* 水平器 */
.level-card { text-align: center; }
.dial { position: relative; width: 240px; height: 240px; margin: 6px auto 4px; }
.dial-ring { position: absolute; inset: 0; border: 2px solid var(--line); border-radius: 50%; background: var(--bg); }
.dial-ring::after { content: ""; position: absolute; inset: 38%; border: 2px solid var(--muted); border-radius: 50%; opacity: .6; }
.dial-cross { position: absolute; inset: 0; background: linear-gradient(var(--line), var(--line)) 50% 0 / 1px 100% no-repeat, linear-gradient(var(--line), var(--line)) 0 50% / 100% 1px no-repeat; }
.bubble { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; background: var(--accent); opacity: .85; }
.level-line { position: absolute; left: 6%; right: 6%; top: 50%; height: 6px; margin-top: -3px; border-radius: 3px; background: var(--accent); }
.dial[data-mode="flat"] .level-line, .dial[data-mode="upright"] .bubble { display: none; }
.dial.is-level .bubble, .dial.is-level .level-line { background: var(--ok); }
.level-angle { font-size: 64px; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.level-angle.is-level { color: var(--ok); }
.level-sub { min-height: 1.6em; margin: 0 0 10px; }

/* 画面の定規 */
.cal-methods { margin-bottom: 8px; }
.cal-methods input[type="radio"] { width: 22px; height: 22px; margin: 0; accent-color: var(--sel); flex: 0 0 auto; }
.cal-area { display: flex; align-items: center; justify-content: flex-start; min-height: 120px; margin: 8px 0; overflow: hidden; }
.cal-box { flex: 0 0 auto; border: 2px solid var(--accent); border-radius: 3.5%/5.5%; background: var(--accent-soft); }
.cal-box.is-round { border-radius: 50%; }
.cal-box.is-cut { align-self: flex-start; border-bottom: 0; border-radius: 12px 12px 0 0; -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent); }
/* スマホでは、合わせる四角を画面の横幅いっぱいまで使えるようにする(カードの短い辺 54mm が、枠の内側に入りきらない機種があるため) */
@media (max-width: 600px) { .cal-area { width: 100vw; margin-left: calc(50% - 50vw); padding-left: 8px; } }
.cal-row { align-items: center; margin-bottom: 10px; }
.cal-row .btn { min-width: 48px; font-size: 20px; }
html.no-scroll, html.no-scroll body { overflow: hidden; }
.ruler-overlay { position: fixed; inset: 0; z-index: 50; background: var(--card); touch-action: none; user-select: none; -webkit-user-select: none; }
.ruler-strip { position: absolute; left: 0; top: 0; }
.ruler-svg { display: block; overflow: visible; }
.ruler-svg line { stroke: var(--ink); stroke-width: 1; shape-rendering: crispEdges; }
.ruler-svg text { fill: var(--ink); font-size: 13px; font-variant-numeric: tabular-nums; }
.ruler-marker { position: absolute; left: 0; top: 0; background: var(--accent); pointer-events: none; }
.ruler-overlay[data-dir="v"] .ruler-marker { width: 100%; height: 2px; margin-top: -1px; }
.ruler-overlay[data-dir="h"] .ruler-marker { height: 100%; width: 2px; margin-left: -1px; }
.ov-bar { position: absolute; right: 10px; bottom: 14px; width: min(250px, calc(100% - 96px)); padding: 10px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 6px 18px rgba(0, 0, 0, .16); }
.ov-read { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; margin-bottom: 8px; }
.ov-warn { color: var(--accent); margin: 0 0 8px; }
.ov-bar .btn { padding: 0 6px; font-size: 14px; }

/* パーセント */
.pc-q { min-height: 1.6em; margin: 10px 0 0; font-weight: 700; }
/* ローン */
table.loan-tbl td, table.loan-tbl th { font-size: 14px; padding: 6px 10px; }
/* 全角・半角 */
.zk-kinds { display: flex; flex-wrap: wrap; gap: 0 18px; }
/* サイコロ */
.dice-card { text-align: center; }
.dice-out { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; min-height: 76px; margin: 8px 0 4px; }
.die { display: inline-grid; width: 64px; height: 64px; border: 2px solid var(--ink); border-radius: 12px; background: var(--card); }
.die.d6 { grid-template: repeat(3, 1fr) / repeat(3, 1fr); padding: 7px; }
.die.d6 i { width: 12px; height: 12px; margin: auto; border-radius: 50%; }
.die.d6 i.on { background: var(--ink); }
.die.d6.is-one i.on { width: 18px; height: 18px; background: var(--accent); }
.die.dn { place-items: center; font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.dice-out.is-rolled .die { animation: dice-shake .35s ease-out; }
@keyframes dice-shake { 0% { transform: rotate(-14deg) scale(.9); } 60% { transform: rotate(6deg); } 100% { transform: none; } }
.dice-sum { min-height: 1.6em; margin: 4px 0 12px; color: var(--muted); }
.dice-sum b { font-size: 40px; color: var(--main); margin: 0 4px; font-variant-numeric: tabular-nums; }
.dice-hist { text-align: left; margin: 12px 0 0; padding-left: 1.6em; }
.dice-hist li { padding: 2px 0; }

/* 過ぎた行は薄く */
tr.is-past td { opacity: .5; }
/* 年齢計算・厄年・法要 */
.yk-now { margin: 6px 0 0; display: flex; flex-direction: column; gap: 2px; }
.yk-now b { font-size: 22px; line-height: 1.35; }
.yk-now b.yk-yes { color: var(--accent); }
.yk-now span { color: var(--muted); font-size: 14px; }
.yk-list { margin: 10px 0 0; padding: 0; list-style: none; }
.yk-list li { display: grid; grid-template-columns: 1fr auto 7em; gap: 8px; align-items: center; padding: 7px 0; border-top: 1px solid var(--line); font-size: 15px; }
.yk-list li small { display: block; font-size: 11px; color: var(--muted); }
.yk-list li b { text-align: right; font-weight: 400; }
.yk-list li.is-hon b { font-weight: 700; }
.yk-list li.is-past { opacity: .45; }
.yk-list li.is-now { background: var(--bg); box-shadow: inset 3px 0 0 var(--main); padding-left: 8px; }
.yk-list li.is-now b { color: var(--main); font-weight: 700; }
h3.yk-h { margin: 14px 0 4px; font-size: 15px; }
table.yk-tbl th, table.yk-tbl td { white-space: normal; vertical-align: top; font-size: 14px; padding: 7px 8px; }
table.yk-tbl td small, table.yk-tbl th small { display: block; font-size: 11px; color: var(--muted); font-weight: 400; }
table.yk-tbl td.is-hon { font-weight: 700; background: var(--bg); }
table.yk-tbl th small.yk-big { color: var(--accent); font-weight: 700; }
table.hy-tbl td { vertical-align: top; }
table.hy-tbl td small { display: block; font-size: 11px; color: var(--muted); }
table.hy-tbl tr.is-next td { background: var(--bg); }
table.hy-tbl tr.is-next td:first-child { box-shadow: inset 3px 0 0 var(--main); }

/* 日の出・月齢 */
.moon-card { display: flex; align-items: center; gap: 18px; }
.moon-wrap { flex: 0 0 auto; line-height: 0; }
.moon-svg .moon-dark { fill: #2b2f36; }
.moon-svg .moon-lit { fill: #f3d77a; }
.moon-age { font-size: 40px; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.mn-list li { justify-content: space-between; }
.mn-list li small { color: var(--muted); font-size: 13px; }

/* 画像の切り抜き・回転 */
.im-rot .btn { font-size: 15px; padding: 0 8px; }
.crop-wrap { position: relative; margin: 6px auto 4px; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; border-radius: 6px; background: #000; }
.crop-wrap canvas { display: block; }
.crop-box { position: absolute; border: 2px solid #fff; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .55); cursor: move; outline: 1px solid rgba(0, 0, 0, .4); }
.crop-box::before, .crop-box::after { content: ""; position: absolute; inset: 0; pointer-events: none; border: 0 solid rgba(255, 255, 255, .45); }
.crop-box::before { left: 33.33%; right: 33.33%; border-width: 0 1px; }
.crop-box::after { top: 33.33%; bottom: 33.33%; border-width: 1px 0; }
/* 角のつまみ。見た目は小さく、触れる範囲は 44px */
.ch { position: absolute; width: 44px; height: 44px; margin: -22px 0 0 -22px; z-index: 1; }
.ch::after { content: ""; position: absolute; left: 13px; top: 13px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .5); }
.ch.nw { left: 0; top: 0; cursor: nwse-resize; }
.ch.ne { left: 100%; top: 0; cursor: nesw-resize; }
.ch.sw { left: 0; top: 100%; cursor: nesw-resize; }
.ch.se { left: 100%; top: 100%; cursor: nwse-resize; }
p.err.is-info { color: var(--muted); }

/* 音声の波形 */
canvas.wave { display: block; width: 100%; height: 80px; margin: 2px 0 8px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; touch-action: manipulation; }

/* 広告枠: 高さを先に確保して、読み込み後に中身がずれないようにする */
.ad { margin: 22px 0; display: flex; justify-content: center; align-items: center; overflow: hidden; }

.ft { border-top: 1px solid var(--line); padding: 16px 0 28px; font-size: 13px; color: var(--muted); }
.ft-nav { display: flex; flex-wrap: wrap; gap: 0 16px; }
.ft-nav a { display: inline-flex; align-items: center; min-height: 44px; }

/* トップの検索 */
.search { margin: 12px 0 4px; }
input[type="search"] {
  width: 100%; min-height: 48px; padding: 10px 14px; font: inherit; font-size: 16px; color: var(--ink);
  background: var(--card); border: 1px solid var(--line); border-radius: 24px; appearance: none; -webkit-appearance: none;
}

/* 分類へ飛ぶリンク。スマホでは横にスクロールする1行、PC では折り返す */
.cat-nav { display: flex; gap: 6px; margin: 10px -14px 2px; padding: 0 14px 4px; overflow-x: auto; scrollbar-width: none; }
.cat-nav::-webkit-scrollbar { display: none; }
.cat-nav a {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: 20px; font-size: 14px; text-decoration: none; white-space: nowrap;
}
.cat-nav a::before { content: ""; width: 9px; height: 9px; border-radius: 3px; background: var(--cat); }
.cat-nav a:hover { border-color: var(--cat); }
section[data-cat] { scroll-margin-top: 8px; }

/* トップを PC で見たとき: 幅を広げて、分類を2列(左の列を上から下へ、次に右の列)に並べ、分類の中のカードも2列にする。
   分類ごとにツールの数が違うので、表の形(grid)ではなく段組み(columns)にして、すき間ができないようにする */
@media (min-width: 980px) {
  .is-home .wrap { max-width: 1120px; padding: 0 24px; }
  .is-home .search { max-width: 540px; }
  .is-home .cats { column-count: 2; column-gap: 28px; }
  .is-home .cats > section { break-inside: avoid; padding-top: 1px; }
  .is-home .cats > section > h2 { margin-top: 22px; }
  .is-home .tool-list { grid-template-columns: 1fr 1fr; gap: 6px; }
  .is-home .cat-nav { flex-wrap: wrap; overflow: visible; margin: 12px 0 0; padding: 0; }
  .is-home h1 { margin-bottom: 4px; }
  .is-home .search { margin-top: 10px; }
  /* カードを低くして、1画面に入る分類を増やす: 絵を名前の左に置き、説明は1行にする */
  .is-home .tool-list a {
    display: grid; grid-template-columns: 26px 1fr; column-gap: 10px; align-items: center;
    min-height: 58px; padding: 8px 10px;
  }
  .is-home .tool-list a .ti { grid-row: 1 / span 2; margin: 0; }
  .is-home .tool-list a b { font-size: 14.5px; line-height: 1.35; }
  .is-home .tool-list a small:not(.is-live) { -webkit-line-clamp: 1; margin-top: 0; }
  .is-home .cats > section > h2 { margin: 18px 0 8px; }
}

/* マイページ: 押すとその下でツールが開くカード。形はトップのカードと同じ */
.tool-list .my-open {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start;
  width: 100%; min-height: 48px; padding: 10px 10px 9px; text-align: left; cursor: pointer;
  background: var(--card); border: 2px solid var(--cat, var(--line)); border-radius: 10px;
}
.tool-list .my-open b { font-size: 15px; line-height: 1.35; overflow-wrap: anywhere; padding-right: 16px; }
.tool-list .my-open small:not(.is-live) { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 2px; }
.my-open[aria-expanded="true"] { background: var(--bg); }
/* 開く・閉じるの向き(下向きの山 → 上向き) */
.my-chev { position: absolute; top: 14px; right: 12px; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); }
.my-open[aria-expanded="true"] .my-chev { top: 18px; transform: rotate(-135deg); }
.my-ext { margin-top: 4px; font-size: 12px; color: var(--muted); }
.my-ext::after { content: " ↗"; }
.tool-list li.my-panel { display: block; grid-column: 1 / -1; padding: 4px 10px 6px; background: var(--bg); border: 2px solid var(--cat, var(--line)); border-radius: var(--radius); }
.my-panel-hd { display: flex; align-items: center; gap: 6px; }
.my-panel-hd b { flex: 1; min-width: 0; font-size: 16px; }
/* カードの枠の決まり(.tool-list の a)が当たらないように、細かく指定する */
.tool-list li.my-panel a.my-panel-link { display: inline-flex; flex-direction: row; align-items: center; min-height: 44px; padding: 0 6px; font-size: 13px; color: var(--muted); background: none; border: 0; text-decoration: underline; }
.tool-list li.my-panel a.my-panel-link::after { content: " ↗"; white-space: pre; }
.my-close { min-width: 44px; min-height: 44px; padding: 0; font-size: 20px; border-color: transparent; background: transparent; }
.my-loading { margin: 6px 0 10px; }
.my-panel iframe { display: block; width: 100%; height: 160px; border: 0; background: transparent; }

/* 埋め込まれた中(?embed=1): 道具の部分だけを出す */
.is-embed .hd, .is-embed .ft, .is-embed main > h1, .is-embed .tool-side, .is-embed .pin-line, .is-embed .pin-row, .is-embed .ad { display: none !important; }
.is-embed main.wrap { max-width: none; padding: 0 0 4px; }
.is-embed .tool-grid { display: block; }
.is-embed .tool-main > :first-child { margin-top: 2px; }

/* ツールのページを PC で見たとき: 左に道具(今までと同じ幅)、右に説明と関連ツール */
@media (min-width: 980px) {
  .is-tool .wrap { max-width: 1120px; padding: 0 24px; }
  .tool-grid { display: grid; grid-template-columns: minmax(0, 640px) minmax(0, 1fr); column-gap: 36px; align-items: start; }
  .tool-main { min-width: 0; }
  .tool-side { min-width: 0; padding-top: 10px; }
  .tool-side .notes { margin-top: 0; font-size: 14px; }
  .tool-side .notes > h2:first-child, .tool-side > h2:first-child { margin-top: 0; }
  .tool-side h2 { font-size: 15px; margin: 22px 0 6px; }
  .tool-side .rel { grid-template-columns: 1fr 1fr; }
  .tool-side .rel a { min-height: 44px; font-size: 14px; }
}

/* 文章のページ */
.doc { font-size: 15px; }
.doc ul { padding-left: 1.2em; }
.doc li { margin: 6px 0; }
.doc a, .notes a { color: var(--main); }
table.kv th { width: 6em; color: var(--muted); font-weight: 400; vertical-align: top; }
table.kv th, table.kv td { white-space: normal; border-top: 1px solid var(--line); }
table.kv tr:first-child th, table.kv tr:first-child td { border-top: 0; }
table.kv { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); border-collapse: separate; border-spacing: 0; overflow: hidden; }

@media (min-width: 560px) {
  h1 { font-size: 22px; }
  .stats { grid-template-columns: repeat(6, 1fr); }
  .rel { grid-template-columns: repeat(3, 1fr); }
  .tool-list { grid-template-columns: repeat(3, 1fr); }
  #others .tool-list { grid-template-columns: 1fr 1fr; }
  .tool-list a { padding: 12px; }
}

/* ── 体・健康 ── */
.h-sub { font-size: 16px; margin: 18px 0 6px; }
tr.is-now td { font-weight: 700; background: color-mix(in srgb, var(--sel) 8%, transparent); }
.hy-tbl td small { display: block; font-size: 12px; font-weight: 400; color: var(--muted); }
/* BMI の目盛り(15〜40)。左から やせ・普通・肥満1度・2度・3度以上 */
.bmi-bar { position: relative; height: 10px; margin: 14px 2px 22px; border-radius: 5px;
  background: linear-gradient(to right, #7fb2e5 0 14%, #6dbf8b 14% 40%, #e8c15a 40% 60%, #e89a5a 60% 80%, #d9694f 80% 100%); }
.bmi-bar i { position: absolute; top: -5px; width: 4px; height: 20px; margin-left: -2px; border-radius: 2px; background: var(--ink); box-shadow: 0 0 0 2px var(--card); }
.bmi-bar span { position: absolute; top: 13px; font-size: 11px; color: var(--muted); transform: translateX(-50%); }
.bmi-bar span:nth-of-type(1) { left: 14%; } .bmi-bar span:nth-of-type(2) { left: 40%; } .bmi-bar span:nth-of-type(3) { left: 60%; } .bmi-bar span:nth-of-type(4) { left: 80%; }
.kt-level span { min-height: 52px; }
/* お酒 */
.al-list { display: grid; gap: 8px; margin: 10px 0; }
.al-row { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 6px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.al-row b { grid-column: 1 / -1; font-size: 14px; }
.al-row label { display: flex; align-items: center; gap: 4px; min-width: 0; }
.al-row input { min-width: 0; width: 100%; text-align: right; }
.al-row label span { font-size: 13px; color: var(--muted); }
.al-del { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--muted); font-size: 18px; }
.al-bar { position: relative; height: 10px; margin: 12px 2px 22px; border-radius: 5px; background: var(--line); overflow: visible; }
.al-bar i { position: absolute; inset: 0 auto 0 0; border-radius: 5px; background: var(--cat, var(--sel)); }
.al-bar b { position: absolute; top: -3px; width: 2px; height: 16px; background: var(--ink); opacity: .5; }
.al-bar span { position: absolute; top: 13px; font-size: 11px; color: var(--muted); transform: translateX(-50%); }
.al-warn { color: var(--accent); }
.res-k small { display: block; font-size: 12px; opacity: .85; }

/* ── トップ: よく使われるツール(大きいカード)と、マイページの案内 ── */
.pop { margin-top: 14px; }
.pop > h2, .all-h { font-size: 17px; margin: 0 0 8px; }
.all-h { margin-top: 22px; }
.pop-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; padding: 0; list-style: none; }
.pop-list li { min-width: 0; display: flex; }
.pop-list a {
  flex: 1; min-width: 0; display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center;
  min-height: 76px; padding: 12px; border-radius: 14px; text-decoration: none; color: var(--ink);
  border: 2px solid var(--cat, var(--line)); background: color-mix(in srgb, var(--cat, var(--line)) 12%, var(--card));
}
.pop-list a:hover { background: color-mix(in srgb, var(--cat, var(--line)) 20%, var(--card)); }
.pop-list a .ti { width: 34px; height: 34px; grid-row: 1 / span 2; margin: 0; }
.pop-list a b { font-size: 16px; line-height: 1.3; overflow-wrap: anywhere; align-self: end; }
.pop-list a small { font-size: 12px; line-height: 1.35; color: var(--muted); align-self: start; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.my-promo {
  display: flex; align-items: center; gap: 12px; margin: 12px 0 0; padding: 12px 14px; border-radius: 14px;
  background: #e9efe5; color: #26301f; border: 2px solid #b9c4b4; text-decoration: none;
}
.my-promo-star { flex: 0 0 auto; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: #fff; font-size: 20px; color: #e0a800; }
.my-promo-txt { flex: 1; min-width: 0; }
.my-promo-txt b { display: block; font-size: 16px; line-height: 1.35; }
.my-promo-txt small { display: block; font-size: 12.5px; line-height: 1.45; opacity: .85; }
.my-promo-go { flex: 0 0 auto; padding: 8px 12px; border-radius: 18px; background: #2c8351; color: #fff; font-size: 14px; font-weight: 700; white-space: nowrap; }
@media (prefers-color-scheme: dark) {
  .my-promo { background: #2a3127; color: #dfe8da; border-color: #55604f; }
  .my-promo-star { background: #1c211a; }
}
/* ヘッダーの「マイページ」を、ほかのリンクより目立つ形にする */
.hd-nav a.hd-my { display: inline-flex; align-items: center; gap: 4px; margin: 6px 0 6px 10px; padding: 0 12px; min-height: 36px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); color: var(--ink); font-weight: 700; }
.hd-nav a.hd-my span { color: #e0a800; }
@media (min-width: 980px) {
  .is-home .pop-list { grid-template-columns: repeat(4, 1fr); gap: 10px; }
  .is-home .pop-list a { min-height: 84px; padding: 14px; }
  .is-home .my-promo { max-width: 640px; }
}
/* 読み取り: カメラのボタンを1段目いっぱいに、画像と貼り付けを2段目に並べる */
.rd-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rd-btns #cam { grid-column: 1 / -1; }
.rd-btns .file-pick, .rd-btns .file-pick .btn, .rd-btns > .btn { width: 100%; margin: 0; }
.rd-btns:has(#paste[hidden]) .file-pick { grid-column: 1 / -1; }

/* ── ツールのページ: 主ボタンと答えの数字を、分類の色にする(赤は注意だけに使う) ──
   白い字・白い地のどちらでも読めるよう、分類の色を少し濃くしたものを使う(コントラスト比 4.5 以上)。
   分類が無いページ(トップ・マイページ・固定ページ)は、選択中と同じ濃い色。元に戻すなら --main を var(--accent) にする */
:root { --main: var(--sel); --main-ink: var(--sel-ink); }
body[data-tcat="money"] { --main: #2c8351; --main-ink: #fff; }
body[data-tcat="date"] { --main: #c93f24; --main-ink: #fff; }
body[data-tcat="health"] { --main: #607b1a; --main-ink: #fff; }
body[data-tcat="time"] { --main: #9a6800; --main-ink: #fff; }
body[data-tcat="unit"] { --main: #2a6fb5; --main-ink: #fff; }
body[data-tcat="phone"] { --main: #7b5cc4; --main-ink: #fff; }
body[data-tcat="kuji"] { --main: #c43e82; --main-ink: #fff; }
body[data-tcat="net"] { --main: #0f7f81; --main-ink: #fff; }
body[data-tcat="file"] { --main: #8a6a3f; --main-ink: #fff; }
@media (prefers-color-scheme: dark) {
  body[data-tcat="money"] { --main: #5fc08a; --main-ink: #17181a; }
  body[data-tcat="date"] { --main: #ff7a5c; --main-ink: #17181a; }
  body[data-tcat="health"] { --main: #b3d15a; --main-ink: #17181a; }
  body[data-tcat="time"] { --main: #f0b840; --main-ink: #17181a; }
  body[data-tcat="unit"] { --main: #6fa8e8; --main-ink: #17181a; }
  body[data-tcat="phone"] { --main: #a890ee; --main-ink: #17181a; }
  body[data-tcat="kuji"] { --main: #f07ab4; --main-ink: #17181a; }
  body[data-tcat="net"] { --main: #4cc4c6; --main-ink: #17181a; }
  body[data-tcat="file"] { --main: #c9a26e; --main-ink: #17181a; }
}

/* リンク集のカード(フリーメール集など) */
.tl-tag { display: inline-block; margin-right: 5px; padding: 0 5px; border: 1px solid var(--line); border-radius: 4px; font-style: normal; font-size: 10px; line-height: 1.5; color: var(--muted); vertical-align: 1px; }
.lk-list { display: grid; gap: 8px; margin: 0 0 10px; padding: 0; list-style: none; }
.lk-list a { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; padding: 12px 14px; border: 2px solid var(--main); border-radius: 10px; background: var(--card); color: inherit; text-decoration: none; }
.lk-list a b { font-size: 17px; line-height: 1.3; }
.lk-list a .lk-by { grid-column: 1; color: var(--muted); font-size: 12px; }
.lk-list a span { grid-column: 1; font-size: 14px; line-height: 1.55; }
.lk-list a i { grid-column: 2; grid-row: 1 / span 3; font-style: normal; font-size: 13px; font-weight: 700; color: var(--main); white-space: nowrap; }
.lk-list a:hover { background: var(--bg); }
.lk-ad { margin: 0 0 8px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; color: var(--muted); }

/* マイページの、まだ入っていない場所(点線の枠) */
.tool-list .my-slot button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: 100%; min-height: 84px; padding: 8px; border: 2px dashed color-mix(in srgb, var(--muted) 45%, transparent); border-radius: var(--radius); background: transparent; color: var(--muted); font: inherit; cursor: pointer; }
.my-edit-slots { margin-top: 8px; }
.tool-list .my-slot button span { font-size: 22px; line-height: 1; }
.tool-list .my-slot button small { font-size: 12px; }
.tool-list .my-slot button:hover, .tool-list .my-slot button:focus-visible { border-color: var(--muted); color: var(--ink); }

/* 文字数カウントの入力欄: 地の色に埋もれないように、白地に分類色の太い枠 */
.ta-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 14px 0 6px; }
.ta-head .lb { margin: 0; font-size: 15px; font-weight: 700; color: var(--ink); }
.ta-head .btn { min-height: 40px; padding: 0 16px; font-size: 14px; }
textarea.ta-main { min-height: 200px; background: var(--card); border: 2px solid var(--main); }
textarea.ta-main::placeholder { color: var(--muted); opacity: 1; }

/* コピペ帳 */
#pc-set { background: color-mix(in srgb, var(--main) 14%, var(--card)); border-color: color-mix(in srgb, var(--main) 50%, var(--line)); }
.cp-intro {margin: 0 0 12px; font-size: 15px; line-height: 1.7; }
.cp-safe { margin: 0 0 12px; padding: 10px 12px; border: 2px solid var(--main); border-radius: 10px; background: var(--card); font-size: 13.5px; line-height: 1.6; }
.cp-safe b { display: block; font-size: 15px; color: var(--main); }
.cp-h { margin: 16px 0 6px; font-size: 15px; }
.card > .cp-h:first-child { margin-top: 0; }
.cp-chips { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cp-chip { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 56px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); font: inherit; text-align: left; cursor: pointer; min-width: 0; }
.cp-chip small { font-size: 11.5px; color: var(--muted); line-height: 1.3; }
.cp-chip b { font-size: 15px; line-height: 1.35; overflow-wrap: anywhere; word-break: break-all; }
.cp-chip:active { background: var(--bg); }
.cp-chip.is-done { border-color: var(--main); }
.cp-chip.is-done small { color: var(--main); font-weight: 700; }
.cp-foot { margin-top: 18px; }
.cp-link { padding: 10px 0; border: 0; background: none; color: var(--muted); font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; }
.cp-warn { margin: 6px 0 12px; padding: 10px 12px; border: 1px solid var(--accent); border-radius: 10px; font-size: 14px; }
.cp-warn p { margin: 0 0 8px; }
input[type="password"] { width: 100%; min-height: 48px; padding: 10px 12px; font: inherit; font-size: 18px; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; appearance: none; -webkit-appearance: none; }

/* ── 箱と棚の見た目(2026-12-01 の見本を 2026-12-03 に本番へ) ── */
.pop h2::before { content: "＋"; margin-right: 6px; color: #2c8351; font-weight: 700; }
/* 一覧: 分類が棚の1段。下に棚板を1本 */
.cats section { margin: 0 -6px 18px; padding: 2px 6px 12px; border-bottom: 7px solid #dccfb8; border-radius: 0 0 3px 3px; box-shadow: 0 5px 6px -4px rgba(60, 40, 10, .28); }
.cats section > h2 { display: inline-block; margin: 10px 0 6px; padding: 2px 10px; border: 1px solid var(--cat); border-radius: 3px; background: var(--card); font-size: 14px; }
/* カード: 上に分類色の帯 */
.cats .tool-list a, .pop-list a, .my-cards .my-open, .my-cards li[data-slug] > a { border-width: 1px !important; border-top: 9px solid var(--cat, var(--line)) !important; border-radius: 4px 4px 9px 9px !important; }
/* マイページ: ふたと取っ手のある箱の中に、カードと点線の枠が並ぶ */
.kbox { margin: 14px 0; border: 3px solid #b9c4b4; border-radius: 16px; background: color-mix(in srgb, var(--card) 70%, transparent); overflow: hidden; }
.kbox-lid { display: flex; align-items: center; gap: 8px; padding: 7px 14px; background: #e9efe5; border-bottom: 3px solid #b9c4b4; font-weight: 700; font-size: 14px; color: #33402f; }
.kbox-lid i { width: 20px; height: 20px; flex: 0 0 auto; background: linear-gradient(#2c8351, #2c8351) center / 100% 34% no-repeat, linear-gradient(#2c8351, #2c8351) center / 34% 100% no-repeat; }
.kbox-lid span { margin-left: auto; width: 54px; height: 8px; border-radius: 4px; background: #b9c4b4; }
.kbox .my-cards { margin: 0; padding: 10px; }
/* 「ツールを選ぶ」を押すと、箱の代わりに「並べ替えられる1行ずつの一覧」が箱の形で出て、その下にツール一覧が開く */
main:has(#edit-panel:not([hidden])) .kbox { display: none; }
#picked { margin: 10px 0 14px; padding: 0 8px 6px; border: 3px solid #b9c4b4; border-radius: 16px; background: var(--bg); overflow: hidden; }
#picked::before { content: "マイページ　「≡」をつかむと順番を変えられます"; display: block; margin: 0 -8px 2px; padding: 7px 14px 7px 42px; background: linear-gradient(#2c8351, #2c8351) 14px center / 20px 7px no-repeat, linear-gradient(#2c8351, #2c8351) 20.5px center / 7px 20px no-repeat, #e9efe5; border-bottom: 3px solid #b9c4b4; font-weight: 700; font-size: 13px; color: #33402f; }
#edit-panel > h2:first-of-type, #edit-panel > h2:first-of-type + p { display: none !important; }
@media (prefers-color-scheme: dark) {
  .cats section { border-bottom-color: #5b5142; }
  .kbox, .kbox-lid { border-color: #55604f; }
  .kbox-lid { background: #2a3127; color: #dfe8da; }
  .kbox-lid span { background: #55604f; }
  #picked { border-color: #55604f; }
  #picked::before { background-color: #2a3127; color: #dfe8da; border-color: #55604f; }
}

/* ── ツールのページ(2026-12-03): 題名をトップのカードと同じ形に(説明は抜き)。道具の枠と見出しに分類の色。道具の中の小さい文字を大きめに。
   右側(説明・関連ツール)の文字は小さいまま ── */
.tool-h { display: flex; align-items: center; gap: 10px; margin: 12px 0 10px; padding: 10px 12px; border: 1px solid var(--main); border-top: 9px solid var(--main); border-radius: 4px 4px 9px 9px; background: color-mix(in srgb, var(--main) 12%, var(--card)); }
.tool-h .ti { width: 30px; height: 30px; margin: 0; color: var(--main); }
.tool-h span { min-width: 0; overflow-wrap: anywhere; }
@media (min-width: 980px) { .tool-h { max-width: 640px; } }
.tool-main .card { border-color: color-mix(in srgb, var(--main) 45%, var(--line)); }
.tool-main label.lb, .tool-main .lb { font-size: 15px; font-weight: 700; color: var(--main); }
.tool-main .small, .tool-main .res-k { font-size: 14.5px; }
.tool-main h2 { font-size: 17px; }
/* 入力欄とプルダウンの枠も分類の色に */
.tool-main input[type="text"], .tool-main input[type="date"], .tool-main input[type="number"], .tool-main input[type="password"], .tool-main select, .tool-main textarea, .tool-main .combo { border: 2px solid color-mix(in srgb, var(--main) 70%, var(--card)); }
.tool-main .combo input[type="text"] { border: 0; }
/* マイページ「ツールを追加する」: カードの絵と名前のところは、そのツールへのリンク。カードの中なので、リンクとしての枠や地は付けない */
#others .tl-card a.tl-go { flex: 1; min-width: 0; display: flex; flex-direction: row; align-items: center; gap: 10px; min-height: 44px; margin: 0; padding: 0; border: 0 !important; border-radius: 0 !important; background: none; color: inherit; text-decoration: none; }
#others .tl-card a.tl-go .ti { margin: 0 2px; }
#others .tl-card a.tl-go b { text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--ink) 35%, transparent); text-underline-offset: 3px; }
#others .tl-card a.tl-go:hover b { text-decoration-color: currentColor; }
/* 前回の入力(押すと欄に入る1行)。道具のいちばん上に出る */
.rem { display: flex; gap: 6px; margin: 0 0 10px; }
.rem-go { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 6px 12px; border: 2px dashed color-mix(in srgb, var(--main) 60%, var(--card)); border-radius: 10px; background: var(--card); color: var(--ink); font: inherit; font-size: 15px; text-align: left; cursor: pointer; }
.rem-go small { flex: 0 0 auto; font-size: 12.5px; color: var(--muted); }
.rem-go span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.rem-go span i { font-style: normal; color: var(--muted); margin: 0 4px; }
.rem-go em { flex: 0 0 auto; padding: 4px 10px; border-radius: 14px; background: var(--main); color: var(--main-ink); font-style: normal; font-size: 13.5px; font-weight: 700; }
.rem-x { flex: 0 0 auto; width: 44px; min-height: 48px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--muted); font: inherit; font-size: 20px; cursor: pointer; }
.rem-clear { margin-top: 18px; }
/* 整数の欄に、読めないものが入っているとき */
.tool-main input.is-bad { border-color: var(--accent); }
.int-msg { margin: 4px 0 0; }
/* 総ざらいの直し(2026-12-03) */
/* 暗い画面では、赤字(マイナス)の色を明るくする(#c9302c のままだと地の色と近くて読めない) */
@media (prefers-color-scheme: dark) { .res-v.is-minus { color: #ff8a80; } }
/* ヘッダーの「マイページ」: 押す所を高く(36 → 40px。ヘッダーの高さ 44px に収まる上限) */
.hd-nav a.hd-my { min-height: 40px; margin-top: 2px; margin-bottom: 2px; }
/* 「マイページに追加」の行は、ボタンが出る前から高さを取っておく(あとから出ると下の中身がずれる) */
.pin-line { min-height: 40px; }
/* 入力例の文字は、薄くしすぎない(地の色との差が足りなかった) */
.tool-main ::placeholder { opacity: 1; color: var(--muted); }
