/* 白地・黒灰の文字・青 1 色。区切りは細い線と余白と見出しで作る（影・大きい角丸・絵文字は使わない）。 */
:root {
  --ink: #222;
  --sub: #5c5c5c;
  --line: #d4d4d4;
  --faint: #ececec;
  --blue: #1f5fbf;
  --blue-dark: #174a96;
  --font: "Yu Gothic UI", "Hiragino Sans", "Noto Sans JP", "Meiryo", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: #fff; color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.6; }
body { padding: 20px 28px 12px; max-width: 1480px; margin: 0 auto; }

h1 { font-size: 22px; font-weight: 700; margin: 0; letter-spacing: 0.02em; }
h2 { font-size: 15px; font-weight: 700; margin: 0 0 6px; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.app-head { margin-bottom: 14px; }
.sub { margin: 2px 0 0; color: var(--sub); font-size: 13px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 0; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--line); }
.spacer { flex: 1; }

button, input[type="text"] { font: inherit; color: var(--ink); }
button { background: #fff; border: 1px solid #9a9a9a; border-radius: 2px; padding: 5px 14px; cursor: pointer; }
button:hover { background: #f4f4f4; }
button:focus-visible, input:focus-visible, .table-wrap:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
button.primary { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 700; }
button.primary:hover { background: var(--blue-dark); }
button.link { border: none; background: none; color: var(--blue); padding: 0 2px; text-decoration: underline; font-size: 13px; }
button.link:hover { background: none; color: var(--blue-dark); }
button:disabled { color: #9a9a9a; border-color: var(--line); cursor: default; background: #fff; }
input[type="text"] { border: 1px solid #9a9a9a; border-radius: 2px; padding: 4px 6px; background: #fff; }

.note { margin: 10px 0 0; padding: 8px 12px; border-left: 3px solid var(--blue); background: #f6f8fc; color: var(--ink); font-size: 14px; }

.layout { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 32px; margin-top: 18px; align-items: start; }
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } }
.side section { margin-bottom: 22px; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.sec-head h2 { border: none; margin: 0; }
.sec-actions { display: flex; gap: 8px; }
.hint { color: var(--sub); font-size: 13px; margin: 4px 0 8px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0; }
.row label { display: flex; align-items: center; gap: 4px; font-size: 14px; }

.records { list-style: none; margin: 0; padding: 0; max-height: 340px; overflow-y: auto; border-top: 1px solid var(--faint); }
.records li { display: grid; grid-template-columns: auto 14px 1fr auto; gap: 8px; align-items: start; padding: 7px 2px; border-bottom: 1px solid var(--faint); }
.records .swatch { width: 14px; height: 14px; margin-top: 4px; }
.records .name { font-weight: 700; word-break: break-all; }
.records .detail { color: var(--sub); font-size: 13px; }
.records .memo { color: var(--ink); font-size: 13px; word-break: break-all; }
.records input[type="checkbox"] { width: 16px; height: 16px; margin: 4px 0 0; accent-color: var(--blue); }

.meta { margin: 0; white-space: pre-wrap; font-family: var(--font); font-size: 13px; color: var(--sub); }

.readout { min-height: 28px; padding: 3px 0 6px; font-size: 14px; font-variant-numeric: tabular-nums; }
.chart-wrap { position: relative; border: 1px solid var(--line); }
#chart { display: block; width: 100%; height: 380px; touch-action: pan-y; cursor: crosshair; }
.empty { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; padding: 0 12%; color: var(--sub); background: #fff; }
.empty[hidden] { display: none; }
.empty-title { font-weight: 700; color: var(--ink); margin: 0 0 6px; }
.empty ol { margin: 0; padding-left: 1.3em; }

.content h2 { margin-top: 22px; }
.table-wrap { height: 300px; overflow: auto; border: 1px solid var(--line); }
table { border-collapse: collapse; width: max-content; min-width: 100%; font-variant-numeric: tabular-nums; font-size: 14px; }
th, td { text-align: right; padding: 3px 14px; white-space: nowrap; }
th { position: sticky; top: 0; background: #fff; border-bottom: 1px solid var(--ink); font-weight: 700; z-index: 1; }
td { border-bottom: 1px solid var(--faint); height: 26px; }
tr.spacer-row td { border: none; padding: 0; }

.status { margin: 14px 0 0; padding-top: 8px; border-top: 1px solid var(--line); color: var(--sub); font-size: 13px; }

dialog { border: 1px solid #8a8a8a; border-radius: 2px; padding: 20px 24px; max-width: 560px; width: calc(100% - 40px); color: var(--ink); }
dialog::backdrop { background: rgba(0, 0, 0, 0.35); }
dialog h2 { font-size: 17px; margin-bottom: 12px; }
dialog .lead { font-weight: 700; }
.field { display: block; margin: 8px 0; }
.field input { display: block; width: 100%; margin-top: 3px; }
.dlg-actions { display: flex; gap: 8px; align-items: center; margin-top: 16px; }
.steps { padding-left: 1.3em; margin: 0 0 8px; }
.steps li { margin-bottom: 4px; }
progress { width: 100%; height: 6px; accent-color: var(--blue); }
.log { max-height: 140px; overflow: auto; margin: 8px 0 0; padding: 6px 8px; background: #f6f6f6; border: 1px solid var(--faint); font-size: 12px; font-family: ui-monospace, Consolas, monospace; white-space: pre-wrap; }

body.dragging::after { content: "ここにドロップして開く"; position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700; color: var(--blue); background: rgba(255, 255, 255, 0.9); border: 3px dashed var(--blue); z-index: 10; }
