:root {
  --bg: #fffdf6;
  --surface: #ffffff;
  --text: #243238;
  --muted: #5f6b70;
  --border: #b6c3c8;
  --primary: #f8b84e;
  --primary-strong: #ef9f1e;
  --accent: #5ab3a7;
  --danger: #bc544b;
  --shadow: 0 8px 20px rgba(36, 50, 56, 0.1);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #fffef9 0%, #fff7df 100%);
}

.start-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.start-card {
  width: min(760px, 100%);
  background: var(--surface);
  border: 3px solid var(--border);
  border-radius: 20px;
  padding: 32px;
  box-shadow: var(--shadow);
}
h1 { font-size: 42px; margin: 0 0 8px; }
.lead { font-size: 24px; margin: 0 0 20px; }
.saved-info {
  font-size: 24px;
  padding: 14px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: #f9fffd;
}

.start-actions { display: flex; gap: 16px; margin: 24px 0; }

.btn {
  border: 3px solid transparent;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 700;
}
.btn:disabled {
  background: #e1e5e7;
  border-color: #c2c9cc;
  color: #7e868a;
  cursor: not-allowed;
}
.btn-xl { font-size: 30px; padding: 18px 28px; }
.btn-lg { font-size: 24px; padding: 14px 24px; }
.btn-primary { background: var(--primary); border-color: #c88518; color: #392000; }
.btn-primary:hover:not(:disabled),
.btn-primary:focus-visible:not(:disabled) { background: var(--primary-strong); }
.btn-secondary { background: #8ed3ca; border-color: #3d8f83; color: #12352f; }
.btn-secondary:hover:not(:disabled),
.btn-secondary:focus-visible:not(:disabled) { background: var(--accent); }
.btn-light { background: #ffffff; border-color: #8ca0aa; color: #1f2d33; }
.btn-light:hover,
.btn-light:focus-visible { background: #f2f8fb; }

.help-dialog {
  position: fixed;
  inset: 0;
  display: none;
  background: rgba(10, 23, 31, 0.5);
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.help-dialog.open { display: flex; }
.help-content {
  width: min(680px, 100%);
  background: #ffffff;
  border: 3px solid #6f8b96;
  border-radius: 16px;
  padding: 24px;
}
.help-content h2 { margin: 0 0 8px; font-size: 34px; }
.help-content li { font-size: 24px; margin-bottom: 8px; }

/* editor */
.editor-page { min-height: 100vh; padding: 16px; }
.editor-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  border: 3px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 14px;
}
.editor-top h1 { font-size: 32px; margin: 0; }
.status-text { font-size: 22px; font-weight: 700; }
.controls { display: flex; gap: 10px; flex-wrap: wrap; }

.layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 14px;
}
.panel {
  background: #ffffff;
  border: 3px solid var(--border);
  border-radius: 14px;
  padding: 14px;
}
.block-list { display: grid; gap: 10px; }
.block-btn {
  text-align: left;
  font-size: 24px;
  padding: 14px;
  border: 3px solid #7d939d;
  border-radius: 12px;
  background: #f8fdff;
  cursor: pointer;
}
.block-btn.selected {
  background: #ffe7b7;
  border-color: #c68010;
}
.block-btn:hover { background: #e9f6ff; }

.news-sheet {
  background: #fff;
  border: 4px solid #1f2e34;
  min-height: 700px;
  padding: 14px;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 10px;
}
.slot {
  border: 3px dashed #7b8d95;
  border-radius: 8px;
  padding: 8px;
  min-height: 62px;
  background: #fcfffd;
}
.slot.glow {
  background: #fff3ce;
  border-color: #d6870d;
}
.slot .title { font-size: 44px; font-weight: 800; min-height: 52px; }
.slot .subtitle { font-size: 30px; font-weight: 700; min-height: 42px; }
.slot .date { font-size: 22px; min-height: 30px; }
.slot .body { font-size: 24px; line-height: 1.6; min-height: 330px; }
.slot .caption, .slot .notice { font-size: 22px; min-height: 42px; }
.image-slot {
  min-height: 260px;
  display: grid;
  place-items: center;
  background: #f4f8fa;
}
.image-slot img { max-width: 100%; max-height: 240px; object-fit: contain; }
.placeholder { font-size: 22px; color: #56646a; }

[contenteditable="true"]:focus {
  outline: 3px solid #e8a530;
  background: #fffdf5;
}

.toast-wrap {
  position: fixed;
  top: 16px;
  right: 16px;
  display: grid;
  gap: 8px;
  z-index: 100;
}
.toast {
  min-width: 300px;
  background: #fff;
  border: 3px solid #4f7c88;
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 10px;
  font-size: 22px;
}
.toast button {
  float: right;
  border: 2px solid #687f89;
  background: #fff;
  font-size: 18px;
}

@media print {
  body { background: #fff; }
  .editor-top, .panel, .toast-wrap, .help-dialog { display: none !important; }
  .layout { grid-template-columns: 1fr; }
  .news-sheet { border: none; min-height: auto; }
}
