:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --text: #172033;
  --muted: #667085;
  --border: #d8e0e9;
  --primary: #0f766e;
  --primary-hover: #0b625c;
  --primary-soft: #e8f7f5;
  --accent: #7c3aed;
  --accent-soft: #f1eaff;
  --danger: #b42318;
  --focus: rgba(15, 118, 110, 0.22);
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --radius: 16px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-width: 0; background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif; line-height: 1.7; }
body.dark {
  --bg: #0e1720;
  --surface: #16222d;
  --surface-soft: #111b25;
  --text: #f3f8f8;
  --muted: #aab9be;
  --border: #32434b;
  --primary: #7bd9cf;
  --primary-hover: #98e4dc;
  --primary-soft: #183c39;
  --accent: #c4a5ff;
  --accent-soft: #332651;
  --danger: #ffaaa2;
  --focus: rgba(123, 217, 207, 0.23);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}
button, textarea, input { font: inherit; }
button { cursor: pointer; }
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.header-inner, .page-shell, .site-footer { width: min(1220px, calc(100% - 32px)); margin: 0 auto; }
.header-inner { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; padding: 28px 0 24px; }
.eyebrow { margin: 0 0 4px; color: var(--primary); font-size: 0.86rem; font-weight: 800; }
h1, h2, h3, p, span, strong, code { overflow-wrap: anywhere; }
h1 { margin: 0; font-size: clamp(1.85rem, 4vw, 2.5rem); line-height: 1.25; }
.lead { max-width: 820px; margin: 10px 0 0; color: var(--muted); }
.page-shell { padding: 28px 0 56px; }
.tool-grid { display: grid; grid-template-columns: minmax(300px, 0.82fr) minmax(0, 1.38fr); gap: 24px; align-items: start; }
.panel, .content-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel { padding: 22px; min-width: 0; }
.panel-heading h2, .result-topbar h2, .content-section h2 { margin: 0; line-height: 1.35; }
.panel-heading p, .result-status { margin: 5px 0 0; color: var(--muted); font-size: 0.92rem; }
.mode-fieldset { margin: 18px 0; border: 1px solid var(--border); border-radius: 12px; padding: 12px; }
.mode-fieldset legend { padding: 0 6px; font-weight: 800; }
.mode-option { display: inline-flex; align-items: center; gap: 7px; margin-right: 16px; }
.input-label { display: block; margin-bottom: 7px; font-weight: 800; }
textarea { width: 100%; min-width: 0; resize: vertical; border: 1px solid var(--border); border-radius: 11px; background: var(--surface-soft); color: var(--text); padding: 14px; outline: none; font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace; font-size: 1rem; line-height: 1.6; }
textarea:focus, button:focus-visible, input:focus-visible, summary:focus-visible { border-color: var(--primary); box-shadow: 0 0 0 3px var(--focus); outline: none; }
.counter-row { min-height: 1.4em; display: flex; justify-content: space-between; gap: 10px; margin-top: 6px; color: var(--muted); font-size: 0.82rem; }
.field-error { color: var(--danger); font-weight: 800; }
.sample-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.sample-button { min-width: 40px; min-height: 40px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-soft); color: var(--text); font-size: 1.15rem; font-weight: 800; }
.input-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 16px; }
.theme-toggle, .primary-button, .secondary-button, .ghost-button { min-height: 44px; border-radius: 10px; padding: 10px 16px; font-weight: 800; border: 1px solid transparent; }
.theme-toggle, .ghost-button { background: var(--surface-soft); color: var(--text); border-color: var(--border); }
.primary-button { background: var(--primary); color: #fff; }
body.dark .primary-button { color: #0b211f; }
.primary-button:hover { background: var(--primary-hover); }
.secondary-button { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); }
.notice-box, .important-note { margin-top: 18px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-soft); padding: 14px; }
.notice-box p, .important-note p { margin: 5px 0 0; color: var(--muted); font-size: 0.9rem; }
.highlight-area { margin-top: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-soft); padding: 14px; }
.block-label { display: block; color: var(--muted); font-size: 0.8rem; font-weight: 800; }
.highlighted-text { margin-top: 7px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); padding: 12px; font-family: "SFMono-Regular", Consolas, monospace; font-size: 1.15rem; white-space: pre-wrap; word-break: break-word; }
.target-char { display: inline-block; border-radius: 4px; background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); padding: 0 2px; }
.mini-note { margin: 6px 0 0; color: var(--muted); font-size: 0.8rem; }
.result-list { display: grid; gap: 12px; margin-top: 16px; }
.empty-state { border: 1px dashed var(--border); border-radius: 12px; background: var(--surface-soft); color: var(--muted); padding: 28px 16px; text-align: center; }
.char-card { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-soft); padding: 16px; }
.big-char-box { display: flex; align-items: center; justify-content: center; min-height: 120px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); font-size: 4rem; font-family: "SFMono-Regular", Consolas, "Noto Sans Mono", monospace; }
.char-details h3 { margin: 0; }
.detail-grid { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 6px 10px; margin-top: 10px; }
.detail-grid dt { color: var(--muted); font-size: 0.84rem; font-weight: 800; }
.detail-grid dd { margin: 0; }
.similar-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.similar-chip { border: 1px solid var(--border); border-radius: 999px; background: var(--surface); padding: 4px 9px; font-family: "SFMono-Regular", Consolas, monospace; }
.copy-status { min-height: 1.5em; margin: 12px 0 0; color: var(--primary); font-weight: 800; font-size: 0.9rem; }
.copy-status.error { color: var(--danger); }
.content-section { margin-top: 28px; padding: 26px; }
.content-section > p { margin: 10px 0 0; color: var(--muted); }
.comparison-groups { display: grid; gap: 20px; margin-top: 20px; }
.comparison-group { min-width: 0; }
.comparison-group h3 { margin: 0 0 9px; }
.table-wrap { width: 100%; overflow: hidden; border: 1px solid var(--border); border-radius: 12px; }
.comparison-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.comparison-table th, .comparison-table td { padding: 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; word-break: break-word; }
.comparison-table th { background: var(--surface-soft); font-size: 0.82rem; }
.comparison-table tr:last-child td { border-bottom: 0; }
.table-char { font-size: 1.5rem; font-family: "SFMono-Regular", Consolas, monospace; font-weight: 800; }
.info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 22px; }
.info-grid article { border: 1px solid var(--border); border-radius: 12px; background: var(--surface-soft); padding: 16px; }
.info-grid h3 { margin: 0; font-size: 1rem; }
.info-grid p { margin: 7px 0 0; color: var(--muted); font-size: 0.93rem; }
.faq-section details { border-top: 1px solid var(--border); padding: 14px 0; }
.faq-section details:first-of-type { margin-top: 16px; }
.faq-section summary { cursor: pointer; font-weight: 800; }
.faq-section details p { margin: 9px 0 0; color: var(--muted); }
.site-footer { padding: 0 0 28px; color: var(--muted); text-align: center; font-size: 0.86rem; }
@media (max-width: 940px) { .tool-grid { grid-template-columns: 1fr; } }
@media (max-width: 720px) { .header-inner { flex-direction: column; } .theme-toggle { width: 100%; } .char-card { grid-template-columns: 90px minmax(0, 1fr); } .big-char-box { min-height: 90px; font-size: 3rem; } .comparison-table th:nth-child(4), .comparison-table td:nth-child(4) { display: none; } }
@media (max-width: 600px) { .header-inner, .page-shell, .site-footer { width: min(100% - 22px, 1220px); } .panel, .content-section { padding: 18px; } .input-actions { display: grid; grid-template-columns: 1fr; } .input-actions button { width: 100%; } .info-grid { grid-template-columns: 1fr; } .mode-option { display: flex; margin: 6px 0; } .counter-row { flex-direction: column; } .char-card { grid-template-columns: 1fr; } .big-char-box { min-height: 110px; } .detail-grid { grid-template-columns: 1fr; } .detail-grid dt { margin-top: 6px; } .comparison-table th:nth-child(3), .comparison-table td:nth-child(3) { display: none; } }
