:root {
  --ink: #111111;
  --paper: #ffffff;
  --muted: #666666;
  --line: #dddddd;
  --soft: #f5f5f3;
  --accent: #111111;
  --radius: 10px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP",
    "Yu Gothic UI", "Yu Gothic", Meiryo, system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.7;
}

a { color: var(--ink); }

.site-header {
  border-bottom: 2px solid var(--ink);
}
.site-header .inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.site-header .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.05rem;
}
.site-header .brand img { width: 34px; height: 34px; border-radius: 8px; }
.site-header nav { margin-left: auto; display: flex; gap: 16px; font-size: 0.92rem; }
.site-header nav a { text-decoration: none; }
.site-header nav a:hover { text-decoration: underline; }

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 20px 16px 48px;
}

h1 { font-size: 1.55rem; line-height: 1.4; margin: 8px 0 6px; }
h2 { font-size: 1.2rem; margin: 32px 0 10px; border-left: 5px solid var(--ink); padding-left: 10px; }
h3 { font-size: 1.02rem; margin: 20px 0 6px; }
p.lead { color: #333; margin-top: 0; }

.card {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin: 16px 0;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.field label { display: block; font-size: 0.85rem; font-weight: 700; margin-bottom: 4px; }
.field input {
  width: 100%;
  padding: 9px 10px;
  font-size: 1rem;
  border: 1px solid #bbb;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }

button {
  font: inherit;
  font-size: 0.92rem;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--ink);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}
button:hover { background: var(--soft); }
button.primary { background: var(--ink); color: #fff; }
button.primary:hover { background: #333; }
button.ghost { border-color: #bbb; color: #333; }
button.small { padding: 4px 9px; font-size: 0.85rem; }

.rows { display: flex; flex-direction: column; gap: 8px; }
.row-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  background: #fff;
}
.row-item .kind {
  font-size: 0.78rem;
  font-weight: 700;
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: 2px 9px;
  white-space: nowrap;
  margin-top: 4px;
}
.row-item.kind-break .kind { background: var(--ink); color: #fff; }
.row-item.kind-other .kind { border-style: dashed; }
.row-item .inputs { display: flex; flex-wrap: wrap; gap: 6px; }
.row-item input[type="text"] {
  flex: 1 1 180px;
  padding: 7px 9px;
  font-size: 0.98rem;
  border: 1px solid #bbb;
  border-radius: 7px;
}
.row-item input.note { flex: 1 1 140px; }
.row-item .dur { display: inline-flex; align-items: center; gap: 3px; }
.row-item input[type="number"] {
  width: 64px;
  padding: 7px 6px;
  font-size: 0.98rem;
  border: 1px solid #bbb;
  border-radius: 7px;
  text-align: right;
}
.row-item .ops { display: flex; gap: 4px; }

.summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: 16px 0;
}
.summary .box {
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  padding: 10px 12px;
  text-align: center;
}
.summary .box .k { font-size: 0.8rem; color: var(--muted); }
.summary .box .v { font-size: 1.3rem; font-weight: 700; }

table.schedule {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
table.schedule th, table.schedule td {
  border: 1px solid var(--line);
  padding: 7px 9px;
  text-align: left;
  vertical-align: top;
}
table.schedule th { background: var(--soft); }
table.schedule td.time { white-space: nowrap; font-variant-numeric: tabular-nums; }
table.schedule tr.transition td { color: var(--muted); font-size: 0.86rem; background: #fcfcfb; }
table.schedule tr.break-row td { background: var(--soft); font-weight: 700; }

.products { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.product {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: #fff;
}
.product h3 { margin-top: 0; }
.product .price { font-weight: 700; font-size: 1.1rem; }
.product p { font-size: 0.9rem; color: #333; }
.product a.btn {
  display: inline-block;
  margin-top: 6px;
  padding: 8px 14px;
  background: var(--ink);
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.9rem;
}

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 40px;
}
.site-footer .inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 18px 16px 28px;
  font-size: 0.85rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}

.note-small { font-size: 0.85rem; color: var(--muted); }
ol.steps li, ul.tips li { margin-bottom: 6px; }

/* 印刷用シート（画面では非表示） */
#print-sheet { display: none; }

@media print {
  body { background: #fff; }
  .site-header, .site-footer, .no-print { display: none !important; }
  main { max-width: none; padding: 0; }
  #print-sheet { display: block; }
  #print-sheet h1 { font-size: 1.4rem; text-align: center; margin-bottom: 2px; }
  #print-sheet .meta { text-align: center; color: #333; margin-bottom: 14px; font-size: 0.95rem; }
  #print-sheet table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
  #print-sheet th, #print-sheet td {
    border: 1px solid #999;
    padding: 6px 8px;
    text-align: left;
  }
  #print-sheet th { background: #eee; }
  #print-sheet td.time { white-space: nowrap; font-variant-numeric: tabular-nums; }
  #print-sheet tr.transition td { color: #555; font-size: 0.85rem; }
  #print-sheet tr.break-row td { background: #eee; font-weight: 700; }
  #print-sheet .totals { margin-top: 12px; font-size: 0.95rem; }
  #print-sheet .credit { margin-top: 18px; font-size: 0.75rem; color: #777; text-align: right; }
}

@media (max-width: 560px) {
  .row-item { grid-template-columns: auto 1fr; }
  .row-item .ops { grid-column: 1 / -1; justify-content: flex-end; }
  h1 { font-size: 1.3rem; }
}

/* ---------- 音響セッティングシート ---------- */

.field textarea, .field select {
  width: 100%;
  padding: 9px 10px;
  font-size: 1rem;
  font-family: inherit;
  border: 1px solid #bbb;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}
.field textarea { min-height: 88px; resize: vertical; line-height: 1.6; }

.free-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 760px) { .free-grid { grid-template-columns: repeat(3, 1fr); } }

.ch-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  -webkit-overflow-scrolling: touch;
}
table.editor {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  font-size: 0.92rem;
}
table.editor th, table.editor td {
  border-bottom: 1px solid var(--line);
  padding: 6px;
  text-align: left;
  vertical-align: top;
}
table.editor thead th { background: var(--soft); font-size: 0.8rem; white-space: nowrap; }
table.editor tbody tr:last-child td { border-bottom: none; }
table.editor td.ch { text-align: center; font-weight: 700; white-space: nowrap; padding-top: 12px; }
table.editor td.ops { white-space: nowrap; }
table.editor input[type="text"], table.editor select {
  width: 100%;
  padding: 6px 7px;
  font-size: 0.92rem;
  border: 1px solid #bbb;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}
table.editor select { width: auto; min-width: 76px; }

table.ch-preview td.c, table.ch-preview th:nth-child(1) { text-align: center; white-space: nowrap; }

/* 印刷シート（音響セッティングシート用パーツ） */
@media print {
  @page { size: A4; margin: 14mm; }
  #print-sheet .p-notes { margin-top: 16px; }
  #print-sheet .p-notes h2 {
    font-size: 1rem;
    border-left: 4px solid #111;
    padding-left: 8px;
    margin: 14px 0 5px;
  }
  #print-sheet .p-note-body {
    white-space: pre-wrap;
    border: 1px solid #999;
    padding: 7px 9px;
    min-height: 2.2em;
    font-size: 0.92rem;
  }
  #print-sheet .totals { white-space: pre-wrap; }
}
