/* 配点メーカー：見た目。明るい配色だけ（暗い配色には切り替えない）。 */
:root {
  color-scheme: light;
  --bg: #f3f4ef;
  --surface: #ffffff;
  --surface-2: #f7f8f4;
  --line: #e3e6df;
  --line-strong: #cfd4cb;
  --text: #1c241f;
  --muted: #646d67;
  --faint: #98a09a;
  --accent: #1f6b4f;
  --accent-hover: #185a42;
  --accent-ink: #ffffff;
  --accent-soft: #e6efe9;
  --accent-ring: rgba(31, 107, 79, .22);
  --track: #e2e5de;
  --danger: #b8402f;
  --danger-soft: #fbece8;
  --warn: #8a5d00;
  --warn-soft: #fff4d6;
  --on-accent-warn: #ffd27a;
  --radius: 18px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(28, 36, 31, .04), 0 6px 20px rgba(28, 36, 31, .04);
  --font: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --page-pad: 32px;
  --card-pad: 28px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-bottom: 150px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.7 var(--font); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.mono { font-family: var(--mono); }
svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---- 上の帯 ---- */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1200px; margin: 0 auto; padding: 12px var(--page-pad); display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; }
.logo { width: 34px; height: 34px; border-radius: 9px; background: var(--accent); color: #fff; display: grid; place-items: center; flex: none; }
.logo svg { width: 20px; height: 20px; }
.logo circle { fill: var(--accent); }
.brand-name { font-weight: 700; font-size: 17px; letter-spacing: .02em; }
.badge { font-size: 10px; font-weight: 700; letter-spacing: .06em; color: var(--muted); border: 1px solid var(--line-strong); border-radius: 6px; padding: 1px 6px; }
.top-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.no-send { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-size: 13px; font-weight: 600; margin-right: 6px; border-radius: 6px; }
.no-send .dot { width: 7px; height: 7px; border-radius: 50%; background: #2f9e6e; }

.page { max-width: 1200px; margin: 0 auto; padding: 0 var(--page-pad) 40px; }

/* ---- 見出し ---- */
.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px 32px; padding: 40px 0 28px; flex-wrap: wrap; }
.eyebrow { margin: 0 0 12px; font-size: 11px; font-weight: 700; letter-spacing: .14em; color: var(--accent); }
.hero h1 { margin: 0; font-size: clamp(28px, 4vw, 42px); line-height: 1.35; font-weight: 600; letter-spacing: .02em; }
.lead { margin: 16px 0 0; color: var(--muted); font-size: 14px; }
.hero-side { text-align: right; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 4px 0; font-size: 12px; }
.steps li + li::before { content: '→'; color: var(--faint); margin: 0 6px; }
.steps button { border: 0; background: none; padding: 2px 4px; border-radius: 6px; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; }
.steps button:hover { color: var(--text); }
.step-num { font-family: var(--mono); }
.step-state:empty { display: none; }
.steps .done .step-state { color: var(--accent); font-weight: 700; }
.steps .current { color: var(--accent); font-weight: 700; }
.steps .current .step-state { background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 0 7px; font-size: 10px; line-height: 18px; }
.hero-note { margin: 6px 0 0; font-size: 12px; color: var(--muted); }

/* ---- 2段組み ---- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 370px); gap: 24px; align-items: start; }
.main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; min-width: 0; }
.side { position: sticky; top: 20px; max-height: calc(100vh - 40px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; display: grid; gap: 16px; min-width: 0; padding: 0 2px 2px; margin: 0 -2px; }

/* ---- カード ---- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px var(--card-pad); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.card-head h2 { margin: 0; font-size: 18px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.card-num { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 5px; border-radius: 7px; background: var(--accent-soft); color: var(--accent); font: 700 12px/1 var(--mono); }
.count { font-size: 12px; color: var(--muted); font-family: var(--mono); }

.field { margin: 0 0 18px; min-width: 0; }
.field:last-child { margin-bottom: 0; }
.field > label, legend { display: block; font-size: 13px; font-weight: 600; margin-bottom: 7px; padding: 0; }
.opt { font-weight: 400; color: var(--faint); font-size: 12px; margin-left: 6px; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }

input:not([type]), input[type=text], input[type=number], input[type=search], select, textarea {
  width: 100%; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface);
  padding: 9px 12px; outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; line-height: 1.6; display: block; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:disabled { background: var(--surface-2); color: var(--faint); }
input[type=number] { -moz-appearance: textfield; }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; flex: none; }
select {
  appearance: none; -webkit-appearance: none; padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23646d67' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 14px;
}
.hint { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.hint.first { margin: -8px 0 12px; }
.hint.inline { margin: 0; }

/* ---- ボタン ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line-strong); background: var(--surface); border-radius: var(--radius-sm); padding: 7px 14px; font-size: 13px; font-weight: 600; line-height: 1.5; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn:hover:not(:disabled) { background: var(--surface-2); border-color: var(--faint); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.small { padding: 5px 12px; font-size: 12px; }
.btn.tiny { padding: 0; width: 34px; height: 38px; font-size: 16px; flex: none; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.danger { color: var(--danger); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
:is(.btn, .chip, .mode-btn, .icon-btn, .fix-btn, .add-item, .legend-row, .seg, .task-q, .steps button, summary, .no-send):focus-visible { outline: 3px solid var(--accent-ring); outline-offset: 2px; }

/* ---- 01 基本設定 ---- */
.sample-pick { display: flex; align-items: center; gap: 8px; }
.sample-label { font-size: 12px; color: var(--muted); }
.sample-pick select { width: auto; min-width: 150px; padding-top: 6px; padding-bottom: 6px; font-size: 13px; }
.total-input { display: flex; align-items: center; gap: 10px; }
.total-input input { font: 700 28px/1.2 var(--font); padding: 10px 14px; height: 60px; flex: 1; min-width: 0; }
.total-input span { font-size: 13px; color: var(--muted); white-space: nowrap; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.chip { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 8px; padding: 3px 10px; font-size: 12px; font-weight: 600; }
.chip:hover { border-color: var(--faint); }
.chip[aria-pressed=true] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
#step-select { height: 60px; }

/* ---- 02 採点項目と配分 ---- */
.mode-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border: 1px solid var(--line); background: var(--surface-2); border-radius: 12px; }
.mode-btn { border: 0; background: transparent; border-radius: 9px; padding: 9px 12px; font-size: 13px; font-weight: 600; color: var(--muted); }
.mode-btn:hover { color: var(--text); }
.mode-btn[aria-pressed=true] { background: var(--accent); color: var(--accent-ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
#mode-hint { margin-top: 10px; }
.tools { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
#sec-alloc.is-direct .for-weight { display: none; }
#sec-alloc:not(.is-direct) .for-direct { display: none; }

.empty { margin-top: 16px; border: 1px dashed var(--line-strong); border-radius: 14px; padding: 28px 20px; text-align: center; background: var(--surface-2); }
.empty-title { font-weight: 700; margin: 0 0 4px; }
.empty p { margin: 0; color: var(--muted); font-size: 13px; }
.empty .row { justify-content: center; margin-top: 16px; }

.items { list-style: none; margin: 16px calc(var(--card-pad) * -1) 0; padding: 0 var(--card-pad); border-top: 1px solid var(--line); }
.item { padding: 24px 0; }
.item + .item { border-top: 1px solid var(--line); }
.item-head { display: flex; align-items: center; gap: 12px; }
.code { display: inline-flex; align-items: center; gap: 6px; font: 600 11px/1 var(--mono); color: var(--faint); width: 36px; flex: none; }
.code .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; }
.item-name { flex: 1; min-width: 0; font-weight: 600; }
.icon-btns { display: flex; gap: 2px; flex: none; }
.icon-btn { width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); display: grid; place-items: center; padding: 0; }
.icon-btn:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.icon-btn:disabled { color: var(--line-strong); cursor: default; }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn.del { color: var(--danger); }
.icon-btn.del:hover { background: var(--danger-soft); color: var(--danger); }

.item-body { display: grid; grid-template-columns: minmax(0, 1fr) 96px; gap: 16px; align-items: start; margin-top: 18px; }
.w-row { display: flex; align-items: center; gap: 14px; min-height: 40px; }
.w-num { width: 64px !important; flex: none; text-align: center; font-family: var(--mono); padding: 7px 6px !important; }
.w-caption { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 2px; padding-right: 78px; }
.p-row { display: none; align-items: center; gap: 6px; min-height: 40px; }
.fix-value { width: 110px !important; text-align: center; font-family: var(--mono); font-weight: 700; }
.p-row .unit { font-size: 13px; color: var(--muted); }
.p-caption { display: none; font-size: 11px; color: var(--muted); margin-top: 2px; }
.item.is-fixed .w-row, .item.is-fixed .w-caption, #sec-alloc.is-direct .w-row, #sec-alloc.is-direct .w-caption { display: none; }
.item.is-fixed .p-row, #sec-alloc.is-direct .p-row { display: flex; }
.item.is-fixed .p-caption, #sec-alloc.is-direct .p-caption { display: block; }

.w-range { -webkit-appearance: none; appearance: none; flex: 1; min-width: 0; height: 24px; background: transparent; margin: 0; --fill: 50%; }
.w-range::-webkit-slider-runnable-track { height: 6px; border-radius: 999px; background: linear-gradient(to right, var(--accent) var(--fill), var(--track) var(--fill)); }
.w-range::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -6px; border-radius: 50%; background: var(--accent); border: 3px solid #fff; box-shadow: 0 0 0 1px var(--accent), 0 1px 3px rgba(0, 0, 0, .25); }
.w-range::-moz-range-track { height: 6px; border-radius: 999px; background: var(--track); }
.w-range::-moz-range-progress { height: 6px; border-radius: 999px; background: var(--accent); }
.w-range::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--accent); border: 3px solid #fff; box-shadow: 0 0 0 1px var(--accent); }
.w-range:focus-visible { outline: none; }
.w-range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 1px var(--accent), 0 0 0 5px var(--accent-ring); }

