:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --ink: #1d2025;
  --muted: #6b7280;
  --line: #e3e6ea;
  --accent: #0b6fb4;
  --accent-soft: #e8f2f9;
  --warn-bg: #fff7e0;
  --warn-line: #e0a800;
  --danger-bg: #fdeceb;
  --danger-line: #c0392b;
  --ok: #1f7a4d;
  --radius: 10px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", sans-serif;
  font-size: 15px;
  line-height: 1.7;
}

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

.wrap { max-width: 920px; margin: 0 auto; padding: 24px 20px 80px; }
.wrap.wide { max-width: 1240px; }

header.site {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  padding: 18px 20px;
}
header.site .inner { max-width: 1240px; margin: 0 auto; display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
header.site h1 { font-size: 17px; margin: 0; letter-spacing: .02em; }
header.site .sub { color: var(--muted); font-size: 13px; }
header.site .who { margin-left: auto; color: var(--muted); font-size: 13px; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 18px;
}
.panel h2 { font-size: 15px; margin: 0 0 4px; }
.panel .hint { color: var(--muted); font-size: 13px; margin: 0 0 16px; }

label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.req::after { content: "必須"; margin-left: 6px; font-size: 11px; color: #c0392b; font-weight: 600; }

input[type=text], input[type=email], input[type=tel], input[type=number],
input[type=date], input[type=time], select, textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  font: inherit;
  background: #fff;
  color: inherit;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }

.field { margin-bottom: 16px; }
.row { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
.row.three { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 680px) { .row, .row.three { grid-template-columns: 1fr; } }

button, .btn {
  font: inherit;
  padding: 9px 18px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  color: inherit;
}
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
button.primary:disabled { opacity: .5; cursor: not-allowed; }
button.small { padding: 4px 11px; font-size: 13px; }
button:hover:not(:disabled) { filter: brightness(.97); }

/* ---- カレンダー ---- */


/* ---- 一覧 ---- */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: #fafbfc; }
tr.warn td:first-child { box-shadow: inset 3px 0 0 var(--warn-line); }
tr.danger td:first-child { box-shadow: inset 3px 0 0 var(--danger-line); }
tr.warn { background: var(--warn-bg); }
tr.danger { background: var(--danger-bg); }

.pill {
  display: inline-block; padding: 1px 10px; border-radius: 999px;
  font-size: 12px; border: 1px solid var(--line); background: #fff; white-space: nowrap;
}
.pill.received { background: #eef4fb; border-color: #cfe0ee; color: #1d5a8a; }
.pill.arranging { background: #fff7e0; border-color: #ecd8a0; color: #8a6300; }
.pill.confirmed { background: #e9f5ee; border-color: #bfe0cc; color: var(--ok); }
.pill.done { background: #eef0f2; border-color: #d8dce0; color: #4a5560; }
.pill.reported { background: #eef0f2; border-color: #d8dce0; color: #4a5560; }
.pill.cancelled { background: #f3f4f5; border-color: #e0e2e5; color: #9aa0a6; text-decoration: line-through; }

.tabs { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.tabs button { border-radius: 999px; }
.tabs button.on { background: var(--ink); border-color: var(--ink); color: #fff; }

.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar input, .toolbar select { width: auto; min-width: 150px; }
.toolbar .spacer { margin-left: auto; }

.note { color: var(--muted); font-size: 13px; }
.empty-state { color: var(--muted); padding: 40px 0; text-align: center; }

.msg { padding: 11px 14px; border-radius: 7px; margin-bottom: 14px; font-size: 14px; }
.msg.error { background: var(--danger-bg); border: 1px solid #f0c3bf; color: #97291c; }
.msg.ok { background: #e9f5ee; border: 1px solid #bfe0cc; color: var(--ok); }
.msg ul { margin: 6px 0 0; padding-left: 20px; }

dialog {
  border: none; border-radius: 12px; padding: 0; width: min(760px, 94vw);
  box-shadow: 0 18px 50px rgba(0,0,0,.22);
}
dialog::backdrop { background: rgba(20,24,28,.45); }
dialog .dlg-head {
  padding: 16px 20px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px;
}
dialog .dlg-head h3 { margin: 0; font-size: 16px; }
dialog .dlg-body { padding: 20px; max-height: 68vh; overflow: auto; }
dialog .dlg-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 10px; }
dialog .dlg-foot .spacer { margin-left: auto; }

.kv { display: grid; grid-template-columns: 8em 1fr; gap: 4px 14px; font-size: 14px; }
.kv dt { color: var(--muted); font-size: 13px; }
.kv dd { margin: 0; }

pre.mail {
  white-space: pre-wrap; word-break: break-word; background: #fafbfc;
  border: 1px solid var(--line); border-radius: 7px; padding: 14px; font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; line-height: 1.75;
}

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.stat { background: #fafbfc; border: 1px solid var(--line); border-radius: 8px; padding: 14px; }
.stat .n { font-size: 24px; font-weight: 700; letter-spacing: -.01em; }
.stat .l { font-size: 12px; color: var(--muted); }

.bar { display: block; height: 8px; background: var(--accent-soft); border-radius: 999px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); }

/* ---- 狭い画面 ---- */
/* 表は列を削るより横に流す。削ると「見えていない」ことに気づけない。
   ただし補助的な列（棒グラフ・対象）だけは隠す。 */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-scroll > table { min-width: 100%; }

@media (max-width: 640px) {
  .wrap { padding-left: 16px; padding-right: 16px; }
  table { font-size: 13px; }
  th, td { padding: 8px 7px; }
  .hide-sm { display: none; }
  header.site h1 { font-size: 15px; }
  header.site .who { margin-left: 0; width: 100%; }
  .stat .n { font-size: 20px; }
  .toolbar > * { flex: 1 1 auto; }
  dialog { width: 100vw; max-width: 100vw; border-radius: 0; }
  dialog .dlg-body { max-height: 74vh; }
}

/* お受けできない日。カレンダーを置かず、文章で出す。 */
.ng-list { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 16px; }
.ng-list h3 { font-size: 14px; margin: 0 0 4px; }
.ng-list dl { display: grid; grid-template-columns: 7em 1fr; gap: 2px 12px; margin: 10px 0 0; }
.ng-list dt { font-size: 13px; color: var(--muted); }
.ng-list dd { margin: 0; font-size: 14px; font-variant-numeric: tabular-nums; }
@media (max-width: 560px) { .ng-list dl { grid-template-columns: 5.5em 1fr; } }

/* 断りではなく、難しい前提を先に伝えるときの色 */
.msg.warn { background: var(--warn-bg, #fdf6e3); border: 1px solid var(--warn-line, #e0b44a); color: #6b4e12; }

/* 申し込みフォーム：小見出しと、複数選べるチェックボックス */
.subhead { font-size: 14px; font-weight: 700; margin: 18px 0 2px; }
.checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; margin-top: 4px; }
.checks label { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 400; cursor: pointer; }
.checks input { width: 16px; height: 16px; flex: none; }
@media (max-width: 560px) { .checks { grid-template-columns: 1fr; } }

/* 希望日と開始時刻は必ず横に並べる（スマホでも対応が分かるように） */
.row.wish { display: grid; grid-template-columns: 1.4fr 1fr; gap: 10px 14px; align-items: end; }
.row.wish + .row.wish { margin-top: 10px; }
