/* ケアプラン利用票ジェネレータ（ブラウザデモ版）
   PDFMaker renderer/style.css の配色・トーンを踏襲した自己完結スタイル */
:root {
  color: #17202a;
  background: #f7f8fb;
  font-family: "Yu Gothic UI", "Meiryo", "Hiragino Sans", system-ui, sans-serif;
  font-size: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: #f7f8fb;
}

button { font: inherit; }

button {
  border: 1px solid #b8c0cc;
  background: #ffffff;
  color: #17202a;
  border-radius: 6px;
  min-height: 36px;
  padding: 0 14px;
  cursor: pointer;
}

button:hover:not(:disabled) {
  border-color: #6a7a90;
  background: #f3f6fa;
}

button:disabled {
  color: #8b95a3;
  cursor: not-allowed;
}

button.primary {
  border-color: #2563eb;
  background: #2563eb;
  color: #ffffff;
  font-weight: 700;
}

button.primary:hover:not(:disabled) {
  background: #1d4ed8;
}

.app-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 10px 18px;
  background: #eef2f8;
  border-bottom: 1px solid #dce2eb;
}

.app-brand {
  font-weight: 700;
  font-size: 16px;
  color: #2b3547;
  white-space: nowrap;
}

.demo-badge {
  padding: 2px 10px;
  border-radius: 999px;
  background: #fff7df;
  border: 1px solid #e4bd57;
  color: #7a5b12;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.app-note {
  color: #6a7688;
  font-size: 12px;
}

.app-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 18px;
  display: grid;
  gap: 14px;
}

.control-panel,
.preview-panel,
.about-panel {
  background: #ffffff;
  border: 1px solid #dce2eb;
  border-radius: 8px;
  padding: 16px;
}

.lead {
  margin: 0 0 12px 0;
  line-height: 1.7;
  color: #2b3547;
}

code {
  padding: 1px 5px;
  border-radius: 4px;
  background: #eef2f8;
  color: #1d4ed8;
  font-family: Consolas, "Yu Gothic UI", monospace;
  font-size: 12px;
}

.source-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.drop-hint {
  margin: 10px 0 0 0;
  color: #7a8698;
  font-size: 12px;
  line-height: 1.6;
}

.status {
  margin-top: 12px;
  padding: 8px 12px;
  border-radius: 6px;
  background: #e8f7ee;
  border: 1px solid #88c79c;
  color: #19713c;
  font-size: 13px;
  line-height: 1.6;
}

.status.error {
  background: #fdecec;
  border-color: #e4a3a0;
  color: #b42318;
}

.status[hidden] { display: none; }

.group-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.group-row[hidden] { display: none; }

.group-row label {
  color: #485568;
  font-weight: 700;
  font-size: 13px;
}

.group-row select {
  font: inherit;
  min-height: 34px;
  min-width: 240px;
  border: 1px solid #b8c0cc;
  border-radius: 6px;
  padding: 0 10px;
  background: #ffffff;
  color: #17202a;
}

.preview-panel {
  padding: 10px;
  min-height: 360px;
}

.empty-hint {
  padding: 60px 20px;
  text-align: center;
  color: #7a8698;
  line-height: 1.9;
}

.empty-hint[hidden] { display: none; }

#preview,
#mergePreview {
  display: block;
  width: 100%;
  height: 72vh;
  min-height: 420px;
  border: 1px solid #dce2eb;
  border-radius: 6px;
  background: #eef1f6;
}

#preview[hidden],
#mergePreview[hidden] { display: none; }

/* --- PDFの結合・並べ替え --- */
.merge-panel h2 {
  margin: 0 0 8px 0;
  font-size: 15px;
  color: #2b3547;
}

.pdf-list {
  margin: 12px 0 0 0;
  padding: 0;
  list-style: none;
  border: 1px solid #dce2eb;
  border-radius: 6px;
  overflow: hidden;
}

.pdf-list[hidden] { display: none; }

.pdf-item {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 8px 12px;
  background: #ffffff;
}

.pdf-item + .pdf-item {
  border-top: 1px solid #e7ecf3;
}

.pdf-item:nth-child(even) {
  background: #f7f9fc;
}

.pdf-name {
  flex: 1 1 auto;
  min-width: 160px;
  font-weight: 700;
  color: #2b3547;
  word-break: break-all;
}

.pdf-pages {
  color: #6a7688;
  font-size: 12px;
  white-space: nowrap;
}

.pdf-item-actions {
  display: flex;
  gap: 6px;
}

.pdf-item-actions button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 13px;
}

.merge-result {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.merge-result[hidden] { display: none; }

.download-link {
  display: inline-block;
  padding: 8px 16px;
  border: 1px solid #2563eb;
  border-radius: 6px;
  background: #2563eb;
  color: #ffffff;
  font-weight: 700;
  text-decoration: none;
}

.download-link:hover {
  background: #1d4ed8;
}

.merge-info {
  color: #6a7688;
  font-size: 12px;
}

.about-panel h2 {
  margin: 0 0 8px 0;
  font-size: 15px;
  color: #2b3547;
}

.about-panel p {
  margin: 0 0 10px 0;
  color: #485568;
  line-height: 1.8;
  font-size: 13px;
}

.about-panel p:last-child { margin-bottom: 0; }

.drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(37, 99, 235, 0.1);
}

.drop-overlay[hidden] { display: none; }

.drop-inner {
  padding: 26px 40px;
  background: #ffffff;
  border: 2px dashed #2563eb;
  border-radius: 12px;
  color: #1d4ed8;
  font-weight: 700;
  font-size: 16px;
  box-shadow: 0 12px 32px rgba(20, 27, 38, 0.2);
  pointer-events: none;
}

@media (max-width: 720px) {
  .source-actions button { flex: 1 1 auto; }
  .group-row { flex-direction: column; align-items: stretch; }
}
