:root {
  --ink: #0a0e10;
  --panel: #111719;
  --panel-2: #151d1f;
  --panel-3: #1b2426;
  --line: rgba(229, 236, 223, 0.14);
  --line-strong: rgba(229, 236, 223, 0.28);
  --paper: #e5ecdf;
  --muted: #8e9a91;
  --acid: #c8f05a;
  --acid-soft: rgba(200, 240, 90, 0.12);
  --annex: #5ad9f0;
  --amber: #f2a950;
  --danger: #ff846e;
  --green: #77d689;
  --yellowgreen: #bcd66a;
  --yellow: #e5bd5c;
  --gray: #89928c;
  --radius: 4px;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.3);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--paper);
  background:
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px),
    var(--ink);
  background-size: 32px 32px;
  font-family: "Yu Gothic UI", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  line-height: 1.65;
  overflow-x: hidden;
}

button, input, textarea, select { font: inherit; }
button, summary, select { cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible, a:focus-visible {
  outline: 2px solid var(--acid);
  outline-offset: 3px;
}
a { color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.ambient { position: fixed; pointer-events: none; z-index: -1; filter: blur(80px); opacity: .16; border-radius: 50%; }
.ambient-one { width: 560px; height: 560px; top: -260px; right: -140px; background: var(--acid); }
.ambient-two { width: 480px; height: 480px; bottom: 2vh; left: -340px; background: #487e71; }

.site-header {
  width: min(1440px, calc(100% - 48px));
  margin: 0 auto;
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 13px; text-decoration: none; }
.brand b { display: block; font-family: "Yu Mincho", "Hiragino Mincho ProN", serif; letter-spacing: .12em; font-size: 16px; }
.brand small { display: block; color: var(--muted); font: 9px/1.4 Consolas, monospace; letter-spacing: .17em; margin-top: 2px; }
.brand-mark { width: 34px; height: 34px; display: flex; gap: 3px; align-items: center; justify-content: center; border: 1px solid var(--line-strong); transform: rotate(45deg); }
.brand-mark i { width: 2px; background: var(--acid); animation: meter 1.8s ease-in-out infinite alternate; }
.brand-mark i:nth-child(1) { height: 8px; }
.brand-mark i:nth-child(2) { height: 18px; animation-delay: -.5s; }
.brand-mark i:nth-child(3) { height: 25px; animation-delay: -.9s; }
.brand-mark i:nth-child(4) { height: 12px; animation-delay: -.2s; }
@keyframes meter { to { transform: scaleY(.48); opacity: .55; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .brand-mark i { animation: none; } }

.header-actions { display: flex; align-items: center; gap: 18px; }
.save-indicator { color: var(--muted); font: 11px Consolas, monospace; letter-spacing: .06em; }
.save-indicator i { display: inline-block; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px var(--green); }
.save-indicator.saving i { background: var(--amber); box-shadow: 0 0 12px var(--amber); }
.button { border: 0; color: inherit; transition: .2s ease; }
.button-quiet { padding: 9px 12px; background: transparent; border: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.button-quiet:hover { color: var(--paper); border-color: var(--line-strong); }
a.button-quiet { display: inline-block; text-decoration: none; }

main { width: min(1180px, calc(100% - 48px)); margin: 0 auto; }
.hero { min-height: 490px; display: grid; grid-template-columns: 1.4fr .6fr; align-items: end; gap: 8vw; padding: 100px 0 74px; }
.eyebrow, .section-kicker { margin: 0 0 22px; color: var(--acid); font: 10px Consolas, monospace; letter-spacing: .22em; }
.hero h1 { margin: 0; font-family: "Yu Mincho", "Hiragino Mincho ProN", serif; font-size: clamp(42px, 6.4vw, 82px); font-weight: 500; line-height: 1.18; letter-spacing: .02em; word-break: keep-all; }
.hero h1 em { color: var(--acid); font-style: normal; }
.hero-copy { max-width: 390px; margin: 0 0 10px; padding-top: 22px; border-top: 1px solid var(--line-strong); color: #b4beb5; font-family: "Yu Mincho", "Hiragino Mincho ProN", serif; font-size: 14px; }

.step-rail { position: sticky; top: 0; z-index: 20; display: grid; grid-template-columns: repeat(5, 1fr); background: rgba(10,14,16,.92); backdrop-filter: blur(16px); border: 1px solid var(--line); box-shadow: var(--shadow); }
.step-rail a { display: flex; gap: 12px; align-items: center; padding: 15px 18px; text-decoration: none; color: var(--muted); font-size: 12px; border-right: 1px solid var(--line); transition: .2s ease; }
.step-rail a:last-child { border-right: 0; }
.step-rail a:hover { color: var(--paper); background: var(--acid-soft); }
.step-rail span { color: var(--acid); font: 10px Consolas, monospace; }

.status-message { position: sticky; top: 58px; z-index: 19; margin: 14px 0 -50px auto; width: fit-content; max-width: 100%; padding: 11px 15px; color: var(--ink); background: var(--acid); box-shadow: var(--shadow); font-size: 13px; }
.status-message.error { color: #fff; background: #a9473d; }

.work-section { scroll-margin-top: 70px; padding: 118px 0 24px; }
.section-heading { display: grid; grid-template-columns: 66px 1fr minmax(220px, 340px); align-items: start; gap: 22px; margin-bottom: 48px; }
.step-number { width: 50px; height: 50px; display: grid; place-items: center; color: var(--acid); border: 1px solid var(--line-strong); font: 12px Consolas, monospace; }
.section-heading h2 { margin: 0; font-family: "Yu Mincho", "Hiragino Mincho ProN", serif; font-size: clamp(28px, 4vw, 42px); font-weight: 500; line-height: 1.3; }
.section-heading .section-kicker { margin: 0 0 7px; }
.section-heading > p { margin: 9px 0 0; color: var(--muted); font-size: 12px; border-left: 1px solid var(--line-strong); padding-left: 18px; }

.input-grid { display: grid; grid-template-columns: 1.45fr .75fr; gap: 16px; }
.field { display: flex; flex-direction: column; min-width: 0; padding: 20px; background: var(--panel); border: 1px solid var(--line); }
.field-label { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.field-label b { font-family: "Yu Mincho", "Hiragino Mincho ProN", serif; letter-spacing: .08em; }
.field-label small, .field-help { color: var(--muted); font-size: 10px; }
.field-help { margin-top: 12px; }
textarea, input[type="search"], select {
  width: 100%; color: var(--paper); background: #0c1113; border: 1px solid var(--line); border-radius: 0;
}
textarea { display: block; min-height: 160px; resize: vertical; padding: 16px; line-height: 1.8; }
.field-large textarea { min-height: 380px; font-family: "Yu Mincho", "Hiragino Mincho ProN", serif; font-size: 15px; }
textarea::placeholder, input::placeholder { color: #56605a; }
textarea:focus, input:focus, select:focus { border-color: rgba(200,240,90,.7); outline: none; box-shadow: 0 0 0 1px rgba(200,240,90,.2); }
.primary-action-wrap { display: flex; align-items: center; justify-content: flex-end; gap: 18px; margin-top: 18px; }
.primary-action-wrap p { margin: 0; color: var(--muted); font-size: 10px; }
.button-primary { min-width: 280px; display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; background: var(--acid); color: var(--ink); font-weight: 700; }
.button-primary:hover { background: #dcff7e; transform: translateY(-2px); box-shadow: 0 12px 30px rgba(200,240,90,.14); }

.candidate-block { margin-bottom: 18px; padding: 28px; background: var(--panel); border: 1px solid var(--line); }
.candidate-title-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 22px; }
.candidate-title-row > div:first-child { display: flex; align-items: center; gap: 12px; }
.candidate-title-row h3 { margin: 0; font-family: "Yu Mincho", "Hiragino Mincho ProN", serif; font-size: 22px; font-weight: 500; }
.saved-prompt-list { margin-top: 18px; }
.saved-prompt-name { min-width: 0; overflow-wrap: anywhere; }
.saved-prompt-time { flex: 0 0 auto; }
.saved-prompt-preview { margin: 0 0 14px; color: var(--muted); font-size: 11px; line-height: 1.6; overflow-wrap: anywhere; }
.saved-prompt-actions { gap: 6px; }
.block-index { display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid var(--line-strong); color: var(--acid); font: 10px Consolas, monospace; }
.selection-count { color: var(--muted); font: 10px Consolas, monospace; }
.empty-state { padding: 22px; color: var(--muted); border: 1px dashed var(--line-strong); font-size: 12px; text-align: center; }
.empty-state[hidden] { display: none; }
.empty-large { padding: 60px 20px; }
.chip-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-cloud:empty { display: none; }
.chip {
  position: relative; display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 8px 11px;
  color: #bdc6be; background: var(--panel-3); border: 1px solid var(--line); text-align: left; font-size: 12px; transition: .16s ease;
}
button.chip:hover { color: var(--paper); border-color: var(--line-strong); transform: translateY(-1px); }
.chip.selected { color: var(--ink); background: var(--acid); border-color: var(--acid); }
.chip.selected.stock { color: var(--paper); background: #315d58; border-color: #4e8c81; }
.chip small { max-width: 24ch; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.chip.selected small { color: rgba(10,14,16,.64); }
/* 別館 (suno/) にも収録があるジャンルの印。選択中(.selected)でも消えないよう、
   border ではなく外周の box-shadow で描く。別館のアクセント色と同じ青。 */
.chip.in-annex { box-shadow: 0 0 0 1px var(--annex); }
.result-row.in-annex { box-shadow: 0 0 0 1px var(--annex); }
.result-row.selected.in-annex { box-shadow: inset 3px 0 0 var(--acid), 0 0 0 1px var(--annex); }
.annex-legend { display: flex; align-items: center; gap: 8px; margin: -12px 0 18px; color: var(--muted); font-size: 10px; }
.annex-legend i { flex: none; width: 20px; height: 12px; border: 1px solid var(--annex); }
.annex-legend a { color: var(--annex); }
.chip-reason { width: 14px; height: 14px; display: inline-grid; place-items: center; border: 1px solid currentColor; border-radius: 50%; font: 8px Consolas, monospace; opacity: .55; }
.chip-cloud-small .chip { min-height: 30px; padding: 5px 8px; font-size: 11px; }
.remove-x { font-size: 13px; opacity: .65; }
.instrument-selection { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; max-width: 100%; }
.instrument-model-toggle { display: flex; align-items: center; gap: 6px; margin-left: 8px; color: var(--muted); font-size: 9px; cursor: pointer; }
.instrument-model-toggle input { width: 13px; height: 13px; margin: 0; accent-color: var(--acid); }
.instrument-model-picker { width: min(100%, 320px); min-width: 0; height: 32px; padding: 0 8px; color: var(--paper); background: #0c1113; border: 1px solid var(--line); font-size: 10px; }
.instrument-reference { max-width: 100%; padding: 0 8px; color: var(--muted); font-size: 9px; line-height: 1.45; overflow-wrap: anywhere; }

.stability { display: inline-flex; align-items: center; gap: 4px; padding: 2px 5px; color: var(--paper); background: rgba(137,146,140,.2); border: 1px solid rgba(137,146,140,.35); font-size: 8px; white-space: nowrap; }
.stability::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--gray); }
.stability.stable { background: rgba(119,214,137,.14); border-color: rgba(119,214,137,.42); }
.stability.stable::before { background: var(--green); }
.stability.mostly { background: rgba(188,214,106,.14); border-color: rgba(188,214,106,.42); }
.stability.mostly::before { background: var(--yellowgreen); }
.stability.unstable { background: rgba(229,189,92,.14); border-color: rgba(229,189,92,.42); }
.stability.unstable::before { background: var(--yellow); }
.stability.custom { background: rgba(242,169,80,.14); border-color: rgba(242,169,80,.45); }
.stability.custom::before { background: var(--amber); }
.chip.selected .stability { color: var(--ink); border-color: rgba(10,14,16,.25); }

.search-drawer { margin-top: 22px; border-top: 1px solid var(--line); }
.search-drawer summary { padding: 18px 0 10px; color: #b7c0b8; font-size: 12px; }
.search-drawer summary span { color: var(--muted); margin-left: 8px; font-size: 9px; }
.search-controls { display: grid; grid-template-columns: 1fr 230px; gap: 8px; }
.search-field input, select { height: 42px; padding: 0 12px; }
select { appearance: auto; }
.standalone-search { display: block; margin-top: 22px; }
.picker-label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 10px; }
.search-results { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; margin-top: 8px; max-height: 310px; overflow-y: auto; }
.search-results:empty { display: none; }
.result-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; padding: 9px 10px; color: #b9c2ba; background: #0d1315; border: 1px solid var(--line); font-size: 11px; text-align: left; }
button.result-row:hover { border-color: var(--line-strong); color: var(--paper); }
.result-row.selected { border-color: var(--acid); box-shadow: inset 3px 0 0 var(--acid); }
.result-row > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-row small { display: block; color: var(--muted); font-size: 8px; overflow: hidden; text-overflow: ellipsis; }
.selected-shelf { min-height: 58px; display: grid; grid-template-columns: 105px 1fr; align-items: start; gap: 12px; margin-top: 16px; padding: 13px; background: rgba(0,0,0,.16); border-left: 2px solid var(--acid); }
.selected-shelf > span { padding-top: 5px; color: var(--muted); font-size: 10px; }
.dual-shelf { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.instrument-picker-group { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; margin-top: 22px; }
.instrument-picker-group .standalone-search { margin-top: 0; }
.micro-note { margin: -12px 0 18px; color: var(--muted); font-size: 10px; }
.scope-switch { display: flex; align-items: center; padding: 3px; background: #0c1113; border: 1px solid var(--line); }
.scope-switch > span { padding: 0 9px; color: var(--muted); font-size: 9px; }
.scope-switch select { width: auto; min-width: 180px; height: 32px; padding: 0 8px; color: var(--paper); background: transparent; border: 0; font-size: 10px; }
.custom-tag-entry { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 8px; margin-top: 12px; }
.custom-tag-field { display: block; min-width: 0; }
.custom-tag-field > span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 10px; }
.custom-tag-field input { width: 100%; height: 42px; padding: 0 12px; color: var(--paper); background: #0c1113; border: 1px solid var(--line); border-radius: 0; }
.custom-tag-entry .button-quiet { height: 42px; color: var(--acid); }

.subsection-label { display: flex; align-items: baseline; justify-content: space-between; margin: 34px 0 12px; color: var(--acid); font: 10px Consolas, monospace; letter-spacing: .15em; }
.subsection-label small { color: var(--muted); font: 10px "Yu Gothic UI", sans-serif; letter-spacing: 0; }
.template-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.template-option { position: relative; display: block; min-height: 84px; padding: 18px 18px 15px 48px; background: var(--panel); border: 1px solid var(--line); cursor: pointer; transition: .16s ease; }
.template-option:hover { border-color: var(--line-strong); }
.template-option.selected { border-color: var(--acid); background: var(--acid-soft); }
.template-option input { position: absolute; left: 18px; top: 22px; accent-color: var(--acid); }
.template-option b { display: block; margin-bottom: 6px; color: var(--paper); font: 11px Consolas, monospace; letter-spacing: .04em; }
.template-option small { color: var(--muted); font-size: 9px; }

.section-map { display: grid; gap: 8px; }
.section-card { display: grid; grid-template-columns: 56px minmax(180px, .75fr) minmax(300px, 1.5fr); min-height: 146px; background: var(--panel); border: 1px solid var(--line); }
.section-card-index { display: grid; place-items: center; color: var(--acid); border-right: 1px solid var(--line); font: 11px Consolas, monospace; writing-mode: vertical-rl; letter-spacing: .15em; }
.section-preview { padding: 18px; border-right: 1px solid var(--line); min-width: 0; }
.section-preview label, .section-tags > span { display: block; margin-bottom: 9px; color: var(--muted); font-size: 9px; letter-spacing: .05em; }
.section-preview select { height: 38px; }
.lyrics-preview { max-height: 76px; margin: 10px 0 0; overflow: hidden; color: #aeb8b0; font-family: "Yu Mincho", serif; font-size: 11px; white-space: pre-wrap; }
.section-tags { padding: 18px; min-width: 0; }
.stock-empty { color: #667069; font-size: 10px; }
.section-tag-chip { min-height: 32px; padding: 5px 8px; }

.preset-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; padding: 0 20px 20px; background: var(--panel); border: 1px solid var(--line); }
.preset-buttons { display: flex; flex-wrap: wrap; gap: 6px; max-height: 210px; overflow-y: auto; }
.preset-button { padding: 7px 9px; color: #aeb8b0; background: #0c1113; border: 1px solid var(--line); font-size: 9px; text-align: left; }
.preset-button:hover { border-color: var(--line-strong); color: var(--paper); }
.preset-button.selected { color: var(--ink); background: var(--acid); border-color: var(--acid); }
.output-grid { display: grid; grid-template-columns: .75fr 1.25fr; gap: 16px; }
.output-card { min-width: 0; padding: 20px; background: #dfe7da; color: var(--ink); box-shadow: var(--shadow); }
.output-card header { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.output-card header span { color: #647066; font: 9px Consolas, monospace; letter-spacing: .12em; }
.output-card h3 { margin: 3px 0 0; font-family: "Yu Mincho", serif; font-size: 18px; font-weight: 600; }
.output-card textarea { min-height: 240px; color: #17201a; background: #f2f5ef; border-color: rgba(10,14,16,.16); font-family: Consolas, "Yu Gothic UI", monospace; font-size: 12px; }
.output-card:last-child textarea { min-height: 360px; font-family: "Yu Mincho", serif; }
.copy-button { padding: 8px 12px; color: #e9efe5; background: #19221c; border: 0; font-size: 10px; }
.copy-button.copied { color: var(--ink); background: var(--acid); }
.output-card footer { display: flex; justify-content: space-between; margin-top: 10px; color: #667168; font-size: 9px; }
.output-card footer strong { color: #202a23; font: 10px Consolas, monospace; }

.toolkit-local-note { margin: -22px 0 18px; color: var(--muted); font-size: 10px; text-align: right; }
.toolkit-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.toolkit-card { min-width: 0; padding: 28px; background: var(--panel); border: 1px solid var(--line); }
.toolkit-card-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.toolkit-card-header > div { display: flex; align-items: center; gap: 12px; min-width: 0; }
.toolkit-card-header > div > div > span { color: var(--acid); font: 9px Consolas, monospace; letter-spacing: .12em; }
.toolkit-card-header h3 { margin: 3px 0 0; font-family: "Yu Mincho", "Hiragino Mincho ProN", serif; font-size: 20px; font-weight: 500; }
.toolkit-button { flex: 0 0 auto; min-width: 0; padding: 13px 15px; font-size: 11px; }
.toolkit-button:disabled { cursor: wait; opacity: .64; transform: none; box-shadow: none; }
.toolkit-description { min-height: 3.5em; margin: 0 0 14px; color: #aeb8b0; font-size: 11px; line-height: 1.75; }
.tool-status { min-height: 34px; margin: 0 0 14px; padding: 8px 10px; color: var(--acid); background: var(--acid-soft); border-left: 2px solid var(--acid); font-size: 10px; }
.tool-status[hidden] { display: none; }
.tool-status.error { color: #f0b2aa; background: rgba(169,71,61,.12); border-left-color: #a9473d; }
.output-card.toolkit-output { margin-top: 0; padding: 16px; box-shadow: none; }
.output-card.toolkit-output textarea { min-height: 260px; }

.site-footer { width: min(1440px, calc(100% - 48px)); margin: 120px auto 0; padding: 30px 0 44px; display: flex; justify-content: space-between; align-items: center; gap: 20px; color: var(--muted); border-top: 1px solid var(--line); font-size: 10px; }
.site-footer > span { color: var(--paper); font-family: "Yu Mincho", serif; letter-spacing: .14em; }
.site-footer p { margin: 0; }
.site-footer a { text-decoration: none; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; min-height: 430px; gap: 40px; padding-top: 80px; }
  .hero-copy { margin-left: auto; }
  .section-heading { grid-template-columns: 52px 1fr; }
  .section-heading > p { grid-column: 2; margin-top: 0; }
  .input-grid, .output-grid, .toolkit-grid { grid-template-columns: 1fr; }
  .search-results { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .section-card { grid-template-columns: 48px minmax(180px,.65fr) 1fr; }
}

@media (max-width: 680px) {
  .site-header, main, .site-footer { width: min(100% - 28px, 1180px); }
  .save-indicator { display: none; }
  .brand small { display: none; }
  .hero { min-height: 380px; padding: 64px 0 50px; }
  .hero h1 { font-size: clamp(26px, 8.4vw, 46px); }
  .step-rail { grid-template-columns: repeat(5, 1fr); }
  .step-rail a { justify-content: center; padding: 13px 5px; font-size: 0; }
  .step-rail span { font-size: 10px; }
  .work-section { padding-top: 90px; }
  .section-heading { margin-bottom: 32px; }
  .section-heading > p { grid-column: 1 / -1; border-left: 0; padding-left: 0; }
  .candidate-block { padding: 18px; }
  .candidate-title-row { align-items: flex-start; }
  .tag-heading-row { display: block; }
  .tag-heading-row .scope-switch { margin-top: 16px; width: fit-content; max-width: 100%; }
  .scope-switch select { min-width: 0; max-width: calc(100vw - 120px); }
  .search-controls, .dual-shelf, .template-grid, .preset-panel { grid-template-columns: 1fr; }
  .instrument-picker-group { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .instrument-picker-group .picker-label { font-size: 9px; line-height: 1.3; }
  .search-results { grid-template-columns: 1fr; }
  .selected-shelf { grid-template-columns: 1fr; }
  .section-card { grid-template-columns: 38px 1fr; }
  .section-card-index { grid-row: 1 / 3; }
  .section-preview { border-right: 0; border-bottom: 1px solid var(--line); }
  .section-tags { grid-column: 2; }
  .primary-action-wrap { display: block; }
  .button-primary { width: 100%; min-width: 0; }
  .primary-action-wrap p { margin-top: 8px; text-align: center; }
  .toolkit-local-note { margin-top: -12px; text-align: left; }
  .toolkit-card { padding: 18px; }
  .toolkit-card-header { align-items: stretch; flex-direction: column; }
  .toolkit-button { width: 100%; }
  .toolkit-description { min-height: 0; }
  .site-footer { align-items: flex-start; flex-direction: column; }
}

/* =====================================================================
   統合版で追加した部品。本館の既存クラスはそのまま使い、別館由来の
   コンポーネント（系譜パネル・構造プロファイル・Suno出力）だけを足す。
   ===================================================================== */

/* 検索行に「シーン」を足したので3列にする */
.genre-search-controls { grid-template-columns: 1fr minmax(0, 190px) minmax(0, 190px); }

/* result-row は div になり、中に選択ボタンと系譜ボタンを並べる */
.result-row { padding: 0; overflow: hidden; }
.result-main {
  flex: 1; min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 9px 10px; color: inherit; background: transparent; border: 0; font: inherit; text-align: left;
}
.result-main > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-main small { display: block; color: var(--muted); font-size: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lineage-open {
  flex: none; align-self: stretch; padding: 0 9px; color: var(--annex); background: transparent;
  border: 0; border-left: 1px solid var(--line); font-size: 10px; letter-spacing: .04em; transition: .16s ease;
}
.lineage-open:hover { color: var(--ink); background: var(--annex); }
.lineage-open.is-open { color: var(--ink); background: var(--annex); font-weight: 700; }

/* 別館収録のチップは、選択ボタンと系譜ボタンを包んで並べる */
.chip-wrap { display: inline-flex; align-items: stretch; }
.chip-wrap .chip { box-shadow: 0 0 0 1px var(--annex); }
.chip-wrap .lineage-open { border: 1px solid var(--annex); border-left: 0; margin-left: 1px; }

/* ------------------------------------------------------------ 系譜パネル */
.genre-detail { margin: 18px 0; padding: 18px; background: var(--panel); border: 1px solid var(--annex); }
.detail-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 14px; }
.detail-head h3 { margin: 0; font-family: "Yu Mincho", "Hiragino Mincho ProN", serif; font-size: 20px; font-weight: 500; }
.detail-head .scene-tag { padding: 3px 9px; border: 1px solid var(--line-strong); color: var(--annex); font: 10px Consolas, monospace; letter-spacing: .1em; }
.detail-head .detail-years { color: var(--muted); font: 11px Consolas, monospace; }
.detail-head .button-quiet { margin-left: auto; }
.detail-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.detail-cols h4 { margin: 0 0 8px; color: var(--annex); font: 10px Consolas, monospace; letter-spacing: .18em; font-weight: 400; }
.detail-cols p { margin: 0 0 14px; color: #c2d2dc; font-size: 12px; line-height: 1.8; }
.lineage-row { margin-bottom: 12px; }
.lineage-none { color: var(--muted); font-size: 11px; }
.track-list { margin: 0; padding: 0; list-style: none; }
.track-list li { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 10px; padding: 4px 0; border-bottom: 1px solid rgba(229,236,223,.06); font-size: 11px; }
.track-list li:last-child { border-bottom: 0; }
.track-list li > span { min-width: 0; overflow-wrap: anywhere; }
.track-list .track-year { color: var(--annex); font: 10px Consolas, monospace; }
.track-list .track-artist { color: var(--muted); }

/* ------------------------------------------------------- 別館由来のチップ */
.chip-palette { display: flex; flex-wrap: wrap; gap: 6px; }
.annex-chip {
  display: inline-flex; align-items: center; gap: 7px; max-width: 100%; padding: 5px 10px;
  color: var(--muted); background: transparent; border: 1px solid var(--line);
  font-size: 11px; line-height: 1.5; text-align: left; overflow-wrap: anywhere; transition: .16s ease;
}
.annex-chip:hover { color: var(--paper); border-color: var(--line-strong); }
.annex-chip.is-on { color: var(--ink); background: var(--annex); border-color: var(--annex); font-weight: 600; }
.annex-chip.is-listed { color: var(--paper); border-color: var(--line-strong); }
.chip-remove { opacity: .65; }
.chip-empty { color: var(--muted); font-size: 11px; }
.palette-stack { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 8px 0; }
.spec-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 8px 0; }
.check-row { display: flex; align-items: center; gap: 10px; font-size: 12px; cursor: pointer; }
.check-row input { width: 16px; height: 16px; accent-color: var(--annex); }
.result-count { margin: 8px 0 0; color: var(--muted); font: 10px Consolas, monospace; letter-spacing: .08em; }

/* ------------------------------------------------ 構造プロファイルとタグ列 */
.profile-info { color: #c2d2dc; font-size: 12px; line-height: 1.8; }
.profile-info em { color: var(--annex); font-style: normal; }
.profile-info ul { margin: 8px 0 0; padding-left: 18px; color: var(--muted); }
.tag-chain { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 5px; }
.tag-chain li { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 6px 9px; background: var(--panel-3); border: 1px solid var(--line); }
.tag-chain .chain-index { color: var(--annex); font: 10px Consolas, monospace; }
.tag-chain .chain-text { font-family: Consolas, monospace; font-size: 11px; overflow-wrap: anywhere; }
.tag-chain .chain-buttons { display: flex; gap: 4px; }
.tag-chain .chain-buttons button { width: 22px; height: 22px; padding: 0; display: grid; place-items: center; color: var(--muted); background: transparent; border: 1px solid var(--line); font-size: 10px; }
.tag-chain .chain-buttons button:hover:not(:disabled) { color: var(--paper); border-color: var(--line-strong); }
.tag-chain .chain-buttons button:disabled { opacity: .3; cursor: default; }
.tag-chain-empty { color: var(--muted); font-size: 11px; }
.inline-add { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.inline-add input { flex: 1; min-width: 160px; padding: 9px 10px; color: var(--paper); background: #0c1113; border: 1px solid var(--line); }
.palette-group { margin-bottom: 14px; }
.palette-group:last-child { margin-bottom: 0; }
.palette-group h4 { margin: 0 0 7px; color: var(--muted); font: 10px Consolas, monospace; letter-spacing: .14em; font-weight: 400; }

/* -------------------------------------------------------- Suno 3点の出力 */
.output-block { margin-bottom: 10px; padding: 16px; background: var(--panel); border: 1px solid var(--line); }
.output-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.output-head h3 { margin: 0; font-family: "Yu Mincho", "Hiragino Mincho ProN", serif; font-size: 15px; font-weight: 500; letter-spacing: .08em; }
.output-actions { display: flex; align-items: center; gap: 10px; }
.char-meter { color: var(--muted); font: 10px Consolas, monospace; letter-spacing: .05em; }
.char-meter.zone-short, .char-meter.zone-long { color: var(--amber); }
.char-meter.zone-good { color: var(--green); }
.char-meter.zone-over { color: var(--danger); }
.zone-bar { position: relative; height: 3px; margin-top: 9px; background: rgba(229,236,223,.08); overflow: hidden; }
.zone-bar i { display: block; height: 100%; width: 0; background: var(--annex); transition: width .2s ease; }
.zone-bar.zone-over i { background: var(--danger); }
.output-block textarea { width: 100%; padding: 11px 12px; color: #c9dde8; background: #0c141a; border: 1px solid var(--line); font: 12px/1.75 Consolas, monospace; resize: vertical; }
.field-help { margin: 10px 0 0; color: var(--muted); font-size: 10px; line-height: 1.7; }

.fold { margin-top: 14px; border: 1px solid var(--line); background: var(--panel); }
.fold summary { padding: 12px 16px; color: var(--muted); font-size: 11px; cursor: pointer; }
.fold summary:hover { color: var(--paper); }
.fold-body { padding: 0 16px 16px; }
.fold-body textarea { width: 100%; padding: 11px 12px; color: #c9dde8; background: #0c141a; border: 1px solid var(--line); font: 11px/1.7 Consolas, monospace; resize: vertical; }
.fold-body .output-actions { justify-content: flex-end; margin-top: 8px; }
.rules-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.rule-card { padding: 13px 15px; background: var(--panel-2); border: 1px solid var(--line); }
.rule-card h4 { margin: 0 0 6px; color: var(--annex); font: 10px Consolas, monospace; letter-spacing: .16em; font-weight: 400; }
.rule-card p { margin: 0; color: #c2d2dc; font-size: 11px; line-height: 1.8; }

.brand b em { color: var(--annex); font-style: normal; font-size: 11px; letter-spacing: 0; }

/* 統合版はステップが6つ。5列のままだと折り返す */
.step-rail { grid-template-columns: repeat(6, 1fr); }
.step-rail a { gap: 9px; padding: 15px 12px; font-size: 11px; }

/* 説明文が本館より長い。1fr は min-content に負けるので minmax(0,…) で抑え、
   見出しも一段小さくして右段が細長く潰れないようにする。 */
.hero { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 4vw; }
.hero h1 { font-size: clamp(32px, 4.6vw, 60px); }
.hero-copy { max-width: 460px; }

@media (max-width: 860px) {
  .detail-cols, .rules-grid, .palette-stack, .spec-grid, .genre-search-controls { grid-template-columns: 1fr; }
}