.item-score { text-align: right; }
.score { margin: 0; line-height: 1; color: var(--accent); white-space: nowrap; }
.score b { font: 700 30px/1 var(--mono); letter-spacing: -.02em; }
.score span { font-size: 12px; margin-left: 3px; color: var(--muted); }
.item.is-zero .score { color: var(--warn); }
.pct { margin: 6px 0 0; font: 11px/1 var(--mono); color: var(--muted); }
.fix-btn { margin-top: 10px; display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px; padding: 2px 9px; font-size: 11px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.fix-btn svg { width: 12px; height: 12px; }
.fix-btn:hover { border-color: var(--faint); color: var(--text); }
.fix-btn[aria-pressed=true] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
#sec-alloc.is-direct .fix-btn { display: none; }
.ratio-note { margin: 8px 0 0; font-size: 12px; color: var(--warn); }
.ratio-note:empty { display: none; }

.note-field { display: block; margin-top: 16px; }
.note-field > span { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.anchors { margin-top: 12px; }
.anchors summary { color: var(--accent); font-size: 13px; font-weight: 600; list-style: none; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; border-radius: 6px; }
.anchors summary::-webkit-details-marker { display: none; }
.anchors summary::before { content: ''; border-left: 6px solid currentColor; border-top: 4px solid transparent; border-bottom: 4px solid transparent; transition: transform .15s; }
.anchors[open] summary::before { transform: rotate(90deg); }
.anchors .filled { font-weight: 400; color: var(--muted); font-size: 12px; }
.anchor-fields { display: grid; gap: 10px; margin-top: 12px; padding: 14px; background: var(--surface-2); border-radius: 12px; }
.anchor-fields label { display: grid; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }

.add-item { width: 100%; margin-top: 4px; border: 1px dashed var(--line-strong); background: var(--surface-2); color: var(--accent); border-radius: 12px; padding: 14px; font-size: 14px; font-weight: 600; }
.add-item:hover { border-color: var(--accent); background: var(--accent-soft); }

/* ---- 採点する相手・AIへの頼み方 ---- */
.more { padding: 0; }
.more > summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 20px var(--card-pad); cursor: pointer; border-radius: var(--radius); }
.more > summary::-webkit-details-marker { display: none; }
.more-icon { width: 26px; height: 26px; border-radius: 7px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; flex: none; }
.more-title { flex: 1; font-size: 16px; font-weight: 600; }
.more-toggle::before { content: '＋'; color: var(--muted); font-size: 18px; }
.more[open] .more-toggle::before { content: '－'; }
.more-body { padding: 20px var(--card-pad) 24px; border-top: 1px solid var(--line); }
.options label { display: flex; gap: 10px; align-items: center; font-size: 14px; margin: 8px 0; }

/* ---- 貼り付け ---- */
.paste-card { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
#paste-text { font: 13px/1.6 var(--mono); }
.paste-msg { margin: 16px 0 0; font-size: 13px; }
.paste-msg.is-error { color: var(--danger); }
.paste-mode { margin-top: 12px; padding: 12px 14px; background: var(--surface-2); border-radius: 10px; }
.paste-mode legend { margin-bottom: 4px; }
.paste-mode label { display: flex; gap: 8px; align-items: center; font-size: 13px; margin: 4px 0; }
.paste-mode .is-disabled { color: var(--faint); }
.table-wrap { overflow-x: auto; margin-top: 12px; border: 1px solid var(--line); border-radius: 10px; }
.paste-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.paste-table th, .paste-table td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.paste-table th { background: var(--surface-2); font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.paste-table tr:last-child td { border-bottom: 0; }
.paste-table .num { text-align: right; font-family: var(--mono); white-space: nowrap; }
.paste-table .strong { font-weight: 700; color: var(--accent); }
.paste-table .muted { color: var(--muted); }
.paste-table tr.off td:not(:first-child) { color: var(--faint); text-decoration: line-through; }
.skipped { margin-top: 10px; font-size: 12px; color: var(--muted); }
.skipped summary { cursor: pointer; }

/* ---- いまの配点 ---- */
.summary { border-radius: var(--radius); overflow: hidden; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); outline: none; }
.summary-head { background: var(--accent); color: var(--accent-ink); padding: 22px 24px 24px; }
.summary-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.eyebrow.light { color: rgba(255, 255, 255, .78); margin: 0; }
.pill { font-size: 10px; font-weight: 700; letter-spacing: .06em; border: 1px solid rgba(255, 255, 255, .45); border-radius: 999px; padding: 1px 9px; }
.big { margin: 14px 0 0; line-height: 1; white-space: nowrap; }
.big b { font: 700 46px/1 var(--font); letter-spacing: -.02em; }
.big .of { font-size: 15px; opacity: .85; margin-left: 8px; }
.summary.is-ng .big b { color: var(--on-accent-warn); }
.sub { margin: 10px 0 0; font-size: 12px; opacity: .82; }
.stack { display: flex; height: 10px; border-radius: 999px; background: rgba(255, 255, 255, .16); overflow: hidden; margin-top: 18px; }
.seg { border: 0; padding: 0; height: 100%; flex: none; }
.seg:not(:last-child) { border-right: 1px solid var(--accent); }
.summary-body { padding: 16px 20px 20px; }
.legend { list-style: none; margin: 0; padding: 0; }
.legend-row { width: 100%; display: grid; grid-template-columns: 8px minmax(0, 1fr) auto 46px; gap: 10px; align-items: center; border: 0; background: none; padding: 6px 6px; border-radius: 8px; text-align: left; font-size: 14px; }
.legend-row:hover { background: var(--surface-2); }
.legend-row .dot { width: 8px; height: 8px; border-radius: 50%; }
.legend-row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend-row .pts { font: 700 14px/1 var(--mono); white-space: nowrap; }
.legend-row .pts small { font: 400 11px var(--font); color: var(--muted); margin-left: 1px; }
.legend-row .pc { font: 12px/1 var(--mono); color: var(--muted); text-align: right; }
.alloc-status { margin: 12px 0 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; }
.legend:empty + .alloc-status { margin-top: 0; padding-top: 0; border-top: 0; }
.alloc-status p { margin: 0; }
.alloc-status .ok-line { color: var(--accent); font-weight: 600; display: flex; gap: 6px; align-items: flex-start; }
.alloc-status .ok-line svg { width: 16px; height: 16px; flex: none; margin-top: 3px; }
.alloc-status .sub-line { color: var(--muted); font-size: 12px; margin-top: 2px; }
.alloc-status .empty-line { color: var(--muted); }
.alloc-status ul { margin: 6px 0 0; padding-left: 18px; }
.alloc-status ul.warn { color: var(--warn); font-size: 12px; }
.alloc-status.is-error .err-box { background: var(--danger-soft); color: var(--danger); border-radius: 10px; padding: 10px 12px; }
.alloc-status.is-error .btn { margin-top: 10px; }
.preview-head { display: flex; justify-content: space-between; align-items: baseline; margin-top: 18px; font-size: 13px; font-weight: 700; }
.preview-head .mono { font-size: 11px; color: var(--muted); font-weight: 400; }
.preview { margin-top: 8px; height: 190px; font: 12px/1.65 var(--mono) !important; background: var(--surface-2) !important; white-space: pre; overflow: auto; }
.preview.is-empty { white-space: pre-wrap; color: var(--muted); }
.export-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.export-buttons .btn { padding: 12px 8px; font-size: 14px; }
.export-note, .storage-note { margin: 10px 0 0; font-size: 12px; color: var(--muted); text-align: center; }
.export-note:empty { display: none; }
.export-note.is-done { color: var(--accent); font-weight: 600; }
.storage-note.is-warn { color: var(--warn); background: var(--warn-soft); padding: 8px 10px; border-radius: 8px; text-align: left; }
.disclaimer { margin: 0; font-size: 12px; color: var(--muted); padding: 0 6px; }

/* ---- ここでできること・やりたいことから探す ---- */
/* 入力側の列の下に貼りついて、スクロールしても見える帯 */
.context-bar { position: sticky; bottom: 16px; z-index: 20; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 14px; padding: 12px 16px; box-shadow: 0 10px 30px rgba(28, 36, 31, .16), 0 1px 3px rgba(28, 36, 31, .08); }
.ctx-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ctx-label { flex: none; font-size: 11px; font-weight: 700; color: var(--accent-ink); background: var(--accent); border-radius: 999px; padding: 2px 10px; }
.ctx-title { flex: 1; min-width: 0; margin: 0; font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctx-item { font-weight: 400; color: var(--muted); margin-left: 2px; }
.ctx-side { display: flex; gap: 2px; flex: none; }
.ctx-side .btn { color: var(--accent); }
.ctx-side svg { width: 14px; height: 14px; }
.ctx-detail { display: flex; gap: 8px 16px; align-items: flex-start; margin-top: 6px; }
.ctx-text { flex: 1; min-width: 0; margin: 0; font-size: 13px; color: var(--muted); line-height: 1.6; }
.ctx-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; max-width: 46%; }
.context-bar.is-collapsed .ctx-detail { display: none; }
.finder { padding: 0; }
.finder > summary { list-style: none; padding: 14px 20px; font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 8px; cursor: pointer; border-radius: var(--radius); }
.finder > summary::-webkit-details-marker { display: none; }
.finder > summary svg { width: 16px; height: 16px; color: var(--accent); }
.finder > summary::after { content: '＋'; margin-left: auto; color: var(--muted); font-weight: 400; }
.finder[open] > summary::after { content: '－'; }
.finder-body { padding: 0 20px 18px; }
.finder-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 2px; max-height: 360px; overflow: auto; }
.task-q { width: 100%; text-align: left; border: 0; background: none; padding: 7px 8px; border-radius: 8px; font-size: 13px; }
.task-q:hover { background: var(--surface-2); }
.task-q[aria-expanded=true] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.task-body { padding: 4px 8px 10px; font-size: 12px; color: var(--muted); }
.task-body ol { margin: 4px 0 8px; padding-left: 18px; }
.finder-none { font-size: 12px; color: var(--muted); padding: 6px 8px; }

/* ---- 下の帯・通知 ---- */
.footer { display: flex; justify-content: space-between; gap: 8px 16px; margin-top: 36px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.footer p { margin: 0; }
.toast { position: fixed; left: 50%; top: 16px; transform: translate(-50%, -16px); background: #1c241f; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100vw - 32px); z-index: 50; box-shadow: 0 8px 24px rgba(0, 0, 0, .18); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.flash { animation: flash 1.4s ease; }
@keyframes flash { 0%, 100% { box-shadow: 0 0 0 0 transparent; } 15%, 65% { box-shadow: 0 0 0 4px var(--accent-ring); } }

/* ---- 幅が狭いとき ---- */
@media (max-width: 960px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; max-height: none; overflow: visible; margin: 0; padding: 0; }
}
@media (max-width: 640px) {
  :root { --page-pad: 16px; --card-pad: 18px; }
  body { font-size: 14px; }
  .topbar-inner { padding-top: 10px; padding-bottom: 10px; }
  .no-send { display: none; }
  .top-actions .btn { padding: 5px 10px; font-size: 12px; }
  .hero { padding: 28px 0 20px; }
  .lead br { display: none; }
  .hero-side { text-align: left; }
  .steps { justify-content: flex-start; }
  .card { padding: 20px var(--card-pad); }
  .card-head { margin-bottom: 16px; }
  .card-head h2 { font-size: 16px; }
  .sample-pick select { min-width: 0; }
  .item-body { grid-template-columns: minmax(0, 1fr) 82px; gap: 10px; }
  .fix-btn { padding: 2px 7px; }
  .w-row { gap: 10px; }
  .w-num { width: 52px !important; }
  .w-caption { padding-right: 62px; }
  .score b { font-size: 24px; }
  .code { width: 28px; }
  .item-head { gap: 8px; }
  .icon-btn { width: 28px; }
  .fix-value { width: 84px !important; }
  .context-bar { bottom: 10px; padding: 10px 12px; }
  .ctx-side .long { display: none; }
  .ctx-row { flex-wrap: wrap; row-gap: 2px; }
  .ctx-side { order: 2; margin-left: auto; }
  .ctx-title { order: 3; flex-basis: 100%; white-space: normal; line-height: 1.4; font-size: 13px; }
  .ctx-detail { flex-direction: column; }
  .ctx-actions { max-width: none; justify-content: flex-start; }
  .more > summary { padding: 18px var(--card-pad); }
  .more-title { font-size: 15px; }
}
@media (max-width: 480px) {
  .field-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .field-grid .field { margin-bottom: 18px; }
  .field-grid .field:last-child { margin-bottom: 0; }
  #step-select { height: auto; }
}
