:root {
  --ink: #1d1a18;
  --sub: #6b645e;
  --line: #d9d3cc;
  --bg: #f7f4f0;
  --card: #fff;
  --red: #b71c24;
  --red-soft: #fbeced;
  --ok: #1d6b3a;
  --ok-soft: #e7f4ec;
  --warn: #8a5a00;
  --warn-soft: #fdf3dc;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.7 -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", "Yu Gothic", sans-serif;
}
.top { background: var(--red); color: #fff; padding: 14px 16px; }
.top h1 { margin: 0; font-size: 20px; line-height: 1.3; }
.top p { margin: 2px 0 0; font-size: 13px; opacity: .9; }
main { max-width: 720px; margin: 0 auto; padding: 16px 16px 48px; }

.field { display: block; margin: 0 0 22px; }
.name { display: block; font-weight: 700; margin-bottom: 6px; }
.name small { font-weight: 400; color: var(--sub); }
.hint { display: block; margin-top: 6px; font-size: 14px; color: var(--sub); }
input[type="text"], input[type="password"], input[type="date"], select, textarea {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
}
textarea { line-height: 1.7; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, .pick:focus-within {
  outline: 2px solid var(--red);
  outline-offset: 1px;
}

button, .pick {
  display: inline-block;
  min-height: 48px;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
}
.primary { width: 100%; background: var(--red); border-color: var(--red); color: #fff; }
button:disabled { opacity: .6; cursor: wait; }
.actions { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; margin-top: 18px; }

.crop { position: relative; aspect-ratio: 604 / 270; margin-top: 10px; overflow: hidden; border-radius: 8px; background: #222; touch-action: none; cursor: grab; }
.crop img { display: block; width: 100%; height: 100%; object-fit: cover; user-select: none; -webkit-user-drag: none; }
.crop.still { margin: 0 0 14px; border-radius: 0; cursor: default; touch-action: auto; }

.names { list-style: none; margin: 10px 0 0; padding: 0; }
.names li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.names img { width: 64px; height: 48px; object-fit: cover; border-radius: 4px; flex: none; }
.names span { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 14px; }
.names button { min-height: 40px; padding: 4px 12px; font-weight: 400; font-size: 14px; }

.errors, .warnings { list-style: none; margin: 0 0 14px; padding: 12px 14px; border-radius: 8px; }
.errors { background: var(--red-soft); color: var(--red); font-weight: 700; }
.warnings { background: var(--warn-soft); color: var(--warn); }
.lead { margin: 0 0 14px; }

.place { display: flex; gap: 12px; margin-bottom: 14px; padding: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; }
.place > img { width: 88px; height: 66px; object-fit: cover; border-radius: 4px; flex: none; }
.place-fields { flex: 1; min-width: 0; }
.place-fields label { display: block; margin-bottom: 8px; }
.place-fields label:last-child { margin-bottom: 0; }
.place-fields span { display: block; font-size: 14px; font-weight: 700; margin-bottom: 4px; }

/* 確認画面はブログと同じ黒地に。行はタップで見出しの種類を変えられる */
.preview { background: #000; color: #fff; padding: 16px; border-radius: 8px; overflow: hidden; }
.preview h1 { margin: 0 0 8px; font-size: 22px; line-height: 1.5; }
.preview .meta { margin: 0 0 18px; color: #e8816f; font-size: 14px; }
.preview a { color: #ff9d8c; }
.line { display: block; width: 100%; min-height: 0; margin: 0 0 12px; padding: 6px 8px; border: 1px dashed transparent; border-radius: 6px; background: none; color: inherit; font-weight: 400; text-align: left; cursor: pointer; }
.line:hover { border-color: #666; }
.chip { display: inline-block; margin-bottom: 4px; padding: 0 8px; border-radius: 4px; background: #333; color: #ccc; font-size: 12px; font-weight: 700; line-height: 1.7; }
.line-text { display: block; overflow-wrap: anywhere; }
.kind-p .chip { display: none; }
.kind-h2 { background: #7c1218; }
.kind-h2 .chip { background: #fff; color: #7c1218; }
.kind-h2 .line-text { font-size: 20px; font-weight: 700; line-height: 1.5; }
.kind-h3 { border-left: 4px solid #e8816f; border-radius: 0 6px 6px 0; }
.kind-h3 .chip { background: #e8816f; color: #000; }
.kind-h3 .line-text { font-size: 18px; font-weight: 700; line-height: 1.5; }
.block { margin: 0 8px 12px; overflow-x: auto; }
.block ul, .block ol { margin: 0; padding-left: 1.4em; }
.block p { margin: 0; }
.block table { border-collapse: collapse; width: 100%; font-size: 14px; }
.block td { border: 1px solid #555; padding: 6px 8px; }
.body-photo { display: block; width: 100%; height: auto; margin: 0 0 14px; }

.result { padding: 16px; border-radius: 8px; background: var(--card); border: 1px solid var(--line); margin-bottom: 14px; overflow-wrap: anywhere; }
.result.ok { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); font-weight: 700; }
.result.bad { background: var(--red-soft); border-color: var(--red); color: var(--red); font-weight: 700; }

.history { margin-top: 40px; }
.history h2 { font-size: 16px; margin: 0 0 8px; }
.history ul { list-style: none; margin: 0; padding: 0; }
.history li { padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; overflow-wrap: anywhere; }
.history .empty { color: var(--sub); }
.st { display: inline-block; margin-right: 8px; padding: 0 8px; border-radius: 4px; background: var(--line); font-size: 12px; font-weight: 700; }
.st-published { background: var(--ok-soft); color: var(--ok); }
.st-failed { background: var(--red-soft); color: var(--red); }
.st-scheduled { background: var(--warn-soft); color: var(--warn); }
.d { color: var(--sub); margin-right: 8px; }
.t { display: block; margin-top: 2px; }
.why { margin: 4px 0 0; color: var(--red); }
.history button { min-height: 40px; margin-top: 6px; padding: 4px 12px; font-size: 14px; font-weight: 400; }
