:root {
  --ink: #231f1c;
  --muted: #635b56;
  --accent: #c0341d;
  --rule: #e6e1dc;
  --control-rule: #ddd7d1;
  --wash: #faf7f4;
  --white: #fff;
  font: 14px/1.55 "Zen Kaku Gothic New", "Hiragino Sans", sans-serif;
  color: var(--ink);
  background: var(--white);
}
body[data-ep-shell] { font-family: "Zen Kaku Gothic New", "Hiragino Sans", sans-serif; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body, h1, h2, p { margin: 0; }
a { color: inherit; text-underline-offset: 4px; }
button, input, summary { font: inherit; color: inherit; }
button, input { background: var(--white); border: 1px solid var(--control-rule); border-radius: 7px; }
button, summary { cursor: pointer; }

.nm-page { width: min(1120px, calc(100% - 96px)); margin: auto; }
.intro { padding: 42px 0 42px; }
h1 { font-size: 40px; line-height: 1.24; font-weight: 800; letter-spacing: .025em; }
.intro p { margin-top: 10px; color: var(--muted); }

.workspace { display: grid; grid-template-columns: clamp(302px, 28vw, 318px) minmax(0, 1fr); gap: clamp(30px, 5vw, 58px); align-items: start; }
h2 { font-size: 17px; font-weight: 800; }
.filters h2 { min-height: 49px; display: flex; align-items: center; }
.filters h2, .result-heading { padding-bottom: 10px; border-bottom: 1px solid var(--rule); margin-bottom: 0; }
.basic-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.field { min-width: 0; margin: 0 0 15px; padding: 0; border: 0; }
.field legend { padding: 0; margin-bottom: 6px; font-size: 12px; font-weight: 700; }
.choices { display: flex; border: 1px solid var(--control-rule); border-radius: 8px; }
.choice {
  position: relative;
  display: flex;
  flex: 1 0 auto;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.choice + .choice { border-left: 1px solid var(--rule); }
.choice input { position: absolute; width: 1px; height: 1px; margin: 0; overflow: hidden; clip-path: inset(50%); }
.choice-label {
  display: grid;
  flex: 1;
  min-width: 43px;
  min-height: 44px;
  place-items: center;
  padding: 0 4px;
  color: var(--muted);
  font-size: 11px;
}
.basic-fields .choice-label { padding-inline: 2px; }
.choice:first-child .choice-label { border-radius: 7px 0 0 7px; }
.choice:last-child .choice-label { border-radius: 0 7px 7px 0; }
.choice:hover .choice-label, .choice:active .choice-label { background: var(--wash); }
.choice input:checked + .choice-label {
  background: #f9e9e3;
  color: #9d2718;
  font-weight: 800;
}
.choice input:checked + .neutral { background: #edeae7; color: var(--ink); }
.choice input:focus-visible + .choice-label { outline: 2px solid var(--accent); outline-offset: -3px; }
.actions {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px; margin-top: 4px; padding-top: 12px; border-top: 1px solid var(--rule);
}
.extra[open] { flex-basis: 100%; }
.back-to-filters { margin-top: 12px; }
.empty-result {
  margin-top: 18px;
  padding: 36px 20px;
  border: 1px dashed var(--control-rule);
  border-radius: 12px;
  background: var(--wash);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}
.stale-note {
  margin: 12px 0 6px;
  padding: 9px 12px;
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  background: #fff3f0;
  color: #8f2616;
  font-size: 12px;
  font-weight: 700;
}
.results.is-stale .candidates { opacity: .48; transition: opacity .15s ease; }
.extra summary { font-size: 12px; color: var(--muted); font-weight: 650; }
.extra .field { margin: 14px 0; }
.extra .choices { flex-wrap: wrap; gap: 4px; border: 0; }
.extra .choice { flex: 0 0 auto; border: 1px solid var(--rule); border-radius: 7px; }
.extra .choice-label { padding-inline: 9px; border-radius: 6px; }
.reading-query { display: block; font-size: 12px; }
.reading-query input { width: 100px; min-height: 36px; margin-left: 4px; padding-left: 6px; }
.primary {
  width: 100%; min-height: 46px; padding: 0 14px; border-color: var(--accent);
  background: var(--accent); color: var(--white); font-weight: 750; white-space: nowrap;
}
.primary:active { background: #a32917; }
.initial-generate { width: auto; min-width: 114px; margin-left: auto; font-size: 13px; }
.primary span { margin-right: 4px; font-family: system-ui, sans-serif; font-size: 20px; vertical-align: -2px; }

.result-heading { min-height: 49px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.result-summary { display: flex; align-items: center; gap: 18px; min-width: 0; }
.reading-toggle {
  display: inline-flex; align-items: center; gap: 6px; min-height: 38px;
  color: var(--muted); font-size: 11px; font-weight: 650; white-space: nowrap; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.switch-track {
  position: relative; flex: none; width: 29px; height: 17px; border: 1px solid #aaa09a;
  border-radius: 999px; background: #f2efec;
}
.switch-track::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 11px; height: 11px; border-radius: 50%; background: #746961;
}
.reading-toggle input:checked + .switch-track { border-color: #554d48; background: #554d48; }
.reading-toggle input:checked + .switch-track::after { transform: translateX(12px); background: var(--white); }
.reading-toggle:active .switch-track { filter: brightness(.90); }
.reading-toggle input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 3px; }
.result-heading h2 span { margin-left: 7px; color: var(--muted); font-size: 12px; font-weight: 650; vertical-align: 1px; white-space: nowrap; }
.outline {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 38px;
  padding: 0 11px; font-size: 12px; font-weight: 700; white-space: nowrap;
}
.candidates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 19px; padding: 0; margin: 0; list-style: none; }
.candidates li { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-width: 0; min-height: 50px; border-bottom: 1px solid var(--rule); }
.candidate-text { min-width: 0; padding: 4px 0 4px 2px; }
.candidate-ops { display: flex; flex: none; align-items: center; gap: 2px; }
.lock-btn, .keep-btn { display: inline-flex; align-items: center; justify-content: center; gap: 2px; min-width: 34px; height: 36px; padding: 0 5px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--muted); font-size: 10px; font-weight: 700; -webkit-tap-highlight-color: transparent; }
.lock-btn svg, .keep-btn svg { width: 15px; height: 15px; flex: none; }
.lock-btn:hover, .keep-btn:hover { background: var(--wash); color: var(--ink); }
.lock-btn[aria-pressed="true"] { border-color: #d4cbc4; background: #f9e9e3; color: #9d2718; }
.keep-btn[aria-pressed="true"] { color: var(--accent); }
.keep-btn[aria-pressed="true"] svg { fill: currentColor; }
.name { font-size: 15px; font-weight: 670; line-height: 1.3; overflow-wrap: anywhere; }
.reading { margin-top: 2px; color: var(--muted); font-size: 12px; line-height: 1.25; overflow-wrap: anywhere; }
.results[data-hide-readings] .reading { display: none; }
.copy { display: inline-grid; flex: none; place-items: center; width: 44px; height: 44px; border: 0; color: #4c4743; -webkit-tap-highlight-color: transparent; }
.copy:hover, .copy:active, .outline:hover { background: var(--wash); }
.copy-icon { position: relative; display: block; width: 16px; height: 16px; }
.copy-icon::before, .copy-icon::after {
  content: ""; position: absolute; width: 9px; height: 10px; box-sizing: border-box;
  border: 1.4px solid currentColor; border-radius: 2px; background: var(--white);
}
.copy-icon::before { top: 1px; left: 3px; }
.copy-icon::after { top: 4px; left: 6px; }
.result-note { margin-top: 19px; color: var(--muted); font-size: 12px; }

.related { display: flex; gap: 52px; margin-top: 54px; padding: 25px 0 35px; border-top: 1px solid var(--rule); }
.related h2 { font-size: 14px; }
.related ul { display: flex; flex-wrap: wrap; gap: 8px 14px; list-style: none; padding: 0; margin: 10px 0 0; font-size: 12px; color: var(--muted); }
.related a { text-decoration-color: #c5bab2; }
@media (max-width: 920px) {
  .nm-page { width: min(520px, calc(100% - 36px)); }
  .intro { padding: 26px 0 29px; }
  h1 { font-size: 29px; }
  .intro p { margin-top: 7px; font-size: 12px; }
  .workspace { display: block; }
  h2 { font-size: 16px; }
  .filters h2 { min-height: 0; padding-bottom: 9px; }
  .basic-fields { margin-top: 13px; }
  .field { margin-bottom: 12px; }
  .field legend { margin-bottom: 4px; }
  .actions { margin-top: 3px; }
  .results { margin-top: 32px; scroll-margin-top: 16px; }
  .result-heading { padding-bottom: 9px; flex-wrap: wrap; }
  .outline { min-height: 44px; }
  .candidates { grid-template-columns: minmax(0, 1fr); column-gap: 12px; }
  .candidates li { min-height: 48px; }
  .lock-btn, .keep-btn { min-width: 40px; height: 42px; }
  .name { font-size: 14px; }
  .result-note { margin-top: 16px; font-size: 11px; }
  .related { display: grid; gap: 25px; padding: 22px 0 31px; margin-top: 39px; }
  .related ul { gap: 7px 13px; }
}

.result-tools { display: flex; align-items: center; gap: 8px; }
.redraw { width: auto; min-height: 38px; padding-inline: 12px; font-size: 12px; }
.redraw span { margin-right: 2px; font-size: 17px; }
.bulk-copy { width: 125px; padding-inline: 6px; }
.copy-check, .bulk-done { display: none; }
.copy-check {
  width: 23px;
  height: 23px;
  border-radius: 50%;
  place-items: center;
}
.copy-check { background: #edf4ee; color: #2b6341; }
.copy-check::after {
  content: "";
  width: 10px;
  height: 6px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-1px) rotate(-45deg);
}
.bulk-copy .copy-check { width: 18px; height: 18px; }
[data-feedback] .copy-icon, [data-feedback] .bulk-label { display: none; }
[data-feedback="success"] .copy-check { display: grid; }
[data-feedback="success"] .bulk-done { display: inline; }
.bulk-copy[data-feedback="success"] { border-color: #c8ddcd; color: #2b6341; background: #f4f8f4; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.manual-copy {
  width: min(420px, calc(100% - 32px));
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 20px;
  color: var(--ink);
  background: var(--white);
}
.manual-copy::backdrop { background: rgb(35 31 28 / 35%); }
.manual-copy label { display: block; margin-block: 14px; }
.manual-copy textarea { width: 100%; display: block; margin-top: 6px; font: inherit; }
.skip-link { position: absolute; top: 8px; left: 8px; transform: translateY(-150%); }
.skip-link:focus { z-index: 10; transform: none; padding: 8px; background: var(--white); }
.primary:disabled { opacity: .55; cursor: default; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (max-width: 920px) {
  .result-summary { flex-direction: column; align-items: flex-start; gap: 0; }
  .reading-toggle { min-height: 44px; }
  .result-heading h2 { font-size: 15px; white-space: nowrap; }
  .result-heading h2 span { margin-left: 4px; font-size: 11px; }
  .result-tools { gap: 6px; }
  .redraw, .bulk-copy { min-height: 44px; }
  .redraw { padding-inline: 8px; }
  .bulk-copy { width: 120px; }
}
@media (max-width: 350px) {
  .nm-page { width: calc(100% - 24px); }
  .basic-fields { gap: 8px; }
  .result-tools { gap: 4px; }
  .redraw { padding-inline: 5px; font-size: 11px; }
  .bulk-copy { width: 106px; font-size: 11px; }
  .reading-toggle { gap: 4px; }
  .candidates li { position: relative; display: block; }
  .candidate-text { padding-block: 4px; }
  .name { padding-right: 44px; }
  .reading { font-size: 11px; padding-right: 2px; }
  .copy {
    position: absolute; top: 0; right: 0;
    align-items: start; padding: 5px 0 0;
    background: transparent;
  }
  .copy:hover, .copy:active { background: transparent; }
  .copy .copy-check { width: 18px; height: 18px; }
}

@media (max-width: 315px) {
  .basic-fields { display: block; }
  .result-heading { flex-wrap: wrap; }
  .result-summary { width: 100%; flex-direction: row; justify-content: space-between; }
  .result-tools { margin-left: auto; }
}

.intro { padding-bottom: 52px; }
.related { margin-top: 64px; }

.basic-settings .initial-generate {
  display: block;
  margin-left: 0;
  margin-right: auto;
  min-width: 138px;
}

.option-settings {
  margin-top: 44px;
  border-top: 1px solid var(--rule);
  padding-top: 18px;
}

.filters .option-settings h2 {
  display: block;
  min-height: 0;
  margin-bottom: 12px;
  padding-bottom: 0;
  border-bottom: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
}

.option-rows { display: grid; gap: 7px; }
.option-row {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  align-items: center;
  column-gap: 8px;
}
.option-label { color: var(--muted); font-size: 11px; font-weight: 650; }
.option-row .choices { border-radius: 7px; }
.option-row .choice-label { min-width: 34px; min-height: 36px; padding-inline: 3px; }
.option-row .choice:first-child .choice-label { border-radius: 6px 0 0 6px; }
.option-row .choice:last-child .choice-label { border-radius: 0 6px 6px 0; }
.option-settings .actions { margin-top: 12px; }
#name-filters[data-country="western"] .era-row {
  grid-template-columns: minmax(0, 1fr);
  row-gap: 4px;
}
#name-filters[data-country="western"] .era-row .choice-label {
  min-height: 44px;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 920px) {
  .intro { padding-bottom: 39px; }
  .basic-settings .initial-generate { width: 100%; }
  .option-settings { margin-top: 40px; }
  .results { margin-top: 44px; }
  .related { gap: 32px; margin-top: 52px; }
  .option-row .choice-label { min-width: 44px; min-height: 44px; }
}

@media (max-width: 350px) {
  .option-row { grid-template-columns: minmax(0, 1fr); row-gap: 4px; }
}

/* サイト共通CSSの同名クラスとの競合回避（共通側の .intro は flex、.filters は flex、.filters button は白背景ピル、.copy は余白付き注記として定義されている） */
.nm-page .intro { display: block; }
.nm-page .filters { display: block; }
.nm-page .filters .primary {
  background: var(--accent);
  color: var(--white);
  border: 1px solid var(--accent);
  border-radius: 7px;
}
.nm-page .filters .primary:active { background: #a32917; }
.nm-page .candidates .copy { margin-top: 0; padding-top: 0; border-top: 0; }

/* 改名・SEO本文（2026-11-22） */
.nm-about { max-width: 760px; margin-top: 54px; padding-top: 28px; border-top: 1px solid var(--rule); }
.nm-about h2 { font-size: 17px; margin-bottom: 12px; }
.nm-about h3 { font-size: 14px; margin: 26px 0 8px; }
.nm-about p, .nm-about li, .nm-about dd { color: var(--muted); font-size: 13px; line-height: 1.9; }
.nm-about ul { padding-left: 1.2em; margin: 0; }
.nm-about dl { margin: 0; }
.nm-about dt { font-size: 13px; font-weight: 700; margin-top: 12px; }
.nm-about dd { margin: 2px 0 0; }

/* 作成タイプ切替・米国注記・ロック・キープ */
.mode-field { margin-top: 14px; }
.mode-choices .choice-label { display: inline-flex; align-items: center; justify-content: center; gap: 5px; font-size: 12px; }
.mode-choices svg { width: 15px; height: 15px; flex: none; }
.western-note { margin: -4px 0 12px; font-size: 11px; color: var(--muted); }
.redraw { display: inline-flex; align-items: center; gap: 5px; width: auto; min-height: 38px; padding-inline: 12px; font-size: 12px; }
.redraw svg, .share-btn svg { width: 15px; height: 15px; flex: none; }
.lock-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; padding: 8px 10px; border-radius: 8px; background: #faf5f0; font-size: 12px; font-weight: 700; }
.lock-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid #d4cbc4; border-radius: 999px; background: #fff; color: #9d2718; font-size: 12px; }
.lock-pill button { border: 0; background: transparent; padding: 0 2px; font-weight: 900; color: var(--muted); }
.mood-note { margin: 10px 0 0; font-size: 12px; color: var(--muted); }
.keep-panel { margin-top: 22px; padding: 14px 16px; border: 1px solid var(--rule); border-radius: 12px; background: var(--wash); }
.keep-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-bottom: 10px; }
.keep-head h3 { margin: 0; font-size: 14px; font-weight: 800; }
.keep-head h3 span { color: var(--muted); font-size: 12px; font-weight: 700; }
.keep-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.keep-actions a.outline { text-decoration: none; }
.keep-list { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0; }
.keep-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--control-rule); border-radius: 999px; background: #fff; font-size: 13px; font-weight: 700; }
.keep-chip button { border: 0; background: transparent; padding: 0 2px; color: var(--muted); font-size: 14px; line-height: 1; }
