/* 既存のヘッダー/フッター版にモーダルを追加 */
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Hiragino Kaku Gothic ProN", "Noto Sans JP", Meiryo, sans-serif;
  color: #222;
}

/* レイアウト: ヘッダー20% / メイン60% / フッター20% */
.app {
  display: grid;
  grid-template-rows: 20vh 1fr 20vh;
  height: 100vh;
}

/* ヘッダー */
.header {
  padding: 12px 16px;
  border-bottom: 1px solid #e5e5e5;
  background: #fafafa;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.header .title { font-size: 20px; font-weight: 700; }
.header .actions { display: flex; gap: 8px; }
.btn {
  display: inline-block;
  padding: 8px 14px;
  border: 1px solid #999;
  border-radius: 8px;
  background: #f6f6f6;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}
.btn:hover { filter: brightness(0.98); }

/* メイン */
.main { padding: 16px; overflow: auto; }
.form-card {
  max-width: 720px;
  padding: 16px;
  border: 1px solid #ddd;
  border-radius: 10px;
  background: #fff;
}
label { display: block; margin: 10px 0; }
input[type="text"], textarea {
  width: 100%;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
}
.buttons { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; }
button {
  padding: 8px 14px;
  border: 1px solid #999;
  border-radius: 8px;
  background: #f6f6f6;
  cursor: pointer;
}
button:hover { filter: brightness(0.98); }
.message { margin-top: 12px; padding: 8px 10px; border-radius: 6px; }
.message.ok { background: #e8f5e9; border: 1px solid #a5d6a7; }
.message.ng { background: #ffebee; border: 1px solid #ef9a9a; }

/* フッター */
.footer {
  border-top: 1px solid #e5e5e5;
  background: #fafafa;
  padding: 12px 16px;
  overflow: auto;
}
.footer .subtitle { font-weight: 700; margin-bottom: 8px; }
.footer .log-list { margin: 0; padding-left: 18px; }
.footer .log-list li { margin: 2px 0; }

/* ===== モーダル（ポップアップ） ===== */
.modal-backdrop {
  position: fixed;
  z-index: 1000;
  inset: 0;
  background: rgba(0,0,0,0.35);
  display: none; /* .show で表示 */
}
.modal {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(520px, 90vw);
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  overflow: hidden;
  border: 2px solid transparent;
}
.modal-header {
  padding: 12px 16px;
  border-bottom: 1px solid #eee;
  font-weight: 700;
}
.modal-body {
  padding: 16px;
  line-height: 1.6;
}
.modal-footer {
  padding: 12px 16px;
  border-top: 1px solid #eee;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.modal-backdrop.show { display: block; }
.modal-ok { border-color: #4caf50; }
.modal-ng { border-color: #e53935; }
