/* fuseru.html の見た目。CSP（style-src 'self'）のため外部ファイルに置く */
:root {
  --bg: #0f1720; --bg2: #141f2b; --card: #17232f; --card2: #1d2b39; --line: rgba(255,255,255,.12); --line2: rgba(255,255,255,.2);
  --ink: #eef2f6; --dim: #a8b4c2; --faint: #7f8c9b;
  --accent: #7fd6b0; --accent2: #f2c46d; --warn: #ff8f7a;
  --r: 14px;
  /* 種類ごとの色（ハイライト） */
  --c-person: #ff8fa3; --c-company: #c9a3ff; --c-address: #7fc8ff; --c-postal: #8ee3ef; --c-phone: #ffd36b;
  --c-email: #9ff0a8; --c-url: #b9e27a; --c-ip: #f5a65b; --c-mynumber: #ff6b6b; --c-card: #ff9d5c;
  --c-bank: #e8b4ff; --c-birthdate: #ffb3d9; --c-date: #c4ccd6;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  min-height: 100vh; min-height: 100dvh; color: var(--ink); background-color: var(--bg);
  background-image: radial-gradient(900px 500px at 90% -10%, rgba(127,214,176,.10), transparent 60%),
                    radial-gradient(800px 600px at -10% 110%, rgba(127,200,255,.08), transparent 60%);
  background-repeat: no-repeat;
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", "Yu Gothic", "Meiryo", system-ui, sans-serif;
  line-height: 1.75; overflow-x: hidden; font-size: 15px;
  line-break: strict; overflow-wrap: anywhere;
}
a { color: var(--accent); }
a:hover { color: #a8ecd0; }
button, select, textarea { font: inherit; color: inherit; }
code { font-family: ui-monospace, "SFMono-Regular", Consolas, "BIZ UDGothic", monospace; font-size: .92em; background: rgba(255,255,255,.07); padding: 1px 5px; border-radius: 4px; }
.nb { display: inline-block; }
.dim { color: var(--dim); }
.small { font-size: 13px; }
.gc { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; left: 0; bottom: 0; }

/* ---------- 上の帯 ---------- */
.bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 16px;
  background: rgba(15,23,32,.9); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.bar .back { color: var(--dim); text-decoration: none; font-size: 13px; white-space: nowrap; }
.bar .back:hover { color: var(--ink); }
.bar-title { flex: 1; text-align: center; font-weight: 800; letter-spacing: .3em; font-size: 17px; white-space: nowrap; padding-left: .3em; }
.zero { font-size: 12px; font-weight: 700; color: #0f1720; background: var(--accent); padding: 3px 10px; border-radius: 999px; text-decoration: none; white-space: nowrap; }
.zero:hover { color: #0f1720; filter: brightness(1.08); }

/* ---------- 冒頭 ---------- */
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px 40px; }
.hero { padding: 34px 0 18px; max-width: 780px; }
.hero h1 { font-size: clamp(28px, 6.2vw, 46px); line-height: 1.3; font-weight: 800; letter-spacing: .02em; word-break: auto-phrase; text-wrap: balance; }
.lead { margin-top: 12px; font-size: 16.5px; color: #d9e1ea; word-break: auto-phrase; }
.tok { color: var(--c-person); background: rgba(255,143,163,.12); }
.facts { list-style: none; margin-top: 16px; display: grid; gap: 8px; }
.facts li { position: relative; padding-left: 20px; color: var(--dim); font-size: 14px; word-break: auto-phrase; }
.facts li::before { content: ""; position: absolute; left: 4px; top: .7em; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.facts li:last-child::before { background: var(--accent2); }
.facts b { color: var(--ink); }

/* ---------- 道具 ---------- */
.tool { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 10px; }
.step { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; min-width: 0; }
.step-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.step h2 { font-size: 17px; font-weight: 800; display: flex; align-items: center; gap: 9px; }
.step h2 .n { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #0f1720; font-size: 14px; flex: none; }
.step-tools { display: flex; gap: 6px; flex-wrap: wrap; }
.btn { min-height: 40px; padding: 7px 14px; border-radius: 10px; border: 1px solid var(--line2); background: var(--card2); cursor: pointer; font-size: 14px; font-weight: 700; white-space: nowrap; }
.btn:hover { background: #24364a; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.ghost { background: transparent; }
.btn.primary { background: var(--accent); color: #0f1720; border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.done { background: #5fbf95; border-color: #5fbf95; color: #0f1720; }
.area { width: 100%; min-height: 160px; resize: vertical; background: #0d151d; border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px;
  line-height: 1.7; font-size: 15px; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; word-break: normal; line-break: strict; }
.area:focus { outline: 2px solid rgba(127,214,176,.55); outline-offset: 1px; }
.area.short { min-height: 110px; }
.area + .area { margin-top: 8px; }
.area[readonly] { background: #101b25; }
.note { min-height: 1.5em; margin-top: 6px; font-size: 13px; color: var(--dim); }
.note.warn { color: var(--warn); }
.hint { font-size: 13.5px; color: var(--dim); margin-bottom: 10px; }
.hint b { color: var(--ink); }

.types { border: 0; margin-top: 10px; }
.types legend { font-size: 13.5px; font-weight: 700; margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 4px 11px 4px 9px; border-radius: 999px;
  border: 1px solid var(--line2); background: #101b25; cursor: pointer; font-size: 13.5px; user-select: none; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }
.chip .cnt { font-variant-numeric: tabular-nums; color: var(--dim); font-size: 12px; min-width: 1em; text-align: right; }
.chip.off { opacity: .45; }
.chip.off .dot { background: transparent; border: 1.5px solid var(--c); }
.chip:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

.preview { min-height: 160px; max-height: 420px; overflow: auto; background: #0d151d; border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px;
  white-space: pre-wrap; overflow-wrap: anywhere; word-break: normal; line-break: strict; line-height: 1.9; font-size: 15px; }
.preview:empty::before { content: "1 に文章を貼ると、ここに伏せる場所が色付きで出ます。"; color: var(--faint); }
.hl { color: inherit; background: color-mix(in srgb, var(--c) 26%, transparent); border-bottom: 2px solid var(--c); border-radius: 3px; padding: 0 1px; cursor: pointer; }
.hl:hover { background: color-mix(in srgb, var(--c) 40%, transparent); }
.hl.off { background: transparent; border-bottom: 2px dashed color-mix(in srgb, var(--c) 70%, transparent); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--c) 60%, transparent); color: var(--dim); }
.hl.manual { box-shadow: inset 0 0 0 1px var(--c); }
.addbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.sel { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--dim); }
.sel select { min-height: 40px; padding: 6px 8px; border-radius: 10px; border: 1px solid var(--line2); background: var(--card2); }
.manual { margin-top: 10px; font-size: 13px; color: var(--dim); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.manual .tag { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line2); border-radius: 999px; padding: 2px 4px 2px 10px; background: #101b25; color: var(--ink); }
.manual .tag button { border: 0; background: transparent; cursor: pointer; width: 28px; height: 28px; border-radius: 50%; color: var(--dim); }
.manual .tag button:hover { background: rgba(255,255,255,.1); color: var(--ink); }

.table-box { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.table-box summary { cursor: pointer; font-weight: 700; font-size: 14px; }
.table-box .btn { margin-top: 10px; }
.table-scroll { overflow-x: auto; margin-top: 8px; }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--dim); font-weight: 700; white-space: nowrap; }
.map td:first-child { white-space: nowrap; font-family: ui-monospace, Consolas, monospace; color: var(--c, var(--ink)); }

/* ---------- 説明 ---------- */
.info { max-width: 820px; margin-top: 40px; }
.info h2 { font-size: 21px; font-weight: 800; margin-bottom: 10px; word-break: auto-phrase; }
.info p, .dots li, .hint, .note { word-break: auto-phrase; }
.info p { color: #d6dee7; margin-bottom: 10px; }
.dots { padding-left: 1.2em; display: grid; gap: 8px; color: #d6dee7; }
.dots li::marker { color: var(--accent); }
.csp { margin-top: 12px; }
.csp summary { cursor: pointer; color: var(--dim); font-size: 13.5px; }
.csp pre { margin-top: 8px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12.5px; background: #0d151d; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; color: var(--dim); }
.metrics td.num, .metrics th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.metrics td:first-child { white-space: nowrap; }
.metrics .bar-cell { width: 34%; min-width: 90px; }
.metrics .meter { height: 8px; border-radius: 4px; background: rgba(255,255,255,.08); overflow: hidden; }
.metrics .meter i { display: block; height: 100%; background: var(--accent); }
.metrics .meter.low i { background: var(--accent2); }
.metrics tr.total td { font-weight: 800; border-top: 1px solid var(--line2); }

.foot { max-width: 1120px; margin: 30px auto 0; padding: 20px 16px 40px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between; font-size: 13.5px; }

/* 種類ごとの色を --c に */
.t-person { --c: var(--c-person); } .t-company { --c: var(--c-company); } .t-address { --c: var(--c-address); } .t-postal { --c: var(--c-postal); }
.t-phone { --c: var(--c-phone); } .t-email { --c: var(--c-email); } .t-url { --c: var(--c-url); } .t-ip { --c: var(--c-ip); }
.t-mynumber { --c: var(--c-mynumber); } .t-card { --c: var(--c-card); } .t-bank { --c: var(--c-bank); } .t-birthdate { --c: var(--c-birthdate); } .t-date { --c: var(--c-date); }

@media (max-width: 860px) {
  .tool { grid-template-columns: 1fr; }
  .metrics .bar-cell { display: none; }
}
@media (max-width: 420px) {
  body { font-size: 14.5px; }
  .bar .back { font-size: 12px; }
  .bar-title { letter-spacing: .18em; font-size: 16px; }
  .step { padding: 13px; }
  .lead { font-size: 15.5px; }
}
@media (prefers-reduced-motion: no-preference) {
  .btn, .chip, .hl { transition: background-color .15s, opacity .15s, filter .15s; }
}
body.nofx *, body.nofx *::before, body.nofx *::after { transition: none !important; animation: none !important; }
